/* App shell, forms, builder. Tokens live in dash.css. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 26px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
h4 { font-size: .9rem; margin: 14px 0 8px; color: var(--ink-2); }
p { margin: 0 0 10px; }
.muted, small.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; }
.err { color: var(--bad); font-size: .85rem; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.center { justify-content: center; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); min-height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand img { border-radius: 7px; }
.nav { display: flex; gap: 2px; overflow-x: auto; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 550; font-size: .9rem; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { color: var(--brand); background: var(--brand-soft); }
.net { font-size: .75rem; color: var(--warn); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.net::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.net.on { color: var(--ok); }
@media (max-width: 560px) { .net { font-size: 0; gap: 0; } .brand span { display: none; } .topbar { gap: 8px; } }
.badge { background: var(--warn-soft); color: var(--warn); font-size: .75rem; font-weight: 650; padding: 4px 9px; border-radius: 99px; text-decoration: none; white-space: nowrap; }
.user { position: relative; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-weight: 700; cursor: pointer; font: inherit; font-weight: 700; }
.menu { position: absolute; right: 0; top: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 210px; padding: 6px; z-index: 50; display: flex; flex-direction: column; }
.menu.float { position: absolute; }
.menu-head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head small { color: var(--ink-3); }
.menu button, .menu a { text-align: left; font: inherit; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); text-decoration: none; font-size: .9rem; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu .danger { color: var(--bad); }

main { max-width: 980px; margin: 0 auto; padding: 22px 16px 80px; outline: none; }
main.wide { max-width: 1320px; }
main.fill { max-width: 760px; }
.page-head { margin-bottom: 16px; }
.page-head.row { align-items: flex-end; }

/* Buttons & inputs */
.btn { font: inherit; font-size: .9rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; min-height: 38px; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: var(--brand-ink); } }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: transparent; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: .82rem; }
.btn.wide { width: 100%; }
.btn.rec { background: var(--bad); border-color: var(--bad); color: #fff; }
.icon-btn { font: inherit; border: 0; background: transparent; color: var(--ink-2); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; flex: 0 0 auto; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-soft); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.link-btn { font: inherit; font-size: .82rem; background: none; border: 0; color: var(--brand); cursor: pointer; padding: 4px 0; text-decoration: underline; }
.input { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); min-height: 42px; }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
textarea.input { resize: vertical; min-height: 70px; }
.input.sm { min-height: 32px; padding: 4px 8px; font-size: .85rem; width: auto; }
select.input { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: .76rem; }
.field small.err { color: var(--bad); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; cursor: pointer; margin: 6px 0; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); flex: 0 0 auto; }
.check small { display: block; color: var(--ink-3); }
.pill { font-size: .72rem; font-weight: 650; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); text-transform: capitalize; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.muted { background: var(--surface-2); color: var(--ink-3); }
.pill.ghost { background: transparent; border: 1px solid var(--line); text-transform: none; }

/* Cards & lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.survey-card { display: flex; flex-direction: column; gap: 10px; }
.survey-card h3 { font-size: 1.05rem; margin: 0; }
.survey-card h3 a { color: var(--ink); text-decoration: none; }
.survey-card h3 a:hover { color: var(--brand); }
.sc-top { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface-2); border-radius: 10px; padding: 8px; }
.sc-stats div { display: flex; flex-direction: column; }
.sc-stats b { font-size: .95rem; }
.sc-stats span { font-size: .7rem; color: var(--ink-3); }
.sc-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; align-items: center; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.list-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); text-decoration: none; flex-wrap: wrap; }
a.list-row:hover { border-color: var(--brand); }
.sync-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin: 8px 0 4px; flex-wrap: wrap; }
.sync-card.ok { background: var(--ok-soft); }
.sync-card.warn { background: var(--warn-soft); }
.empty-state { text-align: center; padding: 60px 16px; max-width: 520px; margin: 0 auto; }
.empty-state h2 { margin-top: 0; }
.hero { text-align: center; padding: 70px 16px; }
.hero h1 { font-size: 2.2rem; }
.hero p { max-width: 520px; margin: 10px auto 20px; color: var(--ink-2); }
.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-3); padding: 30px 0; justify-content: center; }
.spin { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth { max-width: 420px; margin: 40px auto; }
.auth h1 { margin-bottom: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-top: 12px; }
table.data { border-collapse: collapse; width: 100%; font-size: .85rem; }
table.data th, table.data td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: .75rem; color: var(--ink-2); background: var(--surface-2); position: sticky; top: 0; }
table.data td.acts { text-align: right; }
table.data tr:last-child td { border-bottom: 0; }
.kv-list { display: grid; grid-template-columns: 1fr; gap: 2px; }
.kv { display: grid; grid-template-columns: minmax(140px, 45%) 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 550; overflow-wrap: anywhere; }

/* Modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(8,14,13,.5); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; max-height: 90vh; }
.modal.wide { max-width: 980px; }
.modal header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal header h2 { margin: 0; font-size: 1.05rem; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: #142220; color: #fff; padding: 11px 14px; border-radius: 12px; font-size: .9rem; box-shadow: 0 8px 26px rgba(0,0,0,.25); transition: opacity .3s, transform .3s; border-left: 4px solid #2bb3a3; }
.toast.ok { border-left-color: #4ed38a; }
.toast.warn { border-left-color: #f0a548; }
.toast.bad { border-left-color: #f27474; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------------------------------------------------------------- Form */
.form-wrap { --brand-soft: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.form-head { margin-bottom: 18px; }
.form-title h1 { font-size: 1.45rem; }
.form-desc { color: var(--ink-2); }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.progress-bar { height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s; }
.page-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .8rem; color: var(--ink-3); }
.page-jump { font: inherit; font-size: .8rem; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; background: var(--surface); color: var(--ink-2); max-width: 60%; }
.page-title { font-size: 1.2rem; margin: 6px 0 12px; }
.page-hint { color: var(--ink-2); }
.form-body { display: flex; flex-direction: column; gap: 12px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; transition: border-color .2s; }
.q.has-error { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.q-label { font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.req { color: var(--bad); }
.q-hint { color: var(--ink-3); font-size: .84rem; margin-bottom: 10px; }
.q-label + .input, .q-label + div:not(.q-hint), .q-hint + * { margin-top: 8px; }
.q-error { color: var(--bad); font-size: .84rem; margin-top: 6px; font-weight: 550; }
.q-error:empty { display: none; }
.q.note-info { background: var(--info-soft); border-color: transparent; }
.q.note-warning { background: var(--warn-soft); border-color: transparent; }
.q.note-success { background: var(--ok-soft); border-color: transparent; }
.q.note-plain { background: transparent; border: 0; padding: 4px 2px; }
.q[class*="note-"] .q-label { font-weight: 500; margin: 0; }
.q-group { border: 0; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.q-group > legend { font-weight: 700; font-size: 1.02rem; padding: 0; margin-bottom: 4px; }
.q-calculate .calc-out { display: inline-block; background: var(--surface-2); padding: 6px 12px; border-radius: 8px; font-weight: 650; font-variant-numeric: tabular-nums; }
.choices { display: flex; flex-direction: column; gap: 6px; }
.choices.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .choices.cols-2, .choices.cols-3 { grid-template-columns: 1fr; } }
.choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: background .15s, border-color .15s; min-height: 44px; }
.choice:hover { border-color: var(--brand); }
.choice.on { background: var(--brand-soft); border-color: var(--brand); }
.choice input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; flex: 0 0 auto; }
.choices.seg { flex-direction: row; flex-wrap: wrap; }
.choices.seg .choice { flex: 1 1 100px; justify-content: center; }
.choices.seg .choice input { position: absolute; opacity: 0; pointer-events: none; }
.choices.seg .choice:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.other-input { margin-top: 2px; }
.clear-choice { align-self: flex-start; }
.dropdown { display: flex; flex-direction: column; gap: 6px; }
.with-unit { display: flex; align-items: stretch; }
.with-unit .unit { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; font-size: .85rem; color: var(--ink-2); }
.with-unit .input { border-radius: 0 10px 10px 0; }
.input.num { max-width: 260px; }
.with-unit .input.num { max-width: 220px; }
.input.date { max-width: 260px; }
.stars { display: flex; gap: 4px; }
.stars .star { font-size: 2rem; background: none; border: 0; cursor: pointer; color: var(--line); line-height: 1; padding: 2px; }
.stars .star.on { color: #f59e0b; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale-btn { font: inherit; font-weight: 650; min-width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; flex: 1 1 44px; max-width: 64px; }
.scale-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.scale-ends, .range-ends { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-3); margin-top: 4px; }
.range-wrap { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.range { width: 100%; accent-color: var(--brand); }
.range-out { font-weight: 700; min-width: 60px; text-align: right; }
.range-ends { grid-column: 1; }
.rank-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.rank-list li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.rank-n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex: 0 0 auto; }
.rank-l { flex: 1; }
.grid-q { display: grid; gap: 0; overflow-x: auto; }
.grid-row { display: grid; grid-template-columns: minmax(140px, 1.6fr) repeat(auto-fit, minmax(60px, 1fr)); align-items: center; border-bottom: 1px solid var(--line); }
.grid-headrow { font-size: .76rem; color: var(--ink-2); font-weight: 600; text-align: center; }
.grid-rowlabel { padding: 10px 8px 10px 0; font-size: .9rem; }
.grid-cell { display: flex; justify-content: center; padding: 10px 4px; cursor: pointer; }
.grid-cell input { width: 18px; height: 18px; accent-color: var(--brand); }
.grid-cell-label { display: none; }
@media (max-width: 640px) {
  .grid-headrow { display: none; }
  .grid-row { grid-template-columns: 1fr; padding: 8px 0; }
  .grid-rowlabel { font-weight: 600; }
  .grid-cell { justify-content: flex-start; gap: 10px; padding: 6px 0; }
  .grid-cell-label { display: inline; }
}
.consent { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 auto; }
.geo { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.geo-status { font-size: .9rem; }
.geo-manual { font-size: .85rem; width: 100%; }
.geo-manual summary { cursor: pointer; color: var(--ink-2); }
.geo-manual .row { margin-top: 8px; }
.geo-manual .input { width: 150px; }
.media { display: flex; flex-direction: column; gap: 8px; }
.media-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.media-preview img { max-width: 220px; max-height: 220px; border-radius: 10px; border: 1px solid var(--line); }
.file-chip { background: var(--surface-2); padding: 6px 10px; border-radius: 8px; font-size: .85rem; }
.sig { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sig-pad { width: 100%; max-width: 560px; aspect-ratio: 700 / 240; border: 1px dashed var(--ink-3); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
.q-repeat { display: flex; flex-direction: column; gap: 10px; }
.rep-head { display: flex; align-items: baseline; gap: 10px; }
.rep-head h3 { margin: 0; font-size: 1.05rem; }
.rep-count { font-size: .8rem; color: var(--ink-3); }
.rep-item { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); background: color-mix(in srgb, var(--surface-2) 45%, var(--bg)); padding: 10px 12px 12px; }
.rep-item-head { display: flex; align-items: center; gap: 8px; }
.rep-item-head h4 { margin: 4px 0; flex: 1; color: var(--ink); font-size: .95rem; }
.rep-item-body { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.rep-item .q { padding: 12px; }
.add-rep { align-self: flex-start; border-style: dashed; color: var(--brand); }
.form-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 12px 0 max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 5; }
.form-nav .btn { min-width: 110px; min-height: 44px; }
.save-state, .preview-tag { font-size: .78rem; color: var(--ink-3); text-align: center; }
.preview-tag { color: var(--warn); }
.thanks { text-align: center; padding: 40px 20px; margin-top: 30px; }
.big-check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 2rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.pick-draft { max-width: 560px; margin: 20px auto; }

/* ---------------------------------------------------------------- Admin editor & builder */
.editor-head { margin-bottom: 8px; }
.editor-head .back { font-size: .85rem; text-decoration: none; color: var(--ink-2); }
.editor-head h1 { margin: 6px 0; font-size: 1.35rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 10px 0 16px; overflow-x: auto; }
.tab { font: inherit; font-weight: 600; font-size: .9rem; background: none; border: 0; padding: 10px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.b-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.b-toolbar label.btn { cursor: pointer; }
.b-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .b-cols { grid-template-columns: 1fr; } }
.b-left { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; }
@media (max-width: 900px) { .b-left { position: static; max-height: 55vh; } }
.b-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 8px; cursor: pointer; font-size: .86rem; position: relative; border: 1px solid transparent; }
.b-row:hover { background: var(--surface-2); }
.b-row.sel { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.b-row.container > .b-label { font-weight: 700; }
.b-row.dragging { opacity: .4; }
.b-row.drop-before { box-shadow: inset 0 3px 0 var(--brand); }
.b-row.drop-after { box-shadow: inset 0 -3px 0 var(--brand); }
.b-row.drop-inside { background: var(--brand-soft); outline: 2px dashed var(--brand); }
.twisty { width: 18px; flex: 0 0 auto; background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: .8rem; padding: 0; }
.t-icon { flex: 0 0 auto; min-width: 26px; height: 22px; padding: 0 4px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.b-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-flags { display: flex; gap: 3px; }
.flag { font-size: .66rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 4px; padding: 0 4px; }
.flag.req { color: var(--bad); background: var(--bad-soft); }
.b-id { font-family: ui-monospace, Consolas, monospace; font-size: .7rem; color: var(--ink-3); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-acts { display: none; gap: 0; }
.b-row:hover .b-acts, .b-row.sel .b-acts, .b-row:focus-within .b-acts { display: flex; }
.b-row:hover .b-id, .b-row.sel .b-id { display: none; }
.b-acts .icon-btn { width: 26px; height: 26px; font-size: .8rem; }
.b-add-inside { font: inherit; font-size: .78rem; background: none; border: 1px dashed var(--line); color: var(--ink-3); border-radius: 8px; padding: 3px 10px; margin: 2px 0 6px; cursor: pointer; display: block; }
.b-add-inside:hover { color: var(--brand); border-color: var(--brand); }
.b-empty { text-align: center; padding: 40px 10px; }
.b-props { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.b-hint { color: var(--ink-2); padding: 20px 6px; }
.p-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: .9rem; }
.p-sec { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.p-sec h4 { margin-top: 0; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
.p-grid .span2 { grid-column: 1 / -1; }
.p-checks { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.p-foot { display: flex; gap: 8px; justify-content: flex-end; }
.input.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.opt-table { display: flex; flex-direction: column; gap: 4px; }
.opt-row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 6px; align-items: center; }
.opt-row:has(> :nth-child(4)) { grid-template-columns: 1.4fr 1fr .8fr auto; }
.opt-row .input { min-height: 34px; padding: 5px 8px; font-size: .86rem; }
.opt-head { font-size: .72rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.opt-acts { display: flex; }
.opt-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: .8rem; }
.cond { background: var(--surface-2); border-radius: 10px; padding: 10px; margin-bottom: 12px; }
.cond-title { font-size: .75rem; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.cond-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 6px; }
@media (max-width: 560px) { .cond-row { grid-template-columns: 1fr; } }
.cond-row .input { min-height: 34px; padding: 4px 8px; font-size: .84rem; }
.type-picker { display: flex; flex-direction: column; gap: 14px; }
.tp-cat h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tp-item { font: inherit; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; font-size: .88rem; }
.tp-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.preview-box { max-width: 720px; margin: 0 auto; }
.preview-box .form-nav { position: static; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .settings { grid-template-columns: 1fr; } }
.enum-list { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.choice-cards { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.choice-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice-card span { display: flex; flex-direction: column; }
.choice-card small { color: var(--ink-3); }
.share { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .share { grid-template-columns: 1fr; } }
.share-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.share-row .label { font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.qr { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.qr svg { width: 180px; height: 180px; background: #fff; border-radius: 10px; padding: 6px; }
.dash-head { gap: 8px; }

@media print {
  .topbar, .dash-filters, .dash-hint, .dash-toc, .dash-head .btn, .flip { display: none !important; }
  body { background: #fff; }
  .dcard, .kpi { box-shadow: none; break-inside: avoid; }
  main { max-width: none; padding: 0; }
}
