/* Layout: the "n". Tool keys run along the top and down the left of the image stage;
   the right arm is the settings panel. On phones the keys become a scrolling strip
   and the panel a bottom sheet. Every tool has its own hue; the page stays neutral. */

:root {
  --bg: oklch(0.982 0.004 265);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.966 0.005 265);
  --ink: oklch(0.24 0.02 265);
  --muted: oklch(0.53 0.02 265);
  --line: oklch(0.905 0.007 265);
  --check-a: oklch(0.955 0.003 265);
  --check-b: oklch(0.995 0 0);
  --shadow: 0 1px 2px oklch(0.2 0.02 265 / 0.06), 0 10px 30px oklch(0.2 0.02 265 / 0.07);
  --tint-l: 0.952; --tint-c: 0.04;
  --ink-l: 0.46; --ink-c: 0.15;
  --fill-l: 0.585; --fill-c: 0.175;
  --radius: 20px;
  --rail: 104px;
  --panel: 328px;
  --gap: 12px;
  --font: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.17 0.012 265);
    --surface: oklch(0.215 0.014 265);
    --surface-2: oklch(0.25 0.015 265);
    --ink: oklch(0.94 0.008 265);
    --muted: oklch(0.72 0.015 265);
    --line: oklch(0.31 0.015 265);
    --check-a: oklch(0.27 0.01 265);
    --check-b: oklch(0.31 0.01 265);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 10px 30px oklch(0 0 0 / 0.25);
    --tint-l: 0.29; --tint-c: 0.06;
    --ink-l: 0.84; --ink-c: 0.12;
    --fill-l: 0.62; --fill-c: 0.17;
    color-scheme: dark;
  }
}

/* Any element that carries a hue gets its own colour set. */
[data-hue] {
  --c: oklch(var(--fill-l) var(--fill-c) var(--h));
  --c-tint: oklch(var(--tint-l) var(--tint-c) var(--h));
  --c-ink: oklch(var(--ink-l) var(--ink-c) var(--h));
  --c-glow: oklch(0.55 0.17 var(--h) / 0.32);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--c, var(--ink)); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Top bar */
.topbar { max-width: 1440px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.chip-private { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.chip-private .icon { width: 16px; height: 16px; }
.lang { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.lang .icon { width: 17px; height: 17px; }
.brand span, .lang span { white-space: nowrap; }
.lang-short { display: none; }
@media (max-width: 400px) {
  .lang-full { display: none; }
  .lang-short { display: inline; }
}
/* The smallest phones: the brand and the language need the whole bar; the dropzone still says nothing is uploaded. */
@media (max-width: 359px) {
  .chip-private { display: none; }
  .brand { font-size: 16px; gap: 8px; }
}
/* Language menu: a plain disclosure, so it works without scripts and every language is a real link */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 6px; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; width: min(360px, calc(100vw - 32px)); background: var(--surface); border-radius: 14px; box-shadow: 0 12px 32px oklch(0 0 0 / .18), inset 0 0 0 1px var(--line); }
.lang-menu a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 14px; }
.lang-menu a:hover, .lang-menu a[aria-current] { background: var(--surface-2); }
.lang-menu a[aria-current] { font-weight: 650; }
/* "Open this page in Türkçe": a note under the language button on English pages (lang-hint.js). It floats, so
   nothing moves when it appears. Only English pages show it, so it always sits at the right. */
.topbar-end { position: relative; }
.lang-hint { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: flex; align-items: center; gap: 4px; max-width: calc(100vw - 32px); padding: 5px 5px 5px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: 0 12px 32px oklch(0 0 0 / .2); font-size: 14px; white-space: nowrap; }
.lang-hint[dir="rtl"] { padding: 5px 14px 5px 5px; }
.lang-hint a { color: inherit; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.lang-hint a:hover { text-decoration: underline; }
.lang-hint-close { flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; opacity: .7; }
.lang-hint-close:hover { opacity: 1; background: color-mix(in oklch, var(--bg) 18%, transparent); }

/* Workspace grid */
.workspace {
  max-width: 1440px; margin: 0 auto; padding: 4px 20px 20px;
  display: grid; gap: var(--gap);
  grid-template-columns: var(--rail) repeat(5, minmax(0, 1fr)) var(--panel);
  grid-template-rows: var(--rail) repeat(4, minmax(0, 1fr));
  height: clamp(600px, calc(100vh - 76px), 820px);
}
.tools { display: contents; }

.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-width: 0; padding: 10px 8px; border-radius: 18px; text-decoration: none; text-align: center;
  background: var(--c-tint); color: var(--c-ink); font-weight: 600; font-size: 13px; line-height: 1.2;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease;
}
.tile .icon { width: 28px; height: 28px; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px var(--c-glow); }
.tile[aria-current="page"] { background: var(--c); color: oklch(1 0 0); box-shadow: 0 10px 26px var(--c-glow); }
.tile[aria-current="page"]::after { content: ""; position: absolute; width: 14px; height: 14px; background: var(--c); border-radius: 3px; transform: rotate(45deg); }
.tile-label { overflow-wrap: normal; word-break: normal; hyphens: manual; }

/* corner, top row, left column */
.tile:nth-child(1) { grid-column: 1; grid-row: 1; }
.tile:nth-child(2) { grid-column: 2; grid-row: 1; }
.tile:nth-child(3) { grid-column: 3; grid-row: 1; }
.tile:nth-child(4) { grid-column: 4; grid-row: 1; }
.tile:nth-child(5) { grid-column: 5; grid-row: 1; }
.tile:nth-child(6) { grid-column: 6; grid-row: 1; }
.tile:nth-child(7) { grid-column: 1; grid-row: 2; }
.tile:nth-child(8) { grid-column: 1; grid-row: 3; }
.tile:nth-child(9) { grid-column: 1; grid-row: 4; }
.tile:nth-child(10) { grid-column: 1; grid-row: 5; }
.tile:nth-child(-n+6)[aria-current="page"]::after { bottom: -6px; inset-inline-start: calc(50% - 7px); }
.tile:nth-child(n+7)[aria-current="page"]::after { inset-inline-end: -6px; top: calc(50% - 7px); }
.tile:nth-child(1)[aria-current="page"]::after { bottom: -5px; inset-inline-end: -5px; inset-inline-start: auto; }

/* Stage */
.stage {
  grid-column: 2 / 7; grid-row: 2 / 6; position: relative; min-height: 0; overflow: hidden;
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  transition: box-shadow .2s ease;
}
.workspace.has-tool .stage { box-shadow: var(--shadow), inset 0 0 0 2px var(--c); }

.drop {
  position: absolute; inset: 16px; border-radius: 14px; border: 2px dashed color-mix(in oklch, var(--c-ink) 35%, transparent);
  display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 24px;
  background: color-mix(in oklch, var(--c-tint) 45%, transparent); transition: background-color .15s, border-color .15s;
}
.drop.is-over { background: var(--c-tint); border-color: var(--c); }
.drop-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--c-tint); color: var(--c-ink); }
.drop-icon .icon { width: 32px; height: 32px; }
.drop h2 { margin: 0; font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.015em; text-wrap: balance; }
.drop p { margin: 0; color: var(--muted); }
.drop-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.kbd { font: 12px var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--line), inset 0 0 0 1px var(--line); }
.drop-formats { font-size: 13px; }
/* What every tool promises: one quiet row of words, ticks drawn in the tool's colour. */
.promise { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 13px; font-weight: 600; color: var(--c-ink); }
.promise li { display: inline-flex; align-items: center; gap: 5px; }
/* Cartoon is drawn on the server, so the on-device promises are hidden while it is open. */
.server-tool .local-only { display: none !important; }
.promise li::before { content: ""; width: 9px; height: 5px; border: solid currentColor; border-width: 0 0 2px 2px; transform: translateY(-2px) rotate(-45deg); }

/* Remove object: the brush layer over the photo. One colour at half strength, so overlapping strokes look even. */
.paint { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; opacity: .55; cursor: crosshair; touch-action: none; }

/* First use of an on-device tool: a calm card over the photo while the tool gets ready. No sizes on purpose. */
.prep { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: color-mix(in oklch, var(--surface) 72%, transparent); backdrop-filter: blur(6px); }
.prep-card { display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 320px; padding: 24px 22px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.prep-title { margin: 4px 0 0; font-weight: 700; font-size: 17px; }
.prep-text { margin: 0; color: var(--muted); font-size: 14px; text-wrap: balance; }
.prep-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--c-tint); overflow: hidden; margin-top: 6px; }
.prep-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c); transition: width .3s ease; }
@media (prefers-reduced-motion: reduce) { .prep-bar span { transition: none; } }

.view { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px 24px 72px; }
.frame { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 4px; overflow: hidden;
  background-color: var(--check-b);
  background-image: conic-gradient(var(--check-a) 25%, transparent 0 50%, var(--check-a) 0 75%, transparent 0);
  background-size: 18px 18px; box-shadow: 0 0 0 1px var(--line), 0 12px 40px oklch(0.2 0.02 265 / 0.12); }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.frame .after { clip-path: inset(0 0 0 var(--split, 0%)); }
.split { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 0; }
.split::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: oklch(1 0 0); box-shadow: 0 0 0 1px oklch(0 0 0 / .18); }
.split-handle { position: absolute; top: 50%; left: 0; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; border: 0; background: oklch(1 0 0); color: oklch(0.3 0.02 265); box-shadow: 0 4px 14px oklch(0 0 0 / .25); display: grid; place-items: center; cursor: ew-resize; }
.split-handle .icon { width: 20px; height: 20px; }
.tag { position: absolute; top: 10px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: oklch(0.2 0.02 265 / .62); color: oklch(1 0 0); backdrop-filter: blur(6px); }
.tag-before { left: 10px; }
.tag-after { right: 10px; }

.stage-bar { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; align-items: center; gap: 8px; }
.file-chip { min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 7px 12px; border-radius: 12px; background: color-mix(in oklch, var(--surface) 88%, transparent); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(8px); }
.file-chip b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26ch; }
.file-chip span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.stage-actions { margin-inline-start: auto; display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: color-mix(in oklch, var(--surface) 88%, transparent); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(8px); }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn .icon { width: 20px; height: 20px; }

.busy { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in oklch, var(--surface) 55%, transparent); backdrop-filter: blur(2px); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--c-tint); border-top-color: var(--c); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* Crop box */
.crop-box { position: absolute; box-shadow: 0 0 0 9999px oklch(0.15 0.02 265 / 0.55); outline: 2px solid oklch(1 0 0); cursor: move; touch-action: none; }
.crop-box::before, .crop-box::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(oklch(1 0 0 / .45), oklch(1 0 0 / .45)), linear-gradient(oklch(1 0 0 / .45), oklch(1 0 0 / .45)), linear-gradient(90deg, oklch(1 0 0 / .45), oklch(1 0 0 / .45)), linear-gradient(90deg, oklch(1 0 0 / .45), oklch(1 0 0 / .45));
  background-size: 100% 1px, 100% 1px, 1px 100%, 1px 100%; background-position: 0 33.33%, 0 66.66%, 33.33% 0, 66.66% 0; background-repeat: no-repeat; }
.crop-box::after { background: none; }
.crop-box.has-guide::after { background: radial-gradient(ellipse 32% 38% at 50% 44%, transparent 98%, oklch(1 0 0 / .85) 99%, oklch(1 0 0 / .85) 100%, transparent 101%); }
.handle { position: absolute; width: 22px; height: 22px; margin: -11px; touch-action: none; }
.handle::before { content: ""; position: absolute; inset: 5px; border-radius: 4px; background: oklch(1 0 0); box-shadow: 0 1px 4px oklch(0 0 0 / .35); }
.handle[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.handle[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.handle[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.handle[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }

/* Panel */
.panel {
  grid-column: 7; grid-row: 1 / 6; min-height: 0; display: flex; flex-direction: column;
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); overflow: hidden;
}
.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; min-height: var(--rail); border-bottom: 1px solid var(--line); }
.panel-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--c-tint); color: var(--c-ink); flex: none; }
.panel-head h1 { margin: 0; font-size: 19px; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.panel-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.panel-head > div { min-width: 0; }
.sheet-toggle { display: none; }
.panel-body { flex: 1; overflow: auto; padding: 16px 18px; display: grid; align-content: start; gap: 18px; }
.panel-body.enter { animation: rise .22s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.panel-foot { padding: 14px 18px 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }

.field { display: grid; gap: 8px; }
.field-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.field-label output { font: 600 13px var(--font); letter-spacing: 0; text-transform: none; color: var(--ink); font-variant-numeric: tabular-nums; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.seg.wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.seg button { border: 0; border-radius: 9px; padding: 8px 6px; background: none; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px oklch(0.2 0.02 265 / .14), inset 0 0 0 1px var(--line); }
/* The two directions of one key (JPG to PDF, PDF to JPG) are links that look like the segmented buttons. */
.seg a { display: grid; place-items: center; border-radius: 9px; padding: 8px 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.seg a:hover { color: var(--ink); }
.seg a[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px oklch(0.2 0.02 265 / .14), inset 0 0 0 1px var(--line); }
/* PDF pages to pick from. */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; max-height: 232px; overflow: auto; padding: 3px; }
.pages button { position: relative; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 8px; background: var(--surface-2) 50% 0 / cover no-repeat; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.pages button span { position: absolute; right: 4px; bottom: 4px; min-width: 18px; padding: 1px 5px; border-radius: 6px; background: oklch(0.2 0.02 265 / .72); color: oklch(1 0 0); font-size: 11px; font-weight: 700; }
.pages button[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--c); }
.pages button.is-failed { opacity: .4; }
/* JPG to PDF: the page picked above moves with these. */
.page-order { margin-top: 8px; }

/* Home page with several photos: the tools that take them all. */
.offer { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--c-tint); margin-bottom: 14px; }
.offer-head { margin: 0; font-size: 14px; font-weight: 600; color: var(--c-ink); }
.offer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.offer-list .btn { justify-content: center; text-decoration: none; }
.range { width: 100%; accent-color: var(--c); }
.num-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.num { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.num input, .select { width: 100%; min-width: 0; padding: 9px 11px; border-radius: 10px; border: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; font-size: 15px; color: var(--ink); }
.num input:focus, .select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--c); }
.with-unit { position: relative; }
.with-unit input { padding-inline-end: 38px; }
.with-unit span { position: absolute; inset-inline-end: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); pointer-events: none; }
.lock { width: 36px; height: 40px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.lock[aria-pressed="true"] { color: var(--c-ink); background: var(--c-tint); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--c); margin: 0; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }

/* Many photos converted together: their names, a tick as each one is done. */
/* Image to text: the words that were read, editable before copying */
.seg.ocr-langs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg.ocr-langs > :first-child { grid-column: 1 / -1; }
.ocr-text { display: block; width: 100%; min-height: 220px; max-height: 52vh; resize: vertical; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: 14px/1.55 var(--font); white-space: pre-wrap; }
.ocr-text:focus-visible { outline: 2px solid var(--c); outline-offset: 1px; }
.ocr-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.ocr-count { font-size: 13px; color: var(--muted); }
.batch-list { list-style: none; margin: 0 0 4px; padding: 0; max-height: 196px; overflow: auto; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.batch-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; font-size: 13px; border-bottom: 1px solid var(--line); }
.batch-list li:last-child { border-bottom: 0; }
.batch-list span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-list b { flex: none; font-weight: 600; color: var(--c-ink); }
.batch-list li[data-state="failed"] b { color: var(--muted); }
.note { margin: 0; font-size: 13.5px; padding: 12px 14px; border-radius: 12px; background: var(--c-tint); color: var(--c-ink); }

.result { display: grid; gap: 6px; font-size: 13.5px; }
.result-row { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.result-row span:first-child { color: var(--muted); }
.result-row b { font-weight: 650; }
.saving { color: oklch(0.55 0.14 150); }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--c); border-radius: 3px; transition: width .3s ease; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 13px; padding: 12px 16px; font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none; min-height: 46px; transition: filter .15s, transform .15s; }
.btn .icon { width: 19px; height: 19px; }
.btn-primary { background: var(--c, var(--ink)); color: oklch(1 0 0); box-shadow: 0 6px 18px var(--c-glow, transparent); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.btn-soft { background: var(--c-tint, var(--surface-2)); color: var(--c-ink, var(--ink)); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; transform: none; }
.btn-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.panel-foot > div:not(.btn-row) > .btn, .panel-foot > .btn { width: 100%; }

.tool-list { display: grid; gap: 6px; }
.tool-list a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 14px; }
.tool-list a:hover { background: var(--c-tint); color: var(--c-ink); }
.tool-list .dot { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--c-tint); color: var(--c-ink); }
.tool-list .dot .icon { width: 18px; height: 18px; }

/* Below the tool */
.below { max-width: 1440px; margin: 0 auto; padding: 8px 20px 60px; display: grid; gap: 28px; }
.ad-slot { min-height: 100px; border-radius: 14px; display: grid; place-items: center; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; box-shadow: inset 0 0 0 1px dashed var(--line); border: 1px dashed var(--line); }
.guide { max-width: 72ch; }
.guide h2 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 10px; text-wrap: balance; }
.guide h3 { font-size: 17px; margin: 24px 0 6px; }
.guide * + h2 { margin-top: 36px; }   /* "Questions" after the steps */
.guide p, .guide li { color: color-mix(in oklch, var(--ink) 86%, var(--muted)); font-size: 16px; line-height: 1.65; }
.guide ol { padding-inline-start: 1.3em; }
.site-foot { max-width: 1440px; margin: 0 auto; padding: 24px 20px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; width: 100%; }
.foot-links a { color: var(--ink); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
/* About, privacy, terms and contact */
.doc { max-width: 1440px; margin: 0 auto; padding: 24px 20px 48px; }
.doc .guide h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.02em; margin: 8px 0 18px; }
.doc .guide a { color: inherit; }
.doc .credits { padding-inline-start: 1.2em; }
.doc .updated { font-size: 14px; color: var(--muted); }
.doc .lang-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 8px 30px oklch(0 0 0 / .25); }

/* Tablet: keys in two rows above the stage, panel on the right */
@media (max-width: 1180px) {
  :root { --panel: 300px; }
  .workspace { grid-template-columns: repeat(5, minmax(0, 1fr)) var(--panel); grid-template-rows: auto auto minmax(440px, 1fr); height: auto; min-height: calc(100vh - 76px); }
  .tile { grid-column: auto !important; grid-row: auto !important; padding: 10px 6px; gap: 6px; min-height: 78px; font-size: 12.5px; }
  .tile .icon { width: 24px; height: 24px; }
  .tile[aria-current="page"]::after { display: none; }
  .stage { grid-column: 1 / 6; grid-row: 3; min-height: 440px; }
  .panel { grid-column: 6; grid-row: 1 / 4; }
}

/* Phone: scrolling key strip, full-width stage, bottom sheet */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar { padding: 10px 16px; }
  .chip-private span { display: none; }
  .chip-private { padding: 7px; }
  .workspace { display: flex; flex-direction: column; padding: 0 0 12px; gap: 10px; height: auto; min-height: 0; }
  .tools { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .tools::-webkit-scrollbar { display: none; }
  .tile { flex: none; flex-direction: row; scroll-snap-align: start; min-height: 0; padding: 9px 13px 9px 10px; border-radius: 14px; gap: 8px; font-size: 13.5px; white-space: nowrap; }
  .tile .icon { width: 20px; height: 20px; }
  .tile:hover { transform: none; }
  .stage { margin: 0 16px; min-height: 0; height: min(56vh, 480px); }
  .workspace:not(.has-image) .panel { display: none; }
  body.sheet-on { padding-bottom: calc(var(--sheet-peek, 150px) + 8px); }
  .view { padding: 14px 14px 64px; }
  .drop { inset: 10px; gap: 12px; }
  .drop-paste { display: none; }
  .file-chip b, .file-chip span:first-of-type { display: none; }
  .panel-foot [data-pick] { display: none; }
  .panel {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; max-height: 78vh; border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 40px oklch(0.2 0.02 265 / .18), inset 0 1px 0 var(--line);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .panel-head { min-height: 0; padding: 18px 16px 12px; border-bottom: 0; position: relative; }
  .panel-head::before { content: ""; position: absolute; top: 7px; left: calc(50% - 20px); width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
  .panel-icon { width: 40px; height: 40px; border-radius: 12px; }
  .panel-head h1 { font-size: 17px; }
  .panel-head p { display: none; }
  .sheet-toggle { display: grid; place-items: center; margin-inline-start: auto; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface-2); cursor: pointer; }
  .sheet-toggle .icon { width: 20px; height: 20px; transition: transform .2s; }
  .panel.is-open .sheet-toggle .icon { transform: rotate(180deg); }
  .panel-body { display: none; padding-top: 4px; }
  .panel.is-open .panel-body { display: grid; }
  .panel-foot { border-top: 0; padding-top: 4px; }
  .panel:not(.is-open) .result-row:not(:last-child), .panel:not(.is-open) .meter { display: none; }
  .below { padding: 8px 16px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Your edits: a small copy of each effect's tool key, in the order they were made. Two quick presses turn one off
   or on (it turns grey and says Off); dragging it out of the row removes it. */
.steps { position: relative; flex: none; padding: 12px 16px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.steps-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.steps-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.steps-title b { padding: 1px 7px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-size: 11.5px; letter-spacing: 0; text-transform: none; }
.steps-reset { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.steps-reset .icon { width: 15px; height: 15px; }
.steps-reset:hover { color: var(--ink); background: var(--surface); }
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 8px; }
.step { display: grid; justify-items: center; gap: 5px; width: 84px; padding: 0; border: 0; background: none; color: var(--c-ink); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .18s ease, opacity .18s ease; }
.step-pic { position: relative; display: block; width: 84px; height: 57px; border-radius: 11px; overflow: hidden; background: var(--c-tint); box-shadow: 0 0 0 2px var(--c); transition: filter .2s, opacity .2s, box-shadow .2s; }
/* The key picture drawn at full key size and shrunk, so it looks exactly like the key above. */
.step-art { position: absolute; left: 0; top: 0; width: 228px; height: 156px; transform: scale(.3684); transform-origin: 0 0; container-type: size; pointer-events: none;
  --pic-bg: color-mix(in oklch, var(--c-tint) 55%, var(--surface)); --ease: cubic-bezier(.3, .8, .3, 1); background: var(--pic-bg); }
.step-name { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 650; line-height: 1.2; }
.step-off, .step-bin { position: absolute; inset: 0; display: none; place-items: center; }
.step-off { color: oklch(1 0 0); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 1px 3px oklch(0 0 0 / .6); }
.step-bin { background: oklch(0.55 0.2 25 / .82); color: oklch(1 0 0); }
.step-bin .icon { width: 22px; height: 22px; }
.step:hover .step-pic { box-shadow: 0 0 0 2px var(--c), 0 6px 14px var(--c-glow); }
.step.is-editing .step-pic { box-shadow: 0 0 0 2px var(--c), 0 0 0 5px color-mix(in oklch, var(--c) 28%, transparent); }
.step.is-off .step-pic { filter: grayscale(1); opacity: .5; box-shadow: 0 0 0 2px var(--line); }
.step.is-off .step-off { display: grid; }
.step.is-off .step-name { color: var(--muted); }
/* While dragging, a floating copy follows the pointer and the key's place in the row stays as a faint outline. */
.step.is-lifted { opacity: .25; }
.step-ghost { position: fixed; z-index: 60; margin: 0; pointer-events: none; cursor: grabbing; transition: none; }
.step-ghost .step-pic { box-shadow: 0 0 0 2px var(--c), 0 14px 30px oklch(0.2 0.02 265 / .35); }
.step-ghost.is-out .step-bin { display: grid; }
.step-ghost.is-out .step-pic { box-shadow: 0 0 0 2px oklch(0.6 0.2 25), 0 14px 30px oklch(0.2 0.02 265 / .35); }
.step-ghost.is-back { transition: transform .2s ease; }
.steps-hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 760px) {
  /* In the bottom sheet the edits sit under the tool name, where the thumb reaches them. */
  .panel-head { order: 0; } .steps { order: 1; padding: 6px 16px 10px; border-bottom: 0; background: none; } .panel-body { order: 2; } .panel-foot { order: 3; }
}
