@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,500;6..72,600&display=swap");

:root {
  color-scheme: light;
  --ink: #172320;
  --muted: #66706b;
  --paper: #fffdf8;
  --canvas: #f3efe6;
  --line: #d8d3c8;
  --soft-line: #e9e4da;
  --green: #176b57;
  --green-dark: #0f4e40;
  --green-soft: #e1eee8;
  --amber: #c68532;
  --rust: #9d4f37;
  --shadow: 0 18px 60px rgba(37, 42, 35, 0.09);
  font-family: "Manrope", system-ui, sans-serif;
  font-synthesis: none;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 8% 4%, rgba(255,255,255,.9), transparent 27rem), linear-gradient(135deg, rgba(23,107,87,.025) 25%, transparent 25%) 0 0 / 34px 34px, var(--canvas); }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(23,107,87,.22); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.topbar { height: 76px; padding: 0 clamp(20px, 5vw, 74px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.9); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark { width: 39px; height: 39px; border: 1px solid var(--green); display: grid; place-items: center; font: 600 23px/1 "Newsreader", serif; color: var(--green); transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--green-soft); }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font: 600 19px "Newsreader", serif; letter-spacing: .08em; }
.brand small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; }
.topbar-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #a7aaa5; box-shadow: 0 0 0 4px #ebe9e4; }
.status-dot.online { background: #2a9878; box-shadow: 0 0 0 4px #dff0e9; }
.prototype-pill, .live-badge, .verified-badge, .waiting-pill { font: 500 10px "DM Mono", monospace; letter-spacing: .08em; border-radius: 999px; padding: 6px 9px; }
.prototype-pill { background: #eee8db; color: #716958; margin-left: 8px; }

.lobby-page, .room-page { width: min(1320px, calc(100% - 40px)); margin: 0 auto; }
.hero-grid { min-height: calc(100vh - 190px); display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(340px, .72fr); gap: clamp(40px, 7vw, 100px); align-items: center; padding: 64px 0 52px; }
.eyebrow { color: var(--green); font: 500 11px "DM Mono", monospace; letter-spacing: .15em; margin: 0 0 11px; }
.hero-copy h1 { max-width: 760px; margin: 0; font: 600 clamp(54px, 6vw, 89px)/.97 "Newsreader", Georgia, serif; letter-spacing: -.045em; }
.hero-lede { color: #515b56; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.7; max-width: 700px; margin: 27px 0 35px; }
.paper-card { background: var(--paper); border: 1px solid var(--line); border-radius: 2px; box-shadow: var(--shadow); position: relative; }
.paper-card::after { content: ""; position: absolute; inset: 5px -5px -5px 5px; border-right: 1px solid rgba(159,150,132,.2); border-bottom: 1px solid rgba(159,150,132,.2); pointer-events: none; z-index: -1; }

.protocol-sketch { min-height: 168px; padding: 25px; border: 1px solid var(--line); background: rgba(255,253,248,.7); display: flex; align-items: center; gap: clamp(9px, 1.5vw, 20px); overflow: hidden; }
.sketch-party, .sketch-node { display: grid; place-items: center; flex: 0 0 auto; }
.sketch-party { width: 105px; height: 105px; border: 1px solid #bfc8c2; background: #f7faf7; position: relative; }
.sketch-party span, .sketch-node span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font: 500 13px "DM Mono", monospace; margin-bottom: 7px; }
.sketch-party b, .sketch-node b { font: 500 11px "DM Mono", monospace; }
.sketch-party i, .sketch-node i { font-style: normal; color: var(--muted); font-size: 9px; margin-top: 5px; }
.sketch-party::after { content: ""; position: absolute; top: 8px; right: 8px; width: 11px; height: 11px; background: var(--green-soft); border-radius: 50%; }
.sketch-node { width: 113px; height: 113px; border-radius: 50%; border: 1px solid var(--green); background: #edf5f1; }
.sketch-node.receiver { border-color: var(--amber); background: #fbf2e5; }
.sketch-node.receiver span { background: var(--amber); }
.sketch-arrow { color: #85928b; font: 25px "Newsreader", serif; }
.feature-list { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 18px; color: #58635e; font-size: 12px; }

.lobby-card { padding: 0; transform: rotate(.25deg); }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.mode-tabs button { padding: 20px 10px; border: 0; border-right: 1px solid var(--line); background: #f5f1e8; cursor: pointer; color: #74786f; font-size: 13px; }
.mode-tabs button:last-child { border-right: 0; }
.mode-tabs button.active { background: var(--paper); color: var(--green); box-shadow: inset 0 -3px var(--green); font-weight: 700; }
.lobby-form { display: grid; gap: 22px; padding: 38px; }
.lobby-form label { display: grid; gap: 9px; color: #4e5753; font-size: 12px; font-weight: 700; }
.lobby-form input { width: 100%; border: 1px solid #cfcabf; background: #fffefa; padding: 14px 15px; color: var(--ink); border-radius: 2px; }
.lobby-form .code-input { font: 500 22px "DM Mono", monospace; letter-spacing: .18em; text-transform: uppercase; }
.primary-button, .quiet-button, .add-button, .pairing-box button { border: 0; cursor: pointer; }
.primary-button { background: var(--green); color: white; padding: 15px 19px; font-weight: 700; border-radius: 2px; box-shadow: 0 5px 0 var(--green-dark); transition: transform .16s, box-shadow .16s; }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 0 var(--green-dark); }
.primary-button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-dark); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.form-note { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0; padding-top: 4px; border-top: 1px solid var(--soft-line); }
.explain-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); margin-bottom: 50px; background: rgba(255,253,248,.6); }
.explain-strip article { padding: 26px 30px; border-right: 1px solid var(--line); display: grid; grid-template-columns: 35px 1fr; column-gap: 12px; }
.explain-strip article:last-child { border: 0; }
.explain-strip b { color: var(--green); font: 500 11px "DM Mono", monospace; padding-top: 6px; }
.explain-strip h2 { margin: 0; font: 600 22px "Newsreader", serif; }
.explain-strip p { grid-column: 2; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.room-page { padding: 34px 0 70px; }
.room-header { min-height: 150px; padding: 28px 31px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 28px; margin-bottom: 24px; }
.room-header h1 { margin: 0 0 8px; font: 600 36px "Newsreader", serif; }
.room-header p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; max-width: 650px; }
.pairing-box { min-width: 230px; border: 1px dashed #a9b5ae; background: #f4f8f5; padding: 15px 17px; display: grid; grid-template-columns: 1fr auto; gap: 4px 13px; }
.pairing-box small { font: 500 9px "DM Mono", monospace; color: var(--muted); }
.pairing-box strong { grid-row: 2; font: 500 22px "DM Mono", monospace; letter-spacing: .14em; color: var(--green-dark); }
.pairing-box button { grid-column: 2; grid-row: 1 / 3; background: var(--green-soft); color: var(--green); padding: 8px 11px; font-size: 10px; font-weight: 700; }
.quiet-button { padding: 10px 13px; border: 1px solid var(--line); background: #f7f4ed; color: #59615d; border-radius: 2px; font-size: 11px; font-weight: 700; }
.quiet-button:hover, .add-button:hover { border-color: var(--green); color: var(--green); }
.leave-button { align-self: start; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.release-explainer { display: grid; grid-template-columns: 1.15fr 1fr 1fr; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); margin-bottom: 24px; }
.release-intro, .release-rule { padding: 22px 24px; }
.release-intro { border-right: 1px solid var(--line); }
.release-intro h2 { margin: 0 0 7px; font: 600 25px "Newsreader", serif; }
.release-intro > p:last-child { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.release-rule { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; border-right: 1px solid var(--line); }
.release-rule:last-child { border-right: 0; }
.release-rule .rule-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font: 700 14px "DM Mono", monospace; }
.release-rule b { font-size: 11px; }
.release-rule p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.shared-rule { background: #edf6f1; }
.shared-rule .rule-icon { background: var(--green); color: white; }
.private-rule { background: #faf3e9; }
.private-rule .rule-icon { background: #ead8c1; color: #8a5726; }
.workspace-column { display: grid; gap: 24px; min-width: 0; }
.table-card, .pipeline-card, .result-card, .participants { padding: 26px; }
.section-heading, .result-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.section-heading h2, .result-heading h2 { margin: 0; font: 600 27px "Newsreader", serif; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; }
th { background: #f0ede6; color: #646c67; text-align: left; font: 500 10px "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
th, td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 12px; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
.input-table td { padding: 0; background: #fffefa; }
.input-table th:first-child { width: 46%; }
.input-table th:last-child { width: 38px; }
.input-table input { border: 0; background: transparent; width: 100%; padding: 13px 14px; color: var(--ink); font: 400 13px "DM Mono", monospace; }
.row-remove { width: 100%; height: 43px; border: 0; background: transparent; color: #9c765f; cursor: pointer; font-size: 17px; }
.row-remove:hover:not(:disabled) { background: #f8e9e3; color: var(--rust); }
.row-remove:disabled { opacity: .25; }
.table-actions { margin-top: 15px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; }
.add-button { border: 1px dashed #aeb7b2; background: #f7faf8; color: var(--green); padding: 9px 13px; font-size: 11px; font-weight: 700; }

.run-button { min-width: 170px; }
.waiting-pill { background: #eeeae1; color: var(--muted); }
.progress-track { height: 5px; background: #e7e4dc; overflow: hidden; margin: 3px 0 24px; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #48a184); transition: width .6s ease; }
.phase-row { display: grid; grid-template-columns: 1fr 25px 1fr 25px 1fr; align-items: center; }
.phase-row > div { border: 1px solid var(--line); background: #f6f3ed; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; padding: 13px; opacity: .52; transition: opacity .3s, border .3s, background .3s; }
.phase-row > div.active { opacity: 1; border-color: #9cbeb2; background: #edf5f1; }
.phase-row span { grid-row: 1 / 3; width: 28px; height: 28px; border: 1px solid currentColor; border-radius: 50%; display: grid; place-items: center; color: var(--green); font: 500 10px "DM Mono", monospace; }
.phase-row b { font-size: 12px; }
.phase-row small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.phase-row > i { text-align: center; font-style: normal; color: #9ba19d; }
.run-hint { margin: 14px 0 0; color: var(--rust); font-size: 10px; }

.result-card { border-top: 4px solid var(--green); }
.verified-badge { color: var(--green-dark); background: var(--green-soft); }
.result-table td { font: 500 15px "DM Mono", monospace; background: #fffefa; color: var(--green-dark); }
.result-table td.matched-key { color: #7b4156; background: #faedf1; font-weight: 700; }
.result-footnote { color: var(--muted); font-size: 10px; margin: 14px 0 0; }
.empty-result { border: 1px dashed var(--line); padding: 25px; text-align: center; background: #f8f5ef; }
.empty-result b { font: 600 20px "Newsreader", serif; }
.empty-result p { color: var(--muted); font-size: 11px; margin: 8px 0 0; }

.participants { position: sticky; top: 100px; }
.live-badge { color: var(--green); background: var(--green-soft); }
.peer-list { display: grid; border-top: 1px solid var(--soft-line); }
.peer-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--soft-line); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; font: 600 13px "DM Mono", monospace; background: var(--green); }
.avatar-1 { background: #b6763b; }.avatar-2 { background: #6e6798; }.avatar-3 { background: #497a94; }.avatar-4 { background: #8c5c65; }
.peer-row > div:nth-child(2) { display: grid; gap: 3px; }
.peer-row b { font-size: 11px; }
.peer-row small { color: var(--muted); font-size: 9px; }
.peer-state { display: grid; justify-items: end; gap: 4px; }
.link-dot { width: 7px; height: 7px; background: #b6b8b4; border-radius: 50%; }
.link-dot.open { background: #26a179; box-shadow: 0 0 0 3px #e1f1eb; }
.privacy-note { margin-top: 22px; padding: 15px; background: #f6efe5; border-left: 3px solid var(--amber); }
.privacy-note b { font: 600 13px "Newsreader", serif; }
.privacy-note p { color: #6e6558; font-size: 9px; line-height: 1.6; margin: 5px 0 0; }
.event-log { margin-top: 19px; display: grid; gap: 10px; }
.event-log span { display: grid; grid-template-columns: 10px 1fr; align-items: center; gap: 7px; color: var(--muted); font: 400 9px "DM Mono", monospace; }
.event-log i { width: 6px; height: 6px; border: 1px solid #a6aaa6; border-radius: 50%; }
.event-log i.done { border-color: var(--green); background: var(--green); }
.heading-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.new-round-button { border: 1px solid #c99b66; background: #fbf1e3; color: #8a5726; padding: 10px 13px; border-radius: 2px; cursor: pointer; font-size: 11px; font-weight: 700; }
.new-round-button:hover { background: #f4e1c8; }
.table-help { color: var(--muted); font-size: 11px; line-height: 1.65; margin: -7px 0 16px; padding: 11px 13px; border-left: 3px solid #a7c7ba; background: #f1f7f4; }
.chat-panel { margin-top: 22px; border: 1px solid var(--line); background: #fbf9f4; }
.chat-title { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.chat-title b { font: 600 15px "Newsreader", serif; }
.chat-title small { color: var(--muted); font: 400 8px "DM Mono", monospace; }
.chat-messages { min-height: 120px; max-height: 240px; overflow-y: auto; padding: 11px; display: grid; gap: 9px; align-content: start; }
.chat-messages > p { color: var(--muted); font-size: 10px; text-align: center; margin: 38px 0; }
.chat-message { max-width: 88%; border: 1px solid var(--soft-line); background: white; padding: 8px 9px; }
.chat-message.mine { justify-self: end; background: #eaf4ef; border-color: #c8ddd4; }
.chat-message > span { display: flex; gap: 9px; justify-content: space-between; }
.chat-message b { font-size: 8px; color: var(--green); }
.chat-message time { color: #929792; font: 400 7px "DM Mono", monospace; }
.chat-message p { margin: 4px 0 0; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.chat-compose { display: grid; grid-template-columns: 1fr auto; border-top: 1px solid var(--line); }
.chat-compose input { border: 0; background: white; padding: 11px; min-width: 0; font-size: 10px; }
.chat-compose button { border: 0; background: var(--green); color: white; padding: 0 12px; cursor: pointer; font-size: 9px; font-weight: 700; }
.chat-compose button:disabled { opacity: .4; cursor: not-allowed; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 40; max-width: 420px; display: flex; align-items: center; gap: 16px; padding: 14px 17px; color: white; border-radius: 2px; box-shadow: 0 16px 45px rgba(0,0,0,.2); font-size: 12px; }
.error-toast { background: #854b3b; }
.success-toast { background: var(--green-dark); }
.toast button { border: 0; background: transparent; color: white; cursor: pointer; font-size: 19px; }

/* Demo selector and genome graph additions. */
.lobby-stack { display: grid; gap: 18px; min-width: 0; }
.demo-picker { display: grid; gap: 10px; }
.demo-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-card { min-height: 122px; padding: 16px; display: grid; align-content: start; gap: 6px; text-align: left; border: 1px solid var(--line); background: rgba(255,253,248,.72); cursor: pointer; border-radius: 2px; }
.demo-card > span { color: var(--green); font: 500 9px "DM Mono", monospace; }
.demo-card b { font: 600 17px "Newsreader", serif; }
.demo-card small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.demo-card.active { border-color: var(--green); background: #edf6f1; box-shadow: inset 0 -3px var(--green); }
.demo-card:disabled { cursor: default; opacity: .72; }
.demo-card.active:disabled { opacity: 1; }
.invite-mode-note { margin: 0; color: var(--green-dark); font-size: 9px; }
.mode-tabs button:disabled { cursor: not-allowed; opacity: .55; }
.validation-error { margin: 13px 0 0; padding: 9px 11px; color: var(--rust); background: #f8e9e3; border-left: 3px solid var(--rust); font-size: 10px; }
.add-button:disabled { opacity: .45; cursor: not-allowed; }
.role-line { margin: 15px 0 0; padding-top: 12px; border-top: 1px solid var(--soft-line); color: var(--muted); font: 400 9px "DM Mono", monospace; }
.result-intro { margin: -8px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.6; }

.candidate-catalogue { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 0 0 16px; }
.candidate-catalogue > small { width: 100%; color: var(--muted); font: 500 9px "DM Mono", monospace; letter-spacing: .09em; }
.candidate-catalogue button { border: 1px solid #c9c5bb; background: #f6f3ed; color: #5d6561; padding: 7px 9px; cursor: pointer; border-radius: 999px; font: 500 9px "DM Mono", monospace; }
.candidate-catalogue button.active { border-color: #397eae; background: #e5f1f8; color: #1e608d; }
.variant-table th:first-child { width: 50%; }
.variant-table th:nth-child(2), .variant-table th:nth-child(3) { width: 20%; }
.variant-table input { text-transform: uppercase; }
.variant-table input[type="number"] { text-transform: none; }
.graph-panel { margin-top: 20px; border: 1px solid var(--line); background: #fbfaf6; overflow-x: auto; }
.graph-heading { min-width: 760px; display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.graph-heading b { font: 600 16px "Newsreader", serif; }
.graph-heading small { color: var(--muted); font-size: 8px; }
.variation-svg { display: block; min-width: 820px; width: 100%; height: auto; padding: 6px; }
.graph-backbone { stroke: #89918d; stroke-width: 2; }
.graph-ref-node { fill: #e5e4e0; stroke: #afb3b0; stroke-width: .7; }
.graph-ref-node.variant-site { fill: #f2dce3; stroke: #b68191; }
.reference-base text, .alternate-bubble text { fill: #47514d; font: 500 7px "DM Mono", monospace; pointer-events: none; }
.alternate-bubble line { stroke-width: 1.4; }
.alternate-bubble rect { stroke-width: 1; }
.alternate-bubble.blue-alt line, .alternate-bubble.blue-alt rect { stroke: #2d78a8; }
.alternate-bubble.blue-alt rect { fill: #d9edf8; }
.alternate-bubble.amber-alt line, .alternate-bubble.amber-alt rect { stroke: #bd7b27; }
.alternate-bubble.amber-alt rect { fill: #fae7ca; }
.alternate-bubble.released-alt line, .alternate-bubble.released-alt rect { stroke: #16815f; }
.alternate-bubble.released-alt rect { fill: #cfeee2; }
.alternate-bubble .graph-position { fill: #5f6964; font-size: 7px; }
.graph-axis-label { fill: #777f7a; font: 500 8px "DM Mono", monospace; }
.graph-panel.released { margin-top: 0; border-color: #a6c8bb; background: #f4faf7; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 17px; }
.diff-grid > div { border: 1px solid var(--line); background: #faf8f3; padding: 15px; }
.diff-grid > div:first-child { border-left: 3px solid var(--green); }
.diff-grid > div:last-child { border-left: 3px solid var(--amber); }
.diff-grid b { font: 600 14px "Newsreader", serif; }
.diff-grid ul { margin: 10px 0 0; padding-left: 18px; color: #4f5a55; font: 500 10px/1.8 "DM Mono", monospace; }
.diff-empty { color: var(--muted); font-size: 9px; margin: 10px 0 0; }
.variant-add-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.variant-format-note { margin: 12px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.graph-compare-stack { display: grid; gap: 12px; margin-top: 20px; }
.graph-compare-stack .graph-panel { margin-top: 0; }
.inspector-card { padding: 26px; min-width: 0; overflow: hidden; }
.inspector-note { margin: -7px 0 16px; padding: 11px 13px; border-left: 3px solid #6e6798; background: #f2f0f8; color: #5f5a70; font-size: 9px; line-height: 1.65; }
.inspector-derivations { margin-bottom: 15px; max-height: 260px; overflow: auto; }
.inspector-derivations td { background: #fffefa; font-size: 9px; vertical-align: top; }
.inspector-derivations code { display: block; min-width: 180px; max-width: 390px; overflow-wrap: anywhere; color: #3f6257; font: 400 8px/1.5 "DM Mono", monospace; }
.inspector-scroll { width: 100%; max-width: 100%; min-width: 0; max-height: 440px; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--line); background: #181e1c; color: #dbe7e1; scrollbar-color: #63736b #181e1c; }
.inspector-empty { margin: 0; padding: 24px; color: #aab8b1; font-size: 10px; text-align: center; }
.inspector-entry { padding: 11px 13px; border-bottom: 1px solid #35403b; min-width: 0; max-width: 100%; overflow: hidden; }
.inspector-entry:last-child { border-bottom: 0; }
.inspector-entry > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; min-width: 0; }
.inspector-entry b { color: #7ed5b6; font: 500 9px "DM Mono", monospace; letter-spacing: .06em; }
.inspector-entry span { color: #c5d0cb; font-size: 9px; }
.inspector-entry code { display: block; width: 100%; max-width: 100%; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; margin-top: 7px; color: #e8bf7c; font: 400 8px/1.55 "DM Mono", monospace; }

/* How MPPJ works page. */
button.brand { border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; }
.learn-link { border: 1px solid #b8c9c2; background: #edf5f1; color: var(--green-dark); padding: 8px 11px; border-radius: 2px; cursor: pointer; font-size: 10px; font-weight: 700; white-space: nowrap; }
.learn-link:hover { border-color: var(--green); background: var(--green-soft); }
.learn-link.back { margin-left: auto; }
.learn-page { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 80px; }
.learn-hero { padding: 78px 0 66px; max-width: 990px; }
.learn-hero h1 { margin: 0; font: 600 clamp(54px, 7vw, 94px)/.96 "Newsreader", serif; letter-spacing: -.04em; }
.learn-hero > p:last-of-type { max-width: 780px; margin: 27px 0 0; color: #505b56; font-size: 18px; line-height: 1.7; }
.learn-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.learn-links a { border: 1px solid var(--line); background: var(--paper); color: var(--green-dark); padding: 10px 13px; text-decoration: none; font-size: 10px; font-weight: 700; }
.learn-links a:hover { border-color: var(--green); }
.learn-section { margin-bottom: 28px; padding: clamp(24px, 4vw, 48px); border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); min-width: 0; }
.learn-heading { max-width: 830px; margin-bottom: 30px; }
.learn-heading h2 { margin: 0; font: 600 clamp(32px, 4vw, 52px)/1.03 "Newsreader", serif; letter-spacing: -.025em; }
.learn-heading > p:last-child { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 12px 0 0; }
.animated-protocol { display: grid; grid-template-columns: minmax(130px,.85fr) 38px minmax(160px,1fr) 38px minmax(180px,1.1fr) 38px minmax(175px,1fr); gap: 9px; align-items: stretch; }
.animation-sources { display: grid; gap: 8px; }
.mini-source, .crypto-stage { border: 1px solid var(--line); background: #faf8f3; padding: 12px; min-width: 0; }
.mini-source { display: grid; gap: 6px; }
.mini-source > b { color: var(--green); font: 500 9px "DM Mono", monospace; }
.mini-source > span { display: flex; justify-content: space-between; gap: 7px; padding: 5px 7px; background: white; border: 1px solid var(--soft-line); font: 500 8px "DM Mono", monospace; }
.mini-source i { color: #7b4156; font-style: normal; }
.mini-source .missing { opacity: .48; }
.crypto-stage { display: grid; align-content: start; gap: 14px; position: relative; overflow: hidden; }
.crypto-stage header { display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: center; }
.crypto-stage header > span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--green); font: 500 9px "DM Mono", monospace; }
.crypto-stage header div { display: grid; gap: 2px; }
.crypto-stage header b { font-size: 11px; }
.crypto-stage header small { color: var(--muted); font-size: 7px; }
.crypto-stage > p { color: var(--muted); font-size: 8px; line-height: 1.6; margin: 0; }
.prepare-stage { background: #f0f6f3; }
.helper-stage { background: #f2f0f8; }
.helper-stage header > span { background: #6e6798; }
.receiver-stage { background: #fbf3e7; }
.receiver-stage header > span { background: var(--amber); }
.animated-arrow { display: grid; grid-template-rows: 1fr auto 1fr; align-items: center; justify-items: center; overflow: hidden; }
.animated-arrow span { grid-row: 2; width: 100%; height: 1px; background: #8fa29a; position: relative; }
.animated-arrow span::after { content: ""; position: absolute; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: packetFlow 2.8s infinite ease-in-out; }
.animated-arrow.second span::after { animation-delay: .75s; background: #6e6798; }
.animated-arrow.third span::after { animation-delay: 1.5s; background: var(--amber); }
.animated-arrow small { grid-row: 3; align-self: start; margin-top: 7px; color: var(--muted); font: 500 7px "DM Mono", monospace; }
@keyframes packetFlow { 0%,15% { left: -4px; opacity: 0; } 30% { opacity: 1; } 75% { left: calc(100% - 3px); opacity: 1; } 90%,100% { left: calc(100% - 3px); opacity: 0; } }
.cipher-table { display: grid; gap: 7px; }
.cipher-row { display: grid; grid-template-columns: 10px 1fr; gap: 7px; align-items: center; opacity: .45; animation: encryptReveal 2.8s infinite; }
.cipher-row.delay-1 { animation-delay: .22s; }.cipher-row.delay-2 { animation-delay: .44s; }
.cipher-row i { width: 8px; height: 8px; border-radius: 50%; background: #54a88c; box-shadow: 0 0 0 3px rgba(84,168,140,.13); }
.cipher-row code { overflow: hidden; color: #315e50; font: 500 8px "DM Mono", monospace; }
@keyframes encryptReveal { 0%,15% { opacity: .25; transform: translateX(-5px); } 35%,75% { opacity: 1; transform: none; } 100% { opacity: .25; } }
.share-groups { display: grid; gap: 11px; }
.share-group { display: grid; grid-template-columns: 1fr repeat(3,24px); gap: 4px; align-items: center; }
.share-group code { color: #514b77; font: 500 8px "DM Mono", monospace; }
.share-group span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #ddd9ef; color: #574f85; font: 500 7px "DM Mono", monospace; animation: sharePulse 2.8s infinite; }
.share-group.match span:nth-of-type(2) { animation-delay: .18s; }.share-group.match span:nth-of-type(3) { animation-delay: .36s; }
.share-group span.share-missing { border: 1px dashed #aaa6b8; background: transparent; color: #8e8999; animation: none; }
@keyframes sharePulse { 0%,30%,100% { transform: scale(.88); opacity: .55; } 48%,72% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 4px rgba(110,103,152,.11); } }
.unlock-row { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: center; padding: 9px; border: 1px solid var(--line); background: white; }
.unlock-row .lock { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; font: 700 9px "DM Mono", monospace; }
.unlock-row > div { display: grid; gap: 3px; min-width: 0; }
.unlock-row b { font-size: 8px; }.unlock-row code { font: 500 8px "DM Mono", monospace; overflow-wrap: anywhere; }
.unlock-row.unlocked { animation: unlockGlow 2.8s infinite; }.unlock-row.unlocked .lock { color: white; background: var(--green); }.unlock-row.unlocked code { color: var(--green-dark); }
.unlock-row.locked { opacity: .65; }.unlock-row.locked .lock { color: #875f2e; background: #ead8c1; }
@keyframes unlockGlow { 0%,55%,100% { box-shadow: none; } 70%,85% { border-color: #79b29e; box-shadow: 0 0 0 4px rgba(23,107,87,.08); } }
.accuracy-callout, .prototype-warning, .live-timing-callout { margin-top: 22px; padding: 17px 19px; border-left: 4px solid var(--amber); background: #f8f1e7; }
.accuracy-callout b, .prototype-warning b, .live-timing-callout b { font: 600 17px "Newsreader", serif; }
.accuracy-callout p, .prototype-warning p, .live-timing-callout p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.reveal-grid, .trust-grid, .performance-cards { display: grid; gap: 13px; }
.reveal-grid { grid-template-columns: repeat(3,1fr); }
.reveal-grid article { padding: 20px; border: 1px solid var(--line); background: #faf8f3; }
.reveal-grid article.selected { border-color: #86b5a4; background: #eef7f3; }
.reveal-grid article > span, .trust-grid article > span { color: var(--green); font: 500 9px "DM Mono", monospace; }
.reveal-grid h3, .trust-grid h3 { margin: 9px 0; font: 600 20px "Newsreader", serif; }
.reveal-grid code { display: block; padding: 9px; background: #1d2421; color: #a8e0cb; overflow-wrap: anywhere; font: 500 9px "DM Mono", monospace; }
.reveal-grid p, .trust-grid p { color: var(--muted); font-size: 10px; line-height: 1.65; margin: 10px 0 0; }
.release-warning { margin: 17px 0 0; padding: 13px 15px; background: #faedf1; border-left: 3px solid #a8657c; color: #6f5961; font-size: 10px; line-height: 1.65; }
.trust-grid { grid-template-columns: repeat(3,1fr); }
.trust-grid article { padding: 20px; border-top: 3px solid #9dbdb1; background: #f8f6f1; }
.prototype-warning { border-color: var(--rust); background: #f7eae5; }
.performance-cards { grid-template-columns: repeat(3,1fr); margin-bottom: 30px; }
.performance-cards article { padding: 21px; border: 1px solid var(--line); background: #f8f6f1; }
.performance-cards small { color: var(--green); font: 500 8px "DM Mono", monospace; }
.performance-cards strong { display: block; margin-top: 9px; font: 600 29px "Newsreader", serif; }
.performance-cards p { color: var(--muted); font-size: 9px; line-height: 1.6; margin: 7px 0 0; }
.theory-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 15px 17px; background: #edf3f0; border-left: 3px solid var(--green); }
.theory-strip b { width: 100%; font: 600 16px "Newsreader", serif; }
.theory-strip span { color: #3c5d52; font: 500 9px "DM Mono", monospace; }
.theory-strip p { width: 100%; margin: 2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.performance-subheading { margin: 29px 0 12px; font: 600 24px "Newsreader", serif; }
.learn-table td { background: #fffefa; font-size: 10px; line-height: 1.5; }
.learn-table td:first-child { font-family: "DM Mono", monospace; }
.size-note, .benchmark-caveat { color: var(--muted); font-size: 9px; line-height: 1.65; margin: 11px 0 0; }
.live-timing-callout { border-color: var(--green); background: #edf6f1; }
.learn-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; padding: 36px 42px; background: var(--green-dark); color: white; }
.learn-footer h2 { margin: 0; font: 600 36px "Newsreader", serif; }.learn-footer p { margin: 5px 0 0; max-width: 700px; color: #c6dbd3; font-size: 10px; line-height: 1.6; }.learn-footer .primary-button { background: white; color: var(--green-dark); box-shadow: 0 5px 0 #9abeb1; }

@media (max-width: 1050px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 45px; }
  .hero-copy h1 { max-width: 850px; }
  .lobby-card { max-width: 650px; width: 100%; }
  .room-grid { grid-template-columns: 1fr; }
  .release-explainer { grid-template-columns: 1fr 1fr; }
  .release-intro { grid-column: 1 / 3; border-right: 0; border-bottom: 1px solid var(--line); }
  .participants { position: static; }
  .room-header { grid-template-columns: 1fr auto; }
  .leave-button { grid-column: 2; grid-row: 1; }
  .pairing-box { grid-column: 1 / 3; }
  .animated-protocol { grid-template-columns: 1fr; }
  .animated-arrow { height: 40px; grid-template-columns: 1fr auto 1fr; grid-template-rows: 1fr; }
  .animated-arrow span { grid-column: 2; grid-row: 1; width: 1px; height: 100%; }
  .animated-arrow span::after { left: -3px; top: calc(50% - 3px); animation: sharePulse 2.8s infinite; }
  .animated-arrow small { grid-column: 3; grid-row: 1; align-self: center; justify-self: start; margin: 0 0 0 9px; }
  .trust-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .topbar-status > span:nth-child(2), .prototype-pill { display: none; }
  .lobby-page, .room-page, .learn-page { width: min(100% - 22px, 1320px); }
  .learn-link { padding: 7px 8px; font-size: 8px; }
  .learn-hero { padding: 46px 0 38px; }
  .learn-section { padding: 20px; }
  .reveal-grid, .trust-grid, .performance-cards { grid-template-columns: 1fr; }
  .learn-footer { grid-template-columns: 1fr; padding: 28px 24px; }
  .learn-footer .primary-button { width: 100%; }
  .hero-grid { padding-top: 34px; gap: 35px; }
  .hero-copy h1 { font-size: 50px; }
  .demo-cards { grid-template-columns: 1fr; }
  .diff-grid { grid-template-columns: 1fr; }
  .protocol-sketch { padding: 16px; gap: 8px; overflow-x: auto; }
  .sketch-party { width: 90px; height: 94px; }
  .sketch-node { width: 96px; height: 96px; }
  .explain-strip { grid-template-columns: 1fr; }
  .release-explainer { grid-template-columns: 1fr; }
  .release-intro { grid-column: 1; }
  .release-rule { border-right: 0; border-bottom: 1px solid var(--line); }
  .release-rule:last-child { border-bottom: 0; }
  .explain-strip article { border-right: 0; border-bottom: 1px solid var(--line); }
  .room-header { grid-template-columns: 1fr; }
  .pairing-box, .leave-button { grid-column: 1; grid-row: auto; }
  .pairing-box { min-width: 0; }
  .section-heading, .result-heading { align-items: flex-start; flex-direction: column; }
  .run-button { width: 100%; }
  .phase-row { grid-template-columns: 1fr; gap: 7px; }
  .phase-row > i { transform: rotate(90deg); }
  .table-card, .pipeline-card, .result-card, .participants { padding: 18px; }
}
