/* SUBTECH — startup-era theme (Act 0). Later acts will swap these tokens for Cascadia's. */
:root {
  --bg: #f4efe7;
  --panel: #fffdf9;
  --panel2: #faf5ee;
  --ink: #24201b;
  --muted: #857a6f;
  --line: #e7ddd0;
  --accent: #f2613f;
  --accent-ink: #fff;
  --teal: #1f8a70;
  --salt: #8d99a6;
  --insp: #f2b600;
  --danger: #d64545;
  --sel: #fde7df;
  --kit-bg: #eef7f3;
  --kit-line: #cfe7dd;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --marker: "Marker Felt", "Chalkboard SE", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; }
button { font: inherit; color: inherit; }

#app { display: grid; grid-template-rows: auto 1fr; height: 100vh; }

/* ---------- HUD ---------- */
.hud {
  display: flex; align-items: center; gap: 20px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--panel2);
  -webkit-app-region: drag; user-select: none;
}
.electron .hud { padding-left: 84px; }
.hud button { -webkit-app-region: no-drag; }
.brand { font-weight: 800; letter-spacing: .06em; font-size: 15px; }
.brand small { display: block; font-weight: 600; color: var(--muted); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.stats { display: flex; gap: 22px; align-items: center; margin-left: auto; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.pips { display: flex; gap: 3px; }
.pip { width: 9px; height: 14px; border-radius: 2px; background: var(--line); transition: background .3s; }
.pip.on { background: var(--teal); }
.bar { height: 9px; width: 110px; background: var(--line); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--salt); transition: width .5s; }
.bar.insp i { background: var(--insp); }
.bar.voice i { background: #7fb8a4; }
html.theme-cascadia .bar.voice i { background: #7fb8a4; }
.optrow { display: flex; gap: 8px; align-items: stretch; }
.optrow .opt { flex: 1; min-width: 0; }
.grove { flex: none; padding: 0 12px; border-radius: 9px; border: 1px dashed #b9a6e0; background: #f5f0ff; color: #5b3fa0; font-weight: 700; font-size: 12px; cursor: pointer; white-space: nowrap; }
.grove:hover { background: #ebe1ff; border-style: solid; }
/* ---------- Act 4: Resign (after the house) ---------- */
.resign { margin: 8px 4px 0; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 600; letter-spacing: .06em; cursor: pointer; }
.resign:hover { color: var(--ink); border-color: var(--ink); }
/* ---------- Act 4: four tokens (inspiration flash) ---------- */
.tokens .kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--insp); font-weight: 800; }
.tokens .narr { line-height: 1.6; margin: 8px 0 12px; }
.tk-cfg { font-family: ui-monospace, Menlo, monospace; font-size: 15px; margin: 10px 0 8px; }
.tk-cfg span { font-weight: 800; color: var(--accent); }
.tk-btns { display: flex; gap: 8px; margin-bottom: 10px; }
.tk-btns .tk.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.tk-out { width: 100%; border-collapse: collapse; font-size: 13px; }
.tk-out th { text-align: left; color: var(--muted); font-weight: 600; width: 34%; padding: 6px 8px 6px 0; vertical-align: top; }
.tk-out td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.tk-note { font-style: italic; color: var(--muted); min-height: 1.4em; }
.insp-meter { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.insp-meter label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tokens .row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.tk-tip { font-size: 12px; color: var(--muted); margin: -4px 0 10px; }
.tk-btns .tk[data-v] { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
/* the GPP whiteboard (Act 4): same dry-erase board as Act 0 */
.card.wb.gpp { max-width: 860px; }
.wb.gpp .kicker { color: var(--insp); font-family: var(--font); font-weight: 800; }
.wb.gpp .narr, .wb.gpp .invites { font-family: var(--font); color: var(--ink); }
.wb.gpp .narr { line-height: 1.6; margin: 6px 0 8px; }
.wb.gpp .invites { margin-bottom: 14px; }
.wbcols { display: grid; grid-template-columns: 1fr 1.6fr; gap: 22px; margin: 10px 0 6px; }
.wbhead { font-size: 20px; color: #d6402b; margin-bottom: 6px; }
.wbcols .sticky { display: block; width: fit-content; margin: 0 0 8px; }
.wbcols .sticky:nth-child(odd) { transform: rotate(1.1deg); }
.wbcols .sticky.now { background: #e9e9ef; color: #55556a; }
.wb.gpp .wbrules { grid-template-columns: 1fr; }
.wb.gpp .wbrule .anno { white-space: normal; }
.wb .status span { display: block; font-size: 15px; color: #1f8f6a; transform: rotate(-1deg); margin-top: 3px; }
@media (max-width: 640px) { .wbcols { grid-template-columns: 1fr; } }
/* ---------- Act 4: the years (montage) ---------- */
.years .yr { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; opacity: 0; transform: translateY(4px); transition: opacity .5s, transform .5s; }
.years .yr.on { opacity: 1; transform: none; }
.years .yr span { flex: 1; text-align: left; }
.years .yr b { flex: none; width: 74px; color: var(--muted); font-weight: 700; font-size: 12px; padding-top: 2px; }
.bar.insp.ready { box-shadow: 0 0 0 2px var(--insp), 0 0 14px var(--insp); animation: glow 1.2s infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 2px var(--insp), 0 0 4px var(--insp); } }
.money { font-size: 11.5px; line-height: 1.45; text-align: right; color: var(--muted); border-left: 1px solid var(--line); padding-left: 18px; }
.money b { color: var(--ink); }

/* ---------- Layout ---------- */
.main { display: grid; grid-template-columns: 190px 360px 1fr; min-height: 0; }
.side { border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; background: var(--panel2); }
.side .mailbrand { padding: 0 10px 8px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.side .daylabel { padding: 4px 10px 12px; font-size: 12px; color: var(--muted); }
.side .daylabel b { display: block; color: var(--ink); font-size: 18px; }
.folder { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 7px; cursor: pointer; border: 0; background: none; text-align: left; }
.folder:hover { background: var(--line); }
.folder.active { background: var(--sel); font-weight: 650; }
.folder .count { color: var(--muted); font-size: 12px; }
.side .spacer { flex: 1; }
.gohome { margin: 8px 4px 0; padding: 10px; border-radius: 9px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; }
.gohome:hover { background: #000; }
.money .up { color: #4cd07d; font-size: .85em; }
/* The launch button (Glenn's offer): hazard-striped well, a flip-up molly-guard, a status light. */
.launch { margin: 10px 4px 0; padding: 10px 10px 8px; border-radius: 10px; background: #23272b; color: #e8e8e8; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 6px rgba(0,0,0,.25); }
.lp-label { font: 800 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; text-align: center; color: #f5c518; }
.lp-label small { display: block; margin-top: 2px; font-weight: 500; letter-spacing: .06em; text-transform: none; color: #aab; }
.lp-well { position: relative; height: 62px; margin: 8px 0 6px; border-radius: 8px; perspective: 400px;
  background: repeating-linear-gradient(-45deg, #f5c518 0 8px, #1a1a1a 8px 16px); padding: 6px; }
.lp-btn { position: absolute; inset: 7px; border-radius: 6px; border: 2px solid #5c0a06; cursor: pointer; color: #fff;
  font: 900 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-shadow: 0 1px 0 rgba(0,0,0,.4);
  background: radial-gradient(circle at 50% 30%, #ff5a4e, #c8160c 72%); box-shadow: inset 0 -4px 0 #7a0d0d, 0 2px 0 #000; }
.launch:not(.armed) .lp-btn { pointer-events: none; }
.lp-btn:active { box-shadow: inset 0 -1px 0 #7a0d0d; transform: translateY(2px); }
.lp-cover { position: absolute; inset: 3px; border-radius: 8px; cursor: pointer; transform-origin: 50% 0; transition: transform .35s cubic-bezier(.3,1.4,.5,1);
  border: 2px solid rgba(255, 120, 110, .9); background: linear-gradient(160deg, rgba(255,140,130,.55), rgba(200,30,20,.38) 60%, rgba(255,255,255,.25));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 6px rgba(0,0,0,.35); }
.lp-cover { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px; }
.launch:not(.armed) .lp-btn { color: rgba(255, 255, 255, .45); }
.lp-cover span { background: rgba(0, 0, 0, .55); padding: 2px 5px; border-radius: 3px; font: 800 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .3em; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.launch.armed .lp-cover { transform: rotateX(-118deg); }
.lp-status { display: flex; align-items: center; justify-content: center; gap: 6px; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .2em; color: #9aa; }
.lp-status .led { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 6px #2ecc71; }
.launch.armed .lp-status { color: #ff6b5e; }
.launch.armed .lp-status .led { background: #ff3b2f; box-shadow: 0 0 8px #ff3b2f; animation: lp-blink .8s steps(2, start) infinite; }
@keyframes lp-blink { to { visibility: hidden; } }
.mute { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 6px; }

.list { border-right: 1px solid var(--line); overflow: auto; background: var(--panel); }
.item { padding: 11px 14px 11px 10px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; grid-template-columns: 10px 1fr auto; gap: 2px 8px; }
.item:hover { background: var(--panel2); }
.item.sel { background: var(--sel); }
.item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 5px; visibility: hidden; }
.item.unread .dot { visibility: visible; }
.item.unread .from, .item.unread .subj { font-weight: 700; }
.item .time { font-size: 11px; color: var(--muted); }
.item .subj, .item .prev { grid-column: 2 / 4; }
.item .prev { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.arrive { animation: arrive .45s ease-out; }
@keyframes arrive { from { background: #fff1c2; transform: translateX(-8px); } }
.listempty { padding: 40px 20px; color: var(--muted); text-align: center; font-size: 13px; }

.pane { overflow: auto; padding: 22px 28px 48px; background: var(--panel); }
.pane h1 { font-size: 20px; margin: 0 0 14px; line-height: 1.3; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.msg.kit { background: var(--kit-bg); border-color: var(--kit-line); margin-left: 44px; }
.msg.notes { background: #fffbe6; border: 1px dashed #e4cf73; font-family: var(--mono); font-size: 12.5px; margin-left: 44px; }
.msg.new { animation: arrive .5s ease-out; }
.mh { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; font-size: 13px; }
.who b { display: block; }
.who span { color: var(--muted); font-size: 12px; }
.mh .t { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.body { line-height: 1.6; }
.body.mono { font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; line-height: 1.55; }
.money .neg { color: var(--danger); }
.linkish { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--muted); font-size: 12.5px; cursor: pointer; text-decoration: underline; }
.attach { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); cursor: pointer; font-size: 13px; }
.attach:hover { border-color: var(--accent); }

.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.opts h3 { margin: 0 0 2px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.opt { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; }
.opt:hover:not([disabled]) { border-color: var(--accent); background: #fff; }
.opt .tag { font-size: 9.5px; text-transform: uppercase; letter-spacing: .09em; padding: 3px 6px; border-radius: 4px; background: var(--line); color: var(--muted); font-weight: 800; flex: none; }
.opt.dry .tag { background: var(--ink); color: #fff; }
.opt.snoop .tag { background: #5c677d; color: #fff; }
.opt.warm .tag { background: #ffd8cc; color: #9a3412; }
.opt.work .tag { background: #d7efe6; color: #14634f; }
.opt.lazy .tag { background: #ece6dc; color: #7a6a55; }
.opt.salty .tag { background: #8b1e1e; color: #fff; }
.opt.salty { border-color: #e7b9b9; }
.opt.riff { border-style: dashed; }
.opt.riff .tag { background: var(--insp); color: var(--ink); }
.opt .cost { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; padding-left: 8px; }
.opt[disabled] { opacity: .45; cursor: not-allowed; }
.handled { margin-top: 16px; color: var(--muted); font-size: 13px; }
.paneempty { color: var(--muted); display: grid; place-items: center; height: 100%; text-align: center; line-height: 1.7; }

.banner { margin: 10px; padding: 11px 12px; border-radius: 9px; background: #fff6d6; border: 1px solid #f0cf6a; font-size: 13px; line-height: 1.45; }
.banner button { margin-top: 8px; display: block; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(36, 32, 27, .55); display: grid; place-items: center; z-index: 50; padding: 16px; overflow: auto; }
.card { background: var(--panel); border-radius: 14px; max-width: 560px; width: 100%; padding: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.card h2 { margin: 0 0 6px; }
.card p { line-height: 1.6; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 9px; padding: 10px 16px; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(.95); }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.title { text-align: center; padding: 44px 32px; }
.title h1 { font-size: 64px; letter-spacing: .14em; margin: 0; font-weight: 900; }
.title { max-width: 620px; }
.title .sub { color: var(--muted); margin: 6px 0 26px; }
.title .intro { margin: 0 0 6px; text-wrap: balance; }
.title .intro + .row { margin-top: 24px; }
.title .fine { text-wrap: balance; }
.card p, .card h2 { text-wrap: pretty; }
.title .fine { color: var(--muted); font-size: 11.5px; margin-top: 26px; line-height: 1.5; }

.daycard { text-align: center; padding: 48px 32px; }
.daycard .kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.daycard h2 { font-size: 46px; margin: 8px 0 10px; }
.daycard p { color: var(--muted); margin: 0 0 26px; }

.endcard { max-width: 640px; }
.endcard .kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.endcard h2 { font-size: 34px; margin: 6px 0 18px; }
.endcard dl { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; margin: 0; }
.endcard dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.endcard dd { margin: 0; line-height: 1.5; }
.endcard .next { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.6; }

.toasts { position: fixed; top: 62px; right: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 60; pointer-events: none; align-items: flex-end; }
.toast { background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 7px; font-size: 12px; animation: toast 2.6s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
.toast.flavor { max-width: 340px; padding: 9px 12px; font-size: 13px; line-height: 1.45; background: linear-gradient(135deg, #0d47a1, #1e88e5); font-style: italic; animation-duration: 6.2s; }

.confetti { position: fixed; top: -14px; width: 8px; height: 13px; z-index: 70; animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(108vh) rotate(760deg); } }

/* ---------- Bench puzzle (board 7) ---------- */
.bench { max-width: 860px; }
.bench .kicker, .wb .kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tabs { display: flex; gap: 6px; margin: 14px 0 10px; flex-wrap: wrap; }
.tab { padding: 6px 11px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; font-size: 13px; }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
pre.log { background: #1d1b19; color: #d8f3dc; padding: 12px 14px; border-radius: 8px; font-family: var(--mono); font-size: 12px; overflow: auto; white-space: pre; margin: 0; line-height: 1.55; }
.scope { background: #111; border-radius: 8px; padding: 6px; }
.scope svg { width: 100%; height: auto; display: block; }
.askash { margin: 10px 0 0; background: none; border: 1px dashed var(--line); border-radius: 7px; padding: 5px 10px; font: inherit; font-size: 13px; color: var(--teal); cursor: pointer; }
.askash[aria-pressed="true"] { color: var(--muted); }
pre.log .pin { background: rgba(255, 214, 10, .16); color: #fff3b0; }
pre.log .pin b { color: #ffd60a; font-weight: normal; }
.kitnotes { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--teal); background: var(--panel2); border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.5; }
.kitnotes .who { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.kitnotes p { margin: 0 0 6px; }
.kitnotes ol { list-style: none; margin: 0; padding: 0; }
.kitnotes li { margin: 0 0 4px; }
.kitnotes li b { color: #b58900; font-weight: normal; font-size: 15px; }
.kitnotes .ash { margin: 6px 0 0; color: var(--muted); font-style: italic; }
.q { margin-top: 18px; }
.q h3 { margin: 0 0 8px; font-size: 15px; }
.choices { display: grid; gap: 8px; }
.choice { text-align: left; padding: 10px 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; line-height: 1.4; }
.choice:hover { border-color: var(--accent); background: #fff; }
.feedback { margin-top: 10px; font-size: 13px; color: var(--danger); min-height: 1.4em; line-height: 1.5; }
.feedback.ok { color: var(--teal); }

/* ---------- Whiteboard puzzle (the invention): dry-erase style ---------- */
.card.wb {
  max-width: 1140px; position: relative; font-family: var(--marker); color: #1f8f6a;
  background: #fbfbf7; border: 12px solid #cfd3d6; border-radius: 6px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .035), 0 20px 60px rgba(0, 0, 0, .35);
}
.wb .doodle { position: absolute; top: 14px; right: 18px; width: 130px; opacity: .85; }
.wbtitle { font-family: var(--marker); font-weight: normal; font-size: 30px; color: #d6402b; margin: 0; letter-spacing: .02em; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.wbsub { font-size: 18px; margin: 6px 0 4px; }
.wbsub b { color: #d6402b; font-weight: normal; }
.howto { font-family: var(--font); color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; margin: 4px 0 10px; align-items: center; color: #2b2b2b; }
.legend svg { vertical-align: middle; }
.legend .key { font-weight: normal; display: inline-block; border: 1.5px solid #2b2b2b; padding: 0 4px; border-radius: 2px; font-size: 12px; }
.houses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.house { position: relative; }
.sticky { display: inline-block; background: #bfe2f6; color: #23313a; padding: 6px 9px 7px; font-size: 13.5px; line-height: 1.25; transform: rotate(-1.6deg); box-shadow: 1px 2px 4px rgba(0, 0, 0, .14); max-width: 92%; }
.house:nth-child(2) .sticky { transform: rotate(1.2deg); background: #fff1a8; }
.house:nth-child(3) .sticky { transform: rotate(-.6deg); background: #ffc9d6; }
.sticky b { font-weight: normal; font-size: 15px; }
.board-svg { width: 100%; height: auto; display: block; }
.result { font-size: 14px; min-height: 3.4em; line-height: 1.3; margin-top: 2px; }
.result.ok { color: #1f8f6a; }
.result.bad { color: #d6402b; }
.result.bad b { font-weight: normal; text-decoration: underline double; text-underline-offset: 3px; }
.wbrules { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 26px; margin: 14px 0 4px; }
.wbrule { display: flex; gap: 9px; align-items: center; background: none; border: 0; padding: 3px 2px; cursor: pointer; text-align: left; font-family: var(--marker); font-size: 17px; color: #1f8f6a; }
.wbrule:hover .txt { text-decoration: underline wavy rgba(31, 143, 106, .5); }
.wbrule .num { width: 26px; text-align: center; font-size: 20px; flex: none; }
.wbrule svg { flex: none; }
.wbrule.struck .txt { text-decoration: line-through; text-decoration-color: #d6402b; text-decoration-thickness: 2px; }
.wbrule .anno { color: #d6402b; font-size: 13.5px; transform: rotate(-3deg); white-space: nowrap; }
.wb .row { align-items: center; }
.wb .status { margin-right: auto; font-size: 16px; color: #d6402b; }
.wb .status.win { color: #1f8f6a; font-size: 20px; }
.scrawl { margin-top: 8px; font-size: 16px; color: #1f8f6a; }
.scrawl span { display: block; color: #d6402b; font-size: 15px; transform: rotate(-1.5deg); margin-top: 4px; }

/* the wet floor (Act 2 whiteboard) */
.wf-legend { font-size: 14px; color: #2b2b2b; display: flex; align-items: center; gap: 4px; margin: 2px 0 8px; }
.wf-key.wet { display: inline-block; width: 14px; height: 12px; background: rgba(90, 170, 230, .45); border-radius: 2px; }
.wf-room { fill: none; stroke: #3a3a3a; stroke-width: 1.8; }
.wf-lbl { font-family: var(--marker); font-size: 10px; fill: #6b6b6b; }
.wf-wet { fill: rgba(90, 170, 230, .42); }
.wf-door { stroke: #b07a2a; stroke-width: 4; stroke-linecap: round; }
.wf-path { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.wf-path.plan { stroke: #9a9a9a; stroke-dasharray: 3 4; }
.wf-path.ok { stroke: #1f8f6a; stroke-dasharray: 5 3; }
.wf-path.bad { stroke: #d6402b; stroke-dasharray: 2 3; opacity: .55; }
.wf-print { fill: #6b4a2a; }
.wf-z, .wf-q { font-family: var(--marker); font-size: 11px; fill: #d6402b; }
.wf-msg { font-size: 22px; color: #d6402b; margin: 12px 0 2px; }
.wf-msg span { color: #1f8f6a; }
.wf-part { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; margin: 4px 0; }
.wf-plabel { width: 64px; font-size: 15px; color: #d6402b; }
.wf .wbrule { font-size: 16px; }
.wf .wbrule .anno { font-size: 12.5px; }

svg .edge { stroke-linecap: round; fill: none; }
svg .edge.wire { stroke: #2b2b2b; stroke-width: 3.6; }
svg .edge.wifi { stroke: #1f8f6a; stroke-width: 2.8; stroke-dasharray: 9 7; }
svg .edge.radio { stroke: #d6402b; stroke-width: 3.2; stroke-dasharray: 1 8; }
svg .edge.off { opacity: .13; }
svg .edge.cut { opacity: .25; stroke: #999; }
svg .node circle, svg .node rect { stroke: #2b2b2b; stroke-width: 2.4; fill: #fbfbf7; transition: fill .3s; }
svg .node.lit circle, svg .node.lit rect { fill: #d9f2e6; }
svg .node.heard circle, svg .node.heard rect { fill: #ffe2bf; }
svg .pkt { fill: #ff8c1a; stroke: #fff; stroke-width: 1.5; }
svg .pkt.drop { animation: pktdrop .45s forwards; transform-box: fill-box; transform-origin: center; }
svg .pkt.die { fill: #d6402b; animation: pktdrop .45s forwards; transform-box: fill-box; transform-origin: center; }
@keyframes pktdrop { to { transform: scale(2.4); opacity: 0; } }
.lesson { font-family: var(--font); font-size: 14.5px; line-height: 1.45; margin: 8px 0 6px; min-height: 7.5em; }
.lesson p { margin: 0 0 5px; }
.lesson .danny b { color: #e07a00; }
.lesson .kit b { color: #1f8f6a; }
.lesson p:not(.danny):not(.kit) { color: var(--muted); font-style: italic; }
.card.wb.wbl { max-width: 760px; }
.wbl .wbrules { grid-template-columns: 1fr; }
.lessonboard { max-width: 460px; margin: 0 auto; }
.wb .btn:disabled { opacity: .5; cursor: default; }
svg .nid { font-family: var(--marker); font-size: 13px; fill: #2b2b2b; text-anchor: middle; }
svg .nlabel { font-family: var(--marker); font-size: 12px; fill: #2b2b2b; text-anchor: middle; paint-order: stroke; stroke: #fbfbf7; stroke-width: 4px; stroke-linejoin: round; }
svg .mk { font-family: var(--marker); font-size: 20px; }
svg .mk.ok { fill: #1f8f6a; }
svg .mk.bad { fill: #d6402b; }
svg.storm .edge:not(.off) { animation: storm .18s infinite alternate; }
@keyframes storm { from { stroke: #d6402b; } to { stroke: #ffb703; } }
svg .couch { font-size: 18px; }

.photo { position: relative; font-family: var(--marker); color: #1f8f6a; }

/* ---------- Montage ---------- */
.montage .narr { line-height: 1.7; color: var(--ink); margin: 0 0 16px; }
.inv { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin: 7px 0; position: relative; background: #fff; font-size: 13px; }
.inv span { color: var(--muted); }
.stamp { position: absolute; right: 14px; top: 50%; transform: translateY(-50%) rotate(-9deg) scale(2.4); opacity: 0; color: var(--danger); border: 3px solid var(--danger); padding: 1px 8px; font-weight: 900; letter-spacing: .12em; border-radius: 4px; transition: all .16s ease-in; background: rgba(255,255,255,.85); }
.stamp.on { opacity: 1; transform: translateY(-50%) rotate(-9deg) scale(1); }


@media (max-width: 980px) {
  .main { grid-template-columns: 1fr; grid-template-rows: auto 220px 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .spacer { display: none; }
  .list { border-right: 0; border-bottom: 1px solid var(--line); }
  .hud { flex-wrap: wrap; }
  .stats { margin-left: 0; flex-wrap: wrap; }
  .houses { grid-template-columns: 1fr; }
  .wbrules { grid-template-columns: 1fr; }
}

/* ---------- Cascadia theme (after the mail migration) ---------- */
html.theme-cascadia {
  --bg: #eceef1;
  --panel: #ffffff;
  --panel2: #f5f6f8;
  --ink: #1d2227;
  --muted: #687280;
  --line: #d6dbe1;
  --accent: #33618f;
  --teal: #33618f;
  --salt: #8a939c;
  --insp: #c2a000;
  --sel: #e2eaf3;
  --kit-bg: #f2f5f8;
  --kit-line: #d6dbe1;
}
html.theme-cascadia .card, html.theme-cascadia .msg, html.theme-cascadia .opt, html.theme-cascadia .btn,
html.theme-cascadia .folder, html.theme-cascadia .gohome, html.theme-cascadia .banner, html.theme-cascadia .choice,
html.theme-cascadia .attach, html.theme-cascadia .av, html.theme-cascadia .tab, html.theme-cascadia .opt .tag { border-radius: 2px; }
html.theme-cascadia .hud { background: #1f2a36; color: #e8edf2; border-bottom-color: #1f2a36; }
html.theme-cascadia .hud .stat label, html.theme-cascadia .brand small, html.theme-cascadia .money { color: #a9b4c0; }
html.theme-cascadia .money b { color: #fff; }
html.theme-cascadia .money .neg { color: #ff8a80; }
html.theme-cascadia .money { border-left-color: #3a4756; }
html.theme-cascadia .pip { background: #3a4756; }
html.theme-cascadia .bar { background: #3a4756; }
html.theme-cascadia .opt.warm .tag { background: #e6e9ed; color: #4b5563; }
html.theme-cascadia .opt.work .tag { background: #e2eaf3; color: #33618f; }
html.theme-cascadia .item.arrive { animation: none; }

/* ---------- Blue (a can of it) ---------- */
.bluecan { margin: 8px 4px 0; padding: 9px 10px; border: 0; border-radius: 10px; background: linear-gradient(90deg, #0d47a1, #1e88e5 45%, #90caf9 55%, #1e88e5 65%, #0d47a1); color: #fff; font-weight: 800; letter-spacing: .04em; cursor: pointer; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.25); }
.bluecan small { display: block; font-weight: 600; font-size: 11px; opacity: .85; margin-top: 1px; }
.bluecan:hover { filter: brightness(1.08); }
.bluecan:active { transform: translateY(1px); }

/* ---------- Ragequit ---------- */
.ragequit { margin: 8px 4px 0; padding: 10px; border: 2px solid #8b1a1a; border-radius: 4px; background: #fff; color: #8b1a1a; font-weight: 900; letter-spacing: .14em; cursor: pointer; animation: seethe 1.6s ease-in-out infinite; }
.ragequit:hover { background: #8b1a1a; color: #fff; }
@keyframes seethe { 0%, 100% { transform: translateX(0); } 48% { transform: translateX(0); } 50% { transform: translateX(-1px); } 52% { transform: translateX(1px); } 54% { transform: translateX(0); } }
.card.rage { max-width: 620px; text-align: left; }
.rage-to { font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.rage-body { line-height: 1.6; max-height: 50vh; overflow: auto; }
.btn.danger { background: #b3261e; border-color: #b3261e; color: #fff; }

/* ---------- Epilogue inboxes ---------- */
/* Green Horizon Mail: a rocket company. Night sky up top, one green, rounded but not cute. */
html.theme-green {
  --bg: #eef2ef; --panel: #ffffff; --panel2: #f4f7f5; --ink: #142019; --muted: #5d6f64; --line: #d3ddd6;
  --accent: #2f8f5b; --teal: #2f8f5b; --salt: #8a978f; --insp: #d9a400; --sel: #dff0e5; --kit-bg: #f0f7f2; --kit-line: #cfe5d6;
}
html.theme-green .card, html.theme-green .msg, html.theme-green .opt, html.theme-green .btn, html.theme-green .folder,
html.theme-green .banner, html.theme-green .av, html.theme-green .opt .tag { border-radius: 6px; }
html.theme-green .hud { background: linear-gradient(180deg, #0b1320, #13213a); color: #e9f1ec; border-bottom-color: #0b1320; }
html.theme-green .hud .stat label, html.theme-green .brand small, html.theme-green .money { color: #9fb3c8; }
html.theme-green .money b { color: #fff; }
html.theme-green .money .neg { color: #ff8a80; }
html.theme-green .money { border-left-color: #2a3a55; }
html.theme-green .pip, html.theme-green .bar { background: #2a3a55; }
html.theme-green .pip.on { background: #5fd394; }
html.theme-green .bar i { background: #9fb3c8; }
html.theme-green .bar.insp i { background: var(--insp); }
html.theme-green .mailbrand { color: #2f8f5b; }
/* Treemail: Cascadia's free email service. Friendlier than Cascadia Mail, still Cascadia, with ads. */
html.theme-treemail {
  --bg: #f3f4f8; --panel: #ffffff; --panel2: #f7f8fc; --ink: #1f2330; --muted: #6b7183; --line: #dde0ea;
  --accent: #3a7bd5; --teal: #3a7bd5; --salt: #8b90a0; --insp: #e0a800; --sel: #e3edfb; --kit-bg: #f0f5fd; --kit-line: #d5e3f7;
}
html.theme-treemail .card, html.theme-treemail .msg, html.theme-treemail .opt, html.theme-treemail .btn, html.theme-treemail .folder,
html.theme-treemail .banner, html.theme-treemail .av, html.theme-treemail .opt .tag { border-radius: 12px; }
html.theme-treemail .hud { background: #ffffff; }
html.theme-treemail .mailbrand { color: #3a7bd5; }
html.theme-treemail .side .spacer::after { content: 'Treemail is a free service from Cascadia. Upgrade to Treemail Canopy for 15 GB more storage!'; display: block; margin: 12px 4px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 11.5px; }

/* ---------- Negotiation ---------- */
.nego-top { display: flex; gap: 28px; align-items: flex-end; margin: 14px 0 6px; flex-wrap: wrap; }
.nego-top label { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.nego-top b { font-size: 26px; }
.nego-top .comp .bar { width: 200px; height: 10px; }
.nego-top .comp .bar i { background: #6d8fb3; transition: width .5s, background .5s; }
.nego-top .comp .bar.low i { background: var(--danger); }
.nego-top .comp span { font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.nego-log { max-height: 300px; overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 2px; margin: 8px 0 14px; display: flex; flex-direction: column; gap: 8px; }
.nego-log p { margin: 0; line-height: 1.55; }
.nego-log .narr { color: var(--muted); font-style: italic; }
.nego-log .kit { padding-left: 14px; border-left: 3px solid var(--kit-line); }
.nego-log .new { animation: arrive .5s ease-out; }
html.theme-cascadia .pip.on { background: #8fb8e3; }
html.theme-cascadia .bar i { background: #a9b4c0; }
html.theme-cascadia .bar.insp i { background: var(--insp); }

/* ---------- The laminated Principles card ---------- */
.card.lamcard { max-width: 520px; background: transparent; box-shadow: none; padding: 0; }
.laminated {
  background: linear-gradient(135deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 38%, rgba(255,255,255,.35) 62%, rgba(255,255,255,0) 100%), #f7f5ee;
  border: 1px solid #d8d4c6; border-radius: 14px; padding: 18px 20px 14px;
  box-shadow: 0 0 0 6px rgba(255,255,255,.55), 0 18px 50px rgba(0,0,0,.35);
  font-family: Georgia, "Times New Roman", serif; color: #233127;
}
.lam-head { display: flex; gap: 12px; align-items: center; background: #2f6b4f; color: #fff; margin: -18px -20px 12px; padding: 12px 20px; border-radius: 13px 13px 0 0; }
.lam-head b { display: block; letter-spacing: .12em; font-size: 15px; }
.lam-head span { font-size: 12px; opacity: .85; font-style: italic; }
.laminated ol { margin: 0; padding-left: 22px; font-size: 13px; line-height: 1.45; }
.laminated li { margin-bottom: 5px; }
.laminated li b { color: #2f6b4f; }
.lam-foot { margin-top: 10px; font-size: 11px; font-style: italic; text-align: center; color: #5b6b60; }
.lamcard .row .btn.ghost { background: var(--panel); }

/* ---------- The Loop ---------- */
.loop h2 { margin: 4px 0 0; }
.lp-top { align-items: center; gap: 22px; }
.lp-top b { font-size: 18px; }
.lp-top span { font-size: 13px; }
.lp-blue { margin-left: auto; padding: 6px 11px; }
.choice[disabled] { opacity: .5; cursor: not-allowed; }
.choice[disabled]:hover { border-color: var(--line); background: var(--panel2); }
.choice i { font-style: normal; color: var(--muted); }
.lp-q { font-size: 15px; line-height: 1.55; padding: 12px 14px; margin: 12px 0 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; animation: swim 3.2s ease-in-out infinite; }
@keyframes swim {
  0%, 100% { filter: blur(var(--blur)); transform: none; }
  50% { filter: blur(calc(var(--blur) * 1.7)); transform: translateX(2px) skewX(-.6deg); }
}
.lp-code { background: #1d1b19; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; filter: blur(calc(var(--blur) * .3)); overflow-x: auto; }
.lp-line { background: transparent; border: 0; color: #d8f3dc; text-align: left; font-family: var(--mono); font-size: 13px; white-space: pre; padding: 2px 6px; border-radius: 4px; cursor: text; }
.lp-line:hover, .lp-line:focus-visible { background: #2f2c28; outline: none; }
.lp-time { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.lp-time .bar { width: 200px; height: 8px; }
.lp-time .bar i { background: #6d8fb3; transition: width 1s linear; }
.lp-time .bar.low i { background: var(--danger); }
.lp-say { min-height: 1.6em; color: var(--muted); font-style: italic; margin: 8px 0 10px; line-height: 1.5; }
.lp-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.lp-after { margin-top: 12px; }
.skipto { margin: 14px auto 0; text-align: center; color: var(--muted); font-size: 12.5px; }
.skipto .linkish { display: inline; margin: 0 3px; padding: 2px 4px; }
.lp-cost { float: right; margin-left: 14px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
/* Act 2: the training module */
.training h2 { margin: 4px 0 0; }
.tr-prog { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; font-size: 12.5px; color: var(--muted); }
.tr-prog .bar { width: 220px; height: 8px; }
.tr-prog .bar i { background: #6d8fb3; transition: width .4s; }
.tr-slide { padding: 14px 16px; margin: 12px 0 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; line-height: 1.55; }
.tr-slide h3 { margin: 0 0 6px; font-size: 17px; }
.tr-slide p { margin: 0 0 8px; }
.tr-art { color: var(--muted); font-style: italic; font-size: 13px; padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 6px; }
.tr-art.img { margin: 0; padding: 0; border: 0; }
.tr-art.img img { display: block; width: 100%; max-height: 300px; object-fit: contain; border-radius: 6px; background: #fff; }
.tr-art.img figcaption { margin-top: 4px; font-size: 11px; text-align: right; }
.tr-nav { justify-content: flex-end; align-items: center; gap: 14px; margin-top: 10px; }
.tr-nav .linkish { margin: 0 auto 0 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.tr-clock { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; font-variant-numeric: tabular-nums; }
/* Act 2: the software exception form */
.exception h2 { margin: 4px 0 0; }
.ex-row { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 10px 0; background: var(--panel2); }
.ex-row.approved { border-color: var(--teal); }
.ex-row.pending { opacity: .8; }
.ex-name b { display: block; }
.ex-name span { font-size: 12.5px; color: var(--muted); }
.ex-res { font-size: 13px; margin-top: 6px; color: var(--danger); }
.ex-row.approved .ex-res { color: var(--teal); }
.ex-row.pending .ex-res { color: var(--muted); }
.ex-res i { color: var(--muted); font-style: normal; }
.ex-cats { margin: 8px 0 0; }
.ex-cats .tab { font-size: 12px; padding: 4px 9px; }
/* Act 2: the heartwood */
.heartwood h2 { margin: 4px 0 0; }
.hw-meters { display: flex; gap: 28px; flex-wrap: wrap; margin: 12px 0 6px; font-size: 12.5px; color: var(--muted); }
.hw-meters > div { display: flex; align-items: center; gap: 8px; }
.hw-meters label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.hw-meters .bar { width: 160px; }
.hw-meters .bar i { background: #6d8fb3; }
.hw-voice { display: flex; align-items: center; gap: 6px; }
.hw-sec { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: var(--panel2); }
.hw-sec h3 { margin: 0 0 4px; font-size: 14px; }
.hw-sec p { margin: 0 0 6px; line-height: 1.5; font-size: 13.5px; white-space: pre-line; }
.hw-sec.gen p { color: var(--muted); font-style: italic; }
.hw-sec .tabs { margin: 4px 0 0; }
.hw-sec .tab { font-size: 12px; padding: 4px 9px; }
.hw-sec .tab i { font-style: normal; color: var(--muted); margin-left: 4px; }
.hw-empty { color: var(--muted); }
.hw-note { color: var(--muted); font-size: 13px; }
.heartwood { max-height: 92vh; overflow-y: auto; }
/* Act 2: the backport */
.backport h2 { margin: 4px 0 0; }
.bp-top { display: flex; gap: 20px; align-items: center; margin: 12px 0 6px; flex-wrap: wrap; }
.bp-top label { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.bp-top > div > b { font-size: 24px; font-variant-numeric: tabular-nums; color: var(--danger); }
.bp-top > div > b.ok { color: var(--teal); }
.bp-pings { flex: 1; min-width: 240px; }
.bp-ping { font-size: 12.5px; color: var(--muted); border-left: 3px solid #6d8fb3; padding: 4px 10px; background: var(--panel2); animation: bpin .4s ease-out; }
.bp-ping b { color: var(--ink); font-weight: 700; margin-right: 6px; font-size: 12.5px; }
@keyframes bpin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.bp-rings { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 10px; }
.bp-ring { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: var(--panel2); }
.bp-ring i { font-style: normal; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.bp-ring.done { border-color: var(--teal); color: var(--teal); }
.bp-ring.next { border-color: var(--accent); }
.backport { max-height: 94vh; overflow-y: auto; }
/* Act 3: Growth Rings */
.rings h2 { margin: 4px 0 0; }
.rings { max-height: 94vh; overflow-y: auto; }
.rings .hw-meters b { font-size: 18px; color: var(--ink); }

/* ---------- Mail logos (generated art) ---------- */
.side .mailbrand img { display: block; width: 150px; max-width: 100%; height: auto; }
.side .mailbrand span { display: block; margin-top: 2px; }

/* ---------- The USB-101 certificate ---------- */
.cert { position: relative; margin: 12px 0 10px; container-type: inline-size; }
.cert img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.cert-meta { position: absolute; left: 25%; right: 25%; top: 85.5%; text-align: center; font-size: 1.35cqw; color: #5d7a78; font-variant-numeric: tabular-nums; }
.card.certcard { max-width: 860px; }

/* ---------- Attached photos ---------- */
.card.photocard { max-width: 820px; }
.photo-att { margin: 0 0 12px; }
.photo-att img { display: block; width: 100%; height: auto; border-radius: 4px; }
