/* Interview prep — "Workbench Coach".
   Layout: tree | working list | details panel. Look: navy bar, pill controls, orange voice orb,
   a colour per stage and per item type, ratings red → green. Four palettes; light only.
   No inline style attributes anywhere (CSP), so colours are applied through classes. */

:root {
  color-scheme: light;
  --bg: #EDF2F6; --card: #FFFFFF; --ink: #0F2232; --muted: #5A6B7A; --faint: #8A99A6; --line: #DCE4EA;
  --navy: #0F2232; --navy-2: #1B3448; --on-navy: #F3F7FA; --navy-muted: #9FB2C2; --navy-label: #FFB283;
  --accent: #F2762E; --on-accent: #FFFFFF; --danger: #C2412F;
  --c-recruiter: #2E9C6A; --c-hm: #F2762E; --c-takehome: #2F6FDE; --c-presentation: #8A4FD8; --c-onsite: #D6427A;
  --c-research: #0E9AA7; --c-new: #5A6B7A; --c-x1: #C98A00; --c-x2: #5E9C2A; --c-x3: #3E7CB1;
  --r1: #D9534F; --r2: #EE8A3C; --r3: #D9A600; --r4: #6FAF3C; --r5: #2E9C6A;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --soft: color-mix(in srgb, var(--bg) 55%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, #fff);
  --t-recruiter: color-mix(in srgb, var(--c-recruiter) 15%, #fff); --t-hm: color-mix(in srgb, var(--c-hm) 15%, #fff);
  --t-takehome: color-mix(in srgb, var(--c-takehome) 15%, #fff); --t-presentation: color-mix(in srgb, var(--c-presentation) 15%, #fff);
  --t-onsite: color-mix(in srgb, var(--c-onsite) 15%, #fff); --t-research: color-mix(in srgb, var(--c-research) 15%, #fff);
  --t-new: color-mix(in srgb, var(--c-new) 15%, #fff); --t-x1: color-mix(in srgb, var(--c-x1) 15%, #fff);
  --t-x2: color-mix(in srgb, var(--c-x2) 15%, #fff); --t-x3: color-mix(in srgb, var(--c-x3) 15%, #fff);
  --q: var(--accent); --task: var(--c-takehome); --res: var(--c-research); --skill: var(--c-presentation); --note: #B98A00;
}
:root[data-palette="lagoon"] {
  --bg: #E9F3F1; --ink: #0B2E2F; --line: #D3E4E1; --muted: #557070;
  --navy: #0B3B3C; --navy-2: #175253; --on-navy: #EFFAF8; --navy-muted: #9CC2BF; --navy-label: #FFB3A9;
  --accent: #F25F4C; --c-recruiter: #1E9E74; --c-hm: #F25F4C; --c-takehome: #2B86C5; --c-presentation: #6C63D9; --c-onsite: #D98A00; --c-research: #12A3A3;
}
:root[data-palette="berry"] {
  --bg: #F3EEF6; --ink: #24143A; --line: #E4DAEB; --muted: #6B5C7A;
  --navy: #2A1740; --navy-2: #3E2659; --on-navy: #F8F2FC; --navy-muted: #BBA6CF; --navy-label: #FF9EC0;
  --accent: #E0457B; --c-recruiter: #3BA676; --c-hm: #E0457B; --c-takehome: #4A6CF7; --c-presentation: #9B51E0; --c-onsite: #E8892B; --c-research: #1BA3B8;
}
:root[data-palette="indigo"] {
  --bg: #EEF0F8; --ink: #171936; --line: #DDE0EF; --muted: #5D6180;
  --navy: #1A1B3A; --navy-2: #2A2C55; --on-navy: #F1F2FC; --navy-muted: #A9ACD3; --navy-label: #FFD27A;
  --accent: #5457E8; --c-recruiter: #1F9D66; --c-hm: #5457E8; --c-takehome: #0B93D1; --c-presentation: #C026D3; --c-onsite: #EF6C1A; --c-research: #0F9F8F;
}

/* colour classes (stage colour → --sc/--st, type tone → --tc, rating → --rc) */
.col-recruiter { --sc: var(--c-recruiter); --st: var(--t-recruiter) }
.col-hm { --sc: var(--c-hm); --st: var(--t-hm) }
.col-takehome { --sc: var(--c-takehome); --st: var(--t-takehome) }
.col-presentation { --sc: var(--c-presentation); --st: var(--t-presentation) }
.col-onsite { --sc: var(--c-onsite); --st: var(--t-onsite) }
.col-research { --sc: var(--c-research); --st: var(--t-research) }
.col-new { --sc: var(--c-new); --st: var(--t-new) }
.col-x1 { --sc: var(--c-x1); --st: var(--t-x1) }
.col-x2 { --sc: var(--c-x2); --st: var(--t-x2) }
.col-x3 { --sc: var(--c-x3); --st: var(--t-x3) }
.col-accent { --sc: var(--accent); --st: var(--accent-soft) }
.tone-question { --tc: var(--q) } .tone-task { --tc: var(--task) } .tone-research { --tc: var(--res) }
.tone-skill { --tc: var(--skill) } .tone-note { --tc: var(--note) } .tone-voice { --tc: var(--accent) }
.tone-good { --tc: var(--c-recruiter) } .tone-blue { --tc: var(--c-takehome) }
.rc-1 { --rc: var(--r1) } .rc-2 { --rc: var(--r2) } .rc-3 { --rc: var(--r3) } .rc-4 { --rc: var(--r4) } .rc-5 { --rc: var(--r5) }

* { box-sizing: border-box }
html, body { height: 100%; margin: 0 }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--body) }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer; background: none; border: 0; padding: 0 }
a { color: inherit }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px }
[hidden] { display: none !important }
kbd { font: 600 11px var(--body); border-radius: 6px; padding: 1px 6px; background: rgb(255 255 255 / .16); color: inherit }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }
svg { flex: none }

.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 400px; grid-template-rows: 60px minmax(0, 1fr); height: 100% }

/* ---------------------------------------------------------------- top bar */
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--navy); color: var(--on-navy); z-index: 15 }
.logo { font: 800 19px var(--display); letter-spacing: -.02em; display: flex; gap: 10px; align-items: center; width: 230px; text-decoration: none }
.logo i { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(var(--c-recruiter) 0 20%, var(--c-hm) 0 40%, var(--c-takehome) 0 60%, var(--c-presentation) 0 80%, var(--c-onsite) 0); display: grid; place-items: center }
.logo i::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--navy) }
.cmd { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; background: var(--navy-2); border-radius: 999px; padding: 0 16px; color: var(--navy-muted) }
.cmd input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--on-navy); padding: 9px 0; outline: none }
.cmd input::placeholder { color: var(--navy-muted) }
.cmd:focus-within { outline: 3px solid var(--accent); outline-offset: 2px }
.top .sp { flex: 1 }
.palbtn { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--navy-2); color: var(--on-navy); font-weight: 600 }
.sw { display: inline-flex } .sw i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--navy-2); margin-left: -5px } .sw i:first-child { margin-left: 0 }
.sw-coach i:nth-child(1) { background: #0F2232 } .sw-coach i:nth-child(2) { background: #F2762E } .sw-coach i:nth-child(3) { background: #2F6FDE } .sw-coach i:nth-child(4) { background: #2E9C6A }
.sw-lagoon i:nth-child(1) { background: #0B3B3C } .sw-lagoon i:nth-child(2) { background: #F25F4C } .sw-lagoon i:nth-child(3) { background: #2B86C5 } .sw-lagoon i:nth-child(4) { background: #D98A00 }
.sw-berry i:nth-child(1) { background: #2A1740 } .sw-berry i:nth-child(2) { background: #E0457B } .sw-berry i:nth-child(3) { background: #4A6CF7 } .sw-berry i:nth-child(4) { background: #E8892B }
.sw-indigo i:nth-child(1) { background: #1A1B3A } .sw-indigo i:nth-child(2) { background: #5457E8 } .sw-indigo i:nth-child(3) { background: #C026D3 } .sw-indigo i:nth-child(4) { background: #EF6C1A }
.newbtn { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 9px 16px; font-weight: 700; display: flex; gap: 8px; align-items: center; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent) }
.newbtn svg, .palbtn svg { width: 16px; height: 16px }
.menubtn { display: none; width: 40px; height: 40px; border-radius: 12px; color: var(--on-navy); place-items: center }
.menubtn svg { width: 22px; height: 22px }

.pop { position: fixed; z-index: 50; top: 64px; right: 16px; background: var(--card); color: var(--ink); border-radius: 18px; padding: 8px; box-shadow: 0 18px 50px rgb(10 20 30 / .22); min-width: 260px; display: flex; flex-direction: column; gap: 2px }
.pop button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-align: left; font-weight: 600 }
.pop button:hover, .pop button[aria-pressed="true"] { background: var(--bg) }
.pop small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px }
.pop .sw i { width: 18px; height: 18px; border-color: var(--card) }
.pop .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 15%, #fff); color: var(--tc); font: 800 13px var(--display) }

/* ---------------------------------------------------------------- tree */
.tree { padding: 16px 12px 40px; overflow: auto; border-right: 1px solid var(--line); background: var(--soft) }
.tree h2 { font: 700 11.5px var(--body); color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin: 18px 10px 6px; display: flex; align-items: center; justify-content: space-between; min-height: 26px }
.tree h2:first-child { margin-top: 0 }
.ti { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 12px; color: var(--muted); text-align: left; font-weight: 500; min-width: 0; text-decoration: none }
.ti:hover { background: var(--card) }
.tree .ti[aria-current="page"] { background: var(--navy); color: var(--on-navy) }
.tree .ti[aria-current="page"] .n { color: var(--navy-muted) }
.ti .n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--faint) }
.ti .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.trow { display: flex; align-items: center; gap: 2px }
.trow .ti { flex: 1 }
.plus { width: 26px; height: 26px; flex: none; border-radius: 9px; display: grid; place-items: center; color: var(--muted); opacity: .8 }
.plus:hover, .plus:focus-visible { background: var(--accent); color: var(--on-accent); opacity: 1 }
.plus svg { width: 14px; height: 14px }
.ti.co { font-weight: 700; color: var(--ink) }
.ti.role { padding-left: 18px; font-weight: 600; color: var(--ink) }
.ti.role.closed { color: var(--faint) }
.ti.l3 { padding-left: 28px }
.sdot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--sc); opacity: .35 }
.sdot.done, .sdot.next { opacity: 1 }
.sdot.next { box-shadow: 0 0 0 3px var(--st) }
.sdot.topic { border-radius: 3px; opacity: 1 }
.sdot.cancelled { opacity: .2 }
.ty-mini { font: 800 11px var(--display); width: 26px; height: 22px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 15%, #fff); color: var(--tc) }

/* ---------------------------------------------------------------- middle */
.mid { overflow: auto; min-width: 0 }
.mid-in { padding: 22px 26px 80px; display: flex; flex-direction: column; gap: 20px; max-width: 1100px }
.crumb { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none }
a.crumb:hover { text-decoration: underline }
.crumb.sc { color: var(--sc) }
h1 { font: 800 30px/1.08 var(--display); margin: 2px 0 0; letter-spacing: -.025em; text-wrap: balance; overflow-wrap: anywhere }
h2 { font: 700 18px/1.2 var(--display); margin: 0; letter-spacing: -.01em }
.hrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.hrow .acts { display: flex; gap: 8px; flex-wrap: wrap }
.lead { margin: 0; color: var(--muted) }

.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.tile { border-radius: 18px; padding: 14px 16px; min-width: 0; background: var(--st, var(--card)); color: var(--ink) }
.tile.dark { background: var(--navy); color: var(--on-navy) }
.tile .k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--sc) }
.tile.dark .k { color: var(--navy-label) }
.tile .v { font: 800 34px/1.05 var(--display); letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.tile .v.sm { font-size: 22px; line-height: 1.15 }
.tile .s { font-size: 13px; opacity: .8 }

.pipe { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px }
.pipe > * { text-align: left; padding: 12px; border-radius: 16px; background: var(--card); border: 2px solid transparent; min-width: 0; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; text-decoration: none; color: var(--ink) }
.pipe > *::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--sc); opacity: .3 }
.pipe .done::before, .pipe .next::before { opacity: 1 }
.pipe .next { border-color: var(--sc); background: var(--st) }
.pipe .cancelled .nm { text-decoration: line-through; color: var(--faint) }
.pipe .add { border: 2px dashed var(--line); background: transparent; align-items: center; justify-content: center; color: var(--muted); font-weight: 700 }
.pipe .add::before { display: none }
.pipe .add:hover { border-color: var(--accent); color: var(--accent) }
.pipe .n { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--sc); margin-top: 4px }
.pipe .nm { font: 700 15px/1.2 var(--display) }
.pipe .st { font-size: 12.5px; color: var(--muted) }
.pipe-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: -10px }
.pipe-h a { font: 700 15px var(--display); text-decoration: none }
.pipe-h a:hover { text-decoration: underline }

.tbl { border-radius: 18px; background: var(--card); overflow: hidden; border: 1px solid var(--line) }
.tbl-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px }
.tbl-h .c { margin-left: auto; font-size: 12.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--muted) }
.ic { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 15%, #fff); color: var(--tc); flex: none }
.ic svg { width: 16px; height: 16px }
.r { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 16px; width: 100%; text-align: left; border-top: 1px solid var(--line) }
.r:hover { background: var(--soft) }
.r[aria-current="true"] { background: var(--accent-soft) }
.r .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0 }
.r.done .t { color: var(--faint); text-decoration: line-through }
.r.addrow { grid-template-columns: 30px 1fr; color: var(--muted); font-weight: 600 }
.r.addrow .ty { background: transparent; border: 2px dashed var(--line); color: var(--muted) }
.r.addrow:hover { color: var(--accent) }
form.r.addform { grid-template-columns: 30px minmax(0, 1fr) auto; background: var(--soft) }
form.r.addform input { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: #fff; width: 100%; min-width: 0 }
.ty { font: 800 12px var(--display); width: 30px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 15%, #fff); color: var(--tc) }
.cl { font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; margin-left: 6px }
.ctx { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--st); color: var(--sc); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap }
.pill.due { background: var(--accent-soft); color: var(--accent) }
.pill.late { background: color-mix(in srgb, var(--r1) 16%, #fff); color: var(--r1) }
.pill.ok { background: var(--t-recruiter); color: var(--c-recruiter) }
.pill.doing { background: var(--t-takehome); color: var(--c-takehome) }
.score { display: inline-flex; gap: 3px }
.score i { width: 7px; height: 16px; border-radius: 4px; background: var(--line) }
.score i.on { background: var(--rc) }
.empty { color: var(--muted); padding: 4px 16px 16px; margin: 0 }

/* notes and context */
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.note-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0 }
.nh { display: flex; align-items: center; gap: 10px }
.nh small, .savestate { margin-left: auto; color: var(--faint); font-weight: 600; font-size: 12px }
.autosave { width: 100%; min-height: 150px; resize: vertical; border: 0; border-radius: 12px; padding: 12px; background: var(--soft); line-height: 1.55; font-size: 14.5px }
.autosave:focus { outline: 2px solid var(--sc, var(--accent)); background: #fff }
.dot-ic { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 15%, #fff); color: var(--tc) }
.dot-ic svg { width: 14px; height: 14px }

.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px }
.rolecard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; text-decoration: none; display: flex; flex-direction: column; gap: 6px }
.rolecard:hover { border-color: var(--accent) }
.rolecard b { font: 700 17px/1.2 var(--display) }
.rolecard .dots { display: flex; gap: 5px; margin-top: 4px }
.rolecard.add { border: 2px dashed var(--line); background: transparent; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; min-height: 96px }
.rolecard.add:hover { color: var(--accent); border-color: var(--accent) }
.status { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px }
.status-not_applied { background: var(--bg); color: var(--muted) }
.status-applied { background: var(--t-takehome); color: var(--c-takehome) }
.status-interviewing { background: var(--accent-soft); color: var(--accent) }
.status-failed { background: color-mix(in srgb, var(--r1) 15%, #fff); color: var(--r1) }
.status-closed { background: var(--bg); color: var(--faint) }

/* ---------------------------------------------------------------- details panel */
.insp { border-left: 1px solid var(--line); background: var(--card); overflow: auto }
.insp-in { padding: 20px 20px 60px; display: flex; flex-direction: column; gap: 16px }
.ihead { border-radius: 18px; padding: 16px; background: var(--st); display: flex; flex-direction: column; gap: 6px }
.ihead .tag { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--sc); color: #fff }
.ihead h2 { font: 800 24px/1.1 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere }
.title-edit { font: 800 22px/1.15 var(--display); letter-spacing: -.02em; border: 0; background: transparent; padding: 4px 6px; margin: 0 -6px; border-radius: 10px; width: calc(100% + 12px); resize: none; overflow: hidden }
.title-edit:hover { background: rgb(255 255 255 / .55) }
.title-edit:focus { background: #fff; outline: 2px solid var(--sc) }
.mods { display: flex; flex-wrap: wrap; gap: 6px }
.mods span { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--tc) 15%, #fff); color: var(--tc) }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 }
.facts > div { background: var(--bg); border-radius: 14px; padding: 10px 12px; min-width: 0 }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600 }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere }
.facts .wide { grid-column: 1 / -1 }
.voice { display: flex; align-items: center; gap: 14px; background: var(--navy); color: var(--on-navy); border-radius: 18px; padding: 14px }
.orb { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); flex: none }
.orb svg { width: 24px; height: 24px }
.voice b { display: block; font-size: 15px } .voice p { margin: 0; font-size: 13px; opacity: .75 }
.box { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px }
.box h3 { font: 700 16px var(--display); margin: 0 }
.box .autosave { min-height: 96px }
.box.link { text-align: left; flex-direction: row; align-items: center; gap: 10px; text-decoration: none }
.box.link:hover { border-color: var(--sc) }
.box.link b { flex: 1 }
.box.link span:last-child { color: var(--muted); font-size: 13px }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.form .wide { grid-column: 1 / -1 }
.rate-q { font-weight: 700; font-size: 14px }
.rate { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px }
.rate button { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 9px 2px 7px; display: flex; flex-direction: column; align-items: center; gap: 2px }
.rate b { font: 800 20px/1 var(--display); color: var(--rc) }
.rate span { font-size: 11px; color: var(--muted); font-weight: 600 }
.rate button:hover { border-color: var(--rc) }
.rate button[aria-pressed="true"] { background: var(--rc); border-color: var(--rc) }
.rate button[aria-pressed="true"] b, .rate button[aria-pressed="true"] span { color: #fff }
.hist { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px }
.hist .d { color: var(--muted); font-weight: 600 }
.badge { font: 800 13px var(--display); width: 30px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: var(--rc) }
.linkbtn { color: var(--muted); font-weight: 600; font-size: 12.5px }
.linkbtn:hover { color: var(--danger) }
.danger-zone { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px }

.heat { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; padding: 0 16px 16px }
.heat i { aspect-ratio: 1; border-radius: 6px; background: var(--bg); display: block }
.heat i.l1 { background: color-mix(in srgb, var(--accent) 30%, #fff) } .heat i.l2 { background: color-mix(in srgb, var(--accent) 60%, #fff) } .heat i.l3 { background: var(--accent) }
.r.sess { grid-template-columns: auto minmax(0, 1fr) auto }
.r.sess .sub { color: var(--muted); font-size: 12.5px; display: block }

/* ---------------------------------------------------------------- fields, buttons, dialogs */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0 }
.field label, .field .lab { font-weight: 700; font-size: 13.5px }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: var(--soft); width: 100%; min-width: 0 }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.5 }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); background: #fff }
.field .hint { font-size: 12px; color: var(--muted) }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 9px 16px; font-weight: 700; border: 1px solid var(--line); background: var(--card); text-decoration: none; white-space: nowrap }
.btn:hover { border-color: var(--faint) }
.btn.primary { background: var(--navy); color: var(--on-navy); border-color: var(--navy) }
.btn.go { background: var(--accent); color: var(--on-accent); border-color: var(--accent) }
.btn.danger { color: var(--danger) }
.btn.small { padding: 6px 12px; font-size: 13px }
.btn svg { width: 15px; height: 15px }
.btn:disabled { opacity: .5; cursor: default }

.scrim { position: fixed; inset: 0; background: rgb(8 16 24 / .45); z-index: 60; display: grid; place-items: center; padding: 16px }
.dlg { background: var(--card); border-radius: 24px; width: min(640px, 100%); max-height: calc(100% - 16px); overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 80px rgb(0 0 0 / .3) }
.dlg h2 { font-size: 24px }
.dlg .sub { color: var(--muted); margin: -10px 0 0 }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px }
.types button { border: 2px solid var(--line); border-radius: 14px; padding: 10px 8px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.types button b { font-size: 13.5px; line-height: 1.2 }
.types button small { color: var(--muted); font-size: 11.5px; line-height: 1.3 }
.types button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft) }
.toggles { display: flex; flex-wrap: wrap; gap: 8px }
.tog { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; border: 2px solid var(--line); font-weight: 700; font-size: 13.5px; color: var(--muted) }
.tog i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center }
.tog[aria-pressed="true"] { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, #fff); color: var(--ink) }
.tog[aria-pressed="true"] i { background: var(--tc); border-color: var(--tc) }
.tog[aria-pressed="true"] i::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 4px }
.dlg-foot .sp { flex: 1 }
.dlg .error { color: var(--danger); margin: 0; font-weight: 600 }

.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--navy); color: var(--on-navy); font-weight: 600; padding: 10px 16px; border-radius: 999px; z-index: 70; max-width: calc(100vw - 32px) }
.toast.err { background: var(--danger); color: #fff }
.only-narrow { display: none }
.close { display: none }
.mob { display: none }
.settings pre { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; overflow-x: auto; font: 13px/1.5 ui-monospace, Menlo, monospace }
.settings section { display: flex; flex-direction: column; gap: 8px; max-width: 70ch }
.settings p { margin: 0 }
.drawer-scrim { display: none }

/* ---------------------------------------------------------------- login */
.login-body { display: grid; place-items: center; min-height: 100%; background: var(--navy) }
.login { width: min(380px, 92vw); background: var(--card); border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 14px }
.login h1 { display: flex; gap: 10px; align-items: center }
.login .logo i::after { background: var(--card) }
.login p { margin: 0; color: var(--muted) }
.login .error { color: var(--danger); font-weight: 600 }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1150px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr) 0 }
  .insp { display: none }
  .logo { width: auto }
  .insp.open { display: block; position: fixed; right: 0; top: 60px; bottom: 0; width: min(420px, 100%); z-index: 20; box-shadow: -16px 0 40px rgb(15 34 50 / .18) }
  .only-narrow { display: inline-flex; align-self: flex-start }
  .insp.open .close { display: inline-flex; align-self: flex-end }
  .palbtn b { display: none }
}
@media (max-width: 720px) {
  html, body { height: auto }
  .shell { display: block }
  .top { position: sticky; top: 0; height: 56px; gap: 8px; padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)) }
  .menubtn { display: grid }
  .logo { width: auto; font-size: 0; gap: 0 } /* icon only on phones */
  .top .sp { display: none }
  .cmd { flex: 1 1 0; min-width: 0; padding: 0 12px }
  .cmd kbd, .newbtn kbd, .newbtn b { display: none }
  .newbtn { padding: 10px } .palbtn { padding: 9px 10px }
  .pop { right: 12px; left: 12px; top: 64px }
  .tree { display: none }
  .tree.open { display: block; position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); background: var(--soft); box-shadow: 16px 0 40px rgb(15 34 50 / .25); padding-top: calc(16px + env(safe-area-inset-top, 0px)) }
  .drawer-scrim.open { display: block; position: fixed; inset: 0; z-index: 35; background: rgb(8 16 24 / .4) }
  .mob { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none }
  .mob a, .mob button { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--card); display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--muted); text-decoration: none }
  .mob [aria-current="page"] { background: var(--navy); color: var(--on-navy) }
  .mob .addchip { background: transparent; border: 2px dashed var(--line) }
  .mid-in { padding: 4px 16px 80px }
  h1 { font-size: 26px }
  .strip { grid-template-columns: 1fr 1fr } .tile .v { font-size: 28px } .tile .v.sm { font-size: 18px }
  .pipe { grid-template-columns: 1fr }
  .pipe > * { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px }
  .pipe .n { grid-column: 1 / -1 } .pipe .st { grid-row: 2; grid-column: 2 }
  .pipe .add { display: flex; padding: 10px }
  .r { grid-template-columns: 30px minmax(0, 1fr) auto; padding: 11px 14px }
  .r .ctx { display: none } .r .t { white-space: normal }
  .notes { grid-template-columns: 1fr }
  .insp.open { top: 0; width: 100%; padding-top: env(safe-area-inset-top, 0px); z-index: 45 }
  .insp-in { padding: 16px 16px 60px }
  .heat { grid-template-columns: repeat(7, 1fr) }
  .rate span { font-size: 10px }
  .scrim { place-items: end stretch; padding: 0 }
  .dlg { width: 100%; border-radius: 24px 24px 0 0; max-height: 92%; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)) }
  .two, .form { grid-template-columns: 1fr } .types { grid-template-columns: 1fr 1fr }
  /* 16px stops iOS Safari zooming the page when a field gets focus */
  input, select, textarea, .autosave { font-size: 16px }
}

/* ---------------------------------------------------------------- voice practice room */
.room { position: fixed; inset: 0; z-index: 80; background: var(--navy); color: var(--on-navy); display: flex; flex-direction: column; gap: 16px; padding: calc(20px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); overflow: auto }
.room-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; max-width: 860px; width: 100%; margin: 0 auto }
.room-top h2 { font: 800 26px/1.1 var(--display); overflow-wrap: anywhere }
.room-k { color: var(--navy-label); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .07em }
.room-clock { font: 700 15px var(--body); color: var(--navy-muted); font-variant-numeric: tabular-nums; white-space: nowrap }
.room-mid { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; text-align: center }
.room-state { font: 700 20px var(--display); margin: 0 }
.room-hint { margin: 0; color: var(--navy-muted); font-size: 13.5px }
.orb.big { width: 120px; height: 120px; box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 25%, transparent) }
.orb.big svg { width: 44px; height: 44px }
.orb.big.candidate { animation: pulse 1.2s ease-in-out infinite }
.orb.big.interviewer { background: var(--c-takehome); box-shadow: 0 0 0 12px color-mix(in srgb, var(--c-takehome) 30%, transparent); animation: pulse 1.6s ease-in-out infinite }
.orb.big.thinking, .orb.big.working, .orb.big.connecting { opacity: .7; animation: pulse 2s ease-in-out infinite }
@keyframes pulse { 50% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--accent) 18%, transparent) } }
@media (prefers-reduced-motion: reduce) { .orb.big { animation: none !important } }
.tx { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; overflow: auto; max-width: 860px; width: 100% }
.turn { display: flex; flex-direction: column; gap: 2px; max-width: 85%; padding: 10px 14px; border-radius: 16px; background: var(--navy-2) }
.turn b { font-size: 12px; color: var(--navy-label) }
.turn.candidate { align-self: flex-end; background: color-mix(in srgb, var(--accent) 25%, var(--navy)) }
.tx.light .turn { background: var(--bg); color: var(--ink) }
.tx.light .turn b { color: var(--muted) }
.tx.light .turn.candidate { background: var(--accent-soft) }
.room-foot { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap }
.room .btn:not(.go) { background: var(--navy-2); color: var(--on-navy); border-color: var(--navy-2) }
.room .btn[aria-pressed="true"] { background: var(--r1); border-color: var(--r1) }
.fb { background: var(--card); color: var(--ink); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 14px; max-width: 860px; width: 100%; margin: 0 auto }
.fb .btn:not(.go) { background: var(--card); color: var(--ink); border-color: var(--line) }
.fb-head { display: flex; gap: 14px; align-items: center }
.fb-head b { font: 800 22px var(--display) }
.fb-head p { margin: 2px 0 0 }
.badge.big { width: 56px; height: 56px; border-radius: 16px; font-size: 26px; flex: none }
.badge.rc-0 { background: var(--faint) }
.fb .box ul { margin: 0; padding-left: 18px } .fb .box li { margin: 4px 0 }
.fb .box li::marker { color: var(--tc) }
.fb .hist { grid-template-columns: auto minmax(0, 1fr) } .fb .hist span:last-child { grid-column: 2; color: var(--muted) }
details.box summary { cursor: pointer; font: 700 16px var(--display) }
.sessrow { width: 100%; text-align: left; grid-template-columns: auto auto 1fr }
.sessrow:hover { background: var(--soft) }
.linkbtn.plain { color: inherit; font-size: inherit; text-align: left; text-decoration: underline dotted }
@media (max-width: 720px) { .room-top h2 { font-size: 21px } .orb.big { width: 96px; height: 96px } .turn { max-width: 92% } }
