/* Voos Presenter — host console. Tokens and primitives come from tokens.css. */

html { scroll-padding-top: 88px; }
body { display: flex; flex-direction: column; }

.skip-link {
  position: absolute; left: var(--sp-3); top: -80px; z-index: 100;
  background: var(--surface); color: var(--text); padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
}
.skip-link:focus { top: var(--sp-3); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-row {
  max-width: 1480px; margin: 0 auto; min-height: 60px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-5);
}
.brand { display: inline-flex; align-items: center; gap: var(--sp-2); justify-self: start; min-height: var(--control-h-lg); font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; color: var(--text); text-decoration: none; border-radius: var(--r-sm); }
.brand-sub { font-weight: 400; color: var(--muted); }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; gap: 2px; width: 26px; height: 26px; border-radius: 7px; background: var(--accent); }
.brand-mark i { display: block; width: 3px; border-radius: 2px; background: var(--accent-ink); }
.brand-mark i:nth-child(1) { height: 8px; } .brand-mark i:nth-child(2) { height: 15px; } .brand-mark i:nth-child(3) { height: 11px; }

.tabs { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--surface-2); }
.tabs a {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 38px; padding: 0 var(--sp-4);
  border-radius: 8px; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-hover) ease, color var(--dur-hover) ease, transform var(--dur-press) var(--ease-out);
}
.tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.1); }
.tabs a:active { transform: scale(0.97); }
.tab-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: var(--sp-1);
  border-radius: var(--r-pill); background: var(--bad); color: var(--surface); font-size: var(--fs-xs); font-weight: 700;
}
.actor-btn { justify-self: end; min-height: var(--control-h-lg); min-width: var(--control-h-lg); color: var(--muted); }
.actor-btn #actor-icon { display: inline-flex; }
.actor-btn #actor-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) and (pointer: fine) {
  .tabs a:hover:not([aria-current="page"]) { color: var(--text); }
}
@media (pointer: coarse) { .tabs a { min-height: 44px; } }
@media (max-width: 640px) {
  .topbar-row { grid-template-columns: 1fr auto; padding: var(--sp-2) var(--sp-4); row-gap: var(--sp-2); }
  .tabs { grid-column: 1 / -1; grid-row: 2; }
  .tabs a { flex: 1; min-height: 44px; }
  html { scroll-padding-top: 140px; }
}

/* ---------------------------------------------------------------- layout */
#view { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: var(--sp-5) var(--sp-5) var(--sp-8); }
@media (max-width: 640px) { #view { padding: var(--sp-4) var(--sp-4) var(--sp-7); } }
.view { display: flex; flex-direction: column; gap: var(--sp-4); animation: view-in var(--dur-enter) var(--ease-out) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-4); flex-wrap: wrap; }
.view-head h2 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; }
.view-sub { color: var(--muted); margin-top: var(--sp-1); max-width: 72ch; font-size: var(--fs-sm); }
.grow { flex: 1; min-width: min(100%, 260px); }
.title-row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.toolbar { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.back {
  display: inline-flex; align-items: center; gap: var(--sp-1); align-self: flex-start; min-height: var(--control-h-lg); margin: calc(var(--sp-3) * -1) 0 calc(var(--sp-3) * -1) calc(var(--sp-1) * -1);
  padding-right: var(--sp-2); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; border-radius: var(--r-sm);
}
@media (hover: hover) and (pointer: fine) { .back:hover { color: var(--text); } }
.version { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; opacity: 0.85; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-4); min-width: 0; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.panel-title { font-size: var(--fs-md); font-weight: 650; letter-spacing: -0.005em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); flex-wrap: wrap; }
.split { display: grid; gap: var(--sp-4); align-items: start; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr) 400px; }
  .split-rev { grid-template-columns: 400px minmax(0, 1fr); }
}

.empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); text-align: center; padding: var(--sp-6) var(--sp-4); }
.empty-title { font-weight: 650; }
.empty .muted { max-width: 44ch; font-size: var(--fs-sm); text-wrap: pretty; }
.empty .btn { margin-top: var(--sp-2); }
.hint[data-tone="bad"] { color: var(--bad); }
.hint[data-tone="warn"] { color: var(--warn); font-weight: 600; }
#login-text[data-tone="bad"] { color: var(--bad); }

.toast {
  position: fixed; left: 50%; bottom: max(var(--sp-5), env(safe-area-inset-bottom)); z-index: 50;
  max-width: calc(100vw - 2 * var(--sp-4)); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-pill);
  background: var(--text); color: var(--bg); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-2);
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out);
}
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- rows (deck list) */
.rows { display: flex; flex-direction: column; margin: 0 calc(var(--sp-2) * -1); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 var(--sp-3); padding: 0 var(--sp-2); border-radius: var(--r-md); position: relative; }
.row + .row { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.row-main { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3) 0; min-width: 0; min-height: 60px; justify-content: center; color: inherit; text-decoration: none; }
a.row-main::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* the whole row is the link target */
a.row-main:focus-visible { outline: none; }
a.row-main:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }
.row-title { font-weight: 650; display: inline-flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }
.row-meta { color: var(--muted); font-size: var(--fs-sm); }
.row-side { display: flex; align-items: center; gap: var(--sp-2); color: var(--muted); }
.row-extra { grid-column: 1 / -1; padding-bottom: var(--sp-3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); position: relative; z-index: 1; }
.row { transition: background-color var(--dur-hover) ease; }
@media (hover: hover) and (pointer: fine) { .row:has(a.row-main:hover) { background: var(--surface-hover); } }
.row:has(a.row-main:active) { background: var(--surface-2); }

/* ---------------------------------------------------------------- create deck */
.seg { display: flex; padding: 3px; gap: 2px; border-radius: var(--r-md); background: var(--surface-2); }
.seg-btn {
  flex: 1; min-height: 38px; padding: 0 var(--sp-3); border-radius: 8px; border: 0; background: transparent;
  font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background-color var(--dur-hover) ease, color var(--dur-hover) ease, transform var(--dur-press) var(--ease-out);
}
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.1); }
.seg-btn:active { transform: scale(0.97); }
@media (pointer: coarse) { .seg-btn { min-height: 44px; } }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-1); text-align: center;
  min-height: 116px; padding: var(--sp-4); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  color: var(--muted); cursor: pointer; background: var(--surface);
  transition: background-color var(--dur-hover) ease, border-color var(--dur-hover) ease, transform var(--dur-press) var(--ease-out);
}
.drop-text { font-weight: 650; color: var(--text); font-size: var(--fs-sm); }
.drop[data-has="true"] { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.drop[data-over="true"] { border-color: var(--accent); background: var(--accent-soft); }
.drop:active { transform: scale(0.99); }
input:focus-visible + .drop { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .drop:hover { border-color: var(--text); } }
.file-btn { position: relative; }
.file-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.optional { font-weight: 400; }

details.more { border-top: 1px solid var(--line); padding-top: var(--sp-1); }
details.more > summary {
  display: flex; align-items: center; gap: var(--sp-2); min-height: var(--control-h-lg); cursor: pointer; list-style: none;
  font-size: var(--fs-sm); font-weight: 600; color: var(--muted); border-radius: var(--r-sm);
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur-hover) var(--ease-out); margin: 0 2px; }
details.more[open] > summary::before { transform: rotate(45deg); }
details.more > :not(summary) { margin-bottom: var(--sp-2); }
.options { margin: 0; display: grid; gap: 2px; font-size: var(--fs-sm); }
.options dt { font-weight: 650; margin-top: var(--sp-2); }
.options dd { margin: 0; color: var(--muted); }

/* ---------------------------------------------------------------- deck editor */
fieldset.editor { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
fieldset.editor:disabled { opacity: 0.6; }
@media (min-width: 1100px) {
  fieldset.editor { grid-template-columns: 420px minmax(0, 1fr); }
  .brief { position: sticky; top: 84px; max-height: calc(100dvh - 108px); overflow-y: auto; overscroll-behavior: contain; }
}
.form-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3); flex-wrap: wrap; }
.form-foot > :first-child { margin-right: auto; }
.slides { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.slides-head { display: flex; flex-direction: column; gap: 2px; padding-top: var(--sp-1); }
.slide-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.slide-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); scroll-margin-top: 96px; }
@media (min-width: 720px) { .slide-card { grid-template-columns: 240px minmax(0, 1fr); } }
.slide-side, .slide-main { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.slide-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.slide-head h4 { font-size: var(--fs-md); font-weight: 650; }
.thumb { aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: var(--stage); border: 1px solid var(--line); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb-miss { color: #c9ced8; font-size: var(--fs-xs); }
.slide-side details.more { border-top: 0; padding-top: 0; }
.src-label { font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.src-text { font-size: var(--fs-sm); white-space: pre-line; }
.flags { display: flex; flex-direction: column; gap: var(--sp-1); }
.flags:empty { display: none; }
.flag { display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--warn-soft); font-size: var(--fs-sm); }
.flag svg { color: var(--warn); margin-top: 2px; }
.flag:is([data-kind="angka"], [data-kind="klaim"], [data-kind="kosong"]) { background: var(--bad-soft); }
.flag:is([data-kind="angka"], [data-kind="klaim"], [data-kind="kosong"]) svg { color: var(--bad); }

.progress-note { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--accent-soft); font-size: var(--fs-sm); display: flex; flex-direction: column; gap: var(--sp-2); }
.progress-line { display: flex; justify-content: space-between; gap: var(--sp-3); font-weight: 550; }
.bar { height: 4px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 22%, transparent); overflow: hidden; }
.bar i { display: block; width: 35%; height: 100%; border-radius: inherit; background: var(--accent); animation: bar 1.4s var(--ease-in-out) infinite; }
@keyframes bar { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* ---------------------------------------------------------------- sessions */
.field-pair { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--sp-3); }
.linkbox { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--ok-soft); animation: view-in var(--dur-enter) var(--ease-out) both; }
.linkbox.plain { background: none; padding: 0; animation: none; }
.linkbox-title { display: flex; align-items: center; gap: var(--sp-2); font-weight: 650; font-size: var(--fs-sm); }
.linkbox-title svg { color: var(--ok); }
.linkbox input { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-sm); }

.srows { display: flex; flex-direction: column; margin: 0 calc(var(--sp-2) * -1); }
.srows li + li { border-top: 1px solid var(--line); }
.srow {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-4);
  padding: var(--sp-3) var(--sp-2); min-height: 60px; border-radius: var(--r-md);
  color: inherit; text-decoration: none; font-size: var(--fs-sm);
  transition: background-color var(--dur-hover) ease;
}
a.srow:active { background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) { a.srow:hover { background: var(--surface-hover); } }
.srow-head { display: none; }
.srow-client { display: flex; flex-direction: column; gap: 2px; flex: 1 1 60%; min-width: 0; }
.srow-client .row-title { font-size: var(--fs-md); }
.srow [data-label]::before { content: attr(data-label) " "; color: var(--muted); }
@media (min-width: 1240px) {
  .srow { display: grid; grid-template-columns: minmax(160px, 1fr) 156px 156px 56px 112px 96px 140px; gap: var(--sp-3); }
  .srow [data-label]::before { content: none; }
  .srow-head { display: grid; min-height: 0; padding: 0 0 var(--sp-2); margin: 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--line); }
}

/* ---------------------------------------------------------------- session detail */
.eyebrow { font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.outcome { border-left: 4px solid var(--line-strong); }
.outcome[data-tone="good"] { border-left-color: var(--ok); }
.outcome-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; margin-top: calc(var(--sp-2) * -1); }
.quote { margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--client-soft); font-size: var(--fs-lg); line-height: 1.45; text-wrap: pretty; }
.quote cite { display: block; margin-top: var(--sp-1); font-size: var(--fs-sm); font-style: normal; color: var(--muted); }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: var(--sp-1) var(--sp-4); font-size: var(--fs-sm); }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.prose { max-width: 75ch; text-wrap: pretty; }
.sub { font-size: var(--fs-sm); font-weight: 650; margin-bottom: var(--sp-1); }
.cols { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.bullets { display: flex; flex-direction: column; gap: var(--sp-1); padding-left: 1.1em; list-style: disc; font-size: var(--fs-sm); }
.bullets li::marker { color: var(--muted); }
.pending { display: flex; align-items: center; gap: var(--sp-2); color: var(--muted); min-height: 72px; }
.items { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 0; flex-wrap: wrap; }
.item + .item { border-top: 1px solid var(--line); }
.item:first-child { padding-top: 0; } .item:last-child { padding-bottom: 0; }
.item-main { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; flex: 1 1 260px; }
.item-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.stats { margin: 0; display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); }
.stat dt { font-size: var(--fs-sm); color: var(--muted); }
.stat dd { margin: 0; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; }
.transcript { display: flex; flex-direction: column; gap: var(--sp-3); max-width: 80ch; }
.line { padding-left: var(--sp-3); border-left: 3px solid var(--accent); }
.line[data-role="client"] { border-left-color: var(--client); }
.line-who { display: flex; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-sm); }
.line[data-role="client"] .line-who b { color: var(--client); }
.line p { text-wrap: pretty; }

/* ---------------------------------------------------------------- results */
.tiles { margin: 0; display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: var(--sp-1); min-height: 128px; }
.tile dt { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.tile dd { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.tile .hint { margin-top: auto; text-wrap: pretty; }
.tile-lead { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.tile-lead dd { color: var(--accent); }
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile dd { font-size: var(--fs-xl); } .tile-lead { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
  .view, .linkbox { animation: none; }
  .tabs a:active, .seg-btn:active, .drop:active { transform: none; }
  .toast { transform: translate(-50%, 0); transition: opacity var(--dur-enter) ease; }
  .bar i { animation: none; width: 100%; opacity: 0.5; }
}

/* ---- question map in the session report */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { text-align: left; vertical-align: top; padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; border-bottom: 1px solid var(--line); }
.table th { font-weight: 600; color: var(--muted); white-space: nowrap; }

.proposal-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
