

* { box-sizing: border-box; }

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 3px; }
* { scrollbar-width: thin; scrollbar-color: #ccc transparent; }

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  border: 0;
  background: #fff;
  border-radius: 0;
  display: flex;
  flex-direction: row;
}



#guidePage {
  width: 100%;
  padding: 72px 0 96px;
  text-align: center;
  align-items: center;
}

.image_title {
  margin: 0 0 18px;
  color: #101018;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.4px;
}

#guidePage h2 {
  max-width: 760px;
  margin: 0 auto;
  color: #6b6b78;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  overflow-wrap: anywhere;
}

#guidePage h2 .fmt,
#guidePage h2 .fmt2 {
  color: #6558e8;
  font-weight: 600;
}

.upload-box {
  position: relative;
  width: 100%;
  margin: 40px auto 0;
  padding: 56px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #d9d9e3;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(17, 17, 26, 0.05);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.upload-box:hover { border-color: #b7aefc; background: #fcfbff; box-shadow: 0 24px 48px rgba(17, 17, 26, 0.08); }
.upload-box:focus-within { border-color: #6558e8; box-shadow: 0 0 0 4px rgba(101, 88, 232, 0.12); }

.upload-icon {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #f2efff;
  color: #6558e8;
  transition: transform 0.2s ease;
}
.upload-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.upload-title { color: #14141c; font-size: 17px; font-weight: 700; line-height: 1.5; }

.upload-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: fit-content; min-width: 220px; height: 56px;
  margin: 20px 0 0; padding: 0 30px;
  border-radius: 999px;
  background-color: #6558e8; color: #fff;
  cursor: pointer; font-size: 16px; font-weight: 700; line-height: 1; letter-spacing: -0.1px;
  box-shadow: 0 10px 24px rgba(101, 88, 232, 0.22);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.upload-label-plus { position: relative; flex: none; box-sizing: border-box; width: 20px; height: 20px; border: 2px solid currentColor; border-radius: 50%; }
.upload-label-plus::before, .upload-label-plus::after { content: ""; position: absolute; left: 50%; top: 50%; background-color: currentColor; transform: translate(-50%, -50%); }
.upload-label-plus::before { width: 8px; height: 2px; }
.upload-label-plus::after { width: 2px; height: 8px; }
.upload-label:hover { background-color: #5749d6; box-shadow: 0 14px 30px rgba(101, 88, 232, 0.28); transform: translateY(-2px); }
.upload-label:active { transform: translateY(0); }

.upload-hint { margin: 16px 0 0; color: #8b8b98; font-size: 14px; line-height: 1.6; }

#inputFiles { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.grid-container {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
  width: 100%; margin: 56px 0 0;
}
.grid-container .grid-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  min-width: 0; margin: 0; padding: 28px 24px;
  border: 0; border-radius: 20px;
  background: #f7f6ff; text-align: left;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.grid-container .grid-item:hover { background: #f1eeff; box-shadow: 0 16px 36px rgba(101, 88, 232, 0.1); transform: translateY(-2px); }
.grid-item svg { flex: 0 0 56px; width: 56px; height: 56px; padding: 14px; border-radius: 50%; background: #fff; color: #6558e8; box-shadow: 0 6px 16px rgba(101, 88, 232, 0.12); }
.feature-body { min-width: 0; }
.feature-title { margin: 0 0 8px; color: #101018; font-size: 18px; font-weight: 700; line-height: 1.4; letter-spacing: -0.2px; }
.feature-desc { margin: 0; color: #6b6b78; font-size: 15px; line-height: 1.7; }

@media (max-width: 1080px) { .grid-container { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .grid-container { grid-template-columns: 1fr; gap: 16px; }
  .grid-container .grid-item { padding: 22px 20px; gap: 14px; }
  .grid-item svg { flex: 0 0 48px; width: 48px; height: 48px; padding: 12px; }
  .feature-title { font-size: 16px; }
  .feature-desc { font-size: 14px; line-height: 1.65; }
}



.guide-section { margin: 64px 0 0; padding: 0; background: transparent; color: #182230; font-family: inherit; line-height: 1.65; counter-reset: step-counter; text-align: left; }
.guide-section h3 { margin: 40px 0 16px; padding: 0; border: 0; color: #101018; font-size: 24px; font-weight: 700; line-height: 1.35; letter-spacing: -0.5px; }
.guide-section > h3:first-child { margin-top: 0; }
.guide-section p { margin: 0 0 14px; color: #6b6b78; font-size: 15px; line-height: 1.75; }
.guide-section strong { padding: 0; background: transparent; color: #6558e8; font-weight: 600; }
.guide-section .step { position: relative; margin-bottom: 12px; padding: 22px 22px 22px 68px; border: 1px solid #f0f0f5; border-radius: 16px; background: #fff; box-shadow: 0 2px 10px rgba(17, 17, 26, 0.03); transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.guide-section .step:hover { border-color: #e4e0ff; box-shadow: 0 12px 28px rgba(17, 17, 26, 0.07); transform: translateY(-2px); }
.guide-section .step h4 { margin: 0 0 8px; color: #101018; font-size: 16px; font-weight: 700; line-height: 1.4; text-align: left; }
.guide-section .step::before { counter-increment: step-counter; content: counter(step-counter); position: absolute; left: 22px; top: 22px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #6558e8; color: #fff; font-size: 13px; font-weight: 700; }
.guide-section .step p { margin: 0; color: #6b6b78; font-size: 14px; line-height: 1.7; text-align: left; }

.faq { margin: 16px 0; padding: 0; }
.faq dt { position: relative; margin-top: 12px; padding: 16px 48px 16px 20px; border-radius: 14px; background: #f7f6ff; color: #101018; font-size: 16px; font-weight: 600; line-height: 1.5; text-align: left; cursor: pointer; transition: background-color 0.2s ease; -webkit-tap-highlight-color: transparent; }
.faq dt:hover { background: #f1eeff; }
.faq dt::after { content: "+"; position: absolute; top: 50%; right: 20px; transform: translateY(-50%); color: #6558e8; font-size: 20px; font-weight: 600; line-height: 1; }
.faq dt.active::after { content: "−"; }
.faq dd { margin: 0; height: 0; overflow: hidden; color: #6b6b78; font-size: 15px; line-height: 1.7; text-align: left; transition: height 0.22s ease; }
.faq dd > div { padding: 12px 20px 14px; }

@media (max-width: 900px) {
  .faq dt { padding: 14px 44px 14px 16px; font-size: 15px; }
  .faq dt::after { right: 16px; }
  .faq dd > div { padding: 10px 16px 12px; }
}



section.panel {
  display: none; width: 100%;
  justify-content: space-between; align-items: flex-start;
  gap: 16px; margin: 32px auto 48px;
}

#file-list {
  flex: 1; min-width: 0; margin: 8px 0; padding: 0;
  list-style: none; background-color: #fff; border-radius: 6px;
  height: calc(100vh - 86px);
  overflow-x: hidden; overflow-y: auto;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: max-content; align-content: start; gap: 8px;
}

#file-list li {
  position: relative; display: flex; align-items: center; flex-direction: column;
  min-width: 0; min-height: 190px;
  border: 1px solid #f0f0f5; border-radius: 16px;
  padding: 8px; background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#file-list li:hover { border-color: #e4e0ff; box-shadow: 0 12px 28px rgba(17, 17, 26, 0.07); }


.remove-file-btn {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 24px; height: 24px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: #98a0ae; cursor: pointer;
  box-shadow: 0 1px 4px rgba(17, 17, 26, 0.12);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.remove-file-btn::before, .remove-file-btn::after { content: ""; position: absolute; top: 50%; left: 50%; width: 10px; height: 1.5px; border-radius: 2px; background: currentColor; }
.remove-file-btn::before { transform: translate(-50%, -50%) rotate(45deg); }
.remove-file-btn::after { transform: translate(-50%, -50%) rotate(-45deg); }
.remove-file-btn:hover { background: #fff1f1; color: #e5484d; }

@media (hover: hover) and (pointer: fine) {
  .remove-file-btn { opacity: 0; visibility: hidden; transform: scale(0.9); }
  #file-list li:hover .remove-file-btn,
  #file-list li:focus-within .remove-file-btn,
  .remove-file-btn:focus-visible { opacity: 1; visibility: visible; transform: scale(1); }
}

#file-list .col { width: 100%; padding: 4px; text-align: center; font-size: 13px; min-width: 0; }
#file-list .thumbbox { display: flex; justify-content: center; align-items: center; overflow: hidden; width: 100%; height: 120px; background: #f7f8fa; border-radius: 5px; }
img.thumbnail { width: 100%; height: 100%; object-fit: contain; display: block; }
#file-list .orig-size { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #687588; font-size: 12px; }

#file-list .name-cell { display: flex; align-items: center; justify-content: safe center; gap: 1px; min-width: 0; overflow: hidden; }
#file-list .file-name-input { flex: 0 1 auto; min-width: 0; max-width: 100%; padding: 3px 5px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-overflow: ellipsis; cursor: text; transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease; }
#file-list li:hover .file-name-input { border-color: #d7d0ff; background: #f6f4ff; color: #3f3a5c; }
#file-list .file-name-input:hover, #file-list .file-name-input:focus { border-color: #a99cff; background: #fff; color: #182230; }
#file-list .file-name-input:focus { outline: none; border-color: #6558e8; box-shadow: 0 0 0 3px rgba(101, 88, 232, 0.12); }
#file-list .file-ext { flex: none; color: #98a0ae; font-size: inherit; }
#file-list .size-info { font-weight: 600; color: #182230; }
#file-list .saved-pct { font-size: 11px; color: #22c55e; font-weight: 600; }
#file-list .status { font-size: 12px; color: #929baa; }



.setting {
  flex: 0 0 300px; width: 300px; min-width: 0; min-height: 45px;
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
  background: #fff; border-radius: 20px; border: 0;
  box-shadow: 0 12px 32px rgba(17, 17, 26, 0.07);
}

.h2_title { margin: 0; padding: 0 0 8px; color: #182230; font-size: 23px; font-weight: 700; line-height: 1.35; letter-spacing: -0.6px; text-align: left; }

#settingBox { width: 100%; }

.setting-row { margin-bottom: 16px; }
.setting-row:last-child { margin-bottom: 0; }
.setting-label { display: block; margin-bottom: 8px; font-size: 14px; color: #182230; font-weight: 600; }


.quality-slider-wrap {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 12px;
  background: #f9f8ff; border: 1px solid #e8e5ff; border-radius: 12px;
}
.quality-slider-wrap input[type="range"] {
  flex: 1; min-width: 0; height: 18px; margin: 0;
  appearance: none; -webkit-appearance: none;
  background: transparent; outline: none; cursor: pointer;
}
.quality-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #6558e8 var(--val, 75%), #e8e5ff var(--val, 75%));
}
.quality-slider-wrap input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #6558e8; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(101, 88, 232, 0.4);
  cursor: pointer;
  margin-top: -6px;
}
.quality-slider-wrap input[type="range"]::-moz-range-track {
  height: 4px; border-radius: 2px;
  background: #e8e5ff;
}
.quality-slider-wrap input[type="range"]::-moz-range-progress {
  height: 4px; border-radius: 2px;
  background: #6558e8;
}
.quality-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #6558e8; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(101, 88, 232, 0.4);
  cursor: pointer;
  border: none;
}
.quality-value {
  flex: 0 0 36px; text-align: right;
  font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: #6558e8;
}

.setting-select {
  width: 100%; height: 46px; padding: 0 32px 0 12px;
  border: 1px solid #d9dee8; border-radius: 12px; background: #fff;
  color: #182230; font-size: 15px;
  cursor: pointer; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236558e8' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}
.setting-select:focus { border-color: #6558e8; box-shadow: 0 0 0 3px rgba(101, 88, 232, 0.1); }



.button_box { width: 100%; margin: 16px 0; }

#compressAllBtn {
  width: 100%; min-height: 30px;
  display: flex; align-items: center; justify-content: center;
  padding: 6px 16px; gap: 8px;

  font-size: 13px; font-weight: 700; letter-spacing: -0.1px;

  border-radius: 999px; border: 1px solid #6558e8;
  background: #6558e8; color: #fff;

  cursor: pointer;
  box-shadow: 0 10px 24px rgba(101, 88, 232, 0.22);
  transition: all 0.2s ease;
}
#compressAllBtn:hover:not(:disabled) { background: #5749d6; border-color: #5749d6; box-shadow: 0 14px 30px rgba(101, 88, 232, 0.28); transform: translateY(-1px); }
#compressAllBtn:active:not(:disabled) { transform: translateY(0); }
#compressAllBtn:disabled { background: #e8eaf0; border-color: #e8eaf0; color: #a9aebb; cursor: not-allowed; box-shadow: none; transform: none; }
#compressAllBtn.compressing:disabled { background: #6558e8; border-color: #6558e8; color: #fff; cursor: wait; box-shadow: 0 12px 26px rgba(101, 88, 232, 0.22); }



.outputBox { display: none; width: 100%; padding: 12px; margin: 8px 0; border: 1px solid #eef0f4; border-radius: 16px; background: #fff; }
.output-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; }
#output_name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: #687588; }
#downloadButton { flex: 0 0 auto; min-width: 88px; height: 36px; padding: 0 14px; background-color: #6558e8; color: #fff; cursor: pointer; border-radius: 999px; border: 0; font-size: 12px; font-weight: 600; transition: background-color 0.2s ease; }
#downloadButton:hover:not(:disabled) { background-color: #5749d6; }
#downloadButton:disabled { opacity: 0.5; cursor: not-allowed; }



@media screen and (max-width: 768px) {
  .container { width: 100%; height: auto; padding: 0 16px; flex-direction: column; }
  .image_title { margin: 0 0 15px; font-size: 32px; letter-spacing: -1px; }
  #guidePage { width: 100%; margin: 0; padding: 50px 0 64px; }
  #guidePage h2 { margin: 0 auto; font-size: 14px; line-height: 1.7; }
  .upload-box { margin-top: 32px; padding: 40px 16px; border-radius: 20px; }
  .upload-label { width: fit-content; min-width: 200px; height: 52px; margin-top: 18px; }
  .grid-container { margin-top: 36px; }
  .guide-section { margin: 36px 0 0; padding: 0; }
  .guide-section h3 { margin: 32px 0 14px; font-size: 20px; letter-spacing: -0.4px; }
  .guide-section .step { padding: 20px 16px 20px 54px; }
  .guide-section .step::before { left: 14px; top: 18px; width: 24px; height: 24px; font-size: 12px; }

  section.panel { flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 8px; overflow: hidden; margin: 24px auto 32px; }
  #file-list { width: 100%; height: calc(100vh - 360px); min-height: 180px; margin: 4px 0; padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  #file-list li { min-height: 170px; padding: 6px; }
  #file-list .thumbbox { height: 105px; }
  #file-list .orig-size { font-size: 11px; }
  #file-list .col { padding: 4px 0; font-size: 12px; line-height: 16px; }

  .setting { flex: none; width: 100%; margin: 0; padding: 16px; gap: 10px; border-radius: 16px; }
  .h2_title { padding: 0 0 8px; font-size: 20px; }
  .button_box { margin: 12px 0; }
  .outputBox { margin: 4px 0; padding: 8px; }
}

@media screen and (max-width: 480px) {
  .image_title { font-size: 28px; letter-spacing: -0.8px; }
  .upload-label { width: 100%; max-width: 280px; }
  .grid-container { grid-template-columns: 1fr; }
}
