/* Themes: light and warm only, no dark mode (issue #9). Chai is the default; pick another with THEME. */
:root {
  color-scheme: light;
  --bg: #faf6ef; --card: #fffdf9; --ink: #231d17; --muted: #6e6255; --line: #e8dfd2; --hero: #f3e6d6;
  --accent: #b4441a; --accent-ink: #fff; --accent-soft: #f6e2d6; --link: #b4441a;
  --ok: #2f7d45; --bad: #b42318; --wait: #8a5a00; --focus: #1d4ed8;
}
:root[data-theme="haldi"] {
  --bg: #fff9ec; --card: #fffef8; --ink: #2a2113; --muted: #6f5f43; --line: #efe2c2; --hero: #fcefc9;
  --accent: #e7a417; --accent-ink: #2a1c00; --accent-soft: #fbebc4; --link: #8a5a00; --focus: #7a3e00;
}
:root[data-theme="gulab"] {
  --bg: #fff6f4; --card: #fff; --ink: #2b1a1c; --muted: #735a5e; --line: #f1dcda; --hero: #fce6e8;
  --accent: #b8335a; --accent-ink: #fff; --accent-soft: #fbe1e6; --link: #b8335a; --bad: #a4161a;
}
:root[data-theme="mitti"] {
  --bg: #f6f1e7; --card: #fffcf6; --ink: #26211b; --muted: #6a6052; --line: #e3d9c6; --hero: #e9e3d2;
  --accent: #8c4f2b; --accent-ink: #fff; --accent-soft: #ecdccb; --link: #8c4f2b;
  --ok: #4e7a4a; --bad: #a4161a; --wait: #7a5300; --focus: #2f5d8a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
a { color: var(--link); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .4rem 0 .6rem; overflow-wrap: anywhere; }
p, li { max-width: 75ch; }

/* ---------- Page frame ---------- */
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; }
.topline { border-bottom: 1px solid var(--line); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
.brand::before { content: ""; width: 26px; height: 26px; border-radius: 8px; background: var(--accent); }
.inline { display: inline; margin: 0; font-size: .9rem; }
.link { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.eyebrow { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--link); font-weight: 700; margin: 0; }
.muted-eyebrow { color: var(--muted); margin-top: 32px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.back { color: var(--muted); font-size: .9rem; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.steps { color: var(--muted); padding-left: 1.2rem; }
.actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
label { font-size: .9rem; font-weight: 600; display: block; }
.input { display: block; width: 100%; min-height: 46px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit; font-weight: 400; color: var(--ink); background: var(--card); }
.input:focus { border-color: var(--accent); }
.row2 { display: flex; gap: 12px; }
.row2 > * { flex: 1; min-width: 0; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--card); margin: 16px 0 0; }
.consent { margin: 0; }
.consent p { margin: 0 0 8px; font-size: .9rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 8px; min-height: 28px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.big { min-height: 56px; font-size: 1.1rem; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.err { color: var(--bad); font-size: .9rem; margin: 0; }
.err:empty { display: none; }
.st { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.st.ready { color: var(--ok); } .st.busy { color: var(--link); } .st.fail { color: var(--bad); } .st.nf { color: var(--muted); } .st.wait { color: var(--wait); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Landing ---------- */
.land { display: grid; gap: 32px; padding-top: 40px; padding-bottom: 56px; min-height: calc(100dvh - 73px); align-content: center; }
.land h1 { font-size: 2.1rem; }
.howto { display: grid; gap: 12px; list-style: none; padding: 0; margin: 0; }
.howto li { display: flex; gap: 14px; align-items: flex-start; margin: 0; max-width: none; }
.howto .n { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--link); display: grid; place-items: center; font-weight: 700; }
.howto p { margin: 2px 0 0; }

/* ---------- Sign up / sign in ---------- */
.auth { display: grid; gap: 24px; }
.auth-form { max-width: 480px; width: 100%; margin: 0 auto; }
.auth-form.card { border: 0; background: none; padding: 0; }
.welcome { display: none; border-radius: 20px; background: var(--hero); padding: 48px; }
.welcome blockquote { font-size: 1.35rem; line-height: 1.45; margin: 16px 0; }

/* ---------- Dashboard ---------- */
.banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--hero); border-color: transparent; margin-top: 0; }
.banner h1 { font-size: 1.3rem; margin: 0; }
.banner p { margin: 4px 0 0; }
.convs { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 16px; background: var(--card); overflow: hidden; }
.convs li { margin: 0; max-width: none; }
.convs li + li { border-top: 1px solid var(--line); }
.conv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px; height: 100%; color: var(--ink); text-decoration: none; }
.conv > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.conv .badges { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.empty { text-align: center; padding: 40px 16px; }
.empty .icon { font-size: 2rem; margin: 0; }
.empty p { margin-left: auto; margin-right: auto; }

/* ---------- New conversation + recorder ---------- */
.newg { display: grid; gap: 20px; }
.newg > * { min-width: 0; }
.tips ul { margin: 8px 0 0; padding-left: 1.2rem; }
.tips li { margin: 6px 0; }
.tips-toggle summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.tips-panel { display: none; }
.recorder { display: flex; flex-direction: column; align-items: center; padding: 16px 0; max-width: 520px; margin: 0 auto; }
.mic { --level: 0; width: 170px; height: 170px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; margin-top: 16px;
  box-shadow: 0 0 0 calc(6px + var(--level) * 34px) color-mix(in srgb, var(--accent) 16%, transparent); transition: box-shadow .08s linear; }
.mic span { width: 104px; height: 104px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 40px; }
.mic.off { box-shadow: none; }
.mic.off span { background: var(--muted); }
.timer { font: 600 2.4rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 24px 0 4px; font-variant-numeric: tabular-nums; }
.recorder .err { max-width: 420px; margin-top: 12px; }
.actions-row { width: 100%; max-width: 420px; margin-top: 24px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); margin: 16px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .mic { transition: none; } }

/* ---------- Conversation ---------- */
.title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.convg { display: grid; }
.convg > * { min-width: 0; }
.fail-title { color: var(--bad); margin: 0; }
.turns { list-style: none; padding: 0; margin: 16px 0 0; }
.turns li { display: flex; gap: 12px; margin-top: 14px; }
.turns .t { width: 48px; flex: none; color: var(--muted); font: .75rem ui-monospace, monospace; padding-top: 3px; }
.turns p { margin: 0; overflow-wrap: anywhere; }
.who { font-size: .75rem; font-weight: 700; }
.who.a { color: var(--link); } .who.b { color: var(--ok); }
.transcript { margin-top: 20px; }
.transcript > summary { cursor: pointer; font-weight: 600; padding: 8px 0; min-height: 44px; }

/* "Your app" (issue #4) */
.app { margin-top: 20px; }
.app-title { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; margin: 0 0 10px; }
.app .steps { list-style: none; padding: 0; margin: 0 0 8px; color: var(--ink); }
.app .steps li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.app .dot { width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; margin-top: 2px; border: 2px solid var(--line); color: var(--muted); }
.app .done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.app .now .dot { border-color: var(--accent); border-top-color: transparent; animation: spin 1s linear infinite; }
.app .failed .dot { background: var(--bad); border-color: var(--bad); color: #fff; }
.app .you .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.app .waiting .lab { color: var(--muted); }
.app .lab small { display: block; color: var(--muted); font-size: .8rem; }
@media (prefers-reduced-motion: reduce) { .app .now .dot { animation: none; } }
.plan { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 10px 0; }
.plan .chrome { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); padding: 4px 10px; border-bottom: 1px solid var(--line); background: var(--bg); }
.plan .chrome a { display: inline-flex; align-items: center; min-height: 36px; }
.plan iframe { display: block; width: 100%; height: 60vh; min-height: 360px; border: 0; background: #fff; }
.decide { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: start; }
.decide > :only-child, .decide .changes[open] { grid-column: 1 / -1; }
.approve-form { margin: 0; }
.approve-form .btn, .changes summary { width: 100%; }
.changes summary { list-style: none; }
.changes summary::-webkit-details-marker { display: none; }
.changes[open] summary { margin-bottom: 10px; }
.link-card { display: block; border: 1px solid var(--ok); border-radius: 12px; padding: 12px; margin: 10px 0; color: var(--ink); overflow-wrap: anywhere; text-decoration: none; background: color-mix(in srgb, var(--ok) 10%, var(--card)); }
.note { border-radius: 10px; background: var(--accent-soft); padding: 10px 12px; font-size: .9rem; margin: 10px 0; }
.rounds { font-size: .85rem; color: var(--muted); }
dialog.confirm { border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); max-width: 420px; width: calc(100% - 32px); padding: 18px; }
dialog.confirm::backdrop { background: rgba(35, 29, 23, .35); }

/* ---------- Tablet 640–1199px ---------- */
@media (min-width: 640px) {
  .wrap { padding-left: 32px; padding-right: 32px; }
  .convs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; border: 0; background: none; overflow: visible; border-radius: 0; }
  .convs li + li { border-top: 0; }
  .conv { flex-direction: column; align-items: stretch; justify-content: space-between; min-height: 132px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
  .conv .badges { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
  .decide { grid-template-columns: 1fr 1fr; }
  .plan iframe { height: 520px; }
  .auth-form.card { border: 1px solid var(--line); background: var(--card); padding: 32px; margin-top: 24px; }
}

/* ---------- Desktop ≥1200px (designed at 1920px) ---------- */
@media (min-width: 1200px) {
  .wrap { padding-left: 48px; padding-right: 48px; }
  h1 { font-size: 2rem; }
  .land { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 72px; }
  .land h1 { font-size: 3rem; max-width: 16ch; }
  .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: stretch; min-height: calc(100dvh - 120px); }
  .auth-form.card { align-self: center; margin: 0; justify-self: center; }
  .welcome { display: flex; flex-direction: column; justify-content: center; }
  .convs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .newg { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 48px; align-items: start; }
  .tips-toggle { display: none; }
  .tips-panel { display: block; position: sticky; top: 24px; }
  .recording .newg { grid-template-columns: minmax(0, 1fr); }
  .convg { grid-template-columns: minmax(0, 1.7fr) minmax(380px, 1fr); gap: 32px; align-items: start; }
  .convg .plan iframe { height: max(640px, calc(100dvh - 420px)); }
  .txpanel { position: sticky; top: 24px; max-height: calc(100dvh - 48px); overflow: auto; }
}
/* While recording, the recorder stands alone on every size. */
.recording .tips-panel, .recording .tips-toggle { display: none !important; }

/* ---------- Publish to live (issue #15) ---------- */
.topnav { display: flex; align-items: center; gap: 14px; }
@media (max-width: 639px) { .topnav .inline .muted, .topnav .inline .sep { display: none; } }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin: 6px 0; }
.row-actions > * { flex: 1 1 100%; }
.row-actions form { margin: 0; } .row-actions form .btn, .row-actions > .btn { width: 100%; }
.publish summary { list-style: none; width: 100%; }
.publish summary::-webkit-details-marker { display: none; }
.publish[open] summary { margin-bottom: 4px; }
.publish .addr { color: var(--ink); overflow-wrap: anywhere; }
.note.bad { background: color-mix(in srgb, var(--bad) 10%, var(--card)); border-left: 4px solid var(--bad); }
.spinner.sm { width: 18px; height: 18px; margin: 0 6px 0 0; display: inline-block; vertical-align: -3px; border-width: 3px; }
@media (min-width: 640px) { .row-actions > * { flex: 1 1 0; } .publish[open] { flex-basis: 100%; } }

/* ---------- Admin portal (issue #15). Mobile first: bottom tabs; tablet: icon rail; desktop: sidebar. ---------- */
body.admin { background: #f3eee6; }
.ap { --side: #1f1a15; --side-2: #2c251f; --side-ink: #e8dfd2; --side-mute: #a39686; --canvas: #f3eee6; --panel: #fffdf9; --row: #faf6ef;
  --ok-soft: color-mix(in srgb, var(--ok) 12%, #fff); --wait-soft: color-mix(in srgb, var(--wait) 14%, #fff); --bad-soft: color-mix(in srgb, var(--bad) 10%, #fff);
  display: grid; grid-template-columns: 1fr; min-height: 100dvh; background: var(--canvas); font-size: 14px; }
.ap * { min-width: 0; }
.ap a { color: var(--link); }
.ap h1 { font-size: 22px; margin: 0; line-height: 1.25; }
.ap h2 { font-size: 15px; margin: 0; }
.ap .muted { color: var(--muted); } .ap .small { font-size: 13px; }
.ap-side { position: sticky; bottom: 0; order: 2; z-index: 5; display: flex; background: var(--side); color: var(--side-ink); padding: 4px 6px; border-top: 1px solid #3a3129; }
.ap-brand, .ap-sec, .ap-me, .ap-side .ext { display: none; }
.ap-chip { font-size: 10px; letter-spacing: .14em; background: var(--accent); color: #fff; padding: 2px 7px; border-radius: 4px; }
.ap-nav { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: 8px; color: var(--side-ink) !important; text-decoration: none; font-size: 11px; font-weight: 500; }
.ap-nav:hover, .ap-nav.on { background: var(--side-2); color: #fff !important; }
.ap-nav.on::before { content: ""; position: absolute; left: 25%; right: 25%; top: -4px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.ap-nav svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ap-nav .n { position: absolute; top: 4px; right: calc(50% - 24px); background: var(--accent); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 0 6px; }
.ap-out { background: none; border: 0; padding: 0; color: var(--side-mute); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; min-height: 44px; }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.av.lg { width: 56px; height: 56px; font-size: 20px; }
.ap-main { display: flex; flex-direction: column; }
.ap-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; background: var(--side); color: var(--side-ink); }
.ap-menu { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ap-menu::before { content: ""; width: 24px; height: 24px; border-radius: 6px; background: var(--accent); }
.crumb { display: none; gap: 8px; align-items: center; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb a { color: var(--muted); text-decoration: none; } .crumb b { color: var(--ink); }
.ap-search { order: 3; width: 100%; margin: 0; position: relative; }
.ap-search input { width: 100%; min-height: 44px; padding: 0 12px 0 34px; border-radius: 8px; border: 1px solid #3a3129; background: var(--side-2); color: #fff; font: inherit; }
.ap-search::before { content: "⌕"; position: absolute; left: 12px; top: 10px; color: var(--side-mute); font-size: 16px; }
.env { font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 4px; padding: 3px 8px; letter-spacing: .06em; margin-left: auto; }
.ap-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.ap-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ap-title p { margin: 4px 0 0; color: var(--muted); }
.ap-note { margin: 0; padding: 10px 14px; border-radius: 8px; border-left: 4px solid var(--ok); background: var(--ok-soft); }
.ap-note.warn { border-color: var(--wait); background: var(--wait-soft); } .ap-note.bad { border-color: var(--bad); background: var(--bad-soft); }
.ap-empty { padding: 24px 16px; margin: 0; color: var(--muted); text-align: center; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; }
.kpi small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 22px; line-height: 1.2; }
.kpi span { font-size: 12px; color: var(--muted); } .kpi span.up { color: var(--ok); } .kpi span.warn { color: var(--wait); font-weight: 600; }
.kpi.hl { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.panel-h { display: flex; align-items: center; gap: 8px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-h h2 { margin-right: auto; }
.panel-b { padding: 16px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; background: var(--canvas); max-width: 100%; }
.seg a { flex: none; padding: 0 12px; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; border-right: 1px solid var(--line); white-space: nowrap; }
.seg a:last-child { border-right: 0; } .seg a.on { background: var(--panel); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.seg i { font-style: normal; font-size: 11px; color: var(--muted); }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; width: 100%; }
.tools .tool[type="search"] { flex: 1 1 160px; }
.tool { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font: inherit; font-size: 13px; color: var(--ink); }
.ap table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ap thead { display: none; }
.ap tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ap tbody tr:last-child { border-bottom: 0; }
.ap td { display: block; padding: 0; vertical-align: middle; }
.ap td.hm { display: none; } .ap td.full { grid-column: 1 / -1; }
.ap td .sub { display: block; font-size: 12px; color: var(--muted); }
.ap td b, .ap td .mono { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.mono-cell a { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.who { display: flex; gap: 10px; align-items: center; }
.ap .dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.ap .dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.d-ok { color: var(--ok); } .d-wait { color: var(--wait); } .d-bad { color: var(--bad); } .d-off { color: #7d7368; } .d-acc { color: var(--accent); } .d-prev { color: #6a5f8a; }
.age { font-size: 12px; } .age.old { color: var(--bad); font-weight: 700; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.acts > *, .acts form { flex: 1 1 auto; margin: 0; } .acts form .b2, .acts > .b2 { width: 100%; }
.b2 { min-height: 44px; padding: 0 12px; border-radius: 7px; font: 600 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; border: 1px solid var(--line); background: var(--panel); color: var(--ink) !important; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.b2.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) !important; }
.b2.ok { background: var(--ok); border-color: var(--ok); color: #fff !important; }
.b2.bad { color: var(--bad) !important; border-color: color-mix(in srgb, var(--bad) 35%, #fff); }
.b2.bad.fill { background: var(--bad); color: #fff !important; border-color: var(--bad); }
.b2.off, .b2:disabled { opacity: .5; cursor: default; }
.lnk { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; }
.inl { display: inline; margin: 0; }
.rej { position: relative; }
.rej summary { list-style: none; width: 100%; } .rej summary::-webkit-details-marker { display: none; }
.rej-pop { display: grid; gap: 6px; margin-top: 8px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.rej-pop label, .field label { font-weight: 600; font-size: 12.5px; }
.ap textarea, .ap input[type=text], .ap input[type=email], .ap input[type=password] { width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; min-height: 44px; color: var(--ink); }
.ap textarea { min-height: 90px; }
.hint { font-size: 12px; color: var(--muted); }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pager span:first-child { margin-right: auto; }
.props { display: grid; grid-template-columns: 110px 1fr; margin: 0 0 14px; }
.props dt, .props dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
.props dt { color: var(--muted); font-size: 12.5px; } .props dd { overflow-wrap: anywhere; }
.props > :nth-last-child(-n+2) { border-bottom: 0; }
.props .sub { display: block; font-size: 12px; color: var(--muted); }
.split { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.ap .stack { display: grid; gap: 16px; margin: 0; }
.idhead { display: flex; gap: 14px; align-items: center; } .idhead p { margin: 2px 0 0; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 14px 22px; font-size: 13px; }
.tl li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tl li::after { content: ""; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl small { display: block; color: var(--muted); }
.txl { display: grid; gap: 10px; max-height: 70dvh; overflow: auto; }
.turn { display: grid; grid-template-columns: 72px 1fr; gap: 10px; font-size: 14px; }
.turn b { font-size: 12px; color: var(--accent); padding-top: 2px; } .turn.b-side b { color: #6a5f8a; }
.turn time { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--wait-soft); border: 1px solid color-mix(in srgb, var(--wait) 30%, #fff); border-radius: 10px; flex-wrap: wrap; }
.dz { border-color: color-mix(in srgb, var(--bad) 25%, #fff); } .dz .panel-h { background: color-mix(in srgb, var(--bad) 5%, #fff); border-radius: 10px 10px 0 0; }
.dz-row { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dz-row:first-child { padding-top: 0; } .dz-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dz-row p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.del summary { list-style: none; } .del summary::-webkit-details-marker { display: none; }
.del-form { display: grid; gap: 8px; margin-top: 10px; }
dialog.ap-dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); max-width: 440px; width: calc(100% - 32px); padding: 20px; font-size: 15px; }
dialog.ap-dialog::backdrop { background: rgba(31, 26, 21, .45); }
dialog.ap-dialog p { margin: 0 0 16px; }
dialog.ap-dialog .acts { justify-content: flex-end; }

@media (min-width: 640px) {
  .ap { grid-template-columns: 68px minmax(0, 1fr); }
  .ap-side { position: sticky; top: 0; bottom: auto; order: 0; height: 100dvh; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; border-top: 0; }
  .ap-brand { display: flex; align-items: center; padding: 6px 0 16px; }
  .ap-brand::before { content: ""; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); }
  .ap-brand span { display: none; }
  .ap-side a.ext { display: flex; }
  .ap-nav { flex: none; width: 48px; min-height: 44px; font-size: 0; }
  .ap-nav span { display: none; }
  .ap-nav .n { top: 2px; right: -4px; font-size: 10px; }
  .ap-nav.on::before { left: -10px; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .ap-me { display: flex; margin-top: auto; padding-top: 12px; border-top: 1px solid #3a3129; }
  .ap-me div { display: none; }
  .ap-head { flex-wrap: nowrap; height: 60px; padding: 0 20px; background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line); }
  .ap-menu { display: none; }
  .crumb { display: flex; }
  .ap-search { order: 0; width: 240px; margin-left: auto; }
  .ap-search input { min-height: 40px; background: var(--canvas); border-color: var(--line); color: var(--ink); }
  .ap-search::before { top: 8px; color: var(--muted); }
  .env { margin-left: 0; }
  .ap-body { padding: 24px 20px 40px; gap: 18px; }
  .kpis { gap: 12px; } .kpi b { font-size: 26px; }
  .ap thead { display: table-header-group; }
  .ap tr { display: table-row; padding: 0; }
  .ap tbody tr:hover td { background: #fbf4ea; }
  .ap th { text-align: left; background: var(--row); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 16px; white-space: nowrap; border-bottom: 1px solid var(--line); }
  .ap td { display: table-cell; padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .ap tbody tr:last-child td { border-bottom: 0; }
  .ap td.hm { display: table-cell; }
  .ap td.t-hide, .ap th.t-hide { display: none; }
  .acts { flex-wrap: wrap; justify-content: flex-end; }
  .acts > *, .acts form { flex: none; }
  .acts form .b2, .acts > .b2 { width: auto; }
  .tools { width: auto; }
  .rej-pop { position: absolute; right: 0; z-index: 10; width: 320px; text-align: left; }
  .dz-row { flex-direction: row; justify-content: space-between; align-items: center; }
  .dz-row.col { flex-direction: column; align-items: stretch; }
  .note-cell { max-width: 260px; }
}
@media (min-width: 1200px) {
  .ap { grid-template-columns: 232px minmax(0, 1fr); }
  .ap-side { align-items: stretch; padding: 16px 12px; }
  .ap-brand { gap: 8px; padding: 6px 4px 18px; font-weight: 700; font-size: 14px; white-space: nowrap; }
  .ap-brand span { display: inline; }
  .ap-sec { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--side-mute); padding: 14px 10px 6px; }
  .ap-nav { width: auto; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 0 10px; font-size: 14px; }
  .ap-nav span { display: inline; }
  .ap-nav .n { position: static; margin-left: auto; font-size: 11px; padding: 1px 8px; }
  .ap-nav.on::before { left: -12px; }
  .ap-me { gap: 10px; align-items: center; padding: 14px 8px 0; }
  .ap-me div { display: block; }
  .ap-head { padding: 0 28px; }
  .ap-search { width: 320px; }
  .ap-body { padding: 24px 28px 40px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ap td.t-hide, .ap th.t-hide { display: table-cell; }
  .acts { flex-wrap: nowrap; }
  .split { grid-template-columns: 340px minmax(0, 1fr); gap: 18px; }
  .split.r { grid-template-columns: minmax(0, 1fr) 380px; }
}

/* ---------- Idea check questions (issue #14) ---------- */
.questions { border: 1px solid var(--line); border-left: 4px solid var(--wait); border-radius: 12px; padding: 14px 16px; margin: 12px 0; background: var(--card); }
.questions ol { margin: 6px 0 4px; padding-left: 1.3rem; } .questions li { margin: 4px 0; overflow-wrap: anywhere; }
.ap .qh { font-size: 13px; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ap .checks { list-style: none; margin: 0; padding: 0; } .ap .checks li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; overflow-wrap: anywhere; }
.ap .checks li:last-child { border-bottom: 0; } .ap .checks .sub { display: block; font-size: 12px; color: var(--muted); }
.ap .qa ol { margin: 4px 0; padding-left: 1.2rem; font-size: 13px; } .ap .qa .sub { font-size: 12px; color: var(--muted); margin: 0 0 8px; overflow-wrap: anywhere; }
.setup-checks span { display: inline-block; margin: 0 8px 4px 0; font-size: 12.5px; }

/* ---------- Phone app card (issue #26) ---------- */
.appcol > .card:first-child { margin-top: 16px; }
.phone .ph-q { font-weight: 600; margin: 0 0 10px; }
.phone .dev { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.phone .dev button { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.phone .dev button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.phone .dev svg { width: 26px; height: 26px; flex: none; }
.phone .dev small { display: block; color: var(--muted); font-size: 12.5px; }
.ic-android { fill: var(--ok); } .ic-apple { fill: var(--ink); }
.phone .nojs { font-size: 1rem; margin: 14px 0 6px; }
.phone .btn.big { min-height: 54px; font-size: 1.05rem; }
.phone .dl { margin: 4px 0 6px; }
.phone .facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; }
.phone .steps { margin: 14px 0 8px; padding-left: 1.4rem; display: grid; gap: 8px; }
.phone .warn { border-left: 3px solid var(--wait); background: color-mix(in srgb, var(--wait) 12%, var(--card)); border-radius: 0 10px 10px 0; padding: 8px 12px; margin: 10px 0; }
.phone .fp summary { cursor: pointer; color: var(--link); font-size: .9rem; }
.phone .fp code { display: block; margin-top: 6px; font: 12.5px ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; background: var(--hero); padding: 8px 10px; border-radius: 8px; }
.phone .ios-note { background: var(--hero); border-radius: 14px; padding: 12px 14px; }
.phone [hidden] { display: none !important; }
