/* The IAS Project — a scholarly, paper-and-ink interface. Saffron for action, teal for progress, violet reserved for AI. */
:root {
  --paper: #f6f3ec; --surface: #fffdf8; --surface-2: #f0ebe0; --ink: #1c2230; --ink-2: #3a4150; --muted: #6a7080; --line: #e2dccd; --line-2: #d3cbb8;
  --accent: #b8501a; --accent-ink: #fff; --accent-soft: #f6e3d6; --teal: #1e5c58; --teal-soft: #dcebe8;
  --good: #2c7a4b; --good-soft: #e0f0e6; --warn: #9c6a12; --warn-soft: #f6ecd5; --bad: #b0281f; --bad-soft: #f7e0dd;
  --ai: #5a49b3; --ai-soft: #ebe7fa;
  --radius: 10px; --shadow: 0 1px 2px rgba(28,34,48,.05), 0 4px 16px rgba(28,34,48,.05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --paper:#14171d; --surface:#1b1f27; --surface-2:#222731; --ink:#ece8de; --ink-2:#cfcabd; --muted:#9a9fab; --line:#2d333f; --line-2:#3a4150; --accent:#e07a3c; --accent-soft:#3a2518; --teal:#5fb3ac; --teal-soft:#183331; --good:#5cc08a; --good-soft:#173324; --warn:#e0b050; --warn-soft:#342a14; --bad:#f07468; --bad-soft:#3a1c1a; --ai:#a596ff; --ai-soft:#262040; color-scheme: dark; } }
:root[data-theme="dark"] { --paper:#14171d; --surface:#1b1f27; --surface-2:#222731; --ink:#ece8de; --ink-2:#cfcabd; --muted:#9a9fab; --line:#2d333f; --line-2:#3a4150; --accent:#e07a3c; --accent-soft:#3a2518; --teal:#5fb3ac; --teal-soft:#183331; --good:#5cc08a; --good-soft:#173324; --warn:#e0b050; --warn-soft:#342a14; --bad:#f07468; --bad-soft:#3a1c1a; --ai:#a596ff; --ai-soft:#262040; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.85rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
p { margin: 0 0 .8em; } small, .muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: .88em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

/* ── Layout ── */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.15rem; font-weight: 700; margin: 0 6px 18px; color: var(--ink); text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: .9rem; letter-spacing: .02em; }
.brand small { display: block; font: 500 .7rem var(--sans); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.nav-group { margin: 14px 0 4px; padding: 0 8px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a .ico { width: 18px; text-align: center; opacity: .8; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 10px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; }
.top .grow { flex: 1; }
.content { padding: 26px 28px 60px; max-width: 1180px; }
.role-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.role-switch button { border: 0; background: transparent; padding: 5px 12px; font: 500 .82rem var(--sans); color: var(--muted); cursor: pointer; }
.role-switch button.on { background: var(--ink); color: var(--paper); }
.menu-btn { display: none; }

/* ── Primitives ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; font: 600 .88rem var(--sans); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.sm { padding: 5px 10px; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { position: relative; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; font-size: 1rem; }
.dot { position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff; font-size: .65rem; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: .3em; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 12px; } .stack-sm > * + * { margin-top: 6px; }
.section { margin-top: 28px; } .section > h2 { margin-bottom: 12px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 0; color: var(--muted); }
.kicker { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 4px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.ai { background: var(--ai-soft); color: var(--ai); border-color: transparent; }
.badge.verified::before { content: "✓"; font-weight: 800; }
.ai-banner { background: var(--ai-soft); color: var(--ai); border-radius: 8px; padding: 9px 12px; font-size: .85rem; font-weight: 500; display: flex; gap: 8px; align-items: flex-start; }
.ai-banner::before { content: "AI"; font: 800 .65rem var(--sans); background: var(--ai); color: #fff; border-radius: 4px; padding: 2px 5px; margin-top: 2px; }

.stat { padding: 14px 16px; }
.stat .v { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .8rem; margin-top: 2px; }

/* ── Forms ── */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }

/* ── Tables & lists ── */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.list > .item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list > .item:last-child { border-bottom: 0; }
.item .t { font-weight: 600; } .item .s { font-size: .82rem; color: var(--muted); }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty b { display: block; color: var(--ink-2); font-family: var(--serif); font-size: 1.05rem; margin-bottom: 4px; }

/* ── Tiles ── */
.tile { display: flex; flex-direction: column; gap: 8px; }
.tile .meta { font-size: .8rem; color: var(--muted); }
.tile .price { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.tile .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.thumb { aspect-ratio: 16/8; border-radius: 8px; background: linear-gradient(135deg, var(--teal-soft), var(--accent-soft)); display: grid; place-items: center; color: var(--teal); font-family: var(--serif); font-size: 1.05rem; text-align: center; padding: 10px; position: relative; overflow: hidden; }
.thumb .dur { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font: 600 .7rem var(--sans); padding: 2px 6px; border-radius: 4px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; flex: none; }
img.avatar { object-fit: cover; padding: 0; background: var(--line); }
.avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar.ai { background: var(--ai); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; box-shadow: 0 0 0 3px var(--good-soft); }
.stars { color: var(--warn); letter-spacing: 1px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--teal); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); font-weight: 600; font-size: .88rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--accent); text-decoration: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 4px 11px; font-size: .82rem; cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.slot { border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; background: var(--surface); cursor: pointer; font: 600 .82rem var(--sans); }
.slot:hover, .slot.on { border-color: var(--accent); color: var(--accent); }

/* ── Notes / workspace ── */
.note-body { white-space: pre-wrap; font-family: var(--serif); font-size: 1.02rem; line-height: 1.7; }
.tree details { border-bottom: 1px solid var(--line); padding: 6px 0; }
.tree summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.tree a { display: flex; justify-content: space-between; padding: 4px 0 4px 14px; color: var(--ink-2); }
.topic-section h4 { display: flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }

/* ── Chat / room ── */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px; }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: var(--teal); color: #fff; }
.msg.ai { background: var(--ai-soft); border: 1px solid color-mix(in srgb, var(--ai) 25%, transparent); }
.msg .who { font-size: .72rem; font-weight: 700; opacity: .75; margin-bottom: 2px; }
.room-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile-video { aspect-ratio: 4/3; border-radius: 12px; background: #11151c; color: #cfd6e4; display: grid; place-items: center; position: relative; }
.tile-video .name { position: absolute; left: 10px; bottom: 8px; font-size: .8rem; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 6px; }
.rec { color: #ff6b5a; font-weight: 700; font-size: .78rem; }

/* ── Modal / toast ── */
.modal-back { position: fixed; inset: 0; background: rgba(20,22,28,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; font-size: .88rem; max-width: 360px; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; } .toast.good { background: var(--good); color: #fff; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); background: var(--surface); border-left: 1px solid var(--line); z-index: 40; padding: 18px; overflow-y: auto; box-shadow: -10px 0 30px rgba(0,0,0,.1); }
.pay-box { border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px; background: var(--surface-2); }
.breakdown td { padding: 5px 0; border: 0; } .breakdown tr.total td { border-top: 1px solid var(--line); font-weight: 700; padding-top: 8px; }

/* ── Auth ── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--ink); color: var(--paper); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h1 { font-size: 2.4rem; color: var(--paper); max-width: 14ch; }
.auth-art .creed { font-family: var(--serif); font-size: 1.05rem; line-height: 1.9; opacity: .85; }
.auth-form { padding: 48px; display: flex; flex-direction: column; justify-content: center; max-width: 460px; width: 100%; margin: 0 auto; }
.demo-accounts button { text-align: left; }

/* ── Responsive ── */
@media (max-width: 960px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.2); }
  .menu-btn { display: grid; }
  .top, .content { padding-left: 16px; padding-right: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-art { padding: 28px 20px; } .auth-art h1 { font-size: 1.8rem; } .auth-form { padding: 24px 16px; }
  .room-stage { grid-template-columns: 1fr; }
  .top .hide-sm { display: none; }
}

/* PRD 1.2 §16 content protection: moving viewer watermark */
.protected-player .wm { position: absolute; pointer-events: none; user-select: none; color: #fff; opacity: .35; font: 600 .8rem/1.2 var(--sans, system-ui); text-shadow: 0 1px 2px rgba(0,0,0,.6); transition: left 1.2s ease, top 1.2s ease; white-space: nowrap; z-index: 2; }
.protected-player video::-internal-media-controls-download-button { display: none; }
.meter-big { font-family: var(--serif); font-size: 1.6rem; }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.denoms button.on { outline: 2px solid var(--accent); }
.card.warn-border{border-color:var(--bad)}

/* ── PRD 1.3 accessibility & mobile ── */
.skip-link{position:absolute;left:-999px;top:8px;z-index:1000;background:var(--ink);color:var(--paper);padding:8px 14px;border-radius:8px}
.skip-link:focus{left:8px}
:focus-visible{outline:3px solid var(--accent, #c8742c);outline-offset:2px}
#view:focus,#view h1:focus{outline:none}
.tabbar{display:none}
@media (max-width:767px){
  .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:50;background:var(--card, #fff);border-top:1px solid var(--line, #ddd);padding:4px 4px calc(4px + env(safe-area-inset-bottom))}
  .tabbar a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:.7rem;color:var(--muted, #667);text-decoration:none;padding:6px 0;min-height:44px}
  .tabbar a span{font-size:1.1rem}
  .tabbar a.active{color:var(--ink, #111);font-weight:600}
  .content{padding-bottom:84px}
}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* ── V1.3.1: ☰ works on every width — collapses the sidebar on desktop, slides it in on phones ── */
.menu-btn { display: grid; }
.app.nav-collapsed { grid-template-columns: 0 1fr; }
.app.nav-collapsed .side { visibility: hidden; padding: 0; border: 0; overflow: hidden; }
.side-backdrop { display: none; }
@media (max-width: 760px) {
  .app.nav-collapsed { grid-template-columns: 1fr; }
  .app.nav-collapsed .side { visibility: visible; padding: 18px 14px; }
  .side-backdrop.on { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 29; }
}
.auth-type { display: flex; gap: 8px; }
.auth-type label { flex: 1; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.auth-type label:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.auth-type input { margin-right: 6px; }
fieldset.field{border:0;padding:0;margin:0 0 4px}fieldset.field legend{font-weight:600;font-size:.85rem;margin-bottom:6px;padding:0}

/* Updates 1.1 — approved logo (dark ink on transparent; inverted wherever the background is dark), About, public pages */
.logo { display: block; height: auto; max-width: 100%; }
.brand .logo { width: 200px; margin: -10px 0 -6px -8px; }
.auth-art .brand .logo { width: 300px; margin: -16px 0 0 -20px; }
.logo.on-ink { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo { filter: invert(1) hue-rotate(180deg); } :root:not([data-theme="light"]) .logo.on-ink { filter: none; } }
:root[data-theme="dark"] .logo { filter: invert(1) hue-rotate(180deg); }
:root[data-theme="dark"] .logo.on-ink { filter: none; }
.nav-foot { border-top: 1px solid var(--line); margin-top: 14px; padding: 12px 10px 4px; font-size: .82rem; }
.nav-foot a { color: var(--muted); }
.about { max-width: 720px; }
.about p { font-size: 1.02rem; line-height: 1.75; }
.about-entity { margin-top: 22px; color: var(--ink-2); }
.about-credit { margin-top: 4px; font-family: var(--serif); font-style: italic; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; display: inline-block; }
.pub { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.pub-head .logo { width: 230px; margin: -10px 0 -10px -14px; }
.pub-head nav, .pub-foot nav { display: flex; gap: 16px; align-items: center; }
.pub-main { flex: 1; padding: 40px 24px; max-width: 900px; width: 100%; margin: 0 auto; }
.pub-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) { .pub-head { padding: 12px 16px; } .pub-head .logo { width: 180px; } .pub-main { padding: 24px 16px; } .pub-foot { padding: 16px; } }

/* Lean launch — floating live-call window (LiveKit / Jitsi); survives page re-renders */
.media-dock { position: fixed; right: 16px; bottom: 16px; width: min(520px, calc(100vw - 32px)); height: min(380px, 60vh); z-index: 60; background: #0f1115; color: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.media-dock.min { height: 44px; }
.media-dock.min .media-body { display: none; }
.media-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #1b1e25; font-size: .88rem; }
.media-head .btn { color: #fff; border-color: #3a3f4a; }
.media-body { position: relative; flex: 1; min-height: 0; }
.media-body iframe { border: 0; }
.mtile.remote { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.mtile.remote video { width: 100%; height: 100%; object-fit: cover; }
.mtile.local { position: absolute; right: 10px; bottom: 52px; width: 28%; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; border: 2px solid #fff3; background: #222; }
.mtile.local video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.media-ctrl { position: absolute; left: 10px; bottom: 10px; gap: 6px; }
.media-ctrl .btn { background: #2a2e37; color: #fff; border-color: #3a3f4a; }
@media (max-width: 640px) { .media-dock { right: 8px; left: 8px; bottom: 8px; width: auto; height: 52vh; } }

/* Simplified navigation (27 Nov 2026): core actions highlighted, extras in a collapsible "More" */
.nav-group.core { color: var(--accent); }
.nav-core a { font-weight: 600; }
.nav-core a .ico { color: var(--accent); }
button.nav-more { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 8px); background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; margin-left: 0; }
button.nav-more:hover { color: var(--ink); }
.nav-more-items a { font-size: .9rem; padding-top: 6px; padding-bottom: 6px; }
/* Home: three core actions */
.core-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 6px 0 26px; }
.core-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; min-height: 170px; }
.core-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.08); border-color: var(--accent); }
.core-card .ci { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--accent-soft, #eef3ff); color: var(--accent); }
.core-card h2 { margin: 4px 0 0; font-size: 1.25rem; }
.core-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.core-card .go { margin-top: auto; font-weight: 600; color: var(--accent); }
.core-card.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.core-card.primary p { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.core-card.primary .ci { background: color-mix(in srgb, var(--paper) 15%, transparent); color: var(--paper); }
.core-card.primary .go { color: var(--paper); }
.online-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; }
@media (max-width: 860px) { .core-actions { grid-template-columns: 1fr; } .core-card { min-height: 0; } }
/* v1.7.1 (owner): make "More" clearly visible — bold, larger, ink colour, subtle box */
button.nav-more { font-size: .92rem; font-weight: 700; letter-spacing: .02em; color: var(--ink); text-transform: none; padding: 9px 12px; margin: 10px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
button.nav-more:hover { border-color: var(--accent); color: var(--accent); }
button.nav-more[aria-expanded="true"] { border-color: var(--accent); }
/* v1.11 marketing */
.offer-banner { border-left: 4px solid var(--accent); margin-bottom: 14px; }
.mini-chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; margin: 10px 0 4px; }
.mc-col { flex: 1; display: flex; align-items: flex-end; gap: 1px; height: 100%; min-width: 0; }
.mc-a, .mc-b { flex: 1; min-height: 1px; border-radius: 2px 2px 0 0; }
.mc-a, .dot-a { background: var(--accent); } .mc-b, .dot-b { background: var(--teal); }
.dot-a, .dot-b { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.wf-steps { margin: 8px 0; padding-left: 20px; } .wf-steps li { margin: 2px 0; }
.counsel h1 { font-size: 1.6rem; }
[hidden] { display: none !important; }
.wf-main { flex: 1; min-width: 0; }
.share-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.reminder { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.reminder:last-child { border-bottom: 0; }
.rem-high { color: var(--bad); } .rem-medium { color: var(--warn); } .rem-low { color: var(--muted); }
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.15); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie-bar p { margin: 0; font-size: .88rem; flex: 1 1 320px; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
.testi { font-style: italic; }

/* ══════════ v1.13 visual refresh (owner, 5 Dec 2026) ══════════
   Warm "notebook paper" look: cream paper, terracotta for action, forest green for progress. No navy.
   Bigger, calmer type; more space; line icons; one main action per screen. */
:root {
  --paper: #f8f3ea; --surface: #fffdf9; --surface-2: #f3ece0; --ink: #2b2420; --ink-2: #4a3f38; --muted: #7a6d63;
  --line: #eadfcd; --line-2: #dccfb9; --accent: #b4532a; --accent-ink: #fff; --accent-soft: #f8e6da;
  --teal: #2f6b55; --teal-soft: #e1eee7; --good: #2f7d4f; --good-soft: #e2f1e7; --warn: #a06a10; --warn-soft: #f7ecd4;
  --bad: #b3362b; --bad-soft: #f8e1dd; --ai: #6a4fb8; --ai-soft: #eee8fa;
  --radius: 14px; --shadow: 0 1px 2px rgba(60,40,20,.05), 0 6px 22px rgba(60,40,20,.06);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --paper:#17130f; --surface:#211b16; --surface-2:#2a231d; --ink:#f2e9dd; --ink-2:#d9cdbd; --muted:#a69786; --line:#3a3027; --line-2:#4a3d31; --accent:#e58a55; --accent-soft:#3d2618; --teal:#79b89c; --teal-soft:#1d3229; --good:#6cc28f; --good-soft:#1b3324; --warn:#e3b45a; --warn-soft:#352a14; --bad:#f07a6d; --bad-soft:#3b1d19; --ai:#b2a0ff; --ai-soft:#2a2242; } }
:root[data-theme="dark"] { --paper:#17130f; --surface:#211b16; --surface-2:#2a231d; --ink:#f2e9dd; --ink-2:#d9cdbd; --muted:#a69786; --line:#3a3027; --line-2:#4a3d31; --accent:#e58a55; --accent-soft:#3d2618; --teal:#79b89c; --teal-soft:#1d3229; --good:#6cc28f; --good-soft:#1b3324; --warn:#e3b45a; --warn-soft:#352a14; --bad:#f07a6d; --bad-soft:#3b1d19; --ai:#b2a0ff; --ai-soft:#2a2242; }
html, body { font-size: 16px; line-height: 1.6; }
h1 { font-size: 2rem; } h2 { font-size: 1.32rem; }
.card { border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.btn { min-height: 42px; border-radius: 10px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn.sm { min-height: 34px; }
.btn.primary { box-shadow: 0 2px 8px rgba(180,83,42,.25); }
input, select, textarea { border-radius: 10px; min-height: 42px; font-size: 1rem; }
.content { max-width: 1120px; }
.section { margin-top: 26px; }
.ico { vertical-align: -0.2em; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* navigation */
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-weight: 500; }
.nav-ico { display: inline-flex; color: var(--muted); }
.nav a.active .nav-ico, .nav a:hover .nav-ico { color: var(--accent); }
.nav a.active { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
@media (max-width:767px){
  .tabbar { background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(60,40,20,.06); }
  .tabbar a { font-size: .74rem; gap: 3px; padding: 6px 0; border-radius: 12px; }
  .tabbar a.active { color: var(--accent); background: var(--accent-soft); }
  .content { padding-bottom: 96px; }
}
/* Ask hero */
.ask-hero { background: linear-gradient(160deg, var(--surface) 0%, var(--accent-soft) 140%); border: 1px solid var(--line); border-radius: 20px; padding: 26px 24px 18px; box-shadow: var(--shadow); }
.ask-hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 4px 0 14px; }
.ask-box { background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 16px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
.ask-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ask-box textarea { border: 0; width: 100%; resize: vertical; min-height: 60px; background: transparent; padding: 6px 4px; font-size: 1.08rem; outline: none; box-shadow: none; }
.ask-tools { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ask-tools .icon-btn { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); cursor: pointer; background: var(--surface-2); border: 0; }
.ask-tools .icon-btn.listening { background: var(--bad-soft); color: var(--bad); animation: pulse 1.2s infinite; }
.mini-select { min-height: 34px; width: auto; padding: 4px 8px; font-size: .85rem; }
.examples { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .88rem; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; display: inline-flex; }
.ask-results { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.ask-results h3 { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; }
.ask-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
@media (max-width: 760px) { .ask-grid { grid-template-columns: 1fr; } .ask-hero { padding: 20px 16px 14px; } }
.ask-expert { margin-bottom: 10px; }
.grow { flex: 1; min-width: 0; }
/* live ring around online experts */
.ring-live { position: relative; display: inline-flex; border-radius: 50%; padding: 3px; background: conic-gradient(var(--good), #9be3b7, var(--good)); animation: spin 4s linear infinite; }
.ring-live > * { border: 2px solid var(--surface); border-radius: 50%; animation: spin 4s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--bad-soft); } }
@media (prefers-reduced-motion: reduce) { .ring-live, .ring-live > * { animation: none; } }
.online-strip { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x mandatory; }
.online-person { display: flex; flex-direction: column; align-items: center; gap: 6px; color: inherit; scroll-snap-align: start; min-width: 66px; }
.online-person:hover { text-decoration: none; }
.tile-link { display: flex; flex-direction: column; gap: 8px; color: inherit; }
.tile-link b { color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }
.tile-link:hover { text-decoration: none; border-color: var(--accent); }
/* daily question */
.daily .opt { display: block; width: 100%; text-align: left; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; }
.daily .opt:hover:not([disabled]) { border-color: var(--accent); }
.daily .opt.right { border-color: var(--good); background: var(--good-soft); }
.daily .opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.streak { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; }
/* journey */
.journey { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 10px 0 16px; counter-reset: j; }
.journey li { position: relative; text-align: center; font-size: .82rem; color: var(--muted); padding-top: 26px; }
.journey li span { position: absolute; top: 4px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line-2); z-index: 1; }
.journey li::before { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--line-2); }
.journey li:first-child::before { display: none; }
.journey li.done span { background: var(--teal); border-color: var(--teal); } .journey li.done::before, .journey li.now::before { background: var(--teal); }
.journey li.now { color: var(--ink); font-weight: 700; } .journey li.now span { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.journey-stats > div { display: flex; flex-direction: column; } .journey-stats b { font-size: 1.3rem; font-family: var(--serif); } .journey-stats small { font-size: .78rem; }
/* hubs */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.hub-tile { display: flex; flex-direction: column; gap: 6px; color: inherit; transition: transform .12s, border-color .12s; }
.hub-tile .ico { color: var(--accent); margin-bottom: 4px; }
.hub-tile:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
/* onboarding chips */
.chip-opt input { position: absolute; opacity: 0; }
.chip-opt span { display: inline-block; border: 1.5px solid var(--line-2); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.chip-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.chip-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* help button */
.help-fab { position: fixed; right: 18px; bottom: 18px; z-index: 45; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--accent); box-shadow: var(--shadow); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width:767px){ .help-fab { bottom: 84px; right: 12px; width: 42px; height: 42px; } }
/* celebration */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .2; } }
/* expert online switch */
.big-switch { display: inline-flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; }
.big-switch input { position: absolute; opacity: 0; }
.big-switch .knob { width: 52px; height: 30px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; flex-shrink: 0; }
.big-switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.big-switch.on { border-color: var(--good); background: var(--good-soft); } .big-switch.on .knob { background: var(--good); } .big-switch.on .knob::after { left: 25px; }
.big-switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.big-switch small { display: block; color: var(--muted); }
.badge.teal { background: var(--teal-soft); color: var(--teal); display: inline-flex; align-items: center; gap: 3px; }
@media (max-width: 760px) { .examples { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .examples .chip { white-space: nowrap; } }
