/* Svgkit. Style: framed-sheet (taste skill app sheet, seed 473982570). One tinted L-frame holds the top bar
   and the file list; the work sits on a white sheet inset 8px from the right and bottom, 16px corners, no shadow.
   Face: the frame is tinted a step towards the petrol accent, and the saved share of every file is a petrol bar.
   Grid: sheet padding 24, one gap of 24 everywhere; stage minmax(0,1fr) + rail 320 = sheet width - 48 - 24. */
:root {
  --ground: #f2f6f7;
  --surface: #ffffff;
  --raised: #f4f6f8;
  --active: #e6ecee;
  --border: #e3e7ea;
  --rule: #eef0f2;
  --control: #cdced1;
  --text: #131416;
  --muted: #5d5f60;
  --accent: #1b6c80;
  --accent-ink: #ffffff;
  --accent-soft: #e3f0f3;
  --positive: #1e7b4f;
  --negative: #c4242a;
  --warning: #92400e;
  --pill-warning-bg: #fffbeb;
  --pill-negative-bg: #ffedea;
  --radius-card: 8px;
  --radius-control: 6px;
  --radius-sheet: 16px;
  --sheet-inset: 8px;
  --sidebar-width: 228px;
  --gap: 24px;
  --pad: 24px;
  --control-height: 32px;
  --fs-title: 22px;
  --fs-section: 16px;
  --fs-body: 14px;
  --fs-small: 12px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --checker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='16' height='16' fill='%23ffffff'/%3E%3Cpath d='M0 0h8v8H0zM8 8h8v8H8z' fill='%23edf0f2'/%3E%3C/svg%3E");
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--text); font: 400 var(--fs-body)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, p, dl, dd, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num, output, .files, .subline { font-variant-numeric: tabular-nums; }
.small { font-size: var(--fs-small); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
kbd { font: 500 12px/1 var(--font); padding: 2px 5px; border-radius: 4px; background: var(--active); }

.ic { display: block; flex: none; }
[data-icon] { display: inline-flex; }

/* ── Shell ── */
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: 48px minmax(0, 1fr); height: 100dvh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 var(--sheet-inset) 0 16px; }
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--text); text-decoration: none; }
.mark { color: var(--accent); align-self: center; }
.brand-name { font-weight: 600; font-size: 15px; }
.brand-by { color: var(--muted); font-size: var(--fs-small); }
.privacy { color: var(--muted); font-size: var(--fs-small); margin: 0 auto; }
.top-actions { display: flex; gap: 8px; margin-left: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-height); padding: 0 12px; border-radius: var(--radius-control); border: 1px solid transparent; background: transparent; font-weight: 500; font-size: 13px; white-space: nowrap; cursor: pointer; transition: background-color 120ms ease-out, color 120ms ease-out; }
.btn.primary { background: var(--text); color: #fff; }
.btn.primary:hover { background: #2c2e31; }
.btn.ghost { background: var(--surface); border-color: var(--border); }
.btn.ghost:hover { background: var(--raised); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.wide { width: 100%; justify-content: flex-start; }
.icon-btn { display: inline-grid; place-items: center; width: var(--control-height); height: var(--control-height); border: 0; border-radius: var(--radius-control); background: transparent; }
.icon-btn:hover { background: var(--active); }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-size: var(--fs-small); font-weight: 500; }
.link:hover { text-decoration: underline; }
.only-phone { display: none; }

/* ── File list (frame) ── */
.side { grid-row: 2; display: flex; flex-direction: column; min-height: 0; padding: 8px 12px 12px; }
.side-head { padding: 8px 4px 12px; }
.side-head h2 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.count { color: var(--muted); font-weight: 400; }
.side-total { color: var(--muted); font-size: var(--fs-small); }
.files { flex: 1; overflow: auto; display: grid; align-content: start; gap: 2px; }
.file { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px; border-radius: var(--radius-control); cursor: pointer; }
.file:hover { background: var(--active); }
.file[aria-current="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); } /* taste-skill-ignore: a 1px inset edge, not a drop shadow */
.file-name { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pct { font-size: var(--fs-small); font-weight: 500; text-align: right; }
.file-pct.up { color: var(--negative); }
.file-sizes { grid-column: 1 / -1; font-size: var(--fs-small); color: var(--muted); }
.file-bar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--active); overflow: hidden; }
.file-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.file-err { grid-column: 1 / -1; color: var(--negative); font-size: var(--fs-small); }
.side-foot { display: grid; gap: 6px; padding-top: 12px; }

/* ── Sheet ── */
.sheet { grid-row: 2; min-width: 0; margin: 0 var(--sheet-inset) var(--sheet-inset) 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sheet); overflow: auto; padding: var(--pad); }

.empty { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--gap); min-height: 100%; }
.drop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 48px; padding: 40px; border-radius: 12px; background: var(--raised); border: 1.5px dashed var(--control); }
.drop-text { display: grid; justify-items: start; gap: 12px; }
.drop h1 { font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; max-width: 20ch; }
.drop-text > p { max-width: 46ch; color: var(--muted); font-size: 15px; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.samples { display: grid; gap: 12px; }
.sample-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sample { display: grid; gap: 6px; width: 100%; padding: 0; border: 0; background: none; text-align: left; font-size: var(--fs-small); color: var(--muted); }
.sample-art { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--radius-card); background: var(--surface) var(--checker); border: 1px solid var(--border); transition: border-color 120ms ease-out; }
.sample-art img { width: 44%; height: 44%; object-fit: contain; }
.sample:hover .sample-art { border-color: var(--accent); }
.sample b { display: block; color: var(--text); font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.can { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.can dt { font-weight: 600; margin-bottom: 4px; }
.can dd { color: var(--muted); }

.title-row { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.title-text { min-width: 0; flex: 1; }
.title-row h1 { font-size: var(--fs-title); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.subline { color: var(--muted); margin-top: 2px; }
.subline b { color: var(--text); font-weight: 600; }
.subline .saved { color: var(--positive); font-weight: 600; }
.subline .grew { color: var(--negative); font-weight: 600; }
.title-actions { display: flex; gap: 8px; }
.error { padding: 10px 12px; border-radius: var(--radius-card); background: var(--pill-negative-bg); color: #831c1e; margin-bottom: 16px; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }

/* ── Stage ── */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 8px 0 10px; color: var(--muted); font-weight: 500; position: relative; }
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; min-height: var(--control-height); }
.seg { display: inline-flex; padding: 2px; border-radius: var(--radius-control); background: var(--raised); }
.seg button { border: 0; background: none; height: 28px; padding: 0 10px; border-radius: 4px; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: inset 0 0 0 1px var(--border); } /* taste-skill-ignore: inset edge on the selected segment */
.zoom { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.zoom output { min-width: 40px; text-align: center; font-size: 13px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare[data-mode="side"] .onion { display: none; }
.compare[data-mode="onion"] { grid-template-columns: 1fr; }
.compare[data-mode="onion"] .pane:not(.onion) { display: none; }
.pane { display: grid; gap: 8px; min-width: 0; }
.canvas { position: relative; height: 420px; border-radius: var(--radius-card); overflow: auto; display: grid; place-items: safe center; border: 1px solid var(--border); }
.compare[data-bg="checker"] .canvas { background: #fff var(--checker); }
.compare[data-bg="light"] .canvas { background: #fff; }
.compare[data-bg="dark"] .canvas { background: #17191b; border-color: #17191b; color: #f2f2f2; }
.canvas img { grid-area: 1 / 1; display: block; }
.canvas[data-fit="true"] img { width: 82%; height: 82%; object-fit: contain; }
.onion .top-img { opacity: .5; }
.pane figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.pane figcaption .num { color: var(--text); font-weight: 500; }
.onion figcaption input { flex: 1; accent-color: var(--accent); }

.code { margin: 0; max-height: 520px; overflow: auto; padding: 16px; border-radius: var(--radius-card); background: var(--raised); font: 400 12.5px/1.6 "IBM Plex Mono", ui-monospace, monospace; white-space: pre; tab-size: 2; }
.diff span { display: block; padding: 0 8px; margin: 0 -8px; white-space: pre; }
.diff .add { background: #e2f6e9; color: #0b4a2a; }
.diff .del { background: #fdecea; color: #831c1e; }
.diff .gap { color: var(--muted); }
.formats { display: flex; flex-wrap: wrap; gap: 6px; }
.formats button { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--muted); }
.formats button:hover { color: var(--text); }
.formats button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; font-weight: 500; }
.code-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.code-bar .small { margin-right: auto; }
.warnings { display: grid; gap: 6px; margin-bottom: 8px; }
.warnings li { padding: 8px 10px; border-radius: var(--radius-control); background: var(--pill-warning-bg); color: var(--warning); font-size: 13px; }

/* ── Rail ── */
.rail { display: grid; gap: 0; border-radius: var(--radius-card); border: 1px solid var(--border); }
.group { display: grid; gap: 10px; padding: 16px; }
.group + .group { border-top: 1px solid var(--rule); }
.group h2 { font-size: 13px; font-weight: 600; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field { display: grid; gap: 4px; }
.field-row { display: flex; justify-content: space-between; font-size: 13px; }
.field input[type="range"] { accent-color: var(--accent); width: 100%; }
input:not([type]), input[inputmode] { height: var(--control-height); min-width: 0; width: 100%; padding: 0 8px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); font-size: 13px; font-variant-numeric: tabular-nums; }
input::placeholder { color: #8a8d90; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); color: var(--muted); cursor: pointer; }
.switch input { appearance: none; width: 30px; height: 18px; border-radius: 9px; background: var(--control); position: relative; margin: 0; cursor: pointer; transition: background-color 120ms ease-out; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 120ms ease-out; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(12px); }
.plugins summary { font-size: 13px; cursor: pointer; padding: 2px 0; }
.plugins > div { display: grid; gap: 6px; padding-top: 8px; max-height: 260px; overflow: auto; }
.plugins h3 { font-size: var(--fs-small); font-weight: 600; color: var(--muted); margin: 6px 0 0; }
.note { margin-top: -2px; }

.colours { display: grid; gap: 6px; }
.colour { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.sw { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, .12); padding: 0; }
.colour .to { display: flex; align-items: center; gap: 4px; }
.colour .to input[type="color"] { width: 26px; height: 26px; padding: 0; border: 1px solid var(--control); border-radius: 5px; background: var(--surface); cursor: pointer; }
.colour .cc { height: 26px; padding: 0 8px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-small); color: var(--muted); }
.colour .cc[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.colour .hex { overflow: hidden; text-overflow: ellipsis; }
.colour .hex s { color: var(--muted); }
.vb { display: grid; grid-template-columns: auto repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; }
.wh { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wh label { display: grid; gap: 4px; }

/* ── Overlays ── */
.dropping { position: fixed; inset: 8px; z-index: 30; display: grid; place-items: center; border-radius: var(--radius-sheet); background: rgba(27, 108, 128, .08); border: 2px dashed var(--accent); pointer-events: none; }
.dropping p { font-size: 18px; font-weight: 600; color: var(--accent); background: var(--surface); padding: 10px 16px; border-radius: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translate(-50%, 8px); opacity: 0; pointer-events: none; background: var(--text); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; transition: opacity 160ms ease-out, transform 160ms ease-out; }
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }

/* ── Narrower screens ── */
@media (max-width: 1180px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group + .group { border-top: 0; }
  .can { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drop { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .top { padding: 0 8px; gap: 8px; }
  .only-phone { display: inline-grid; }
  .hide-phone { display: none; }
  .brand-by { display: none; }
  .side { position: fixed; z-index: 20; top: 48px; left: 0; bottom: 0; width: min(86vw, 320px); background: var(--ground); transform: translateX(-100%); transition: transform 180ms ease-out; }
  .side[data-open="true"] { transform: none; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); } /* taste-skill-ignore: a real overlay sheet */
  .sheet { margin: 0; border-radius: 0; border: 0; padding: 16px; }
  .drop { padding: 28px 20px; }
  .drop h1 { font-size: 24px; }
  .sample-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .can { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .title-row { flex-direction: column; gap: 12px; }
  .rail { grid-template-columns: minmax(0, 1fr); }
  .group + .group { border-top: 1px solid var(--rule); }
  .canvas { height: 220px; }
  .compare { gap: 8px; }
  .zoom { margin-left: 0; }
  .code { max-height: 420px; }
}
