/* QuikSim admin content areas, shown inside a placeholder of the EmDash shell.
   System type stands in for Kumo's own tokens; the build uses Kumo components. */

:root {
  --paper: #FFFFFF; --sunk: #F3F1EE; --row: #F7F6F4; --line: #DDD8D1; --control: #8F887F; --muted: #6A645C; --ink-2: #3E3A35; --ink: #23211E;
  --pos-fg: #1F6B3F; --pos-bg: #E3F1E7; --info-fg: #1F4F8A; --info-bg: #E5EEF9; --warn-fg: #7A4A00; --warn-bg: #FBF0D9;
  --neutral-fg: #5D5850; --neutral-bg: #EEEBE7; --crit-fg: #A2321F; --crit-bg: #FBE9E5; --focus: #1D5FD1;
  --cag: #1E3A5C; --ran: #2D5E44; --uni: #5A2E5E;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #FFFFFF; color: var(--ink); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 14px; line-height: 1.5; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.shell-sidebar { flex: 0 0 240px; padding: 20px; display: flex; flex-direction: column; gap: 18px; background-color: var(--sunk); background-image: repeating-linear-gradient(45deg, rgba(35,33,30,.04) 0 1px, transparent 1px 12px); border-right: 1px solid var(--line); }
.shell-sidebar__label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.shell-sidebar__note { font-size: 13px; line-height: 1.45; color: var(--muted); }
.shell-sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.shell-sidebar nav span { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.shell-sidebar nav a { padding: 7px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 14px; border: 1px solid transparent; }
.shell-sidebar nav a:hover { background: rgba(255,255,255,.6); }
.shell-sidebar nav a[aria-current="page"] { background: #FFFFFF; border-color: var(--line); color: var(--ink); font-weight: 600; }
.shell-main { flex: 999 1 560px; min-width: 0; padding: 28px 40px 56px; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 820px) { .shell-sidebar { flex-basis: 100%; } .shell-main { padding: 24px 20px 48px; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px 24px; }
.page-head h1 { font-size: 24px; line-height: 1.25; font-weight: 700; }
.page-head p { margin-top: 6px; max-width: 680px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; font-size: 13px; }
.crumbs a { color: var(--ink-2); text-underline-offset: 3px; }
.crumbs .sep { color: var(--control); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--control); border-radius: 6px; background: #FFFFFF; color: var(--ink); font: 600 14px system-ui, sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--row); border-color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.btn-primary:hover { background: #3E3A35; border-color: #3E3A35; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-danger { color: var(--crit-fg); border-color: #E8B9AE; }
.btn-danger:hover { background: var(--crit-bg); border-color: var(--crit-fg); }
.btn-danger-solid { background: var(--crit-fg); border-color: var(--crit-fg); color: #FFFFFF; }
.btn[disabled] { background: #F3F1EE; border-color: var(--line); color: #A39D94; cursor: not-allowed; }
.btn-primary[disabled] { background: #E6E2DC; border-color: #E6E2DC; color: var(--control); }
.link { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-bg); color: var(--ink-2); }
.badge-draft, .badge-invited { background: var(--info-bg); color: var(--info-fg); }
.badge-published, .badge-active { background: var(--pos-bg); color: var(--pos-fg); }
.badge-archived, .badge-removed { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge-expired { background: var(--warn-bg); color: var(--warn-fg); }
.badge-hidden { background: var(--ink); color: #FFFFFF; }
.badge-sample { background: transparent; border: 1px dashed var(--control); color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; vertical-align: 1px; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.filters--band { padding: 16px; border-radius: 8px; background: var(--row); }
.f-field { display: flex; flex-direction: column; gap: 6px; }
.f-field label, .f-field .label { font-size: 13px; font-weight: 600; }
.f-input, .f-select { height: 36px; padding: 0 12px; border: 1px solid var(--control); border-radius: 6px; background: #FFFFFF; font: 400 14px system-ui, sans-serif; color: var(--ink); }
.f-input:hover, .f-select:hover { border-color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 36px; padding: 0 12px; border: 1px solid var(--control); border-radius: 999px; background: #FFFFFF; color: var(--ink); font: 600 13px system-ui, sans-serif; cursor: pointer; }
.chip span { font-weight: 400; opacity: .85; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.seg { display: inline-flex; border: 1px solid var(--control); border-radius: 6px; overflow: hidden; background: #FFFFFF; }
.seg button { height: 34px; padding: 0 12px; border: 0; border-right: 1px solid var(--control); background: #FFFFFF; color: var(--ink); font: 500 13px system-ui, sans-serif; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; font-weight: 600; }

.table-wrap { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--row); text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--row); }
table.data td.strong, table.data td .strong { font-weight: 600; color: var(--ink); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .actions { text-align: right; white-space: nowrap; }
table.data .actions > * + * { margin-left: 6px; }
table.data--compact th, table.data--compact td { padding-left: 12px; padding-right: 12px; }
tr.is-live td { background: #EFF6F1 !important; }
tr.is-live td:first-child { box-shadow: inset 3px 0 0 var(--pos-fg); }
tr.is-new td { background: #F4F8FD; }
.live-since { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--pos-fg); }
.help { font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 760px; }

.summary { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.summary > div { padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); }
.summary > div:last-child { border-right: 0; }
.summary dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.summary dd { margin: 0; font-size: 15px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 56px 24px; border: 1px dashed var(--control); border-radius: 8px; text-align: center; font-size: 15px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; font-size: 15px; font-weight: 600; }
.banner[hidden] { display: none; }
.banner-ok { background: var(--pos-bg); color: var(--pos-fg); border: 1px solid #B9DCC4; }
.banner span { flex: 1; }
.icon-btn { width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: rgba(0,0,0,.06); }

/* Dialogs (native <dialog>) */
dialog.dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 12px; box-shadow: 0 12px 32px rgba(35,33,30,.24); color: var(--ink); }
dialog.dlg-wide { width: min(760px, calc(100vw - 32px)); }
dialog.dlg-small { width: min(480px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(35,33,30,.42); }
.dlg__head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.dlg__title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg__title { font-size: 18px; font-weight: 700; }
.dlg__sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
.dlg__body { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.dlg__foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.dlg__foot--split { justify-content: space-between; }
.dlg--plain .dlg__body { padding-top: 24px; }
.dlg--plain h2 { font-size: 18px; font-weight: 700; }
.dlg--plain p { font-size: 14px; line-height: 1.55; color: var(--ink-2); }

.stepper { margin: 0; padding: 0; list-style: none; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.stepper li { display: flex; align-items: center; gap: 8px; }
.stepper .line { flex: 1; height: 1px; background: var(--line); }
.stepper .num { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--control); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.stepper li[aria-current="step"] { color: var(--ink); font-weight: 700; }
.stepper li[aria-current="step"] .num { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.stepper li.done { color: var(--ink-2); }
.stepper li.done .num { background: var(--pos-bg); border-color: var(--pos-bg); color: var(--pos-fg); }

.drop { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 44px 24px; border: 1.5px dashed var(--control); border-radius: 10px; background: #FBFAF8; text-align: center; }
.drop.is-over { border-color: var(--ink); background: #F3F1EE; }
.drop--error { border-color: var(--crit-fg); background: var(--crit-bg); padding: 32px 24px; }
.drop--error strong { color: var(--crit-fg); font-size: 16px; }
.drop__hint { font-size: 13px; line-height: 1.5; color: var(--muted); }
.filebox { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.filebox__name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.filebox__name b { font-weight: 600; }
.filebox__name span { font-size: 12px; color: var(--muted); }
.progress { display: block; height: 6px; border-radius: 3px; background: var(--neutral-bg); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--ink); transition: width 1.2s ease; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; align-items: center; gap: 10px; }
.warnbox { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-fg); }
.warnbox ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
.warnbox li { display: flex; align-items: flex-start; gap: 10px; }
.infobox { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 8px; background: var(--row); line-height: 1.5; color: var(--ink-2); }
.d-field { display: flex; flex-direction: column; gap: 6px; }
.d-field label, .d-field legend, .d-field .label { font-size: 14px; font-weight: 600; padding: 0; }
.d-field .opt { font-weight: 400; color: var(--muted); }
.d-field fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }
.d-input, .d-textarea { width: 100%; border: 1px solid var(--control); border-radius: 6px; font: 400 15px/1.5 system-ui, sans-serif; color: var(--ink); background: #FFFFFF; }
.d-input { height: 38px; padding: 0 12px; }
.d-textarea { padding: 10px 12px; resize: vertical; }
.d-textarea.mono { font: 400 14px/1.6 ui-monospace, Menlo, Consolas, monospace; }
.d-hint { font-size: 13px; line-height: 1.45; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; }
.count { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.count-ok { background: var(--pos-bg); color: var(--pos-fg); }
.count-skip { background: var(--neutral-bg); color: var(--neutral-fg); }
.count-dup { background: var(--warn-bg); color: var(--warn-fg); }
.count-bad { background: var(--crit-bg); color: var(--crit-fg); }
.scroll-box { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Toasts */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 8px; background: var(--ink); color: #FFFFFF; font-size: 14px; font-weight: 600; box-shadow: 0 12px 32px rgba(35,33,30,.24); animation: toast-in .2s ease-out; }
.toast .link { color: #FFFFFF; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Analytics */
.cards { display: flex; flex-wrap: wrap; align-items: stretch; gap: 20px; }
.card { padding: 22px 24px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-head h2 { font-size: 16px; font-weight: 700; }
.funnel { display: flex; flex-direction: column; gap: 14px; }
.funnel__row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 160px; align-items: center; gap: 14px; }
.funnel__label { font-weight: 600; }
.funnel__bar { height: 28px; border-radius: 0 4px 4px 0; background: var(--cag); }
.funnel__value { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.funnel__value b { font-size: 17px; }
.funnel__value span { font-size: 13px; color: var(--muted); }
.stat { padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; }
.stat__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat__value { font-size: 32px; line-height: 1.1; font-weight: 700; }
.stat__sub { font-size: 13px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.rating-row { display: grid; grid-template-columns: minmax(180px, 300px) 64px minmax(0, 1fr); align-items: center; gap: 16px; }
.rating-row__avg { font-size: 24px; font-weight: 700; }
.dist { display: flex; gap: 2px; height: 22px; }
.dist span { display: block; height: 100%; }
.dist span:first-child { border-radius: 4px 0 0 4px; }
.dist span:last-child { border-radius: 0 4px 4px 0; }
.dist span:only-child { border-radius: 4px; }
.r1 { background: #A3B6CE; } .r2 { background: #7E97B8; } .r3 { background: #5A78A0; } .r4 { background: #3A5880; } .r5 { background: #1E3A5C; }
.answer { display: grid; grid-template-columns: 220px minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.answer__meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.answer__meta b { color: var(--ink); }
.answer__q { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
@media (max-width: 900px) { .answer { grid-template-columns: 1fr; gap: 10px; } .rating-row { grid-template-columns: 1fr 64px; } .rating-row .dist { grid-column: 1 / -1; } .funnel__row { grid-template-columns: 84px minmax(0, 1fr) 120px; } }

/* Prototype helper (shared look with public site) */
.proto { position: fixed; left: 12px; bottom: 12px; z-index: 1000; font-family: 'Segoe UI', system-ui, sans-serif; }
.proto__toggle { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: rgba(30,29,27,.94); color: #FFFFFF; font: 600 13px system-ui, sans-serif; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.proto__toggle .dot { width: 8px; height: 8px; border-radius: 50%; background: #F2C66D; }
.proto__panel { position: absolute; left: 0; bottom: 46px; width: min(320px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; padding: 14px; border-radius: 12px; background: #FFFFFF; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(35,33,30,.16); display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.proto__panel[hidden] { display: none; }
.proto__panel h2 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.proto__panel a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.proto__panel ul { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
.proto__panel p { color: var(--ink-2); line-height: 1.45; }

@media (max-width: 767px) { .proto { left: 8px; bottom: 8px; } .proto__toggle { width: 36px; padding: 0; justify-content: center; opacity: .9; } .proto__lbl { display: none; } }
