[hidden] { display: none !important; }
:root {
  --bg: #f4f3f1; --panel: #ffffff; --ink: #1d1c1a; --muted: #6c6862; --line: #e2dfda;
  --accent: #1f5fbf; --accent-ink: #fff; --warn: #9a5b00; --warn-bg: #fff4df; --err: #a61b1b; --err-bg: #fde9e9;
  --stage: #e9e7e3; --radius: 8px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); display: flex; flex-direction: column; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .02em; }
.file { color: var(--muted); max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { flex: 1; color: var(--muted); min-width: 10ch; }
.btn, button.primary, button.ghost, button.small { border-radius: 6px; padding: 6px 12px; border: 1px solid var(--line); background: var(--panel); display: inline-block; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.small { padding: 2px 8px; font-size: 12px; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } .panel { max-height: none; } }
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 16px; gap: 8px; }
.tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tabs [role=tab] { border: 1px solid transparent; background: none; padding: 5px 10px; border-radius: 6px; color: var(--muted); }
.tabs [role=tab][aria-selected=true] { background: var(--panel); border-color: var(--line); color: var(--ink); font-weight: 600; }
.spacer { flex: 1; }
.check { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.canvasWrap { position: relative; flex: 1; min-height: 320px; background: var(--stage); border-radius: var(--radius); overflow: auto; display: grid; place-items: center; }
#view { display: block; image-rendering: auto; max-width: none; }
.canvasWrap.fit #view { max-width: 100%; max-height: 100%; }
.canvasWrap.pix #view { image-rendering: pixelated; }
.drop { text-align: center; padding: 40px; border: 2px dashed #c9c5be; border-radius: 12px; margin: 24px; }
.drop.hover, .canvasWrap.hover { outline: 3px solid var(--accent); }
.muted { color: var(--muted); }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(244, 243, 241, .72); font-weight: 600; text-align: center; padding: 24px; }
.overlay .err { color: var(--err); max-width: 46ch; }
/* quick look on screen: a small badge, not a cover over the preview */
.overlay.quick { inset: 12px 12px auto auto; padding: 6px 10px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 6px; font-weight: 500; font-size: 13px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.filmsGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 12px; width: 100%; align-self: start; }
.filmsGrid figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px; cursor: pointer; }
.filmsGrid figure canvas { width: 100%; height: auto; display: block; }
.filmsGrid figcaption { font-size: 12px; display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.loupe { position: absolute; right: 12px; bottom: 12px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.loupe canvas { width: 240px; height: 240px; image-rendering: pixelated; display: block; }
.loupeInfo { font-size: 11px; color: var(--muted); margin-top: 4px; max-width: 240px; }
.proofNote { margin: 0; font-size: 12px; color: var(--muted); }
.panel { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 50px); padding: 4px 0 24px; }
.sec { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sec h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.seg button { padding: 6px 4px; border: 1px solid var(--line); background: #fff; border-radius: 6px; }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.warn { font-size: 12px; color: var(--warn); background: var(--warn-bg); padding: 6px 8px; border-radius: 6px; margin: 8px 0 0; }
.row { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.row label { color: var(--muted); }
.row input[type=number] { width: 7ch; padding: 3px 4px; border: 1px solid var(--line); border-radius: 4px; }
.row input[type=range] { flex: 1; min-width: 120px; }
.row select { padding: 3px 4px; border: 1px solid var(--line); border-radius: 4px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); padding: 0; }
.swatch[aria-pressed=true] { outline: 2px solid var(--accent); outline-offset: 2px; }
.ink { display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.ink:last-child { border-bottom: 0; }
.ink input[type=color] { width: 30px; height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0; background: none; }
.ink input.name { width: 100%; border: 1px solid transparent; padding: 3px 4px; border-radius: 4px; background: none; }
.ink input.name:hover, .ink input.name:focus { border-color: var(--line); }
.ink .cov { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ink.off { opacity: .45; }
.eye { border: 0; background: none; padding: 0; font-size: 15px; width: 22px; }
.inkMore { grid-column: 1 / -1; background: #faf9f7; border-radius: 6px; padding: 6px 8px; font-size: 13px; }
.inkMore .row { margin: 4px 0; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #efece7; color: var(--muted); }
details > summary { cursor: pointer; color: var(--ink); font-weight: 600; list-style: none; }
details > summary::before { content: "▸ "; color: var(--muted); }
details[open] > summary::before { content: "▾ "; }
.recipe { display: flex; gap: 6px; align-items: center; font-size: 13px; margin: 4px 0; flex-wrap: wrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.2); vertical-align: middle; }
.banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; max-width: min(640px, 92vw); box-shadow: 0 4px 16px rgba(0,0,0,.2); display: flex; gap: 12px; align-items: center; }
.banner.error { background: var(--err); }
.banner button { background: #fff; color: var(--ink); border: 0; border-radius: 5px; padding: 4px 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12px; color: var(--muted); }

.canvasWrap.picking #view { cursor: crosshair; outline: 3px solid var(--accent); }
#compareBtn { user-select: none; touch-action: none; }
.ink { grid-template-columns: 22px 30px minmax(0, 1fr) auto 22px auto; }

#undoBtn:disabled, #redoBtn:disabled { opacity: .4; cursor: default; }

button.small.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.prepBar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #eef4ff; border: 1px solid #c9dafb; border-radius: 8px; padding: 8px 12px; }
.prepBar .grow { flex: 1; min-width: 200px; }

/* no art: the canvas takes the full width */
.layout:has(> #panel[hidden]) { grid-template-columns: 1fr; }

.modalBack { position: fixed; inset: 0; background: rgba(20,20,20,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 10px; width: min(1180px, 100%); height: min(860px, calc(100dvh - 32px)); display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modalHead { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.modalHead h2 { margin: 0; font-size: 16px; }
.modalBody { flex: 1; display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: 0; }
@media (max-width: 760px) { .modalBody { grid-template-columns: 1fr; } }
.outSide { border-right: 1px solid var(--line); padding: 12px 16px; overflow-y: auto; }
.outSide h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
.outSide ol { padding-left: 18px; margin: 4px 0; font-size: 13px; }
.outSide li { margin: 3px 0; }
.outMain { display: flex; flex-direction: column; min-height: 0; background: var(--stage); }
.outMain iframe { flex: 1; border: 0; width: 100%; background: #fff; }
.outEmpty { margin: auto; color: var(--muted); padding: 24px; text-align: center; }
.outBar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }

.jobTitle { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; min-width: 12ch; max-width: 34ch; background: none; }
.jobTitle:hover, .jobTitle:focus { border-color: var(--line); background: #fff; }

.canvasWrap.touching canvas { cursor: crosshair; }
.prepBar .seg { display: inline-flex; gap: 4px; }

.filmNav { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.filmNav button { min-width: 28px; font-size: 16px; line-height: 1; }

.zoomCtl { display: inline-flex; gap: 2px; align-items: center; }
.zoomCtl #zoomPct { min-width: 4.2em; font-variant-numeric: tabular-nums; }
.zoomCtl #zoomFit[aria-pressed=true] { background: var(--panel); border-color: var(--ink); }
/* art editor (right column) */
.toolGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.toolGrid button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 12px; line-height: 1.2; text-align: center; }
.toolGrid button:hover { border-color: var(--ink); }
.toolGrid button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.toolGrid kbd { position: absolute; top: 3px; right: 5px; font: 600 10px/1 inherit; opacity: .5; }
.edIcon { display: inline-flex; }
.edTip { display: flex; gap: 6px; align-items: flex-start; }
.edTip .edIcon { flex: none; margin-top: 1px; color: var(--ink); }
.edRow .edLabel { width: 76px; }
.edRow input[type=range] { min-width: 0; }
.edVal { width: 6ch; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.edLabel { width: 76px; color: var(--muted); }
.edInks { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.edInks .swatch.mini { margin: 0; }
.edInks .swatch.mini[aria-pressed=true] { outline: 2px solid var(--accent); outline-offset: 1px; }
button.small.edPt { display: inline-flex; align-items: center; gap: 5px; }
button.small.edPt[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.edGo button.primary { width: 100%; }
.edTabs { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
.underList { display: flex; flex-wrap: wrap; gap: 4px 12px; flex: 1; }
.underItem { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.underItem .dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px #0002; }
.edGo .row button { flex: 1; }
.canvasWrap.edRing #view { cursor: none; }
.canvasWrap.edAim #view { cursor: crosshair; }
#edCursor { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 40; }
#edCursor .ring { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.7), inset 0 0 0 1px rgba(0,0,0,.7); }
#edCursor[data-tool=eraser] .ring { border-style: dashed; }
#edCursor.down .ring { background: color-mix(in srgb, var(--paint) 45%, transparent); border-color: var(--accent); }
#edCursor .ring::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 2px; margin: -1px; background: #000; box-shadow: 0 0 0 1px #fff; border-radius: 50%; }
.swatch.mini { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); padding: 0; margin-left: 3px; cursor: pointer; }

/* film-download sign-in (inktracker.app) */
.gateBox { background: var(--panel); border-radius: 10px; width: min(440px, 100%); padding: 22px 22px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 10px; }
.gateBox h2 { margin: 0; font-size: 18px; }
.gateBox p { margin: 0; }
.gateBox input[type=email] { padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.gateBox .row { justify-content: flex-end; gap: 8px; margin-top: 4px; }
