:root {
  --ink: #17243b;
  --muted: #7f8aa3;
  --line: #dce1eb;
  --soft: #eef1f7;
  --accent: #0076f4;
  --accent-dark: #0066f4;
  --danger: #dc4d5f;
}
* {
  box-sizing: border-box
}
html, body {
  margin: 0;
  min-height: 100%;
  font-family: Arial,Helvetica,sans-serif;
  background: #fff;
  color: var(--ink)
}
body {
  min-height: 100vh;
  padding: 20px 18px 50px
}
.page {
  width: min(962px,100%);
  margin: 0 auto
}
.hero {
  text-align: center;
  padding-top: 0
}
h1 {
  margin: 0;
  font-size: 50px;
  line-height: 1.08;
  letter-spacing: 0px;
  font-weight: 800;
  color: var(--ink)
}
.subtitle {
  margin: 15px 0 0;
  font-size: 22px;
  line-height: 1.35;
  color: #101827
}
.converter {
  width: 90%;
  margin: 20px auto 0
}
.toolbar {
  height: 46px;
  display: flex;
  align-items: stretch
}
.add-wrap {
  display: flex;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 0;
  overflow: hidden;
  background: var(--soft)
}
.add-button, .add-menu {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  cursor: pointer
}
.add-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px 0 12px;
  font-size: 16px
}
.add-button:hover, .add-menu:hover {
  background: #e7eaf1
}
.add-menu {
  width: 60px;
  border-left: 1px solid var(--line);
  display: grid;
  place-items: center
}
.add-icon {
  width: 20px;
  height: 24px;
  display: inline-block
}
.chevron {
  width: 13px;
  height: 13px;
  border-right: 3px solid #70809d;
  border-bottom: 3px solid #70809d;
  transform: rotate(45deg) translateY(-3px)
}
#fileInput {
  display: none
}
.file-panel {
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  overflow: hidden
}
.empty-state {
  min-height: 97px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer
}
.empty-state.dragover {
  background: #f8f9ff;
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
  color: var(--accent)
}
.file-list {
  display: none
}
.file-list.has-files {
  display: block
}
.file-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 2px 15px 2px 15px;
  border-bottom: 1px solid var(--line);
  gap: 20px
}
.file-row:last-child {
  border-bottom: none
}
.file-meta {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 120px;
  align-items: center;
  column-gap: 14px
}
.file-name {
  font-size: 17px;
  color: #05070b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
  min-width: 0
}
.file-size {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  text-align: left
}
.controls {
  display: flex;
  align-items: center;
  gap: 23px;
  margin-left: auto
}
.output-group {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-size: 16px
}
.format-select {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 0;
  color: var(--accent);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  height: 37px;
  padding: 8px 32px 8px 13px;
  cursor: pointer;
  background-image: linear-gradient(45deg,transparent 50%,var(--accent) 50%),linear-gradient(135deg,var(--accent) 50%,transparent 50%);
  background-position: calc(100% - 16px) 17px,calc(100% - 10px) 17px;
  background-size: 7px 7px,7px 7px;
  background-repeat: no-repeat;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #7c8aa5;
  cursor: pointer;
  padding: 6px;
  display: grid;
  place-items: center;
  border-radius: 0;
}
.icon-button:hover {
  background: #f2f4f8;
  color: #5f6e8b
}
.icon-button svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round
}
.remove-button:hover {
  color: var(--danger);
  background: #fff1f3
}
.footer-bar {
  min-height: 66px;
  background: var(--soft);
  display: flex;
  align-items: center;
  border-radius: 0;
  overflow: hidden
}
.count {
  padding: 0 25px;
  font-size: 18px;
  color: #05070b;
  flex: 1
}
.convert-button {
  align-self: stretch;
  min-width: 175px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 25px
}
.convert-button:hover:not(:disabled) {
  background: var(--accent-dark)
}
/*.convert-button:disabled{opacity:.48;cursor:default}*/
.status-wrap {
  min-height: 38px;
  padding-top: 13px
}
#status {
  font-size: 15px;
  color: #66718a
}
#status.success {
  color: #208353
}
#status.error {
  color: #b72e42
}
.details-panel {
  display: none;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fafbfc;
  padding: 14px 16px;
  color: #5f6b80;
  font-size: 13px;
  line-height: 1.45
}
.details-panel.show {
  display: block
}
.info-line {
  word-break: break-word
}
pre {
  display: none;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 12px 0 0;
  padding: 12px;
  background: #111827;
  color: #e5e7eb;
  border-radius: 0;
  max-height: 280px;
  overflow: auto;
  font-size: 12px
}
pre.show {
  display: block
}
@media(max-width:760px) {
  h1 {
    font-size: 42px
  }
  .subtitle {
    font-size: 19px
  }
  .converter {
    width: 100%;
    margin-top: 21px
  }
  .file-row {
    align-items: flex-start;
    flex-direction: column
  }
  .controls {
    width: 100%;
    margin-left: 0;
    gap: 10px
  }
  .output-group {
    margin-right: auto
  }
  .icon-button {
    width: 38px;
    height: 38px
  }
  .convert-button {
    min-width: 155px;
    font-size: 20px
  }
  .toolbar {
    height: 56px
  }
}
@media(max-width:500px) {
  body {
    padding-left: 10px;
    padding-right: 10px
  }
  h1 {
    font-size: 34px
  }
  .subtitle {
    font-size: 17px
  }
  .add-button {
    font-size: 16px
  }
  .add-menu {
    width: 48px
  }
  .footer-bar {
    min-height: 68px
  }
  .count {
    padding-left: 16px;
    font-size: 16px
  }
  .convert-button {
    min-width: 132px;
    padding: 0 18px;
    font-size: 18px
  }
  .controls {
    flex-wrap: wrap
  }
}
/* Per-image conversion progress */
.file-main {
  min-width: 0;
  flex: 1
}

.progress-area {
  width: 120px;
  display: flex;
  align-items: center;
  justify-self: start;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #e8eaf2;
  border-radius: 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 0;
  background: #e58a00;
  transition: width .18s ease, background-color .18s ease;
}

.progress-fill.status-complete {
  background: #208353;
}

.progress-fill.status-error {
  background: var(--danger);
}

.progress-fill.status-ready {
  background: transparent;
}

.icon-button:disabled, .add-button:disabled, .add-menu:disabled {
  opacity: .45;
  cursor: default
}

@media(max-width:760px) {
  .file-main {
    width: 100%
  }
  .file-meta {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 72px 100px;
    column-gap: 8px
  }
  .progress-area {
    width: 100px
  }
}

/* Centre the selected output-format text. */
.format-select {
  text-align: center;
  text-align-last: center;
  padding-left: 16px;
  padding-right: 32px;
}

/* Conversion settings share the top toolbar with Add More Files. */
.settings-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-bottom: none;
  border-radius: 0;
  background: #fff;
}


.settings-grid {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.setting-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.setting-item.hidden {
  display: none;
}

.setting-input,
.setting-select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  padding: 0 7px;
}

.setting-input {
  width: 58px;
}

.setting-select {
  max-width: 116px;
  cursor: pointer;
}

.setting-input:focus,
.setting-select:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.setting-input:disabled,
.setting-select:disabled {
  opacity: .55;
  cursor: default;
}

@media(max-width:900px) {

  .settings-panel {
    gap: 8px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .settings-grid {
    gap: 8px;
  }

  .setting-item {
    gap: 4px;
  }
}

@media(max-width:760px) {
  .toolbar {
    height: auto;
    flex-wrap: wrap;
  }

  .add-wrap {
    height: 46px;
  }

  .settings-panel {
    flex-basis: 100%;
    min-height: 46px;
    border-left: 1px solid var(--line);
    border-radius: 0;
  }

  .settings-grid {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 6px 0;
  }
}


/* Scale setting */
.scale-input-wrap {
  display: inline-flex;
  align-items: center;
}

.scale-input {
  width: 52px;
  padding-right: 5px;
}

.scale-suffix {
  margin-left: 3px;
  color: var(--muted);
  font-size: 12px;
}


/* =============== That's Not Mine: matched homepage theme =============== */
:root {
  color-scheme: light;
  --bg: #f5f8fc;
  --panel: #ffffff;
  --border: #d7e2ea;
  --text: #182637;
  --muted: #526477;
  --accent: #136c58;
  --accent-dark: #0b5948;
  --glow: #d8ebef;
  --panel-hover: #f0f8f7;
  --symbol-bg: #e4f3ee;
  --button-bg: #ffffff;
  --input-bg: #ffffff;
  --danger: #c43852;
  --success: #136c58;
  --progress-bg: #e4ecee;
  --progress-active: #bf7a14;
  --ink: var(--text);
  --line: var(--border);
  --soft: var(--panel-hover);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101827;
  --panel: #192437;
  --border: #324157;
  --text: #f4f7fb;
  --muted: #aebdd0;
  --accent: #8ae5c5;
  --accent-dark: #6fd3b0;
  --glow: #23354b;
  --panel-hover: #203046;
  --symbol-bg: #2b3a51;
  --button-bg: #192437;
  --input-bg: #141f30;
  --danger: #ff8fa0;
  --success: #8ae5c5;
  --progress-bg: #2d3d51;
  --progress-active: #e9a94f;
  --ink: var(--text);
  --line: var(--border);
  --soft: var(--panel-hover);
}
html { min-height: 100%; background: var(--bg); }
html, body { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); }
body {
  min-height: 100vh;
  padding: 0 20px 80px;
  background: radial-gradient(ellipse at 85% 2%, var(--glow) 0, transparent 45%), var(--bg);
  line-height: 1.55;
}
.page { width: min(1050px, 100%); margin: 0 auto; }
.page-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 28px 0 62px; }
.home-link, .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--text);
  font: inherit;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.home-link:hover, .theme-toggle:hover { border-color: var(--accent); background: var(--panel-hover); }
.home-link:focus-visible, .theme-toggle:focus-visible,
.add-button:focus-visible, .add-menu:focus-visible, .format-select:focus-visible,
.icon-button:focus-visible, .convert-button:focus-visible,
.setting-input:focus-visible, .setting-select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.home-link svg, .theme-toggle svg {
  width: 18px; height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .sun, [data-theme="light"] .theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
.hero { padding: 0; text-align: left; }
.eyebrow { margin: 0 0 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .15em; font-weight: 750; font-size: .75rem; }
h1 { margin: 0; font-size: clamp(2.3rem, 6vw, 4.4rem); line-height: 1.06; letter-spacing: -.055em; font-weight: 800; color: var(--text); }
.subtitle { max-width: 610px; margin: 23px 0 44px; color: var(--muted); font-size: 1.12rem; line-height: 1.55; }
.converter { width: 100%; margin: 0 auto; }
.toolbar { display: flex; align-items: stretch; height: auto; min-height: 60px; gap: 12px; margin-bottom: 12px; }
.add-wrap, .settings-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 8px 32px -30px #0008;
}
.add-wrap { flex: 0 0 auto; overflow: hidden; }
.add-button, .add-menu { color: var(--accent); font-weight: 700; }
.add-button { min-height: 60px; padding: 0 17px; font-size: 15px; }
.add-menu { width: 44px; border-left: 1px solid var(--border); }
.add-button:hover, .add-menu:hover { background: var(--panel-hover); }
.chevron { border-color: var(--accent); }
.settings-panel { flex: 1; min-width: 0; padding: 10px 13px; gap: 10px; }
.settings-grid { justify-content: flex-start; align-content: center; gap: 9px 15px; flex-wrap: wrap; }
.setting-item { color: var(--muted); font-size: 12px; gap: 6px; }
.setting-input, .setting-select {
  height: 33px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--input-bg); color: var(--text); font-size: 12px;
}
.setting-input:focus, .setting-select:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.scale-suffix { color: var(--muted); }
.file-panel {
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 8px 32px -30px #0008;
}
.empty-state { min-height: 120px; padding: 27px; color: var(--muted); font-size: 16px; }
.empty-state.dragover { background: var(--panel-hover); color: var(--accent); outline: 2px dashed var(--accent); outline-offset: -8px; }
.file-row { border-bottom-color: var(--border); padding: 9px 16px; gap: 12px; }
.file-row:last-child { border-bottom: none; }
.file-name { color: var(--text); }
.file-size, .output-group { color: var(--muted); }
.format-select {
  background-color: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--accent);
}
.icon-button { color: var(--muted); border-radius: 10px; }
.icon-button:hover { background: var(--panel-hover); color: var(--accent); }
.remove-button:hover { color: var(--danger); background: var(--panel-hover); }
.footer-bar {
  min-height: 64px;
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.count { color: var(--text); font-size: 16px; padding: 0 20px; }
.convert-button {
  min-width: 160px;
  padding: 0 22px;
  border-radius: 0;
  background: var(--accent);
  color: var(--bg);
  font-weight: 750;
  font-size: 18px;
}
:root[data-theme="light"] .convert-button { color: #fff; }
:root[data-theme="dark"] .convert-button { color: #101827; }
.convert-button:hover:not(:disabled) { background: var(--accent-dark); }
.convert-button:disabled { opacity: .5; cursor: not-allowed; }
.status-wrap { padding: 12px 3px 0; }
#status { color: var(--muted); }
#status.success { color: var(--success); }
#status.error { color: var(--danger); }
.details-panel { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--muted); }
pre { border: 1px solid var(--border); border-radius: 14px; background: var(--input-bg); color: var(--text); }
.progress-track { background: var(--progress-bg); border-radius: 999px; }
.progress-fill { background: var(--progress-active); border-radius: 999px; }
.progress-fill.status-complete { background: var(--success); }
.progress-fill.status-error { background: var(--danger); }
.progress-fill.status-ready { background: transparent; }
@media (max-width: 900px) {
  .toolbar { flex-wrap: wrap; }
  .settings-panel { flex-basis: 100%; padding: 12px 14px; }
}
@media (max-width: 760px) {
  .page-nav { padding: 22px 0 44px; }
  .toolbar { height: auto; }
  .add-wrap { height: auto; }
  .settings-panel { min-height: 0; border-left: 1px solid var(--border); border-radius: 16px; }
  .settings-grid { padding: 0; gap: 10px 14px; }
  .converter { width: 100%; margin-top: 0; }
  .file-row { padding: 12px 14px; }
  .file-name { font-size: 15px; }
  .file-size { font-size: 13px; }
  .count { font-size: 15px; }
  .convert-button { min-width: 135px; font-size: 16px; }
}
@media (max-width: 500px) {
  body { padding: 0 14px 44px; }
  .page-nav { gap: 8px; }
  .home-link, .theme-toggle { padding: 9px 11px; font-size: .78rem; gap: 6px; }
  .home-link svg, .theme-toggle svg { width: 16px; height: 16px; flex-basis: 16px; }
  .subtitle { margin: 17px 0 30px; font-size: 1rem; }
  .add-button { min-height: 54px; }
  .count { padding: 0 14px; }
  .convert-button { min-width: 122px; padding: 0 12px; }
  .file-meta { grid-template-columns: minmax(0, 1fr) 58px 80px; column-gap: 6px; }
  .progress-area { width: 80px; }
}
@media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; } }
