/* Stage styles, 1920×1080 target. */
:root {
  --bg: #f3f5f9; --paper: #ffffff; --ink: #0f1b33; --ink-2: #3f4a63; --ink-3: #74809a; --ink-4: #a8b0c2; --line: #e1e6ef;
  --accent: #1a5fd6; --accent-soft: #e9f0fc; --accent-line: #bcd0f3; --navy: #0b2f6b; --green: #1e8e5a; --green-soft: #e6f5ec; --amber: #b7791f; --amber-soft: #fff4de; --violet: #6b4fd8; --violet-soft: #efeafc;
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; --cond: 'IBM Plex Sans Condensed', 'IBM Plex Sans', sans-serif; --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); overflow: hidden; display: grid; grid-template-rows: 64px 1fr; }
button { font-family: inherit; }
.material-symbols-rounded { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-smoothing: antialiased; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20; }

/* ── Top bar ── */
.top { display: flex; align-items: center; gap: 18px; padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--paper); }
.brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 210px; }
.brand b { font-family: var(--cond); font-size: 17px; font-weight: 700; letter-spacing: -0.1px; }
.brand span { font-size: 11px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; }
.stepper { flex: 1; display: flex; justify-content: center; gap: 4px; }
.step { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.step:hover { background: var(--bg); color: var(--ink); }
.step.on { background: var(--ink); color: #fff; }
.step.on .n { background: rgba(255,255,255,0.2); color: #fff; }
.step.done .n { background: var(--accent-soft); color: var(--accent); }
.tools { display: flex; gap: 6px; min-width: 210px; justify-content: flex-end; }
.tools button { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tools button:hover { background: var(--bg); color: var(--ink); }
.tools button .material-symbols-rounded { font-size: 18px; }
.tools button.armed { border-color: #c0392b; color: #c0392b; }
.tools button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── Stage ── */
.stage { position: relative; min-height: 0; overflow: clip; }
.scene { position: absolute; inset: 0; display: none; }
.scene.on { display: block; }
.foot { display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-size: 11.5px; color: var(--ink-4); border-top: 1px solid var(--line); background: var(--paper); }
.foot b { color: var(--ink-3); font-weight: 600; }
.foot .conf { color: var(--ink-4); }

/* ── Shared labels ── */
.meter { display: inline-flex; gap: 3px; vertical-align: middle; }
.meter i { width: 14px; height: 7px; border-radius: 2px; background: var(--line); }
.meter i.on { background: var(--accent); }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.lbl { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--ink-3); }
.lbl .n { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0; }
.lbl.o1 .n { background: var(--accent); } .lbl.o2 .n { background: var(--violet); } .lbl.o3 .n { background: var(--green); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 100px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.tag.lead { background: var(--accent-soft); color: var(--accent); }
.tag.ill { background: var(--amber-soft); color: var(--amber); }
.tag.wl { background: var(--green-soft); color: var(--green); }

/* ── Phone beats: three columns ── */
.phone-beat { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 36px; padding: 24px 32px 22px; }
.col { flex: 0 0 400px; max-height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ink-4) transparent; padding-right: 4px; animation: slideIn .5s var(--ease) both; }
.col > * { flex-shrink: 0; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; }
.panel .ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel .pt { font-size: 11px; font-weight: 700; letter-spacing: 0.9px; text-transform: uppercase; color: var(--ink-3); }
.opt-h { font-family: var(--cond); font-size: 30px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.05; margin-top: 8px; }
.opt-s { font-size: 14px; line-height: 1.45; color: var(--ink-2); margin-top: 8px; }
.kv { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv div { background: var(--bg); border-radius: 12px; padding: 9px 11px; }
.kv .k { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-3); }
.kv .v { font-size: 13px; font-weight: 600; margin-top: 2px; display: flex; align-items: center; }
.acts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.act { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.act .n { width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.act:hover { background: var(--bg); }
.act.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.act.on .n { background: rgba(255,255,255,.2); color: #fff; }
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { height: 28px; padding: 0 10px; border: none; border-radius: 8px; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(15,27,51,.12); }
.hint { font-size: 12px; color: var(--ink-3); line-height: 1.45; margin-top: 10px; }

/* The phone */
.phone-col { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; }
.phone-outer { position: relative; flex-shrink: 0; }
.phone-frame { width: 430px; height: 932px; position: absolute; top: 0; left: 0; transform-origin: top left; }
.screen-area { position: absolute; inset: 0; border-radius: 52px; overflow: hidden; background: #000; box-shadow: 0 0 0 10px #0b0b0f, 0 0 0 12px #2a2c33, 0 30px 70px rgba(15,27,51,0.35); }
.island { position: absolute; top: 11px; left: 50%; width: 124px; height: 35px; margin-left: -62px; border-radius: 20px; background: #000; z-index: 5; pointer-events: none; }
.screen-area iframe { width: 430px; height: 932px; border: none; display: block; background: #0a1540; }

/* The wire */
.wire { display: flex; flex-direction: column; }
.wire .ph { flex-shrink: 0; }
.wire-list { overflow: visible; scrollbar-width: thin; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.wire-item { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; animation: wireIn .35s var(--ease) both; }
@keyframes wireIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.wire-item .wh { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink); background: var(--bg); cursor: pointer; }
.wire-item .wk { font-size: 9.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; flex-shrink: 0; }
.wire-item.request .wk { background: var(--accent-soft); color: var(--accent); }
.wire-item.response .wk { background: var(--green-soft); color: var(--green); }
.wire-item.code .wk { background: var(--violet-soft); color: var(--violet); }
.wire-item.mcp .wk { background: var(--amber-soft); color: var(--amber); }
.wire-item.event .wk { background: var(--line); color: var(--ink-2); }
.wire-item .wt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wire-item .ti { font-size: 10.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.wire-item pre { margin: 0; padding: 10px 12px; font-family: var(--mono); font-size: 11.5px; line-height: 1.45; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; background: var(--paper); }
.wire-item.closed pre { display: none; }
.wire-empty { font-size: 12.5px; color: var(--ink-3); padding: 20px 0; text-align: center; font-style: italic; }
.wire-note { font-size: 11px; color: var(--ink-4); margin-top: 8px; line-height: 1.4; }

/* Beat 6: families and members */
.fam { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.fam:hover { background: var(--bg); }
.fam .material-symbols-rounded.ic { font-size: 20px; color: var(--accent); width: 28px; text-align: center; }
.fam .fb { flex: 1; min-width: 0; }
.fam .fn { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.fam .fn small { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.fam .fs { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam .sw { width: 38px; height: 22px; border-radius: 11px; background: var(--line); position: relative; flex-shrink: 0; transition: background .2s; }
.fam .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.fam.on .sw { background: var(--accent); } .fam.on .sw::after { transform: translateX(16px); }
.fam.off { opacity: .55; }
.methods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.methods span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--bg); border-radius: 100px; padding: 5px 10px; }
.methods span .material-symbols-rounded { font-size: 14px; color: var(--accent); }
.why { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.why li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 12px; background: var(--bg); }
.why .rank { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.why .wb { flex: 1; min-width: 0; }
.why .wo { font-size: 13px; font-weight: 700; }
.why .wr { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.4; }
.why .wr span { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; }
.why .wr .material-symbols-rounded { font-size: 13px; color: var(--accent); }

/* Notes drawer */
.notes { position: absolute; left: 0; right: 0; bottom: 0; transform: translateY(100%); transition: transform .4s var(--ease); background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -20px 50px -30px rgba(15,27,51,.4); padding: 18px 28px 22px; z-index: 50; max-height: 46%; overflow: auto; }
.notes.open { transform: none; }
.notes .nh { display: flex; align-items: baseline; gap: 14px; }
.notes .nh b { font-family: var(--cond); font-size: 20px; }
.notes .nh span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.notes-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin-top: 10px; }
.notes ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.notes li { font-size: 15px; line-height: 1.45; color: var(--ink); padding-left: 16px; position: relative; }
.notes li::before { content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.notes .k { font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.notes .click li { font-size: 13.5px; color: var(--ink-2); }
.notes .click li::before { background: var(--ink-4); }

/* Expanders: the detail stays one click away */
.more { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.more summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.more summary::-webkit-details-marker { display: none; }
.more summary .material-symbols-rounded { font-size: 20px; color: var(--ink-3); transition: transform .2s var(--ease); }
.more[open] summary .material-symbols-rounded.chev { transform: rotate(90deg); }
.more summary .sub { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--ink-4); }
.more .body { padding: 0 18px 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.more .body p { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.more .body p + p { margin-top: 8px; }
.more .body .panel { border: none; padding: 0; border-radius: 0; }
