/* The editor wears Mariia's two designs: Modern (night, colour fields, glass) and
   Sketch (paper, watercolour, handwriting). Everything below is driven by these tokens.
   CSP forbids style attributes and inline styles; JS only uses CSSOM. */
@font-face { font-family: Onest; src: url(fonts/onest-cyrillic-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; src: url(fonts/onest-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215; }
@font-face { font-family: Headline; src: url(fonts/bebas-neue.woff2) format("woff2"); font-weight: 200 700; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: Headline; src: url(fonts/oswald-cyrillic-wght-normal.woff2) format("woff2"); font-weight: 200 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Caveat; src: url(fonts/caveat-cyrillic-wght-normal.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Caveat; src: url(fonts/caveat-latin-wght-normal.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Red Hat Mono"; src: url(fonts/red-hat-mono.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --rail: 232px;
  --radius: 16px;
  --radius-small: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: Onest, "Segoe UI", system-ui, sans-serif;
  --mono: "Red Hat Mono", ui-monospace, Onest, monospace;
}
:root[data-theme="modern"] {
  color-scheme: dark;
  --bg: #0a0717;
  --ink: #f6f4fc;
  --muted: #b3aec8;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.34);
  --panel: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045) 45%, rgba(255, 255, 255, 0.07)), rgba(24, 18, 44, 0.72);
  --panel-solid: #171228;
  --panel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 18px 44px rgba(0, 0, 0, 0.32);
  --input: rgba(7, 4, 18, 0.6);
  --accent: #ff5fae;
  --accent-ink: #1a0614;
  --accent-soft: rgba(255, 95, 174, 0.18);
  --good: #5fe3b2;
  --warn: #ffc65c;
  --bad: #ff8a8a;
  --rail-bg: rgba(10, 7, 23, 0.72);
  --head: Headline, Oswald, sans-serif;
  --head-case: uppercase;
  --head-weight: 500;
  --head-spacing: 0.015em;
  --head-scale: 1;
  --title-scale: 1;
  --doodle: invert(1);
  --atmosphere:
    radial-gradient(60vmax 44vmax at 88% -8%, rgba(24, 200, 232, 0.5), transparent 68%),
    radial-gradient(52vmax 46vmax at -6% 26%, rgba(224, 58, 168, 0.42), transparent 66%),
    radial-gradient(58vmax 46vmax at 78% 108%, rgba(96, 62, 214, 0.55), transparent 68%),
    radial-gradient(34vmax 30vmax at 20% 104%, rgba(162, 214, 110, 0.2), transparent 68%);
}
:root[data-theme="sketch"] {
  color-scheme: light;
  --bg: #f9f9f6;
  --ink: #17160f;
  --muted: #5b5950;
  --line: rgba(23, 22, 15, 0.2);
  --line-strong: rgba(23, 22, 15, 0.55);
  --panel: #fffefa;
  --panel-solid: #fffefa;
  --panel-shadow: 0 1px 0 rgba(23, 22, 15, 0.1), 1px 3px 14px rgba(70, 40, 20, 0.08);
  --input: #fbfaf4;
  --accent: #17160f;
  --accent-ink: #fffdf6;
  --accent-soft: rgba(245, 191, 212, 0.55);
  --good: #16784f;
  --warn: #8d5a00;
  --bad: #b3261e;
  --rail-bg: rgba(249, 249, 246, 0.82);
  --head: Caveat, "Segoe Script", cursive;
  --head-case: none;
  --head-weight: 700;
  --head-spacing: 0;
  --head-scale: 1.22;
  --title-scale: 0.72;
  --doodle: none;
  --atmosphere:
    radial-gradient(46vmax 36vmax at 92% 4%, rgba(245, 150, 170, 0.42), transparent 70%),
    radial-gradient(40vmax 34vmax at 4% 40%, rgba(250, 170, 120, 0.32), transparent 70%),
    radial-gradient(48vmax 34vmax at 70% 104%, rgba(250, 226, 140, 0.4), transparent 70%);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100svh; }
/* Fixed, painted once: no animation under the working area. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--atmosphere), var(--bg); }
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; opacity: 0.16; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .8 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
h1, h2, h3, p, ol, ul, pre { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.booting { display: grid; place-items: center; min-height: 100svh; margin: 0; font-family: var(--head); font-size: 28px; text-transform: var(--head-case); }

/* Headlines */
.topbar h1, .auth-card h1, .card h2, .section-title, .hero h2, .ask h2 {
  font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); letter-spacing: var(--head-spacing); line-height: 1.05;
}
.card h2, .ask h2 { font-size: calc(23px * var(--head-scale)); }
.card h3, .pair h3 { font-size: 13px; font-weight: 650; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; cursor: pointer; font-weight: 550; text-decoration: none; white-space: nowrap;
  transition: background-color 0.16s, border-color 0.16s, transform 0.16s var(--ease);
}
.btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn--primary:hover { background: var(--accent); filter: brightness(1.12); }
.btn--small { min-height: 34px; padding: 4px 12px; font-size: 13px; }
.btn--quiet { border-color: transparent; }
.btn--wide { width: 100%; }
.btn--danger { background: var(--bad); border-color: var(--bad); color: #190606; font-weight: 650; }
.btn--danger:hover { background: var(--bad); filter: brightness(1.1); }
.btn--danger-quiet { color: var(--bad); border-color: var(--bad); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--accent-soft); }
.icon-btn:disabled { opacity: 0.28; cursor: default; }
.icon-btn--danger:hover:not(:disabled) { color: var(--bad); }
.link { border: 0; background: none; padding: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.seg button { min-height: 34px; padding: 3px 13px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-size: 13px; font-weight: 550; }
.seg button:hover { background: var(--accent-soft); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Fields */
.field { display: grid; gap: 6px; margin: 14px 0; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--input); transition: border-color 0.15s;
}
.field textarea { display: block; resize: none; overflow: hidden; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: 1px solid var(--accent); outline-offset: 0; }
.field-note { color: var(--muted); font-size: 12.5px; }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--bad); }
.field.is-invalid .field-note { color: var(--bad); font-weight: 600; }
.switch { display: flex; align-items: center; gap: 12px; margin: 16px 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: relative; flex: none; width: 46px; height: 26px; border-radius: 26px; border: 1px solid var(--line-strong); background: var(--input); transition: background-color 0.18s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform 0.18s var(--ease); }
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: var(--accent-ink); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text { display: grid; font-weight: 550; }
.switch-text small { color: var(--muted); font-weight: 400; }

/* Upload */
.drop {
  display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 124px; padding: 18px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); transition: background-color 0.16s, border-color 0.16s, transform 0.16s var(--ease);
}
.drop small { color: var(--muted); }
.drop:hover, .drop.is-over, .drop:focus-within { background: var(--accent-soft); border-color: var(--accent); }
.drop.is-over { transform: scale(1.012); }
.progress { display: grid; gap: 7px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.progress-track, .meter { height: 7px; border-radius: 7px; background: var(--line); overflow: hidden; }
.progress-track span, .meter i { display: block; height: 100%; width: 0; border-radius: 7px; background: var(--accent); transition: width 0.25s; }
.slot-media { width: 100%; max-height: 320px; object-fit: contain; border-radius: var(--radius-small); background: rgba(127, 127, 127, 0.12); }
.slot-pdf { display: grid; justify-items: center; gap: 6px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-small); }
.slot-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

/* Sign-in */
.auth { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px); gap: 5vw; align-items: center; min-height: 100svh; padding: 5vw; overflow: hidden; }
.auth-title { font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); line-height: 0.9; font-size: clamp(64px, calc(13.5vw * var(--title-scale)), 230px); animation: rise 0.8s var(--ease) both; }
.auth-title span { display: block; }
.auth-title span + span { padding-left: 0.42em; }
.auth-card { padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--panel-shadow); animation: rise 0.8s 0.12s var(--ease) both; }
.auth-card h1 { margin-top: 18px; font-size: calc(34px * var(--head-scale)); }
.auth-card .muted { margin-top: 6px; }
.auth-logo { width: 54px; height: auto; filter: var(--doodle); }
.auth-error { margin: 10px 0; color: var(--bad); font-weight: 600; }
.auth-card .btn--wide { margin-top: 8px; min-height: 48px; }
.auth > .palette { position: absolute; right: 22px; bottom: 18px; }
.palette { display: block; width: 52px; height: 52px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform 0.3s var(--ease); }
.palette:hover { transform: rotate(-12deg) scale(1.08); }
.palette img { width: 100%; }

/* Shell */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100svh; }
.rail { position: sticky; top: 0; display: flex; flex-direction: column; height: 100svh; padding: 22px 14px 16px; border-right: 1px solid var(--line); background: var(--rail-bg); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; text-decoration: none; font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); font-size: calc(21px * var(--head-scale)); line-height: 1; }
.brand img { width: 38px; height: auto; filter: var(--doodle); }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 8px 12px; margin-bottom: 2px; border-radius: 12px; text-decoration: none; font-weight: 500; color: var(--muted); transition: background-color 0.15s, color 0.15s; }
.nav-item:hover { color: var(--ink); background: var(--accent-soft); }
.nav-item[aria-current="page"] { color: var(--ink); font-weight: 650; background: var(--accent-soft); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail-foot { display: grid; gap: 2px; margin-top: auto; }
.rail-foot .palette { margin: 10px 0 0 6px; }
.rail-link { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 12px; border: 0; border-radius: 10px; background: none; text-decoration: none; color: var(--muted); font-size: 13.5px; cursor: pointer; text-align: left; }
.rail-link:hover { color: var(--ink); background: var(--accent-soft); }
.stage { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 16px 34px; background: var(--rail-bg); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: calc(32px * var(--head-scale)); }
.topbar-actions { display: flex; gap: 8px; margin-left: auto; }
.save-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.save-state--dirty::before, .save-state--saving::before { background: var(--warn); }
.save-state--saving::before { animation: pulse 0.9s infinite; }
.save-state--error, .save-state--invalid, .save-state--conflict { color: var(--bad); font-weight: 600; }
.save-state--error::before, .save-state--invalid::before, .save-state--conflict::before { background: var(--bad); }
.view { max-width: 1240px; padding: 26px 34px 90px; animation: rise 0.42s var(--ease) both; }
.view-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 20px; }
.view-head .muted { flex: 1 1 340px; font-size: 13px; }
.view-note { margin-bottom: 20px; font-size: 13.5px; max-width: 74ch; }
.card { padding: 22px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--panel-shadow); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card > .muted { margin-top: 8px; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.stack .card:last-child { margin-bottom: 0; }
.fold > summary { cursor: pointer; font-weight: 600; }
.fold-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin-top: 8px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 34px 16px; text-align: center; color: var(--muted); }
/* Her drawings are cut-outs with a white ground: on both themes they read as stickers. */
.doodle { width: 110px; height: auto; padding: 6px; background: #fff; border-radius: 6px; rotate: 3deg; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22); }
.job-bar { position: fixed; left: 50%; bottom: 22px; z-index: 20; display: flex; align-items: center; gap: 11px; padding: 11px 20px; transform: translateX(-50%); border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); white-space: nowrap; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.75s linear infinite; }

/* Overview */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.hero h2 { margin: 6px 0 8px; font-size: clamp(38px, calc(4.8vw * var(--head-scale)), 72px); line-height: 0.98; }
.hero-text { max-width: 760px; }
.hero .doodle { width: 150px; flex: none; }
.eyebrow { font-size: 12.5px; color: var(--muted); }
.flow { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 18px; }
.flow li { display: flex; align-items: center; gap: 10px; }
.flow b { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 50%; font-family: var(--mono); font-size: 12px; }
.flow span { display: grid; font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.flow small { color: var(--muted); font-weight: 400; font-size: 12px; }
.callout { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 18px; border: 1px solid var(--warn); border-radius: var(--radius); background: var(--panel); }
.callout .icon { color: var(--warn); }
.callout div { flex: 1; }
.callout h3 { font-size: 15px; }
.callout p { font-size: 13.5px; color: var(--muted); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.count { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.checklist { margin-top: 12px; }
.checklist button { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 40px; padding: 5px 8px; border: 0; border-radius: 9px; background: none; cursor: pointer; text-align: left; }
.checklist button:hover { background: var(--accent-soft); }
.checklist small { color: var(--muted); }
.check { display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.is-done .check { background: var(--good); border-color: var(--good); color: var(--bg); }
.kpis { display: flex; gap: 34px; }
.kpis strong { display: block; font-family: var(--head); font-weight: var(--head-weight); font-size: calc(54px * var(--head-scale)); line-height: 1; }
.kpis span { font-size: 13px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 96px; margin-top: 16px; }
.bar { flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 4px; height: 100%; min-width: 0; text-align: center; }
.bar-fill { align-self: end; display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent); }
.bar small { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.bars--30 { gap: 2px; }
.splits { display: grid; gap: 6px; margin-top: 16px; }
.split { display: grid; grid-template-columns: 82px minmax(0, 1fr) 34px; gap: 10px; align-items: center; font-size: 13px; }
.split b { text-align: right; font-family: var(--mono); font-weight: 500; }
.split-track { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.split-track i { display: block; height: 100%; background: var(--ink); }
.footnote { margin-top: 14px; font-size: 12px; color: var(--muted); }
.job { position: relative; display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; }
.job-dot { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--muted); }
.job--published .job-dot, .job--ready .job-dot { background: var(--good); }
.job--failed .job-dot { background: var(--bad); }
.job--waiting .job-dot, .job--deploying .job-dot, .job--building .job-dot { background: var(--warn); }
.job-body { min-width: 0; flex: 1; }
.job-body > small { color: var(--muted); }
.job-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.job-actions:empty { display: none; }
.job-error { margin-top: 6px; color: var(--bad); font-size: 13px; }
.job-error pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.45 var(--mono); max-height: 180px; overflow: auto; }
.skeleton { min-height: 260px; opacity: 0.5; }

/* Texts: the two designs side by side, each on its own ground */
.pair { margin-bottom: 18px; }
.pair h3 { margin-bottom: 8px; font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); font-size: calc(21px * var(--head-scale)); }
.pair-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--panel-shadow); }
.pair-side { padding: 16px 18px; min-width: 0; }
.pair-side .field { margin: 8px 0 0; }
.pair-side .field > label { display: none; }
.pair-side textarea { border: 0; padding: 4px 0; background: transparent; }
.pair-side textarea:focus { outline: 0; }
.pair-side--sketch { background: #fbfaf3; color: #17160f; --line-strong: rgba(23, 22, 15, 0.4); --muted: #5b5950; --bad: #b3261e; }
.pair-side--sketch textarea { font-family: "Courier New", monospace; color: #17160f; }
.pair-side--modern { background: #120d24; color: #f6f4fc; --line-strong: rgba(255, 255, 255, 0.34); --muted: #b3aec8; --bad: #ff8a8a; }
.pair-side--modern textarea { font-family: "Red Hat Mono", monospace; font-weight: 400; color: #f6f4fc; }
.tag { display: inline-block; font: 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }

/* Photos: Mein Weg frames on either side of her timeline */
.weg { position: relative; margin-bottom: 26px; }
.section-title { font-size: calc(30px * var(--head-scale)); margin-bottom: 18px; }
.weg-line { position: absolute; left: 50%; top: 56px; bottom: 0; width: 2px; background: var(--line-strong); }
.weg-grid { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; gap: 26px 70px; }
.polaroid { padding: 12px 12px 14px; background: #fffefa; color: #17160f; border-radius: 4px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24); transition: rotate 0.25s var(--ease), translate 0.25s var(--ease); --line: rgba(23, 22, 15, 0.2); --line-strong: rgba(23, 22, 15, 0.45); --muted: #5b5950; --accent-soft: rgba(245, 191, 212, 0.55); --accent: #17160f; }
.polaroid--a { rotate: -1.6deg; }
.polaroid--b { rotate: 1.3deg; }
.polaroid--c { rotate: 1.5deg; }
.polaroid--d { rotate: -1.2deg; }
.polaroid:hover, .polaroid:focus-within { rotate: 0deg; translate: 0 -3px; }
.polaroid h3 { margin-top: 10px; font-family: Caveat, cursive; font-weight: 700; font-size: 24px; text-align: center; line-height: 1; }
.polaroid .drop { min-height: 230px; border-radius: 3px; }
.polaroid .slot-media { aspect-ratio: 4 / 5; max-height: none; object-fit: cover; border-radius: 2px; }
.polaroid .btn { color: #17160f; border-color: rgba(23, 22, 15, 0.4); }
.polaroid .btn--quiet { border-color: transparent; }
.about-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }

/* Portfolio */
.add-empty { margin: 10px 0 18px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.work { display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--panel-shadow); transition: transform 0.18s var(--ease), border-color 0.18s; }
.work .drop { min-height: 170px; }
.work .slot-media { aspect-ratio: 4 / 5; object-fit: cover; max-height: 300px; }
.work .field { margin: 10px 0 0; }
.work-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
.work-actions { display: flex; align-items: center; gap: 2px; margin-top: auto; padding-top: 8px; }
.grip { display: inline-grid; place-items: center; width: 34px; height: 36px; cursor: grab; color: var(--muted); }
.grip .icon { stroke-width: 3; }
.work.is-dragging { opacity: 0.45; }
.work.is-target { border-color: var(--accent); transform: translateX(6px); }

/* Documents */
.doc-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; margin-bottom: 18px; }
.doc-column { margin-bottom: 0; }
.doc-column > .field:first-child { margin-top: 0; }
.doc-empty { margin: 10px 0 14px; font-size: 13.5px; }
.docs { margin-bottom: 14px; }
.doc { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.doc-thumb { display: grid; place-items: center; width: 62px; height: 82px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-body .field { margin: 0; }
.doc-body .work-actions { padding-top: 4px; }
.doc-column .drop { min-height: 96px; }

/* Application & settings */
.card h3 { margin: 18px 0 8px; }
.connect { margin-top: 14px; }
.steps { counter-reset: step; display: grid; gap: 9px; }
.steps li { counter-increment: step; display: block; position: relative; padding-left: 32px; font-size: 14px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 50%; font: 12px var(--mono); }
.steps .icon { vertical-align: -2px; }
.state-chip { padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid currentColor; }
.state-chip.is-ok { color: var(--good); }
.state-chip.is-off { color: var(--warn); }
.stack .meter { margin: 12px 0 8px; }
.card .doodle { margin: 10px 0 0 auto; }

/* Toasts & dialogs */
#toasts { position: fixed; inset: 14px 14px auto auto; margin: 0; padding: 0; border: 0; overflow: visible; background: none; display: grid; gap: 8px; width: min(420px, calc(100vw - 28px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 13px; background: var(--ink); color: var(--bg); box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32); pointer-events: auto; animation: rise 0.28s var(--ease) both; }
.toast > span { flex: 1; overflow-wrap: anywhere; white-space: pre-line; font-size: 14px; }
.toast--error { background: var(--bad); color: #190606; }
.toast--success { background: var(--good); color: #04180f; }
.toast-close { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
dialog { color: inherit; }
dialog::backdrop { background: rgba(5, 3, 12, 0.66); }
.ask { width: min(480px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel-solid); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5); }
.ask p { margin-top: 10px; color: var(--muted); }
.ask-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 20px; }
.ask--crop { width: min(560px, calc(100vw - 32px)); }
.crop-frame { width: min(100%, 420px); max-height: 56vh; margin: 16px auto 0; overflow: hidden; border-radius: 10px; cursor: grab; touch-action: none; background: rgba(127, 127, 127, 0.2); }
.crop-frame:active { cursor: grabbing; }
.crop-frame img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.preview { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); }
.preview[open] { display: flex; flex-direction: column; }
.preview header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.preview-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 auto; }
.preview-stage { flex: 1; min-height: 0; display: flex; justify-content: center; background: rgba(127, 127, 127, 0.14); }
.preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-stage[data-device="phone"] { padding: 14px; }
.preview-stage[data-device="phone"] .preview-frame { width: 390px; max-width: 100%; border-radius: 22px; box-shadow: 0 0 0 7px #000, 0 20px 50px rgba(0, 0, 0, 0.4); }

/* Sketch details: tape on cards, tilted headings */
:root[data-theme="sketch"] .card { position: relative; border-radius: 6px; }
:root[data-theme="sketch"] .card::before { content: ""; position: absolute; top: -9px; left: 26px; width: 74px; height: 19px; rotate: -3deg; background: rgba(226, 215, 170, 0.62); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.07); }
:root[data-theme="sketch"] .topbar h1 { rotate: -0.8deg; }
:root[data-theme="sketch"] .btn { border-radius: 8px; }
:root[data-theme="sketch"] .auth-card { border-radius: 6px; rotate: 0.5deg; }
:root[data-theme="sketch"] .job-bar { border-radius: 8px; }

@keyframes rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes pulse { 50% { opacity: 0.3; } }

@media (max-width: 1100px) {
  .doc-columns, .overview-grid, .two-columns { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 14px 22px; }
  .view { padding: 22px 22px 90px; }
}
@media (max-width: 800px) {
  .shell { display: block; padding-bottom: 66px; }
  .rail { position: fixed; inset: auto 0 0; z-index: 15; height: auto; padding: 0; flex-direction: row; border: 0; border-top: 1px solid var(--line); background: var(--panel-solid); }
  .brand, .rail-foot { display: none; }
  .rail nav { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav-item { flex: 1 0 auto; flex-direction: column; gap: 2px; min-height: 60px; min-width: 72px; margin: 0; padding: 8px 6px; border-radius: 0; font-size: 11px; justify-content: center; text-align: center; }
  .nav-item[aria-current="page"]::before { left: 18px; right: 18px; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .topbar { flex-wrap: wrap; gap: 6px 10px; padding: 10px 16px; }
  .topbar h1 { font-size: calc(26px * var(--head-scale)); }
  .topbar-actions { margin-left: 0; width: 100%; }
  .topbar-actions .btn { flex: 1; }
  .save-state { margin-left: auto; }
  .view { padding: 18px 16px 34px; }
  .card { padding: 16px; }
  .pair-grid, .fold-grid, .about-card { grid-template-columns: minmax(0, 1fr); }
  .weg-line { display: none; }
  .weg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .polaroid { padding: 8px 8px 10px; }
  .polaroid .drop { min-height: 170px; padding: 8px; }
  .polaroid .drop small { display: none; }
  .hero .doodle { display: none; }
  .job-bar { bottom: 74px; }
  .callout { flex-wrap: wrap; }
  .auth { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 24px; padding: 22px 16px 80px; }
  .auth-title { font-size: clamp(50px, calc(20vw * var(--title-scale)), 110px); }
  .preview header strong { display: none; }
  .preview-controls { margin: 0; }
  .seg button { padding: 3px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
