/*
VOICE   Calm, exact, professional: a camera body, not a toy.
IDEA    Matte black camera body with an engraved red dot; the photo is the only colour on screen.
PICTURE The image on the canvas; on the start screen, a sunset photo framed by crop marks.
COLOUR  Graphite greys #101114 / #17191e / #1e2026, one red accent #fa4946, white ink.
TYPE    Inter for the interface, Manrope 800 for the wordmark and headings.
LAYOUT  Photoshop grammar: menu, options bar, tool column, canvas, panel column; phones get bottom tools and sheets.
*/
:root {
  color-scheme: dark;
  --bg0: #101114; --bg1: #17191e; --bg2: #1e2026; --bg3: #2a2c33; --bg4: #383b43;
  --line: #2b2e35; --line2: #3a3d46;
  --ink: #ececee; --ink2: #a8aab1; --ink3: #7c7e86;
  --acc: #fa4946; --acc2: #ff5d59; --accSoft: rgba(250, 73, 70, 0.15);
  --ok: #34c77b; --warn: #f2b13b; --err: #ff5d5d;
  --hi: #ffffff; --toast: #2b2c31; --chk1: #2a2b30; --chk2: #222327; --glass: rgba(23, 25, 30, 0.92); --navGlass: rgba(23, 25, 30, 0.96);
  --stage: #101114; --stageTop: #17181b; --accText: #ff7773;
  --top: #141519; --side: #131417; --card: #22242a; --ghost: #25252c; --ghostB: #37373e; --ghostH: #303038;
  --hero1: #432326; --hero2: #1b1b21; --heroB: #353037; --hover: #201c21; --input: #111216; --chipB: #383b45; --chipT: #c9cbd2;
  --r: 8px;
  --safeB: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg0); color: var(--ink); overflow: hidden; overscroll-behavior: none;
  font: 13.5px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: 0.4; cursor: default; }
:focus-visible { outline: 2px solid var(--acc2); outline-offset: 1px; }
.muted { color: var(--ink2); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; line-height: 1.45; }
.mobile-only { display: none !important; }
.hidden-color { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ic { display: block; flex: none; }
.icw { display: inline-flex; }

/* ---------- App frame ---------- */
.app { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: "top" "opts" "main" "foot"; height: 100vh; height: 100dvh; }
.topbar { grid-area: top; } .optionsbar { grid-area: opts; } .main { grid-area: main; } .statusbar, .mobilebar { grid-area: foot; }
.app:not(.has-doc) .toolbar, .app:not(.has-doc) .optionsbar, .app:not(.has-doc) .statusbar { display: none; }
.app:not(.has-doc) .main { grid-template-columns: minmax(0, 1fr); }
.app:not(.has-doc).side-open .main { grid-template-columns: minmax(0, 1fr) 340px; }
.app:not(.has-doc):not(.side-open) .sidebar { display: none; }
.app:not(.has-doc) .mobilebar { display: none !important; }
.app:not(.has-doc) .layers-dock { display: none; }
.topbar { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 10px 0 14px; background: var(--bg1); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; margin-right: 6px; flex: none; }
.brand b { font: 800 17px/1 Manrope, Inter, sans-serif; letter-spacing: -0.01em; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 3px rgba(232, 50, 43, 0.18); flex: none; }
.menubar { display: flex; gap: 1px; }
.mbtn { height: 30px; padding: 0 10px; border-radius: 6px; color: var(--ink2); font-weight: 500; }
.mbtn:hover, .mbtn.open { background: var(--bg3); color: var(--ink); }
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.optionsbar { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 12px; background: var(--bg1); border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none; }
.optionsbar::-webkit-scrollbar { display: none; }
.optionsbar > * { flex: none; }
.opt-title { display: flex; align-items: center; gap: 7px; font-weight: 600; padding-right: 12px; border-right: 1px solid var(--line); height: 26px; }
.opt { display: flex; align-items: center; gap: 7px; flex: none; }
.opt.range input[type=range] { width: 110px; }
.olab { color: var(--ink2); font-size: 12.5px; }
.unit { color: var(--ink3); font-size: 12px; margin-left: -3px; }
.osep { width: 1px; height: 24px; background: var(--line); flex: none; }
.opt.hint { color: var(--ink3); font-size: 12.5px; }
.opt.check, label.check { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; color: var(--ink2); }
input[type=checkbox] { accent-color: var(--acc); width: 16px; height: 16px; margin: 0; }

.main { display: grid; grid-template-columns: 58px minmax(0, 1fr) 320px; min-height: 0; }

/* ---------- Toolbar ---------- */
.toolbar { background: var(--bg1); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 8px 0 12px; gap: 10px; overflow-y: auto; scrollbar-width: none; }
.tools { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.tbtn { width: 40px; height: 35px; border-radius: 8px; color: var(--ink2); display: grid; place-items: center; transition: background .12s, color .12s; }
.tbtn:hover { background: var(--bg3); color: var(--ink); }
.tbtn.on { background: var(--acc); color: #fff; box-shadow: 0 2px 10px rgba(232, 50, 43, 0.35); }
.tsep { width: 24px; height: 1px; background: var(--line); margin: 4px 0; flex: none; }
.swatches { position: relative; width: 46px; height: 50px; flex: none; margin-top: 4px; }
.sw { position: absolute; width: 28px; height: 28px; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.4); }
.sw.fg { left: 2px; top: 2px; z-index: 2; } .sw.bg { left: 16px; top: 18px; }
.mini { position: absolute; width: 16px; height: 16px; color: var(--ink2); display: grid; place-items: center; }
.mini:not(.reset) { right: -2px; top: 0; }
.mini.reset { left: 0; bottom: -2px; }
.mini.reset::before, .mini.reset::after { content: ""; position: absolute; width: 8px; height: 8px; border: 1px solid #888; }
.mini.reset::before { left: 1px; top: 1px; background: #000; z-index: 1; } .mini.reset::after { left: 5px; top: 5px; background: #fff; }

/* ---------- Stage ---------- */
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(120% 120% at 50% 0%, var(--stageTop) 0%, var(--stage) 60%); }
#view { display: block; touch-action: none; outline: none; user-select: none; -webkit-user-select: none; }
.zoomctl { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; background: var(--glass); border: 1px solid var(--line); border-radius: 9px; padding: 2px; backdrop-filter: blur(6px); }
.app:not(.has-doc) .zoomctl { display: none; }
.zv { min-width: 54px; height: 30px; font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; border-radius: 6px; }
.zv:hover { background: var(--bg3); }

/* ---------- Buttons ---------- */
.ib { width: 34px; height: 34px; border-radius: 7px; display: inline-grid; place-items: center; color: var(--ink2); flex: none; }
.ib:hover:not(:disabled) { background: var(--bg3); color: var(--ink); }
.ib.sm { width: 30px; height: 30px; }
.ib.tog.on, .ib.on { background: var(--accSoft); color: var(--acc2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 8px; background: var(--bg3); color: var(--ink); font-weight: 600; border: 1px solid var(--line2); white-space: nowrap; flex: none; }
.btn:hover:not(:disabled) { background: var(--bg4); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--acc2); }
.btn.danger { color: var(--err); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn.on { background: var(--accSoft); border-color: var(--acc); color: var(--acc2); }
.btn.block { width: 100%; height: 42px; font-size: 14.5px; }
.chip { height: 28px; padding: 0 11px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line2); color: var(--ink2); font-size: 12.5px; font-weight: 500; }
.chip:hover { color: var(--ink); border-color: var(--bg4); }
.chip.on { background: var(--accSoft); border-color: var(--acc); color: var(--hi); }
.chip.lang { font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.linkbtn { display: inline-flex; gap: 6px; align-items: center; color: var(--ink2); font-size: 12.5px; }
.linkbtn:hover { color: var(--ink); }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { min-width: 30px; height: 26px; padding: 0 8px; border-radius: 6px; color: var(--ink2); font-size: 12.5px; display: inline-grid; place-items: center; }
.seg button:hover { color: var(--ink); background: var(--bg3); }
.seg button.on { background: var(--bg4); color: var(--hi); box-shadow: inset 0 -2px 0 var(--acc); }

/* ---------- Inputs ---------- */
input[type=number], input[type=text], input[type=password], select, textarea {
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 7px; height: 32px; padding: 0 9px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--acc); }
textarea { height: auto; padding: 8px 10px; resize: vertical; width: 100%; line-height: 1.4; }
select { padding-right: 6px; cursor: pointer; }
input[type=color] { width: 40px; height: 32px; padding: 2px; border-radius: 7px; background: var(--bg2); border: 1px solid var(--line2); cursor: pointer; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.num { width: 58px; text-align: right; font-variant-numeric: tabular-nums; padding: 0 6px; height: 28px; }
.num.wide { width: 70px; }
.field { display: flex; flex-direction: column; gap: 5px; flex: 1; margin-bottom: 10px; }
.field > span { color: var(--ink2); font-size: 12.5px; }
.field small { color: var(--ink3); font-size: 11.5px; }
.field input:not([type=color]), .field select { width: 100%; }
.lbl { color: var(--ink2); font-size: 12.5px; margin: 10px 0 6px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: var(--track, linear-gradient(90deg, var(--bg4) var(--a, 0%), var(--acc) var(--a, 0%), var(--acc) var(--b, 0%), var(--bg4) var(--b, 0%)));
}
input[type=range]::-moz-range-track {
  height: 4px; border-radius: 2px;
  background: var(--track, linear-gradient(90deg, var(--bg4) var(--a, 0%), var(--acc) var(--a, 0%), var(--acc) var(--b, 0%), var(--bg4) var(--b, 0%)));
}
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: #fff; margin-top: -5.5px; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
input[type=range]::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.optionsbar input[type=range] { --a: 0%; --b: 0%; }

.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 3px 0 1px; }
.srow label { color: var(--ink2); font-size: 12.5px; cursor: default; user-select: none; }
.srow .num { height: 24px; width: 52px; font-size: 12px; background: transparent; border-color: transparent; }
.srow .num:hover, .srow .num:focus { background: var(--bg2); border-color: var(--line2); }
.srow input[type=range] { grid-column: 1 / -1; }

/* ---------- Sidebar & panels ---------- */
.sidebar { display: flex; flex-direction: column; background: var(--bg1); border-left: 1px solid var(--line); min-height: 0; }
.tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); flex: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 8px; color: var(--ink2); font-size: 11.5px; font-weight: 500; border-radius: 7px 7px 0 0; position: relative; }
.tab:hover { color: var(--ink); background: var(--bg2); }
.tab.on { color: var(--hi); }
.tab.on::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--acc); }
.panel-body { flex: 1; overflow-y: auto; padding: 12px 14px 18px; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--bg4) transparent; }
.layers-dock { height: 40%; min-height: 210px; border-top: 1px solid var(--line); display: flex; flex-direction: column; flex: none; }
.panel h3 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 0 0 10px; font-weight: 600; }
.row { display: flex; align-items: center; } .row.gap { gap: 8px; } .row.between { justify-content: space-between; gap: 8px; } .row.wrap { flex-wrap: wrap; }
.sec { border-top: 1px solid var(--line); padding: 4px 0 6px; }
.sec > summary { list-style: none; cursor: pointer; padding: 9px 0 6px; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; user-select: none; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid var(--ink3); border-bottom: 1.6px solid var(--ink3); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.sec[open] > summary::before { transform: rotate(45deg); }
.histo-wrap { background: var(--bg0); border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin-bottom: 10px; }
#histo { width: 100%; height: 72px; display: block; }
.panel[data-panel=adjust] > .row { margin-bottom: 8px; }
.adj-head { position: sticky; top: -12px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -12px -14px 10px; padding: 10px 14px; background: var(--bg1); border-bottom: 1px solid var(--line); }
.adj-hint { margin: -2px 0 6px; }
.adj-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.adj-actions .btn { opacity: .45; pointer-events: none; transition: opacity .15s; }
.adj-actions.active .btn { opacity: 1; pointer-events: auto; }
.adj-head .adj-actions { margin: 0; }
.adj-head { flex-wrap: wrap; row-gap: 6px; }
.adj-head .btn, .adj-actions .btn { flex-shrink: 0; }
.adj-actions { flex-wrap: wrap; margin-left: auto; }

.looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 12px; }
.look { display: flex; flex-direction: column; gap: 5px; align-items: stretch; text-align: center; font-size: 11.5px; color: var(--ink2); }
.look canvas { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: var(--bg2); border: 2px solid transparent; }
.look:hover canvas { border-color: var(--bg4); }
.look.on canvas { border-color: var(--acc); }
.look.on { color: var(--hi); }

.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 9px; }
.card.sec { padding: 4px 12px 10px; gap: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-status { min-height: 1em; }
.ai-result { display: flex; flex-direction: column; gap: 8px; }
.ai-result:empty { display: none; }
.ai-img img, .ai-img canvas { width: 100%; height: auto; display: block; border-radius: 8px; }
.ai-skeleton { aspect-ratio: 1; border-radius: 8px; background: linear-gradient(100deg, var(--bg3) 30%, var(--bg4) 50%, var(--bg3) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; display: grid; place-items: center; }
@keyframes shimmer { to { background-position: -150% 0; } }
.ai-tool { display: flex; gap: 12px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 8px; background: var(--bg1); border: 1px solid var(--line); }
.ai-tool:hover { border-color: var(--acc); }
.ai-tool > span:last-child { display: flex; flex-direction: column; }
.ai-tool small { color: var(--ink2); font-size: 12px; }
.ai-tool .icw { color: var(--acc2); }
.card input[type=text] { flex: 1; }

.textform textarea { font-size: 15px; }
.textform .field { margin-bottom: 8px; }
.textform > .row { margin-bottom: 8px; }

.hist { list-style: none; margin: 0; padding: 0; counter-reset: h; }
.hist li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.hist li:hover { background: var(--bg2); }
.hist li.on { background: var(--accSoft); color: var(--hi); box-shadow: inset 2px 0 0 var(--acc); }
.hist li.future { color: var(--ink3); }
.hist time { color: var(--ink3); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* layers */
.layers-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.layers-head { padding: 10px 12px 4px; flex: none; }
.layers-head h3 { margin: 0; }
.layers-head select { height: 28px; max-width: 150px; font-size: 12.5px; }
.layers { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 4px 8px; min-height: 0; }
.layer { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 7px; cursor: pointer; min-height: 52px; border: 1px solid transparent; user-select: none; }
.layer:hover { background: var(--bg2); }
.layer.on { background: var(--accSoft); border-color: rgba(232, 50, 43, 0.55); }
.layer.hidden .tw, .layer.hidden .lname { opacity: 0.45; }
.layer.dragging { opacity: 0.5; }
.layer.dropmark { box-shadow: inset 0 2px 0 var(--acc); }
.tw { position: relative; flex: none; }
.lthumb { width: 44px; height: 44px; border-radius: 5px; display: block; border: 1px solid var(--line2);
  background: repeating-conic-gradient(#d4d4d8 0% 25%, #fff 0% 50%) 0 0 / 10px 10px; }
.badge { position: absolute; right: -4px; bottom: -4px; background: #ffb03a; color: #000; font-weight: 800; font-size: 10px; width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; }
.lname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rename { flex: 1; height: 28px; }
.lockbtn { opacity: 0; } .layer:hover .lockbtn, .lockbtn.on { opacity: 1; }
.layers-foot { display: flex; justify-content: space-between; padding: 6px 10px calc(6px + var(--safeB)); border-top: 1px solid var(--line); flex: none; }

/* ---------- Status bar ---------- */
.statusbar { height: 26px; display: flex; gap: 18px; align-items: center; padding: 0 12px; background: var(--bg1); border-top: 1px solid var(--line); color: var(--ink3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.grow { flex: 1; }

/* ---------- Menus ---------- */
.dropdown { position: fixed; z-index: 60; min-width: 250px; max-height: calc(100dvh - 70px); overflow-y: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 5px; box-shadow: 0 14px 40px rgba(0,0,0,.55); }
.mitem { display: flex; align-items: center; gap: 6px; width: 100%; height: 32px; padding: 0 10px 0 4px; border-radius: 6px; text-align: left; }
.mitem:hover:not(:disabled) { background: var(--acc); color: #fff; }
.mitem:hover:not(:disabled) kbd { color: rgba(255,255,255,.85); }
.mchk { width: 16px; text-align: center; color: var(--acc2); }
.mlabel { flex: 1; }
kbd { font: 500 11.5px/1 Inter, sans-serif; color: var(--ink3); }
.mitem kbd { margin-left: 18px; }
.msep { height: 1px; background: var(--line2); margin: 5px 6px; }
.mmenu details { border-bottom: 1px solid var(--line); }
.mmenu summary { padding: 12px 4px; font-weight: 600; cursor: pointer; }
.mmenu .mitem { height: 40px; }

/* ---------- Dialogs ---------- */
.dlg-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(5, 5, 7, 0.6); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.dlg { width: min(440px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--bg1); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.dlg.wide { width: min(680px, 100%); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 18px; }
.dlg-head h2 { font: 700 16px/1.2 Manrope, Inter, sans-serif; margin: 0; }
.dlg-body { padding: 6px 18px 12px; overflow-y: auto; }
.dlg-body p { margin: 0 0 10px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
.preset { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line2); text-align: left; }
.preset:hover { border-color: var(--bg4); }
.preset.on { border-color: var(--acc); background: var(--accSoft); }
.preset .pv { height: 26px; max-width: 46px; border: 1.5px solid var(--ink2); border-radius: 3px; margin-bottom: 4px; }
.preset small { color: var(--ink3); font-variant-numeric: tabular-nums; }
.anchor { display: grid; grid-template-columns: repeat(3, 30px); gap: 4px; }
.anchor button { width: 30px; height: 30px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line2); }
.anchor button.on { background: var(--acc); border-color: var(--acc); }
.exp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.exp-prev { background: repeating-conic-gradient(var(--chk1) 0% 25%, var(--chk2) 0% 50%) 0 0 / 16px 16px; border-radius: 10px; padding: 10px; display: grid; place-items: center; min-height: 160px; }
.exp-prev canvas { max-width: 100%; height: auto; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.est { font-weight: 600; margin: 8px 0; font-variant-numeric: tabular-nums; }
table.keys { width: 100%; border-collapse: collapse; }
table.keys td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.keys td:first-child { width: 45%; }
table.keys kbd { background: var(--bg2); border: 1px solid var(--line2); border-radius: 5px; padding: 3px 6px; color: var(--ink); }

/* Photoshop-style size dialogs */
.f2 { display: grid; grid-template-columns: 118px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin: 0 0 9px; }
.f2 > label:first-child { color: var(--ink2); font-size: 12.5px; }
.f2.top { align-items: start; }
.f2 input[type=number], .f2 input[type=text], .f2 select:not(.unitsel) { width: 100%; }
.f2 .unitsel { max-width: 150px; }
.f2 label.check { grid-column: 1 / 3; }
.unit-label { color: var(--ink2); font-size: 12.5px; }
.cats { margin-bottom: 12px; flex-wrap: wrap; }
.nd { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.nd .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.nd-form .field { margin-bottom: 10px; }
.nd-info { font-variant-numeric: tabular-nums; margin-top: 4px; }
.nd-form .f2 { grid-template-columns: 86px minmax(72px, 1fr) minmax(0, auto); }
.nd-form .f2 .unitsel { max-width: 132px; }
.f2 input[type=number] { min-width: 64px; }
.isz { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.isz-prev { background: repeating-conic-gradient(var(--chk1) 0% 25%, var(--chk2) 0% 50%) 0 0 / 16px 16px; border-radius: 10px; padding: 10px; display: grid; place-items: center; min-height: 160px; }
.isz-prev canvas { max-width: 100%; height: auto; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.isz-size { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.isz-form > .muted.small { margin: 2px 0 12px; font-variant-numeric: tabular-nums; }
.isz-wh { position: relative; padding-right: 30px; }
.isz-link { position: absolute; right: 0; top: 6px; bottom: 15px; width: 24px; display: grid; place-items: center; color: var(--ink3); border: 1.5px solid var(--line2); border-left: 0; border-radius: 0 6px 6px 0; }
.isz-link.on { color: var(--acc2); border-color: var(--acc); }
.isz-link:disabled { opacity: .6; }
.isz-link .ic { background: var(--bg1); }
.isz-tip { margin: 8px 0 0; }
.csz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px 22px; }
.csz > section h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.csz > section h4 b { color: var(--ink); font-variant-numeric: tabular-nums; }
.csz > .f2 { grid-column: 1 / -1; grid-template-columns: 170px minmax(0, 1fr) auto auto; padding-top: 10px; border-top: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-variant-numeric: tabular-nums; }
.kv span:nth-child(odd) { color: var(--ink2); }
.anchor { display: grid; grid-template-columns: repeat(3, 32px); gap: 3px; }
.anchor button { width: 32px; height: 32px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line2); color: var(--ink2); font-size: 15px; line-height: 1; }
.anchor button.on { background: var(--acc); border-color: var(--acc); box-shadow: inset 0 0 0 9px var(--acc), inset 0 0 0 16px #fff; }
.ext-sw { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line2); }

/* ---------- Toasts & busy ---------- */
#toasts { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(460px, 92vw); }
.toast { background: var(--toast); border: 1px solid var(--line2); border-left: 3px solid var(--ink2); color: var(--ink); padding: 10px 14px; border-radius: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.45); opacity: 0; transform: translateY(8px); transition: all .2s; pointer-events: auto; font-size: 13px; }
.toast.show { opacity: 1; transform: none; }
.toast.ok { border-left-color: var(--ok); } .toast.warn { border-left-color: var(--warn); } .toast.error { border-left-color: var(--err); }
#busy { position: fixed; inset: 0; z-index: 85; display: none; place-items: center; background: rgba(5,5,7,.35); }
#busy.on { display: grid; }
.busy-card { display: flex; align-items: center; gap: 12px; background: var(--bg2); border: 1px solid var(--line2); padding: 14px 18px; border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.5); max-width: 90vw; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--bg4); border-top-color: var(--acc); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.app.dragging .stage::after { content: ""; position: absolute; inset: 10px; border: 2px dashed var(--acc); border-radius: 14px; background: rgba(232,50,43,.06); z-index: 20; pointer-events: none; }

/* ---------- Phone & small tablet ---------- */
@media (max-width: 860px), (pointer: coarse) and (max-width: 1100px) and (orientation: portrait) {
  .mobile-only { display: flex !important; }
  .menubar, .statusbar, .tabs { display: none !important; }
  .app { grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .topbar { height: 50px; padding: 0 6px 0 12px; gap: 4px; }
  .top-actions { gap: 2px; }
  #btnExport { padding: 0 12px; }
  #btnExport span { display: none; }
  .main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; }
  .stage { grid-row: 1; }
  .toolbar { grid-row: 3; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 6px 8px; overflow-x: auto; overflow-y: hidden; height: 58px; gap: 8px; }
  .tools { flex-direction: row; }
  .tsep { width: 1px; height: 24px; margin: 0 4px; }
  .tbtn { width: 42px; height: 42px; flex: none; }
  .swatches { order: -1; width: 46px; height: 44px; margin: 0 4px 0 0; }
  .sw { width: 24px; height: 24px; } .sw.bg { left: 14px; top: 15px; }
  .app:not(.has-doc) .main { grid-template-columns: minmax(0, 1fr) !important; }
  .sidebar { grid-row: 2; display: none; height: min(46dvh, 430px); border: 1px solid var(--line2); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.45); }
  .sidebar.open { display: flex !important; }
  .sheet-head { align-items: center; justify-content: space-between; padding: 8px 10px 4px 16px; position: relative; flex: none; }
  .sheet-head .grab { position: absolute; left: 50%; top: 5px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--bg4); }
  .layers-head h3 { display: none; }
  .layers-dock { display: none; }
  .mobilebar { grid-row: 4; gap: 4px; padding: 5px 6px calc(5px + var(--safeB)); background: var(--bg1); border-top: 1px solid var(--line); overflow-x: auto; }
  .mobilebar .tab { flex: 1 0 auto; min-width: 58px; border-radius: 8px; padding: 6px 4px; }
  .mobilebar .tab.on { background: var(--bg3); }
  .mobilebar .tab.on::after { bottom: 2px; }
  .optionsbar { min-height: 46px; gap: 12px; }
  .opt.range input[type=range] { width: 96px; }
  input[type=number], input[type=text], input[type=password], select, textarea { font-size: 16px; }
  .num { font-size: 14px; }
  .zoomctl { left: 8px; bottom: 8px; }
  #toasts { bottom: 130px; }
  .exp, .nd, .isz, .csz { grid-template-columns: minmax(0, 1fr); }
  .isz-prev { min-height: 0; } .isz-prev canvas { max-height: 160px; width: auto; }
  .f2, .csz > .f2 { grid-template-columns: 92px minmax(0, 1fr) auto auto; }
  .f2 .unitsel { max-width: 118px; }
  .dlg { max-height: calc(100dvh - 24px); }
  .dlg-overlay { padding: 10px; align-items: end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Netlify's free-plan badge (fixed, bottom-right, ~62px tall): keep controls out from under it */
body:has(> #nl-badge-frame) .layers-foot { padding-bottom: calc(42px + var(--safeB)); }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1100px) and (orientation: portrait) {
  body:has(> #nl-badge-frame) .layers-foot { padding-bottom: calc(6px + var(--safeB)); }
  body:has(> #nl-badge-frame) .mobilebar { padding-bottom: calc(64px + var(--safeB)); }
}

/* ---------- Light theme touches (palette itself comes from js/display.js) ---------- */
[data-theme=light] .dlg-overlay { background: rgba(30, 32, 40, 0.32); }
[data-theme=light] input[type=range]::-webkit-slider-thumb { box-shadow: 0 0 0 1px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.3); }
[data-theme=light] input[type=range]::-moz-range-thumb { box-shadow: 0 0 0 1px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.3); }
[data-theme=light] .toast { box-shadow: 0 10px 30px rgba(0,0,0,.16); }
[data-theme=light] .zoomctl { box-shadow: 0 2px 10px rgba(0,0,0,.08); }

/* ---------- Display & eye comfort dialog ---------- */
.dlg-overlay.see-through { background: transparent; backdrop-filter: none; place-items: start end; padding: 58px 14px 14px; }
.dlg.disp { width: 430px; max-width: 100%; box-shadow: 0 18px 50px rgba(0,0,0,.4), 0 0 0 1px var(--line2); }
.disp-body { display: flex; flex-direction: column; gap: 14px; }
.disp-sec { display: flex; flex-direction: column; gap: 8px; }
.disp-sec h4 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.disp-profiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.disp-prof { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 6px 6px 8px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); text-align: left; }
.disp-prof:hover { border-color: var(--ink3); }
.disp-prof.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.disp-sw { position: relative; display: flex; flex-direction: column; gap: 4px; height: 40px; border-radius: 6px; border: 1px solid; padding: 8px 7px; }
.disp-sw i { display: block; height: 4px; border-radius: 2px; width: 80%; }
.disp-sw b { position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; }
.disp-pname { font-weight: 600; font-size: 12.5px; color: var(--ink); line-height: 1.2; }
.disp-prof small { color: var(--ink3); font-size: 10.5px; line-height: 1.3; }
.disp-theme { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.disp-theme button { padding: 0 4px; height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disp-hint { color: var(--ink3); font-size: 11.5px; min-height: 0; }
.disp-hint:empty { display: none; }
.disp-clear { margin-top: 2px; }
.disp-lang { display: grid; grid-template-columns: 1fr 1fr; }
.disp-lang button { height: 30px; }
.disp-links { display: flex; flex-wrap: wrap; gap: 8px; }
.disp-saved { margin: 0; color: var(--ink3); font-size: 11.5px; }
.disp-note { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--accSoft); color: var(--ink); font-size: 12px; line-height: 1.5; }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1100px) and (orientation: portrait) {
  .dlg-overlay.see-through { place-items: end center; padding: 10px 8px calc(8px + var(--safeB)); }
  .dlg.disp { width: 100%; max-height: 78vh; }
  .disp-profiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dlg-overlay.see-through .dlg { max-height: calc(100dvh - 72px); }
/* keep dialog buttons clear of the host badge too */
body:has(> #nl-badge-frame) .dlg-overlay { padding-bottom: 70px; }
body:has(> #nl-badge-frame) .dlg { max-height: calc(100dvh - 100px); }
body:has(> #nl-badge-frame) .dlg-overlay.see-through .dlg { max-height: calc(100dvh - 128px); }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1100px) and (orientation: portrait) {
  body:has(> #nl-badge-frame) .dlg-overlay.see-through { padding-bottom: calc(66px + var(--safeB)); }
}

/* ---------- layer masks ---------- */
.layer .mw { padding: 0; border: 0; background: none; border-radius: 4px; position: relative; flex: none; cursor: pointer; line-height: 0; }
.layer .mthumb { background: #000; }
.layer .tw.target .lthumb, .layer .mw.target .mthumb { outline: 2px solid var(--acc); outline-offset: 1px; }
.layer .mw.off::after { content: ""; position: absolute; inset: 0; background: linear-gradient(45deg, transparent 46%, #ff4d4d 46%, #ff4d4d 54%, transparent 54%); border-radius: 4px; }
.maskpill { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px 0 10px; height: 32px; border-radius: 99px; background: var(--accSoft); color: var(--ink); font-size: 12.5px; font-weight: 600; margin-right: 8px; flex: none; }
.maskpill .btn.sm { height: 24px; padding: 0 10px; font-size: 12px; }
.popmenu { position: fixed; z-index: 1000; min-width: 190px; padding: 6px; border-radius: 12px; background: var(--bg1); border: 1px solid var(--line2); box-shadow: 0 14px 34px rgba(0,0,0,.3); display: flex; flex-direction: column; animation: fade .12s; }
.popmenu .pmitem { text-align: left; padding: 0 12px; min-height: 40px; border-radius: 8px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.popmenu .pmitem:hover, .popmenu .pmitem:focus-visible { background: var(--bg3); outline: none; }
.popmenu .pmitem.danger { color: #e5484d; }

/* ---------- Settings (page and editor dialog) ---------- */
.set-body { display: flex; flex-direction: column; }
.set-sec { padding: 24px 0; border-top: 1px solid var(--line); }
.set-sec:first-child { border-top: 0; padding-top: 4px; }
.set-sec h2 { font-size: 16px; margin: 0 0 12px; font-family: Manrope, Inter, sans-serif; }
.set-rows { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; flex-wrap: wrap; }
.set-label { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.set-label small, .set-sub { color: var(--ink3); font-size: 12.5px; line-height: 1.4; }
.set-ctrl { display: flex; align-items: center; justify-content: flex-end; flex: 0 1 auto; max-width: 100%; }
.set-ctrl .seg { flex-wrap: wrap; }
.set-ctrl select { min-width: 140px; height: 40px; }
.set-hint { color: var(--ink3); font-size: 12.5px; margin: 8px 0 0; }
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.set-actions .btn { min-height: 40px; }
.set-actions .btn.danger { color: #e5484d; }
.set-privacy p { margin: 4px 0 8px; color: var(--ink2); font-size: 13.5px; line-height: 1.55; }
.set-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.set-sw { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); box-shadow: inset 0 0 0 2px var(--bg1); cursor: pointer; padding: 0; }
.set-sw.auto { background: linear-gradient(135deg, #f4f4f5 50%, #16171b 50%); }
.set-sw.on { box-shadow: inset 0 0 0 2px var(--bg1), 0 0 0 2px var(--acc); }
.set-more { border-radius: 10px; background: var(--bg2); padding: 0 14px; margin-top: 4px; }
.set-more summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600; list-style: none; }
.set-more summary::-webkit-details-marker { display: none; }
.set-more summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink3); border-bottom: 2px solid var(--ink3); transform: rotate(45deg); transition: transform .15s; }
.set-more[open] summary::after { transform: rotate(-135deg); }
.set-morebody { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.set-more .set-hint { padding-bottom: 14px; margin: 0; }
.dlg.set-dlg { width: min(640px, 100%); }
.set-dlg .set-ctrl { flex: 1 1 auto; justify-content: flex-start; }
@media (min-width: 560px) { .set-dlg .set-ctrl { flex: 0 1 auto; justify-content: flex-end; } }
.switch { position: relative; width: 46px; height: 28px; border-radius: 99px; border: 0; background: var(--bg4); cursor: pointer; flex: none; transition: background .15s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch.on { background: var(--acc); }
.switch.on::after { transform: translateX(18px); }
@media (pointer: coarse) { .switch { width: 52px; height: 32px; } .switch::after { width: 26px; height: 26px; } .switch.on::after { transform: translateX(20px); } }

/* ---------- in-tool help ---------- */
.helpbtn { color: var(--ink3); }
.helpbtn:hover { color: var(--ink); }
.optionsbar > .helpbtn { margin-left: auto; flex: none; }
#tabs > .helpbtn { margin-left: auto; align-self: center; }
.layers-head > .helpbtn { order: 9; }
.helpbox { position: fixed; right: 16px; top: 104px; z-index: 900; width: 380px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 140px); display: flex; flex-direction: column; border-radius: 14px; background: var(--bg1); border: 1px solid var(--line2); box-shadow: 0 18px 50px rgba(0,0,0,.35); animation: fade .15s; }
.helphead { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 18px; }
.helphead h2 { flex: 1; font-size: 16px; margin: 0; font-family: Manrope, Inter, sans-serif; }
.helphead .grab { display: none; }
.helpbody { overflow-y: auto; padding: 0 18px 18px; font-size: 13.5px; line-height: 1.55; }
.help-sum { margin: 0 0 12px; color: var(--ink); }
.help-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.help-acts .btn { min-height: 36px; }
.helpbody .l-sec { margin-bottom: 14px; }
.helpbody .l-sec h3 { font-size: 13px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); }
.helpbody .l-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.helpbody .l-dl { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 4px 12px; margin: 0; }
.helpbody .l-dl dt { font-weight: 600; }
.helpbody .l-dl dd { margin: 0; color: var(--ink2); }
.l-watchdlg { width: 900px; }
.l-watch video { width: 100%; display: block; border-radius: 10px; background: #000; aspect-ratio: 16 / 10; }
.btn.compare.on { background: var(--accSoft); color: var(--ink); }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1100px) and (orientation: portrait) {
  .helpbox { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; max-height: 70dvh; border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheetUp .2s; }
  .helphead .grab { display: block; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line2); }
  .helphead { position: relative; padding-top: 16px; }
  .helpbody .l-dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .helpbody .l-dl dd { margin-bottom: 6px; }
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- guided tour ---------- */
.tour { position: fixed; inset: 0; z-index: 950; pointer-events: none; }
.tour.centered { background: rgba(8, 9, 12, .55); pointer-events: auto; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(8, 9, 12, .55), 0 0 0 2px var(--acc); transition: all .25s ease; pointer-events: none; }
.tour-card { position: fixed; pointer-events: auto; width: 340px; max-width: calc(100vw - 24px); padding: 16px 18px 14px; border-radius: 14px; background: var(--bg1); color: var(--ink); border: 1px solid var(--line2); box-shadow: 0 18px 50px rgba(0,0,0,.4); transition: left .25s, top .25s; }
.tour.centered .tour-card { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.tour-top { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px 4px 0; }
.tour-count { color: var(--ink3); font-size: 12px; font-weight: 600; }
.tour-card h2 { font-size: 17px; margin: 0 0 6px; font-family: Manrope, Inter, sans-serif; }
.tour-card p { margin: 0 0 14px; color: var(--ink2); font-size: 14px; line-height: 1.5; }
.tour-btns { display: flex; align-items: center; gap: 8px; }
.tour-btns .grow { flex: 1; }
.tour-btns .btn { min-height: 40px; }
.tour-offer { position: fixed; left: 16px; bottom: 16px; z-index: 800; display: flex; gap: 14px; align-items: center; max-width: min(460px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 14px; background: var(--bg1); border: 1px solid var(--line2); box-shadow: 0 14px 40px rgba(0,0,0,.3); animation: fade .2s; }
.tour-offer > div:first-child { display: flex; flex-direction: column; font-size: 13.5px; color: var(--ink2); }
.tour-offer b { color: var(--ink); font-size: 14.5px; }
.tour-offerbtns { display: flex; gap: 8px; flex: none; }
.tour-offerbtns .btn { min-height: 40px; }
@media (max-width: 700px) {
  .tour-offer { left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); max-width: none; flex-wrap: wrap; }
  .tour-offerbtns { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } }


/* tutorial screenshots (Canvas Learn page and the (?) help) */
.l-shot { margin: 0 0 16px; border-radius: 12px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); }
.l-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.l-shot.help-shot { margin: 0 0 12px; border-radius: 10px; }

/* document tab with a close (×) button, as in desktop editors */
.doctabs { display: flex; flex: none; align-items: flex-end; gap: 2px; height: 36px; padding: 0 8px; background: var(--bg1); border-bottom: 1px solid var(--line); }
.doctabs:empty { display: none; }
.doctab { display: flex; align-items: center; gap: 6px; max-width: min(520px, 100%); height: 32px; padding: 0 4px 0 12px; border-radius: 8px 8px 0 0; background: var(--bg0); border: 1px solid var(--line); border-bottom: 0; font-size: 12.5px; color: var(--ink); min-width: 0; }
.doctab .dt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.doctab .dt-meta { color: var(--ink3); white-space: nowrap; }
.doctab .dt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); flex: none; }
.doctab .dt-close { width: 28px; height: 28px; flex: none; }
.viewwrap { position: relative; flex: 1 1 auto; min-height: 0; }
@media (pointer: coarse) { .doctabs { height: 44px; } .doctab { height: 40px; } .doctab .dt-close { width: 40px; height: 40px; } }
@media (max-width: 700px) { .doctab .dt-meta { display: none; } }

/* several open images */
.doctabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.doctabs::-webkit-scrollbar { display: none; }
.doctab { flex: none; max-width: 260px; cursor: pointer; background: transparent; color: var(--ink2); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.doctab.on { background: var(--bg0); color: var(--ink); }
.doctab:not(.on):hover { background: var(--bg2); }
.doctab:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.doctab.dragging { opacity: .5; }
.doctab.droptarget { box-shadow: inset 0 0 0 2px var(--acc); color: var(--ink); }
.viewwrap.droptarget::after { content: ""; position: absolute; inset: 8px; border: 2px dashed var(--acc); border-radius: 12px; pointer-events: none; }
.doctab-ghost { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; max-width: 260px; padding: 8px 12px; border-radius: 10px; background: var(--bg1); color: var(--ink); border: 1px solid var(--acc); box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 12.5px; }

/* shape picker */
.shapepick { gap: 6px; }
.shapepick canvas { display: block; }
.shapepick .caret { color: var(--ink3); font-size: 10px; }
.shapepop { position: fixed; z-index: 200; width: min(360px, calc(100vw - 16px)); max-height: min(70vh, 520px); overflow-y: auto; padding: 8px 12px 12px; background: var(--bg1); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.shapepop h4 { margin: 10px 2px 6px; font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); }
.shapegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.shapecell { display: grid; place-items: center; height: 44px; border-radius: 8px; border: 1px solid transparent; background: var(--bg2); cursor: pointer; padding: 0; }
.shapecell:hover { border-color: var(--line2); }
.shapecell.on { border-color: var(--acc); background: var(--accSoft, rgba(232,50,43,.15)); }
.shapecell:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
