/* MIVA Liquid Glass: MFCC Spatial Glass panels on a luminous ice field, approved MIVA blue and MFCC violet. */
:root {
  --field-a:#EEF3FF; --field-b:#F6F1FF; --aura-1:rgba(28,109,242,.20); --aura-2:rgba(123,97,255,.18);
  --glass:rgba(255,255,255,.56); --glass-deep:rgba(255,255,255,.66); --edge:rgba(255,255,255,.85);
  --hi:rgba(255,255,255,.95); --shadow:rgba(30,40,90,.28);
  --ink:#18203F; --muted:#5E6584; --hair:rgba(24,32,63,.10);
  --blue:#1C6DF2; --violet:#7B61FF; --on-accent:#fff;
  --ok:#21835A; --work:#1C6DF2; --wait:#9A6A00; --bad:#C8344C; --idle:#6F7891; --off:#4A5068;
  --radius-xl:30px; --radius:20px; --radius-s:12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --field-a:#080E20; --field-b:#120C26; --aura-1:rgba(28,109,242,.22); --aura-2:rgba(123,97,255,.20);
    --glass:rgba(24,32,58,.52); --glass-deep:rgba(28,38,68,.62); --edge:rgba(255,255,255,.10); --hi:rgba(255,255,255,.14);
    --shadow:rgba(0,0,0,.55); --ink:#EAF0FF; --muted:#A3ABC6; --hair:rgba(234,240,255,.10);
    --ok:#4CC28C; --wait:#F0B53A; --bad:#FF6F86; --idle:#9AA3BC; --off:#B8BFD6; --work:#7FAEFF; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --field-a:#080E20; --field-b:#120C26; --aura-1:rgba(28,109,242,.22); --aura-2:rgba(123,97,255,.20);
  --glass:rgba(24,32,58,.52); --glass-deep:rgba(28,38,68,.62); --edge:rgba(255,255,255,.10); --hi:rgba(255,255,255,.14);
  --shadow:rgba(0,0,0,.55); --ink:#EAF0FF; --muted:#A3ABC6; --hair:rgba(234,240,255,.10);
  --ok:#4CC28C; --wait:#F0B53A; --bad:#FF6F86; --idle:#9AA3BC; --off:#B8BFD6; --work:#7FAEFF; color-scheme: dark;
}

* { box-sizing:border-box; }
[hidden] { display:none !important; }
html, body { margin:0; min-height:100%; }
html { background:var(--field-a); }
body { font:15px/1.5 Figtree, system-ui, sans-serif; color:var(--ink); background:linear-gradient(160deg, var(--field-a), var(--field-b)); background-attachment:fixed; }
.aurora { position:fixed; inset:0; pointer-events:none; z-index:0;
  background:radial-gradient(40vw 40vw at 18% 12%, var(--aura-1), transparent 70%),
             radial-gradient(46vw 46vw at 88% 78%, var(--aura-2), transparent 70%); }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }

.glass, .glass-deep { position:relative; background:var(--glass); -webkit-backdrop-filter:blur(24px) saturate(1.7); backdrop-filter:blur(24px) saturate(1.7);
  border:1px solid var(--edge); border-radius:var(--radius);
  box-shadow:inset 0 1px 0 var(--hi), inset 0 0 0 1px color-mix(in srgb, var(--hi) 30%, transparent), 0 1px 2px color-mix(in srgb, var(--shadow) 40%, transparent), 0 28px 56px -32px var(--shadow); }
.glass::before, .glass-deep::before { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:linear-gradient(180deg, color-mix(in srgb, var(--hi) 55%, transparent), transparent 38%); opacity:.55; }
.glass > *, .glass-deep > * { position:relative; }
.glass-deep { background:var(--glass-deep); border-radius:var(--radius-xl); }
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) { .glass, .glass-deep { background:var(--field-a); } }

/* Rail and top bar */
.rail.glass { position:fixed; z-index:3; left:14px; top:14px; bottom:14px; width:76px; display:flex; flex-direction:column; align-items:center; gap:6px; padding:14px 8px; border-radius:24px; }
.mark { width:40px; height:40px; border-radius:14px; display:grid; place-items:center; margin-bottom:12px; color:var(--on-accent);
  font:700 20px 'Bricolage Grotesque', sans-serif; background:linear-gradient(140deg, var(--blue), var(--violet)); box-shadow:0 8px 20px -8px var(--blue); }
.nav { width:60px; padding:8px 0; border:0; border-radius:14px; background:none; color:var(--muted); font:600 11px Figtree, sans-serif;
  display:flex; flex-direction:column; align-items:center; gap:4px; cursor:pointer; text-decoration:none; }
.nav[aria-current="page"] { color:var(--blue); background:color-mix(in srgb, var(--blue) 12%, transparent); }
.nav:hover { color:var(--ink); }
.theme { margin-top:auto; }
.ic { width:22px; height:22px; display:block; background:currentColor; -webkit-mask:var(--m) center/contain no-repeat; mask:var(--m) center/contain no-repeat; }
.ic-home { --m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ic-ops { --m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 12h4l3-8 4 16 3-8h4'/%3E%3C/svg%3E"); }
.ic-platform { --m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3l9 5-9 5-9-5z'/%3E%3Cpath d='M3 13l9 5 9-5'/%3E%3C/svg%3E"); }
.ic-business { --m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2M3 13h18'/%3E%3C/svg%3E"); }
.ic-hq { --m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.ic-theme { --m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M20 14A8 8 0 0 1 10 4a8 8 0 1 0 10 10z'/%3E%3C/svg%3E"); }
.ic-bell { --m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9a6 6 0 0 1 12 0c0 6 2 7 2 7H4s2-1 2-7'/%3E%3Cpath d='M10 20a2 2 0 0 0 4 0'/%3E%3C/svg%3E"); }

.top.glass { position:sticky; z-index:2; top:14px; margin:14px 14px 0 104px; display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:8px 10px 8px 12px; border-radius:22px; }
.contexts { display:flex; flex-wrap:wrap; gap:4px; padding:4px; border-radius:16px; background:color-mix(in srgb, var(--ink) 6%, transparent); }
.contexts button { border:0; border-radius:12px; padding:7px 14px; background:none; color:var(--muted); font:600 14px Figtree, sans-serif; cursor:pointer; transition:background .2s, color .2s; }
.contexts button[aria-pressed="true"] { background:var(--glass-deep); color:var(--ink); box-shadow:0 4px 14px -8px var(--shadow), inset 0 1px 0 var(--hi); }
.role { font-size:13px; color:var(--muted); }
.synthetic { font-size:12px; color:var(--wait); border:1px dashed currentColor; border-radius:999px; padding:2px 10px; }
.link { margin-left:auto; font-size:13px; color:var(--muted); }
.link.down { color:var(--bad); font-weight:600; }
.bell { position:relative; border:0; background:none; color:var(--ink); width:42px; height:42px; border-radius:14px; cursor:pointer; display:grid; place-items:center; }
.bell:hover { background:color-mix(in srgb, var(--ink) 6%, transparent); }
.count { position:absolute; top:4px; right:4px; min-width:18px; height:18px; border-radius:9px; background:var(--bad); color:#fff; font:700 11px/18px Figtree, sans-serif; text-align:center; padding:0 5px; }
.notices.glass { position:fixed; z-index:4; right:14px; top:82px; width:min(380px, calc(100vw - 28px)); max-height:60vh; overflow:auto; padding:14px 16px; }

/* Layout */
main { position:relative; z-index:1; margin:16px 14px 40px 104px; }
.view { display:grid; gap:16px; grid-template-columns:minmax(0, 1.25fr) minmax(0, 1fr); align-items:start; }
.column { display:grid; gap:16px; }
.wide { grid-column:1 / -1; }
.sheet { padding:18px 20px; min-width:0; }
h1, h2 { font-family:'Bricolage Grotesque', Figtree, sans-serif; letter-spacing:-.01em; margin:0; }
h2 { font-size:18px; font-weight:650; margin-bottom:12px; }
.head { display:flex; flex-wrap:wrap; align-items:baseline; gap:12px; justify-content:space-between; margin-bottom:14px; }
.head h1 { font-size:28px; font-weight:650; }
.hint, .sub { color:var(--muted); font-size:13px; margin:6px 0 0; }

/* Stage: the one memorable surface */
.stage { grid-row:span 2; padding:28px 28px 22px; display:flex; flex-direction:column; align-items:center; text-align:center; min-height:420px; }
/* MIVA stays beside the work: the stage is pinned on the left while the panels scroll on the right. */
#view-home > .sheet, #view-home > .column { grid-column:2; }
#view-home .stage { grid-column:1; grid-row:1 / span 5; position:sticky; top:92px; }
.hello h1 { font-size:clamp(30px, 3.4vw, 46px); font-weight:600; line-height:1.05; }
.stage miva-2d { display:block; width:230px; height:250px; position:relative; overflow:hidden; margin:6px 0 0; }
.mood { min-height:22px; margin:0 0 8px; font-weight:600; color:var(--muted); }
.thread { list-style:none; margin:0; padding:0 4px; width:100%; max-width:640px; max-height:280px; overflow:auto; display:flex; flex-direction:column; gap:10px; text-align:left; }
.thread li { padding:10px 14px; border-radius:18px; white-space:pre-wrap; overflow-wrap:anywhere; max-width:88%; }
.thread .you { align-self:flex-end; background:var(--blue); color:var(--on-accent); border-bottom-right-radius:6px; }
.thread .miva { align-self:flex-start; background:var(--glass); border:1px solid var(--edge); border-bottom-left-radius:6px; }
.thread .note { display:block; font-size:12px; opacity:.75; margin-top:4px; }
.thread .unavailable { border-color:var(--wait); }
.capsule { margin-top:16px; width:100%; max-width:640px; display:flex; gap:8px; padding:6px; border-radius:999px; background:var(--glass-deep); border:1px solid var(--edge); box-shadow:inset 0 1px 0 var(--hi), 0 16px 36px -22px var(--blue); }
.capsule input { flex:1; min-width:0; border:0; background:none; padding:10px 16px; font:inherit; color:var(--ink); }
.capsule input:focus { outline:none; }
.capsule:focus-within { box-shadow:0 0 0 3px color-mix(in srgb, var(--blue) 45%, transparent); }
.capsule button, .inline button, .act { border:0; border-radius:999px; padding:10px 18px; font:600 14px Figtree, sans-serif; color:var(--on-accent); cursor:pointer;
  background:linear-gradient(140deg, var(--blue), color-mix(in srgb, var(--blue) 70%, var(--violet))); }
.capsule button:disabled { opacity:.55; cursor:progress; }
.act.quiet { background:none; color:var(--bad); border:1px solid var(--hair); }
.act:disabled { opacity:.45; cursor:not-allowed; }
.inline { display:flex; gap:8px; margin-bottom:10px; }
.inline input { flex:1; min-width:0; border:1px solid var(--hair); border-radius:999px; padding:9px 14px; font:inherit; background:var(--glass-deep); color:var(--ink); }

/* Lists */
.list { list-style:none; margin:0; padding:0; display:grid; gap:2px; }
.list > li { padding:10px 2px; border-bottom:1px solid var(--hair); }
.list > li:last-child { border-bottom:0; }
.list .meta { display:block; font-size:12px; color:var(--muted); }
.empty { color:var(--muted); font-size:14px; padding:8px 0; }
.actions { display:flex; gap:8px; margin-top:8px; }
.steps { list-style:none; display:flex; flex-wrap:wrap; gap:6px; padding:0; margin:8px 0 0; }
.facts strong { font-weight:600; }
pre.report { white-space:pre-wrap; margin:8px 0 0; padding:12px 14px; border-radius:var(--radius-s); background:color-mix(in srgb, var(--ink) 5%, transparent); font:13px/1.55 Figtree, sans-serif; }

/* Business: pulse columns, discovery, plans, projects and budgets */
.pulse { display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:8px 26px; }
.pulse h2 { font-size:15px; margin:0 0 4px; color:var(--muted); }
.textlink { border:0; background:none; padding:0 0 0 6px; color:var(--blue); font:inherit; font-weight:600; cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.tracks { width:max-content; max-width:100%; margin-bottom:10px; }
.tracks button[aria-pressed="true"] { background:var(--glass-deep); color:var(--ink); box-shadow:0 4px 14px -8px var(--shadow), inset 0 1px 0 var(--hi); }
.answer { display:grid; gap:8px; margin:10px 0 6px; padding:14px; border-radius:var(--radius-s); background:color-mix(in srgb, var(--blue) 7%, transparent); }
.answer label { font-weight:600; }
.answer textarea { font:inherit; color:var(--ink); background:var(--glass-deep); border:1px solid var(--hair); border-radius:var(--radius-s); padding:10px 12px; resize:vertical; }
.plan > div, .project > strong { display:block; margin-bottom:6px; }
.opps, .milestones { margin:8px 0; padding-left:20px; display:grid; gap:6px; }
.opps .meta, .milestones .meta { display:block; font-size:12px; color:var(--muted); }
.milestones .act { margin-top:6px; padding:7px 14px; font-size:13px; }
.inline label:not(.sr) { align-self:center; font-size:13px; color:var(--muted); white-space:nowrap; }
.inline.spend { flex-wrap:wrap; margin-top:10px; } .inline.spend input { flex:1 1 140px; }
.budget { display:flex; height:8px; border-radius:4px; overflow:hidden; margin:8px 0 4px; background:color-mix(in srgb, var(--ink) 10%, transparent); }
.budget .spent { background:var(--blue); } .budget .held { background:var(--wait); }
.list .meta + .meta { margin-top:2px; }
.changes { margin-top:8px; } .changes .meta { display:block; font-size:12px; color:var(--muted); }
.pending, .paused { margin-top:8px; padding:10px 12px; border-radius:var(--radius-s); background:color-mix(in srgb, var(--wait) 10%, transparent); }
.paused .meta { display:block; }
.chip.released { --c:var(--idle); }
.chip.met, .chip.verified { --c:var(--ok); } .chip.not_met { --c:var(--bad); } .chip.measured_unverified { --c:var(--wait); }
.chip.awaiting_measurement { --c:var(--idle); }
.proposals > li { padding:10px 12px; margin-bottom:6px; border-radius:var(--radius-s); border-bottom:0; background:color-mix(in srgb, var(--violet) 9%, transparent); }
.proposals .meta { display:block; font-size:12px; color:var(--muted); }
.outcome p { margin:6px 0 0; }
.define { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:8px 14px; align-items:end; }
.define strong { grid-column:1 / -1; }
.define label { display:grid; gap:4px; font-size:13px; color:var(--muted); min-width:0; }
.define input, .define select { width:100%; min-width:0; box-sizing:border-box; }
.define input, .define select, .inline select { font:inherit; color:var(--ink); background:var(--glass-deep); border:1px solid var(--hair); border-radius:12px; padding:8px 10px; }

/* Status chips: shape and wording carry meaning, colour reinforces it */
.chip { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; padding:3px 10px 3px 8px; border-radius:999px; white-space:nowrap;
  color:var(--c); background:color-mix(in srgb, var(--c) 13%, transparent); }
.chip::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--c); }
.chip.connected, .chip.completed { --c:var(--ok); }
.chip.working, .chip.running, .chip.planned { --c:var(--work); }
.chip.working::before { animation:pulse 1.4s ease-in-out infinite; }
.chip.awaiting_approval, .chip.blocked { --c:var(--wait); }
.chip.failed, .chip.unverified, .chip.denied, .chip.partially_completed { --c:var(--bad); }
.chip.idle { --c:var(--idle); }
.chip.disconnected { --c:var(--off); }
.chip.disconnected::before { background:none; border:2px solid var(--c); width:6px; height:6px; }
.chip.unknown { --c:var(--muted); background:none; border:1px dashed var(--c); }
.chip.unknown::before { background:none; border:1px dashed var(--c); }
.chip.disabled { --c:var(--off); text-decoration:line-through; text-decoration-thickness:1px; }
.chip.disabled::before { border-radius:2px; }
.chip.not_configured { --c:var(--idle); background:none; border:1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.chip.not_configured::before { background:none; border:1px solid var(--c); }
.chip.needs_review { --c:var(--wait); } .chip.recovered { --c:var(--ok); }
.chip.proposed { --c:var(--wait); } .chip.approved { --c:var(--ok); } .chip.rejected { --c:var(--off); } .chip.not_started { --c:var(--idle); }
@keyframes pulse { 50% { opacity:.3; } }
.key { margin-top:14px; font-size:13px; color:var(--muted); }
.key summary, .history summary { cursor:pointer; font-weight:600; width:max-content; }
.legend { list-style:none; display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:8px 18px; padding:0; margin:10px 0 0; }
.legend li { display:flex; gap:10px; align-items:baseline; }

.strip { display:flex; flex-wrap:wrap; gap:10px 22px; padding:12px 14px; border-radius:var(--radius-s); background:color-mix(in srgb, var(--ink) 4%, transparent); margin-bottom:14px; font-size:14px; }
.strip .meta { color:var(--muted); font-size:12px; margin-left:6px; }
.summary { margin:0 0 12px; font-weight:600; }
.lost { margin:0 0 14px; padding:12px 14px; border-radius:var(--radius-s); color:var(--bad); font-weight:600;
  background:color-mix(in srgb, var(--bad) 10%, transparent); border:1px solid color-mix(in srgb, var(--bad) 35%, transparent); }

/* Agent bays: the character stands on a glass plinth whose halo carries its activity */
.bays { list-style:none; margin:0; padding:0; display:grid; gap:12px; }
.bay { --s:var(--idle); display:grid; grid-template-columns:96px minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas:"pic who now" "pic facts facts" "pic hist hist";
  gap:6px 22px; padding:16px 18px; border-radius:var(--radius); background:var(--glass-deep); border:1px solid var(--edge); box-shadow:inset 0 1px 0 var(--hi); }
.bay[data-activity="working"] { --s:var(--work); } .bay[data-activity="awaiting_approval"] { --s:var(--wait); }
.bay[data-activity="failed"] { --s:var(--bad); } .bay[data-activity="disabled"] { --s:var(--off); }
.halo { grid-area:pic; width:88px; height:88px; border-radius:50%; display:grid; place-items:center; overflow:hidden; align-self:start;
  background:radial-gradient(circle at 50% 35%, var(--hi), color-mix(in srgb, var(--s, var(--idle)) 16%, transparent) 70%);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--s, var(--idle)) 55%, transparent), 0 14px 30px -16px var(--s, var(--shadow)); }
.halo img { width:84%; height:84%; object-fit:contain; object-position:bottom; }
.halo span { font:700 32px 'Bricolage Grotesque', sans-serif; color:var(--muted); }
.bay[data-activity="working"] .halo { animation:breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow:0 0 0 6px color-mix(in srgb, var(--s) 35%, transparent), 0 14px 30px -16px var(--s); } }
.who { grid-area:who; min-width:0; }
.who h3 { margin:0 0 6px; font:650 22px 'Bricolage Grotesque', Figtree, sans-serif; }
.chips { display:flex; flex-wrap:wrap; gap:6px; }
.who .meta, .now .meta { font-size:12px; color:var(--muted); margin:6px 0 0; }
.now { grid-area:now; min-width:0; align-self:center; }
.now p { margin:0; }
.track { display:flex; gap:4px; margin:8px 0 0; }
.track i { flex:1; height:6px; border-radius:3px; background:color-mix(in srgb, var(--ink) 10%, transparent); }
.track i.done { background:var(--ok); } .track i.here { background:var(--s); }
.bay .facts { grid-area:facts; display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:8px 18px; margin:8px 0 0; padding-top:10px; border-top:1px solid var(--hair); }
.bay .facts dt { font-size:12px; color:var(--muted); }
.bay .facts dd { margin:0; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.history { grid-area:hist; font-size:13px; margin-top:4px; }
.history .list { margin-top:6px; }
.bench { margin-top:18px; }
.bench h2 { margin-bottom:2px; }
.bench ul { list-style:none; padding:0; margin:12px 0 0; display:flex; flex-wrap:wrap; gap:12px; }
.bench li { display:flex; align-items:center; gap:10px; padding:8px 14px 8px 8px; border-radius:999px; border:1px dashed var(--hair); }
.bench .halo { width:44px; height:44px; filter:grayscale(1); opacity:.7; box-shadow:none; }
.figures { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:18px; margin:0; }
.figures div { padding:6px 0; }
.figures dt { color:var(--muted); font-size:13px; }
.figures dd { margin:2px 0 0; font:600 34px 'Bricolage Grotesque', sans-serif; }
.usage { width:100%; border-collapse:collapse; font-size:14px; }
.usage th { text-align:left; color:var(--muted); font-weight:600; font-size:12px; padding:0 8px 8px 0; }
.usage td { padding:8px 8px 8px 0; border-top:1px solid var(--hair); }
.usage .meta { display:block; font-size:12px; color:var(--muted); }

.toasts { position:fixed; z-index:5; left:50%; bottom:20px; transform:translateX(-50%); display:grid; gap:8px; width:min(460px, calc(100vw - 28px)); }
.toast { padding:12px 16px; border-radius:16px; background:var(--glass-deep); -webkit-backdrop-filter:blur(22px); backdrop-filter:blur(22px); border:1px solid var(--edge);
  box-shadow:0 20px 40px -20px var(--shadow); border-left:4px solid var(--c, var(--blue)); animation:rise .35s ease-out; }
.toast.high { --c:var(--bad); } .toast.medium { --c:var(--wait); }
@keyframes rise { from { opacity:0; transform:translateY(10px); } }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline:3px solid color-mix(in srgb, var(--blue) 70%, transparent); outline-offset:2px; }

@media (max-width:1100px) { .view { grid-template-columns:1fr; } .stage { grid-row:auto; min-height:0; }
  #view-home .stage { grid-row:auto; position:relative; top:auto; } #view-home > .sheet, #view-home > .column { grid-column:auto; }
  .bay { grid-template-columns:72px minmax(0, 1fr); grid-template-areas:"pic who" "now now" "facts facts" "hist hist"; } .halo { width:68px; height:68px; } }
@media (max-width:720px) {
  .rail.glass { top:auto; left:10px; right:10px; bottom:10px; width:auto; height:64px; flex-direction:row; justify-content:space-around; padding:6px; }
  .mark { display:none; } .theme { margin-top:0; }
  .top.glass { margin:10px 10px 0; } main { margin:12px 10px 96px; } .toasts { bottom:86px; }
  .stage { padding:20px 14px; } .link { margin-left:0; width:100%; order:9; }
  .bay { padding:14px; gap:6px 14px; } .bay .facts { grid-template-columns:1fr 1fr; } .sheet { padding:16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation:none !important; transition:none !important; } }
@media (prefers-reduced-transparency: reduce) { .glass, .glass-deep, .bay { -webkit-backdrop-filter:none; backdrop-filter:none; background:var(--field-a); } }

/* Discovery: conversational profile */
.research { display:grid; grid-template-columns:1fr 1fr auto; gap:8px; margin:6px 0; }
.research input { font:inherit; color:var(--ink); background:var(--glass-deep); border:1px solid var(--hair); border-radius:var(--radius-s); padding:10px 12px; min-width:0; }
.asks { margin:10px 0; padding:12px 14px; border-radius:var(--radius-s); background:color-mix(in srgb, var(--blue) 8%, transparent); }
.asks h3 { margin:0 0 6px; font-size:14px; }
.asks li { display:flex; flex-wrap:wrap; gap:4px 12px; align-items:center; }
.asks li .meta { flex:1 1 220px; }
.profile { list-style:none; margin:12px 0 4px; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:10px; }
.pcard { padding:12px 14px; border-radius:var(--radius-s); background:var(--glass); border:1px solid var(--edge); display:flex; flex-direction:column; gap:6px; }
.pcard.missing { border-style:dashed; opacity:.85; }
.pcard.conflict { border-color:var(--wait); }
.phead { display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
.phead strong { font-size:13px; font-weight:600; }
.pstate { font-size:11px; white-space:nowrap; color:var(--muted); }
.pstate.confirmed { color:var(--ok); } .pstate.proposed { color:var(--wait); }
.pval { margin:0; overflow-wrap:anywhere; }
.psrc { display:flex; flex-wrap:wrap; gap:4px 10px; align-items:center; font-size:12px; color:var(--muted); }
.psrc a { color:inherit; overflow-wrap:anywhere; }
.prov { padding:2px 8px; border-radius:999px; font-size:11px; font-weight:600; background:color-mix(in srgb, var(--c, var(--idle)) 18%, transparent); color:var(--ink); border:1px solid color-mix(in srgb, var(--c, var(--idle)) 45%, transparent); }
.prov.owner_provided { --c:var(--ok); } .prov.public_unverified { --c:var(--wait); } .prov.ai_assumption { --c:var(--violet); } .prov.independently_verified { --c:var(--blue); }
.cand { padding:8px 10px; border-radius:10px; background:color-mix(in srgb, var(--violet) 8%, transparent); display:flex; flex-direction:column; gap:4px; }
.cand blockquote { margin:0; padding-left:8px; border-left:2px solid var(--edge); font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.warn { color:var(--wait); }
.fineprint { font-size:12px; color:var(--muted); margin:6px 0; }
.talk { margin-top:12px; display:flex; flex-direction:column; align-items:stretch; }
.talk .thread { max-width:none; max-height:220px; }
.talk .capsule { max-width:none; margin-top:10px; }
@media (max-width: 640px) { .research { grid-template-columns:1fr; } .profile { grid-template-columns:1fr; } }

/* Discovery: structured profile */
.overview { margin:8px 0 10px; }
.overview .lede { margin:0 0 8px; font-size:15px; line-height:1.45; }
.progress { height:8px; border-radius:99px; background:color-mix(in srgb, var(--ink) 10%, transparent); overflow:hidden; }
.progress i { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg, var(--blue), var(--violet)); }
.decide, .needs { margin:10px 0; padding:12px 14px; border-radius:var(--radius-s); background:color-mix(in srgb, var(--wait) 12%, transparent); }
.needs { background:color-mix(in srgb, var(--blue) 8%, transparent); }
.decide h3, .needs h3 { margin:0 0 8px; font-size:14px; }
.conflict { display:grid; gap:8px; }
.claims { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.claim { padding:10px 12px; border-radius:10px; background:var(--glass); border:1px solid var(--edge); }
.claim p { margin:4px 0 0; overflow-wrap:anywhere; }
.ask { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; justify-content:space-between; padding:6px 0; }
.ask span { flex:1 1 240px; }
.cats { display:grid; gap:8px; margin:10px 0; }
.cat { border:1px solid var(--edge); border-radius:var(--radius-s); background:var(--glass); padding:2px 12px; }
.cat > summary { cursor:pointer; display:flex; gap:10px; align-items:center; padding:10px 0; font-weight:600; list-style:none; }
.cat > summary::-webkit-details-marker { display:none; }
.cat .count { min-width:22px; text-align:center; padding:1px 8px; border-radius:99px; background:color-mix(in srgb, var(--blue) 14%, transparent); font-size:12px; }
.cat .flag { font-size:12px; color:var(--wait); font-weight:600; }
.pitems { list-style:none; margin:0 0 8px; padding:0; display:grid; gap:4px; }
.pitems > li { display:flex; flex-wrap:wrap; gap:2px 10px; align-items:baseline; padding:6px 0; border-bottom:1px solid color-mix(in srgb, var(--ink) 7%, transparent); }
.pitems > li:last-child { border-bottom:0; }
.pname { font-weight:600; }
.meta.ok { color:var(--ok); }
.src { flex-basis:100%; font-size:12px; color:var(--muted); }
.src summary { cursor:pointer; width:max-content; }
.src ul { margin:4px 0 0; padding-left:18px; }
.src a { color:inherit; overflow-wrap:anywhere; }
.evidence { margin-top:10px; font-size:13px; color:var(--muted); }
.evidence summary { cursor:pointer; font-weight:600; width:max-content; }
.srclist { margin:8px 0 0; padding-left:18px; }
.prov.owner_attested { --c:var(--ok); } .prov.owner_confirmed { --c:var(--blue); } .prov.ai_assumption_reviewed { --c:var(--violet); }
@media (max-width: 640px) { .claims { grid-template-columns:1fr; } }

/* Journey and opportunity analysis */
.journey { list-style:none; margin:0 0 12px; padding:10px 12px; display:grid; grid-template-columns:repeat(5, 1fr); gap:8px; border-radius:var(--radius-s); }
.journey a { display:grid; gap:2px; text-decoration:none; color:inherit; padding:6px 8px; border-radius:10px; }
.journey a:hover { background:color-mix(in srgb, var(--blue) 10%, transparent); }
.journey .step { width:22px; height:22px; border-radius:50%; display:inline-grid; place-items:center; font-size:12px; background:color-mix(in srgb, var(--blue) 18%, transparent); }
.analyse { display:grid; gap:6px; }
.analyse input, .analyse textarea { font:inherit; color:var(--ink); background:var(--glass-deep); border:1px solid var(--hair); border-radius:var(--radius-s); padding:10px 12px; }
.anDetail { margin-top:12px; display:grid; gap:12px; }
.method { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; }
.reco { padding:12px 14px; border-radius:var(--radius-s); background:color-mix(in srgb, var(--blue) 9%, transparent); }
.reco p { margin:4px 0; }
.options { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; }
.option { padding:12px; border-radius:var(--radius-s); background:var(--glass); border:1px solid var(--edge); display:grid; gap:6px; align-content:start; }
.option.suggested { border-color:var(--blue); } .option.chosen { box-shadow:0 0 0 2px var(--ok); }
.tally { display:flex; flex-wrap:wrap; gap:4px; }
.rate { padding:1px 8px; border-radius:99px; font-size:11px; font-weight:600; background:color-mix(in srgb, var(--c, var(--idle)) 16%, transparent); border:1px solid color-mix(in srgb, var(--c, var(--idle)) 40%, transparent); }
.rate.favourable { --c:var(--ok); } .rate.unfavourable { --c:var(--bad); } .rate.unknown { --c:var(--idle); }
.chip.ok { --c:var(--ok); }
@media (max-width: 760px) { .journey { grid-template-columns:1fr 1fr; } .options { grid-template-columns:1fr; } }
.plan, .plan * { overflow-wrap:anywhere; min-width:0; }
.opps .meta, .evidence-line { overflow-wrap:anywhere; }
.anDetail { grid-template-columns:minmax(0,1fr); }
.anDetail, .anDetail * { overflow-wrap:anywhere; min-width:0; }
.options { grid-template-columns:repeat(3, minmax(0,1fr)); }
@media (max-width: 760px) { .options { grid-template-columns:minmax(0,1fr); } }
.anDetail .actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.anDetail .chip { white-space:normal; max-width:100%; }
main, .view, .sheet { min-width:0; max-width:100%; }
