/* Molpia Image: frosted glass panels over a graphite room lit with magenta.
   Shared sections (Fonts, Tokens, Base, Page frame, Buttons, Form fields, Alerts and tags, Motion)
   follow paste.molpia/public/app.css, the reference of ../../DESIGN.md, by way of Molpia EXIF. The
   accent is written only through the tokens, so this tool's colour is the accent set below and
   nothing else. */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #121413;
  --glass: rgb(255 255 255 / 4.5%);
  --glass-strong: rgb(255 255 255 / 7%);
  --glass-hover: rgb(255 255 255 / 9%);
  --glass-sunken: rgb(0 0 0 / 22%);
  --line: rgb(255 255 255 / 10%);
  --line-strong: rgb(255 255 255 / 17%);
  --line-hover: rgb(255 255 255 / 26%);
  --highlight: inset 0 1px 0 rgb(255 255 255 / 9%);
  --blur: blur(22px) saturate(150%);
  --solid: #1b1e1c;
  --tint: rgb(255 255 255 / 3%);
  --tint-2: rgb(255 255 255 / 5%);
  --scrollbar: rgb(255 255 255 / 18%);
  --btn-shine: rgb(255 255 255 / 35%);
  --header-bg: rgb(24 27 25 / 60%);

  --text: #e8ecea;
  --text-muted: #a3aaa6;
  --text-faint: #8b938e;

  /* Magenta (Molpia Image, ../../DESIGN.md section 2; hue about 318). Contrast: --accent 6.73:1
     on --bg and 6.11:1 on --solid; white ink 6.40:1 and 5.29:1 on the two ends of the gradient. */
  --accent: #f368c9;
  --accent-2: #f9a8e0;
  --accent-rgb: 243 104 201;
  --accent-ink: #ffffff;
  --gradient: linear-gradient(135deg, #b0187f 0%, #c4228f 100%);
  --gradient-hover: linear-gradient(135deg, #9c1674 0%, #b0187f 100%);
  --accent-soft: rgb(243 104 201 / 14%);
  --danger: #fb7185;
  --danger-soft: rgb(251 113 133 / 12%);
  --warning: #fbbf24;

  --radius: 6px;
  --radius-sm: 4px;
  --page-max: 1180px;
  --page-read-max: 980px;

  --font-ui: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-press: cubic-bezier(0.3, 0, 0.2, 1);

  --shadow-window: var(--highlight), 0 30px 80px -24px rgb(0 0 0 / 75%);
  --shadow-window-focus: var(--highlight), 0 30px 80px -24px rgb(0 0 0 / 75%), 0 24px 70px -28px rgb(var(--accent-rgb) / 45%);
  --shadow-pop: var(--highlight), 0 20px 50px -16px rgb(0 0 0 / 80%);

  /* 44px targets on touch screens (DESIGN.md), 32-36px with a mouse. */
  --target: 36px;
  --target-sm: 32px;
}
@media (pointer: coarse) { :root { --target: 44px; --target-sm: 44px; } }

/* Light theme, the visitor's choice (html[data-theme="light"], from the theme cookie). */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #eef1ef;
  --glass: rgb(255 255 255 / 66%);
  --glass-strong: rgb(255 255 255 / 84%);
  --glass-hover: rgb(16 24 20 / 6%);
  --glass-sunken: rgb(16 24 20 / 4.5%);
  --line: rgb(16 24 20 / 11%);
  --line-strong: rgb(16 24 20 / 18%);
  --line-hover: rgb(16 24 20 / 28%);
  --highlight: inset 0 1px 0 rgb(255 255 255 / 85%);
  --solid: #ffffff;
  --tint: rgb(16 24 20 / 3%);
  --tint-2: rgb(16 24 20 / 4.5%);
  --scrollbar: rgb(16 24 20 / 24%);
  --btn-shine: rgb(255 255 255 / 45%);
  --header-bg: rgb(255 255 255 / 72%);

  --text: #121614;
  --text-muted: #4a534e;
  --text-faint: #646e68;

  /* --accent 6.64:1 on --bg and 7.55:1 on white; white ink 6.40:1 and 5.29:1 on the gradient. */
  --accent: #9c1674;
  --accent-2: #b0187f;
  --accent-rgb: 176 24 127;
  --accent-ink: #ffffff;
  --gradient: linear-gradient(135deg, #b0187f 0%, #c4228f 100%);
  --gradient-hover: linear-gradient(135deg, #9c1674 0%, #b0187f 100%);
  --accent-soft: rgb(var(--accent-rgb) / 10%);
  --danger: #e11d48;
  --danger-soft: rgb(225 29 72 / 9%);
  --warning: #b45309;

  --shadow-window: var(--highlight), 0 24px 60px -30px rgb(16 24 20 / 28%);
  --shadow-window-focus: var(--highlight), 0 24px 60px -30px rgb(16 24 20 / 28%), 0 24px 70px -30px rgb(var(--accent-rgb) / 35%);
  --shadow-pop: var(--highlight), 0 18px 44px -18px rgb(16 24 20 / 30%);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); overflow-y: scroll; scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; scroll-behavior: smooth; }
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: var(--bg); }
html::-webkit-scrollbar-thumb { border: 3px solid var(--bg); border-radius: 6px; background: var(--scrollbar); }
html::-webkit-scrollbar-thumb:hover { background: var(--line-hover); }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
  overflow-x: clip;
  /* Makes body a stacking context, so the aurora (z-index -1) paints above body's own background
     instead of under it. Without this the glass has nothing to frost. */
  isolation: isolate;
}

/* The aurora: soft fields of magenta light behind every panel, drifting slowly. */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 22% 22%, rgb(var(--accent-rgb) / 20%), transparent 70%),
    radial-gradient(34% 32% at 80% 20%, rgb(200 210 205 / 8%), transparent 70%),
    radial-gradient(40% 36% at 64% 84%, rgb(var(--accent-rgb) / 13%), transparent 72%),
    radial-gradient(30% 28% at 16% 88%, rgb(160 170 165 / 7%), transparent 70%);
  animation: aurora 38s ease-in-out infinite alternate;
}
:root[data-theme="light"] body::before { opacity: 0.7; }

::selection { background: rgb(var(--accent-rgb) / 32%); color: var(--text); }

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgb(var(--accent-rgb) / 55%);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  transition: color 160ms var(--ease-out), text-decoration-color 160ms var(--ease-out);
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 3.8vw, 2.8rem); }
h2 { font-size: 1.15rem; letter-spacing: -0.015em; }
h3 { font-size: 1rem; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
code, kbd { font-family: var(--font-mono); font-size: 0.88em; }
kbd { padding: 0 5px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--glass); color: var(--text-muted); }

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.18em;
}
.icon-small { width: 0.9em; height: 0.9em; opacity: 0.7; }
/* The inline sprite holds the symbols; it takes no room and is never shown itself. */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* The hidden attribute always wins over a class that sets display. */
[hidden] { display: none !important; }

/* ---------- Page frame ---------- */
.site-header {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(var(--page-max), calc(100% - 24px));
  margin: 12px auto 0;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--header-bg);
  box-shadow: var(--shadow-pop);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
/* With very large text the nav drops under the brand instead of running off the screen. */
.site-header { flex-wrap: wrap; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-logo { display: block; width: 28px; height: 28px; filter: drop-shadow(0 6px 10px rgb(var(--accent-rgb) / 40%)); transition: transform 300ms var(--ease-out); }
.brand:hover { color: var(--text); }
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }
.site-nav { display: flex; align-items: center; gap: 4px; }

.page { flex: 1; width: 100%; max-width: var(--page-max); margin: 0 auto; padding: clamp(22px, 3vw, 40px) clamp(16px, 3vw, 24px) clamp(24px, 4vw, 48px); }
@media (min-width: 1560px) { :root { --page-max: 1260px; --page-read-max: 1060px; } }

.skip-link { position: absolute; top: 8px; left: 8px; z-index: 60; transform: translateY(-200%); }
.skip-link:focus-visible { transform: none; }

.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 20px; padding: 18px clamp(16px, 4vw, 32px); color: var(--text-muted); font-size: 0.85rem; text-align: center; }
.footer-link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--target-sm); padding: 0; border: 0; background: none; color: var(--text-muted); font: inherit; text-decoration: none; cursor: pointer; transition: color 160ms var(--ease-out); }
.footer-link .icon { transition: transform 220ms var(--ease-out); }
.footer-link:hover { color: var(--accent); }
.footer-link:hover .icon { transform: translateY(-1px) rotate(-8deg); }
/* "Molpia" sits inside "© 2026 Molpia EXIF", so it is underlined to read as a link. */
.footer-home { display: inline; min-height: 0; text-decoration: underline; text-decoration-color: rgb(var(--accent-rgb) / 55%); text-underline-offset: 0.2em; }

/* The theme switch (header only) shows the theme you would get */
.theme-to-dark { display: none; }
:root[data-theme="light"] .theme-to-light { display: none; }
:root[data-theme="light"] .theme-to-dark { display: inline-block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--target);
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: 550 0.92rem/1.1 var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    box-shadow 240ms var(--ease-out),
    transform 160ms var(--ease-press);
}
.btn:hover { color: var(--text); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn .icon { transition: transform 220ms var(--ease-out); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--gradient);
  color: var(--accent-ink);
  font-weight: 650;
  box-shadow: inset 0 1px 0 var(--btn-shine), 0 10px 28px -10px rgb(var(--accent-rgb) / 65%);
}
.btn-primary:hover:not(:disabled) {
  background: var(--gradient-hover);
  color: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 var(--btn-shine), 0 16px 36px -12px rgb(var(--accent-rgb) / 70%);
}
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn-secondary { background: var(--glass-strong); border-color: var(--line-strong); box-shadow: var(--highlight); }
.btn-secondary:hover { background: var(--glass-hover); border-color: var(--line-hover); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--glass-hover); color: var(--text); }
.btn-lg { min-height: 44px; padding: 10px 20px; font-size: 0.98rem; }
.btn-block { width: 100%; }
.icon-btn { width: var(--target); padding: 0; }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.85; }

/* ---------- Form fields ---------- */
.input {
  width: 100%;
  min-height: var(--target);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-sunken);
  color: var(--text);
  font: 400 0.95rem/1.4 var(--font-ui);
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.input:hover { border-color: var(--line-strong); }
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.input::placeholder { color: var(--text-faint); opacity: 1; }
.input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1); cursor: pointer; }

.field-hint { color: var(--text-faint); font-size: 0.82rem; }

/* ---------- Alerts and tags ---------- */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid rgb(251 113 133 / 40%);
  border-radius: var(--radius);
  background: var(--danger-soft);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  animation: nudge 360ms var(--ease-out);
}
.alert .icon { margin-top: 3px; color: var(--danger); }
.alert p + p { margin-top: 4px; }
.alert-info { border-color: rgb(var(--accent-rgb) / 35%); background: var(--accent-soft); animation: none; }
.alert-info .icon { color: var(--accent); }
.alert-warn { border-color: rgb(251 191 36 / 38%); background: rgb(251 191 36 / 9%); animation: none; }
.alert-warn .icon { color: var(--warning); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 550;
  white-space: nowrap;
}
.tag:empty { display: none; }
/* 55% accent: on a selected (tinted) row the 78% mix measured 4.36:1; this keeps 4.5:1 or more. */
.tag-accent, .tag-ok { border-color: rgb(var(--accent-rgb) / 45%); background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 55%, var(--text)); }
.tag-warn { border-color: rgb(251 191 36 / 45%); background: rgb(251 191 36 / 10%); color: var(--warning); }
.tag-muted { color: var(--text-muted); } /* small text on the tinted panels measured 4.34:1 in faint; muted passes 4.5:1 */

/* ---------- The tool ---------- */
.intro { max-width: 720px; margin-bottom: clamp(18px, 2.4vw, 26px); }
.lede { margin-top: 12px; color: var(--text-muted); font-size: 1.075rem; }
.tool { scroll-margin-top: 84px; }
.tool:focus { outline: none; }
.tool > .alert { margin-bottom: 14px; }

/* The drop window: the empty state of the tool, the page's main surface. */
.drop {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--glass-strong);
  box-shadow: var(--shadow-window);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: border-color 220ms var(--ease-out), box-shadow 280ms var(--ease-out), background-color 220ms var(--ease-out);
}
.drop::before {
  /* A dashed inner edge says "drop here" without a dashed outer border. */
  content: "";
  position: absolute;
  inset: 10px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  pointer-events: none;
  transition: border-color 220ms var(--ease-out);
}
.drop:focus-within { border-color: rgb(var(--accent-rgb) / 45%); box-shadow: var(--shadow-window-focus); }
.drop.is-over { border-color: rgb(var(--accent-rgb) / 65%); background: var(--accent-soft); box-shadow: var(--shadow-window-focus); }
.drop.is-over::before { border-color: rgb(var(--accent-rgb) / 70%); }
.drop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: clamp(260px, 38vh, 380px);
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
}
.drop-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; margin-bottom: 8px; border: 1px solid rgb(var(--accent-rgb) / 35%); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); }
.drop-icon .icon { width: 26px; height: 26px; }
.drop-title { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.02em; }
.drop-hint { color: var(--text-muted); font-size: 0.92rem; }
.drop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.drop-formats { margin-top: 12px; color: var(--text-faint); font-size: 0.84rem; }
.drop-noscript { padding: 0 24px 24px; color: var(--warning); text-align: center; }

/* Dragging a file anywhere over the window */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(10 8 16 / 55%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
  animation: fade-in 160ms var(--ease-out);
}
.drop-overlay-box { display: grid; justify-items: center; gap: 10px; padding: 28px 36px; border: 1.5px dashed rgb(var(--accent-rgb) / 80%); border-radius: var(--radius); background: var(--solid); box-shadow: var(--shadow-pop); color: var(--text); font-weight: 600; }
.drop-overlay-box .icon { width: 30px; height: 30px; color: var(--accent); }

/* ---------- Work area: the list, the settings and before/after ---------- */
/* The tool measures itself, so the layout follows the room it has, not the window. */
.tool { container: tool / inline-size; }
.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 21.5rem);
  grid-template-areas: "files settings" "compare settings";
  gap: 16px;
  align-items: start;
}
.files { grid-area: files; }
.settings { grid-area: settings; }
.compare { grid-area: compare; }

.panel {
  min-width: 0;
  padding: clamp(16px, 2.4vw, 22px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--glass-strong);
  box-shadow: var(--shadow-window);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.panel h2 { font-size: 1.15rem; }
.panel > h2, .panel-head { margin-bottom: 14px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.panel-head h2 { display: inline-flex; align-items: center; gap: 10px; }
.panel-head h2:focus { outline: none; }
.panel-head h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* The list of photos */
.files-tools { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.file-list { display: grid; margin: 0; padding: 0; list-style: none; }
.file {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: background-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.file:first-child { border-top-color: transparent; }
.file.is-selected { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 40%); }
.file.is-selected + .file { border-top-color: transparent; }
.file-thumb {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass-sunken);
  color: var(--text-faint);
}
.file-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.file-thumb .icon { width: 22px; height: 22px; }
.file-main { display: grid; gap: 2px; min-width: 0; }
/* Long names wrap to two lines and are cut there; the full name is in the title and the labels. */
.file-name { display: -webkit-box; overflow: hidden; font-size: 0.95rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.file-meta, .file-status, .file-note { color: var(--text-muted); font-size: 0.84rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.file-result { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.file-result-text { min-width: 0; }
/* At large text sizes "Already as small as it gets" is wider than a phone's column: let it wrap. */
.file-result .tag { white-space: normal; }
.file-result .icon { color: var(--text-faint); }
.file-status { display: flex; align-items: flex-start; gap: 6px; }
.file-status .icon { flex: none; margin-top: 0.2em; }
/* Mixed with the text colour: plain --danger measured 4.6:1 on the light glass, too close to the line. */
.file-status.is-error { color: color-mix(in srgb, var(--danger) 82%, var(--text)); }
.file-status.is-working { color: var(--text); }
.file-actions { display: flex; align-items: center; gap: 2px; }
.file-actions .icon-btn { width: var(--target); }
.file-actions [aria-pressed="true"] { background: var(--glass-hover); color: var(--accent); }
.files-hint { margin-top: 12px; color: var(--text-muted); font-size: 0.84rem; }

/* Settings */
.settings > h2 { margin-bottom: 16px; }
.field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
#settings-fields { gap: 20px; }
#settings-fields:disabled { opacity: 0.6; }
.field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-label { color: var(--text); font-size: 0.84rem; font-weight: 550; }
.field-value { color: var(--text-muted); font-size: 0.84rem; }

.segmented { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass-sunken); }
.segmented label { position: relative; flex: 1 1 0; min-width: max-content; cursor: pointer; }
/* The radio stays in place (transparent, on top) so it keeps native keyboard and screen reader
   behaviour; the span under it is what shows. */
.segmented input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-sm);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 550;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.segmented label:hover span { background: var(--glass-hover); color: var(--text); }
.segmented input:checked + span { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 55%); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented input:disabled { cursor: not-allowed; }
.segmented input:disabled + span { opacity: 0.45; }
.segmented label:has(input:disabled):hover span { background: none; color: var(--text-muted); }

.range { width: 100%; min-height: var(--target-sm); margin: 0; accent-color: var(--accent-2); cursor: pointer; }
.range:disabled { cursor: not-allowed; opacity: 0.45; }
.range:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

.select-wrap { position: relative; }
.select {
  width: 100%;
  min-height: var(--target);
  padding: 7px 36px 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-sunken);
  color: var(--text);
  font: 400 0.95rem/1.4 var(--font-ui);
  cursor: pointer;
  appearance: none;
  transition: border-color 160ms var(--ease-out);
}
.select:hover { border-color: var(--line-strong); }
.select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.select option { background: var(--solid); color: var(--text); }
.select-wrap > .icon { position: absolute; top: 50%; right: 12px; color: var(--text-muted); transform: translateY(-50%); pointer-events: none; }
.custom-size { display: flex; align-items: center; gap: 8px; }
.custom-size .input { max-width: 9rem; }
.custom-unit { color: var(--text-muted); font-size: 0.9rem; }
.input[aria-invalid="true"] { border-color: var(--danger); }
#custom-hint.is-error { color: var(--danger); }

.settings-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: 0.86rem; }
.settings-note .icon { margin-top: 3px; color: var(--accent); }

.run { display: grid; gap: 10px; margin-top: 16px; }
.run-summary { color: var(--text-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.run-summary:empty { display: none; }
.run-summary strong { color: var(--text); font-weight: 600; }
.run-progress { width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 3px; background: var(--glass-sunken); box-shadow: inset 0 0 0 1px var(--line); appearance: none; }
.run-progress::-webkit-progress-bar { border-radius: 3px; background: var(--glass-sunken); }
.run-progress::-webkit-progress-value { border-radius: 3px; background: var(--gradient); transition: width 240ms var(--ease-out); }
.run-progress::-moz-progress-bar { border-radius: 3px; background: var(--gradient); }
#run { min-width: 0; }
.run-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.btn-primary[aria-disabled="true"], .btn-primary[aria-disabled="true"]:hover { background: var(--gradient); opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: inset 0 1px 0 var(--btn-shine); }
.thanks { padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: 0.88rem; }

/* Before and after: the copy over the original, cut at the divider. */
.compare-name { margin: -6px 0 12px; color: var(--text-muted); font-size: 0.88rem; overflow-wrap: anywhere; }
.zoom { display: flex; gap: 2px; }
.zoom .btn[aria-pressed="true"] { background: var(--glass-hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.compare-view {
  display: grid;
  place-items: center;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass-sunken);
  overscroll-behavior: contain;
}
.compare-stage {
  position: relative;
  width: min(100%, calc(64vh * var(--ratio, 1.5)));
  aspect-ratio: var(--ratio, 1.5);
  touch-action: pan-y;
  cursor: ew-resize;
  user-select: none;
}
.compare-view.is-full { place-items: start; }
.compare-view.is-full .compare-stage { width: var(--full-width, 100%); max-width: none; touch-action: auto; }
.compare-stage img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; -webkit-user-drag: none; }
.compare-after { clip-path: inset(0 0 0 var(--split, 50%)); }
/* Drawn on the photo itself, so these stay white on dark whatever the theme. */
.compare-line { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; margin-left: -1px; background: #ffffff; box-shadow: 0 0 0 1px rgb(0 0 0 / 35%); pointer-events: none; }
.compare-label { position: absolute; top: 8px; padding: 2px 8px; border-radius: var(--radius-sm); background: rgb(0 0 0 / 62%); color: #ffffff; font-size: 0.78rem; font-weight: 550; pointer-events: none; }
.compare-label-before { left: 8px; }
.compare-label-after { right: 8px; }
.split { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 12px; color: var(--text-muted); font-size: 0.84rem; }
.compare-facts { margin-top: 8px; color: var(--text-muted); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.compare-facts strong { color: var(--text); font-weight: 600; }

.alert-body { flex: 1; min-width: 0; }
.alert-close { margin: -6px -8px -6px 0; color: var(--text-muted); }

/* ---------- Privacy and questions ---------- */
.info { max-width: var(--page-read-max); margin: clamp(56px, 8vw, 96px) auto 0; scroll-margin-top: 84px; }
.info > h2 { margin-bottom: 18px; font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 700; letter-spacing: -0.03em; }
/* Four points in one glass panel, as rows divided by lines, like the questions below. */
.info-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.info-item { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 6px 24px; padding: 18px 20px; }
.info-item + .info-item { box-shadow: inset 0 1px 0 var(--line); }
.info-item h3 { display: flex; align-items: flex-start; gap: 10px; font-size: 1rem; line-height: 1.35; }
.info-item h3 .icon { margin-top: 0.1em; color: var(--accent); }
.info-item p { color: var(--text-muted); font-size: 0.93rem; }
.info-item code { color: var(--text); }
.info-note { max-width: 76ch; margin-top: 16px; color: var(--text-muted); font-size: 0.9rem; }

.faq { border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.faq details { padding: 0 18px; transition: background-color 200ms var(--ease-out); }
.faq details + details { box-shadow: inset 0 1px 0 var(--line); }
.faq details[open] { background: var(--tint); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 14px 0; font-weight: 600; list-style: none; cursor: pointer; transition: color 160ms var(--ease-out); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq-chevron { color: var(--text-faint); transition: transform 260ms var(--ease-out), color 160ms var(--ease-out); }
.faq details[open] .faq-chevron { transform: rotate(90deg); color: var(--accent); }
.faq details p { max-width: 72ch; padding: 0 0 18px; color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Not found ---------- */
.notice-page { max-width: 460px; margin: 0 auto; padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--glass-strong); box-shadow: var(--shadow-window); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.notice-page h1 { font-size: 1.8rem; }
.notice-page p { margin: 10px 0 22px; color: var(--text-muted); }

/* ---------- Motion ---------- */
/* One authored entrance: the intro and the drop window rise once. When photos come in, the three
   panels follow, each a little after the one before. Nothing loops but the aurora. */
@media (prefers-reduced-motion: no-preference) {
  .intro { animation: rise 600ms var(--ease-out) backwards; }
  .drop { animation: rise 680ms var(--ease-out) 90ms backwards; }
  .work:not([hidden]) > .panel { animation: rise 520ms var(--ease-out) backwards; }
  .work:not([hidden]) > .settings { animation-delay: 80ms; }
  .work:not([hidden]) > .compare { animation-delay: 140ms; }
}
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(3%, -2%, 0) rotate(4deg); }
  100% { transform: translate3d(-3%, 3%, 0) rotate(-3deg); }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body::before { animation: none; }
}

/* Without backdrop-filter, glass falls back to a solid tint so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header, .drop, .panel, .info-list, .faq, .notice-page { background: var(--solid); }
}

/* ---------- Narrower screens ---------- */
/* Two columns from 52rem of tool width; the settings stay in view while a long list scrolls,
   on screens tall enough to show the whole panel. */
@container tool (min-width: 52.01rem) {
  @media (min-height: 980px) {
    .settings { position: sticky; top: 84px; }
  }
}
@container tool (max-width: 52rem) {
  .work { grid-template-columns: minmax(0, 1fr); grid-template-areas: "files" "settings" "compare"; }
}
@container tool (max-width: 34rem) {
  .file { grid-template-columns: 44px minmax(0, 1fr); align-items: start; padding: 10px 4px; }
  .file-thumb { width: 44px; height: 44px; margin-top: 2px; }
  .file-actions { grid-column: 2; margin-left: -8px; }
  .panel-head h2 { width: 100%; }
  .files-tools { margin-left: -10px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .split-label { display: none; }
}
@media (max-width: 640px) {
  .site-header { top: 8px; width: calc(100% - 16px); margin-top: 8px; padding: 6px 6px 6px 10px; }
  .site-nav { gap: 2px; }
  .page { padding-top: 20px; }
  .lede { margin-top: 10px; font-size: 1rem; line-height: 1.5; }
  .drop-empty { min-height: 0; padding: 26px 18px 24px; }
  .drop-icon { width: 44px; height: 44px; margin-bottom: 4px; }
  .drop-actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; margin-top: 14px; }
  .info-item { grid-template-columns: minmax(0, 1fr); }
  .compare-view { max-height: 60vh; }
}
/* The narrowest phones: brand, theme switch and "All tools" only fit with tighter spacing. */
@media (max-width: 360px) {
  .site-header { gap: 6px; padding-left: 8px; }
  .brand { gap: 8px; }
  .site-nav .btn-keep-label { padding-left: 8px; padding-right: 8px; gap: 6px; }
}
@media (hover: none) { .hint-paste { display: none; } }
