/* Application chrome: blue on cool grays. The paper stays white in both themes.
   Each colour is light-dark(light theme, dark theme). */
:root {
  --chrome: light-dark(#252a33, #0e1014);
  --on-chrome: #f1f4f8;
  --chrome-soft: #b6bfcd;
  --highlight: #8bb4ff;
  --accent: light-dark(#2458c5, #8bb4ff);
  --accent-fill: light-dark(#2458c5, #3567d1);
  --accent-hover: light-dark(#1b469f, #2c59b8);
  --ink: light-dark(#1a1e26, #e9ecf1);
  --soft: light-dark(#545c6a, #a9b2c0);
  --line: light-dark(#dde1e8, #333a46);
  --field-line: light-dark(#c4cad5, #4a5362);
  --field-hover: light-dark(#97a1b3, #6d788c);
  --field: light-dark(#ffffff, #171a20);
  --surface: light-dark(#ffffff, #1f232b);
  --ground: light-dark(#f3f4f7, #272c36);
  --page: light-dark(#f3f4f7, #15181d);
  --desk: light-dark(#dce0e8, #111317);
  --hover: light-dark(#e9ecf3, #313846);
  --selected: light-dark(#2b313c, #e9ecf1);
  --on-selected: light-dark(#ffffff, #171a20);
  --danger: light-dark(#a8322a, #ff9d94);
  --danger-bg: light-dark(#fbeceb, #3d2321);
  --danger-ink: light-dark(#7e221c, #ffc4be);
  --warn: light-dark(#8a5300, #f0bb66);
  --warn-bg: light-dark(#fdf4df, #3a2f18);
  --warn-ink: light-dark(#6d4300, #f4d08c);
  --info-bg: light-dark(#e7eefd, #223253);
  --info-ink: light-dark(#173679, #d3e0ff);
  --ok-bg: light-dark(#e3f1e5, #1e3728);
  --ok-ink: light-dark(#17592f, #ade2bd);
  --radius: 8px;
  --bar: 58px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 14px/1.5 "Manrope", "Segoe UI", sans-serif; accent-color: var(--accent-fill); }
::selection { background: var(--accent-fill); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; }
.muted { color: var(--soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* top bar */
.topbar { height: var(--bar); display: flex; align-items: center; gap: 28px; padding: 0 20px; background: var(--chrome); color: var(--on-chrome); }
.topbar :focus-visible { outline-color: var(--highlight); }
.brand { display: flex; align-items: center; flex: none; padding: 4px 0; }
.brand img { display: block; }
.topbar nav { display: flex; gap: 4px; align-self: stretch; }
.topbar nav a { display: flex; align-items: center; padding: 0 12px; color: var(--chrome-soft); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; border-top: 3px solid transparent; white-space: nowrap; }
.topbar nav a:hover { color: #fff; }
.topbar nav a[aria-current] { color: #fff; border-bottom-color: var(--highlight); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.who { color: var(--chrome-soft); }
.topbar-link { background: none; border: 0; color: var(--on-chrome); font: inherit; cursor: pointer; padding: 6px 4px; }
.topbar-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.langs { display: inline-flex; padding: 2px; gap: 2px; border-radius: 7px; background: #ffffff17; }
.langs button { border: 0; background: none; color: inherit; font: 600 12px/1 inherit; font-family: inherit; padding: 6px 9px; border-radius: 5px; cursor: pointer; }
.langs button[aria-pressed="true"] { background: #fff; color: #252a33; }
.theme-toggle { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: #ffffff17; color: inherit; cursor: pointer; }
.theme-toggle:hover { background: #ffffff2e; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 15px; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: 600 13.5px/1.2 "Manrope", "Segoe UI", sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease); }
.btn:hover { border-color: var(--accent); background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.is-busy { cursor: progress; }
.btn-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-wide { width: 100%; min-height: 44px; }
.btn.danger, .icon-btn.danger:hover { color: var(--danger); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--soft); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-bg); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent); text-decoration: underline; cursor: pointer; }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* fields */
input:not([type="radio"], [type="checkbox"], [type="file"], [type="color"]), select, textarea {
  width: 100%; min-height: 38px; padding: 7px 11px; border: 1px solid var(--field-line); border-radius: var(--radius);
  background: var(--field); color: var(--ink); font: 400 14px/1.4 "Manrope", "Segoe UI", sans-serif; caret-color: var(--accent);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--soft); opacity: .85; }
input:hover, select:hover, textarea:hover { border-color: var(--field-hover); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px light-dark(#2458c52e, #8bb4ff40); }
[aria-invalid="true"] { border-color: var(--danger) !important; background: var(--danger-bg) !important; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .label { font-size: 12.5px; font-weight: 500; color: var(--soft); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; }
.check { display: flex; align-items: center; gap: 9px; min-height: 38px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 0; flex: none; }
.hint { font-size: 12.5px; color: var(--soft); }
.grid { display: grid; gap: 12px; align-items: end; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--info-bg); color: var(--info-ink); }
.alert { padding: 10px 14px; border-radius: var(--radius); background: var(--danger-bg); color: var(--danger-ink); }

/* editor layout */
.editor { display: grid; grid-template-columns: minmax(420px, 44%) minmax(0, 1fr); height: calc(100vh - var(--bar)); height: calc(100dvh - var(--bar)); }
.tabs { display: none; }
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); container-type: inline-size; }
.actionbar { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.actionbar-title { margin-right: auto; min-width: 0; }
.actionbar h1 { font-size: 17px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-state { font-size: 12px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-state.is-dirty { color: var(--warn); }
.form { position: relative; flex: 1; overflow-y: auto; padding: 0 20px 48px; scrollbar-width: thin; scrollbar-color: var(--field-line) transparent; scroll-padding-block: 20px; }
.form > .notice { margin-top: 16px; }
.block { display: flex; flex-direction: column; gap: 14px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block h2 { font-size: 15px; font-weight: 700; }
details.block:not([open]) { gap: 0; }
details.block > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; border-radius: 4px; }
details.block > summary::-webkit-details-marker { display: none; }
.chevron { transition: transform .18s var(--ease); color: var(--soft); }
details[open] > summary .chevron { transform: rotate(90deg); }
.summary-value { margin-left: auto; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }

/* template picker: each thumbnail is a miniature of its layout */
.templates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tpl { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; cursor: pointer; position: relative; text-align: center; }
.tpl input { position: absolute; opacity: 0; }
.thumb { display: block; position: relative; width: 100%; max-width: 62px; aspect-ratio: 210 / 270; background: #fff; --paper-accent: #2458c5; --paper-rule: #d5d9e1; --paper-ink: #1a1e26; border: 1px solid var(--field-line); border-radius: 5px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.thumb i { position: absolute; left: 12%; right: 12%; display: block; border-radius: 1px; }
.thumb i:nth-child(1) { top: 10%; height: 9%; border-bottom: 2px solid var(--paper-accent); }
.thumb i:nth-child(2) { top: 31%; height: 28%; background: repeating-linear-gradient(var(--paper-rule) 0 2px, transparent 2px 6px); }
.thumb i:nth-child(3) { top: 68%; left: 52%; height: 9%; background: var(--paper-accent); }
.tpl-bahce .thumb i:nth-child(1) { top: 7%; left: 8%; right: 8%; height: 22%; border: 0; border-radius: 3px; background: var(--paper-accent); }
.tpl-bahce .thumb i:nth-child(2) { top: 38%; }
.tpl-editorial .thumb i:nth-child(1) { left: 26%; right: 26%; border-bottom: 3px double var(--paper-ink); }
.tpl-editorial .thumb i:nth-child(3) { background: none; border-block: 2px solid var(--paper-ink); }
.tpl-kompakt .thumb i:nth-child(1) { height: 6%; border-bottom-width: 3px; }
.tpl-kompakt .thumb i:nth-child(2) { top: 23%; height: 48%; background: repeating-linear-gradient(var(--paper-rule) 0 2px, transparent 2px 4px); }
.tpl-kompakt .thumb i:nth-child(3) { top: 76%; }
.tpl-yatay .thumb { aspect-ratio: 297 / 210; max-width: 72px; margin-block: auto; }
.tpl-yatay .thumb i:nth-child(1) { height: 12%; }
.tpl-yatay .thumb i:nth-child(2) { top: 36%; height: 28%; }
.tpl-yatay .thumb i:nth-child(3) { top: 74%; height: 12%; }
.tpl input:checked + .thumb { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tpl:hover .thumb { border-color: var(--accent); }
.tpl input:focus-visible + .thumb { outline: 2px solid var(--ink); outline-offset: 4px; }
.tpl .thumb + span { margin-top: auto; }

.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.swatches legend { float: left; width: 100%; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px light-dark(#0000001f, #ffffff55); transition: transform .15s var(--ease); }
.swatches button:hover { transform: scale(1.08); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.swatches input[type="color"] { width: 38px; height: 32px; padding: 2px; border: 1px solid var(--field-line); border-radius: 6px; background: var(--field); cursor: pointer; }
.segmented { display: flex; flex-wrap: wrap; gap: 0; }
.segmented legend { float: left; width: 100%; }
.segmented label { flex: 1; position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--field-line); font-weight: 500; text-align: center; }
.segmented label:first-of-type span { border-radius: var(--radius) 0 0 var(--radius); }
.segmented label:last-of-type span { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }
.segmented input:checked + span { background: var(--selected); border-color: var(--selected); color: var(--on-selected); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.logo-row { display: flex; gap: 14px; align-items: center; }
.logo-row > div:last-child { display: flex; flex-direction: column; gap: 6px; }
.logo-box { width: 108px; height: 68px; flex: none; display: grid; place-items: center; padding: 6px; border: 1px dashed var(--field-line); border-radius: var(--radius); color: var(--soft); font-size: 12px; background: #f3f4f7; color: #545c6a; text-align: center; }
.logo-box img { max-width: 100%; max-height: 54px; object-fit: contain; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.picker select { flex: 1; min-width: 180px; width: auto; }

/* line items */
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.item { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--ground); border: 1px solid var(--line); border-radius: 12px; }
.item:focus-within { border-color: var(--accent); }
.item-head { display: flex; gap: 6px; align-items: center; }
.item .item-name { font-weight: 600; }
.item-tools { display: flex; flex: none; }
.item textarea { min-height: 36px; resize: none; overflow: hidden; }
.item-numbers { display: grid; grid-template-columns: .7fr .9fr 1.25fr .8fr .8fr; gap: 8px; }
.item-numbers input { text-align: right; font-variant-numeric: tabular-nums; }
.item-numbers input, .item-numbers select { padding-inline: 9px; }
.item-total { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; }
.item-total span { font-size: 12.5px; color: var(--soft); }
.item-total output { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.btn-add { border-style: dashed; color: var(--accent); min-height: 42px; }

.summary { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.summary dl { margin: 0; width: min(100%, 380px); font-variant-numeric: tabular-nums; }
.summary dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--soft); }
.summary dd { margin: 0; font-weight: 600; text-align: right; }
.summary .grand { font-size: 18px; border-bottom: 2px solid var(--accent); }
.summary .grand dt { color: var(--ink); font-weight: 700; }
.summary .grand dd { font-weight: 800; color: var(--accent); }
.summary .internal { margin-top: 8px; padding: 8px 10px; border: 0; border-radius: var(--radius); background: var(--warn-bg); }
.summary .internal dt, .summary .internal dd { color: var(--warn-ink); }
.rates { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--soft); text-align: right; font-variant-numeric: tabular-nums; }

.ref-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ref-list:empty { display: none; }
.ref-list li { position: relative; width: 104px; height: 60px; display: grid; place-items: center; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.ref-list img { max-width: 100%; max-height: 46px; object-fit: contain; }
.ref-remove { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--field-line); background: var(--surface); color: var(--danger); cursor: pointer; }
.ref-remove .icon { width: 12px; height: 12px; }
details.block > .btn.file { align-self: flex-start; }

/* preview stage */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--desk); }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 20px; font-size: 12.5px; color: var(--soft); }
.zoom { display: flex; align-items: center; gap: 2px; }
.zoom-value { min-width: 54px; height: 32px; border: 0; background: none; font: 600 12.5px "Manrope", sans-serif; color: var(--ink); cursor: pointer; border-radius: 6px; font-variant-numeric: tabular-nums; }
.zoom-value:hover { background: var(--hover); }
.stage-error { margin: 0 20px 8px; padding: 8px 12px; border-radius: var(--radius); background: var(--danger-bg); color: var(--danger-ink); }
.stage-scroll { flex: 1; overflow: auto; padding: 8px 28px 40px; scrollbar-width: thin; scrollbar-color: var(--field-hover) transparent; scrollbar-gutter: stable; }
.sheet-slot { margin: 0 auto; position: relative; }
.sheet { position: absolute; top: 0; left: 0; width: 210mm; min-height: 297mm; padding: 14mm; background: #fff; color-scheme: light; transform-origin: 0 0; box-shadow: 0 1px 2px light-dark(#141a281f, #00000066), 0 14px 36px -10px light-dark(#141a2840, #000000b3); }
.sheet.landscape { width: 297mm; min-height: 210mm; }
#doc { display: flow-root; }
.breaks i { position: absolute; left: 0; right: 0; border-top: 1px dashed #c2564d; pointer-events: none; }
.breaks i::after { content: attr(data-label); position: absolute; right: 2mm; top: 2px; font: normal 500 8pt "Manrope", sans-serif; color: #a8322a; }

/* toasts */
.toasts { position: fixed; z-index: 20; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 10px; background: light-dark(#252a33, #3a4250); color: #fff; font-weight: 500; box-shadow: 0 10px 30px -8px #0006; animation: toast-in .25s var(--ease); }
.toast-error { background: #8c261f; }
@keyframes toast-in { from { opacity: .2; transform: translateY(8px); } }

/* login */
.login-body { min-height: 100vh; background: var(--chrome); display: grid; place-items: center; padding: 24px; }
.login { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; max-width: 400px; color: var(--on-chrome); }
.login-tools { display: flex; align-items: center; gap: 10px; }
.login-card { width: 100%; padding: 34px 32px; background: var(--surface); color: var(--ink); border-radius: 12px; box-shadow: 0 24px 60px -20px #0009; display: flex; flex-direction: column; gap: 10px; }
.login-card h1 { margin-bottom: 8px; line-height: 0; }
/* The wordmark is used as a mask so it takes the text colour of either theme. */
.wordmark { display: inline-block; width: 130px; height: 50px; background: var(--ink); -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.login-card input:not([type="hidden"]) { min-height: 44px; }

/* archive */
.archive { max-width: 1120px; margin: 0 auto; padding: 32px 20px 64px; display: flex; flex-direction: column; gap: 18px; }
.archive-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.archive h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters input { flex: 1; min-width: 200px; width: auto !important; }
.filters select { width: auto !important; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.list { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.list th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--soft); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr:hover { background: var(--ground); }
.list .num { text-align: right; white-space: nowrap; font-weight: 600; }
.list .number { font-weight: 700; white-space: nowrap; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
select.status { min-height: 32px !important; width: auto !important; padding: 4px 8px !important; font-weight: 600 !important; font-size: 13px !important; }
select.status-sent { background: var(--info-bg) !important; color: var(--info-ink) !important; }
select.status-accepted { background: var(--ok-bg) !important; color: var(--ok-ink) !important; }
select.status-rejected { background: var(--danger-bg) !important; color: var(--danger-ink) !important; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 64px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--field-line); border-radius: 12px; }
.empty h2 { font-size: 18px; }
.empty .btn { margin-top: 8px; }

/* narrow form column */
@container (max-width: 520px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-numbers .wide { grid-column: span 1; }
  .actionbar #save span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@container (max-width: 400px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .templates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-head { flex-direction: column; align-items: stretch; }
  .item-tools { justify-content: flex-end; }
}

@media (max-width: 960px) {
  .tabs { display: flex; gap: 4px; padding: 8px 12px; height: 54px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .tabs button { flex: 1; border: 0; border-radius: var(--radius); background: var(--ground); font: 600 13.5px "Manrope", sans-serif; color: var(--ink); cursor: pointer; }
  .tabs button[aria-pressed="true"] { background: var(--selected); color: var(--on-selected); }
  .editor { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - var(--bar) - 54px); }
  .editor[data-view="form"] .stage, .editor[data-view="preview"] .panel { display: none; }
  .panel { border-right: 0; }
  .stage-scroll { padding-inline: 12px; }
}
@media (max-width: 720px) {
  :root { --bar: 96px; }
  .topbar { flex-wrap: wrap; align-content: center; gap: 4px 14px; padding: 0 14px; }
  .topbar nav { order: 3; width: 100%; height: 38px; margin-inline: -8px; }
  .who { display: none; }
  .list thead { display: none; }
  .list, .list tbody, .list tr, .list td { display: block; }
  .list tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .list td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 16px; border: 0; }
  .list td[data-label]::before { content: attr(data-label); font-size: 12.5px; color: var(--soft); font-weight: 400; }
  .list td.row-actions { justify-content: flex-end; }
  input:not([type="radio"], [type="checkbox"], [type="file"], [type="color"]), select, textarea { font-size: 16px; }
}
@media (max-width: 480px) {
  .actionbar { padding-inline: 12px; }
  .actionbar #pdf span { font-size: 13px; }
  .form { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
