:root {
  --bg: #EEF4F7; --surface: #FFFFFF; --surface-2: #F7FAFC;
  --ink: #07131D; --ink-2: #2A3B4A; --muted: #5B6B7A;
  --line: #D3DEE7; --line-2: #E4ECF2;
  --accent: #3B82F6; --accent-ink: #FFFFFF; --accent-soft: #E3EDFD;
  --navy: #0B1F33; --navy-ink: #EEF4F7;
  --ok: #178A63; --ok-soft: #DDF3EA; --warn: #B7791F; --warn-soft: #FBEFD5; --bad: #C53A3A; --bad-soft: #FADFDF; --na: #8A98A6;
  --shadow: 0 1px 2px rgba(7,19,29,.06), 0 8px 24px rgba(7,19,29,.06);
  --radius: 10px;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07131D; --surface: #0B1F33; --surface-2: #10283F; --ink: #EEF4F7; --ink-2: #C5D3DE; --muted: #8FA3B5;
    --line: #1F3549; --line-2: #182C3E; --accent: #5B9CFF; --accent-ink: #07131D; --accent-soft: #14304F;
    --ok: #3FCB97; --ok-soft: #0F3A2C; --warn: #E4A94A; --warn-soft: #3B2C10; --bad: #F07070; --bad-soft: #451A1A; --na: #6E8090;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.45; padding-inline: 16px; padding-block: 0 48px; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; line-height: 1.15; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 600; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

/* header */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); margin-inline: -16px; padding-inline: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-block: 10px; }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -.02em; display: inline-flex; align-items: baseline; color: var(--ink); }
.wordmark .n { color: var(--accent); } .wordmark .sub { font-weight: 500; color: var(--muted); font-size: 14px; margin-left: 10px; letter-spacing: 0; }
.wordmark:hover { text-decoration: none; }
.topbar .spacer { flex: 1; }
.day-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: var(--navy-ink); padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.day-pill .big { font-family: var(--mono); font-size: 14px; }
.userchip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.userchip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; }
.sync { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--na); } .sync.live .dot { background: var(--ok); } .sync.err .dot { background: var(--bad); }

/* shell */
.shell { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 28px; max-width: 1280px; margin: 0 auto; padding-top: 20px; }
nav.side { position: sticky; top: 60px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
nav.side a { color: var(--ink-2); padding: 7px 10px; border-radius: 6px; font-size: 13px; font-weight: 500; border-left: 2px solid transparent; display: flex; justify-content: space-between; align-items: center; }
nav.side a:hover { background: var(--surface); text-decoration: none; }
nav.side a.active { color: var(--accent); border-left-color: var(--accent); background: var(--surface); }
nav.side .group { margin-top: 12px; padding: 0 10px; }
nav.side .cnt { font-family: var(--mono); font-size: 11px; color: var(--muted); }
main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head p { margin: 4px 0 0; color: var(--muted); max-width: 66ch; }
.stack { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  nav.side { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  nav.side .group { display: none; }
  nav.side a { border-left: 0; border: 1px solid var(--line); background: var(--surface); padding: 5px 10px; gap: 6px; }
  nav.side a.active { border-color: var(--accent); }
}

/* login */
.login { max-width: 420px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login .wordmark { font-size: 28px; }
.login p { margin: 0; color: var(--muted); }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.login input { font-size: 15px; padding: 10px; }
.login .row { display: flex; gap: 8px; flex-wrap: wrap; }
.login .msg { font-size: 13px; padding: 8px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); }
.login .msg.bad { background: var(--bad-soft); color: var(--bad); }
.login .msg.ok { background: var(--ok-soft); color: var(--ok); }
.login .who { display: flex; gap: 6px; flex-wrap: wrap; }
.login .linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; padding: 0; }

/* controls */
select, input[type="text"], input[type="url"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="file"], textarea {
  font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; max-width: 100%;
}
textarea { resize: vertical; }
.btn { font: inherit; font-size: 13px; font-weight: 600; border-radius: 6px; padding: 7px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: .6; cursor: wait; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.toolbar label { font-size: 12px; color: var(--muted); font-weight: 600; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.form label.wide { grid-column: 1 / -1; }
.form input, .form select, .form textarea { width: 100%; }
.form .actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tile .v { font-family: var(--mono); font-size: 26px; font-weight: 500; margin-top: 4px; line-height: 1; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tile.bad .v { color: var(--bad); } .tile.warn .v { color: var(--warn); } .tile.ok .v { color: var(--ok); } .tile.accent .v { color: var(--accent); }
@media (max-width: 720px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hero { background: var(--navy); color: var(--navy-ink); border-radius: 14px; padding: 20px 24px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.hero h1 { color: #fff; } .hero p { margin: 8px 0 0; color: #B9C9D8; max-width: 60ch; }
.hero .side { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.hero .label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8FA3B5; font-weight: 600; }
.hero .val { font-size: 18px; font-weight: 700; color: #fff; } .hero .gate { font-size: 13px; color: #B9C9D8; } .hero .gate b { color: #fff; }
.hero .btn { align-self: flex-start; margin-top: 6px; background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } }

/* progress */
.bar { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; display: flex; margin-top: 8px; }
.bar i { display: block; height: 100%; } .bar .c { background: var(--ok); } .bar .p { background: var(--accent); } .bar .b { background: var(--bad); }
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.phase { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; border-top: 3px solid var(--line); }
.phase.now { border-top-color: var(--accent); } .phase.done { border-top-color: var(--ok); }
.phase .t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .phase .t b { font-size: 14px; } .phase .pct { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.phase .dates { font-size: 12px; color: var(--muted); margin-top: 2px; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 8px; font-family: var(--mono); }
@media (max-width: 720px) { .phases { grid-template-columns: 1fr; } }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.person.me { border-color: var(--accent); }
.person .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.person .top b { font-size: 15px; } .person .pct { font-family: var(--mono); font-size: 20px; font-weight: 500; }
.person .role { font-size: 12px; color: var(--muted); }
.person .nums { display: flex; gap: 12px; font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 6px; flex-wrap: wrap; }
.person .nums b { color: var(--ink); font-weight: 500; }
.person a.more { font-size: 12px; margin-top: 6px; }

/* tables */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 860px; }
th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.gate td { background: var(--accent-soft); }
tr.grp td { background: var(--surface-2); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
td.id { font-family: var(--mono); color: var(--muted); font-size: 12px; white-space: nowrap; }
td.task { min-width: 300px; } td.task .ws { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
td.due { font-family: var(--mono); font-size: 12px; white-space: nowrap; } td.due.over { color: var(--bad); font-weight: 500; } td.due.soon { color: var(--warn); font-weight: 500; }
td.owner { white-space: nowrap; font-size: 13px; }
.st { font-size: 12px; font-weight: 600; border-radius: 6px; padding: 5px 8px; border: 1px solid var(--line); background: var(--surface); min-width: 118px; }
.st.s-complete { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.st.s-progress { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.st.s-blocked { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.st.s-na { color: var(--na); }
td.ev input { width: 150px; font-size: 12px; } td.notes textarea { width: 200px; min-height: 30px; font-size: 12px; }
.ev-link { font-size: 12px; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.by { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; } .pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; } .pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* cards & panels */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; } .card .head h3 a { color: var(--ink); }
.card .cat { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.card .desc { color: var(--muted); font-size: 13px; margin: 0; }
.card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.card li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.card li .ft { font-family: var(--mono); font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; flex: none; line-height: 1.4; min-width: 34px; text-align: center; }
.card li a { color: var(--ink-2); } .card li a:hover { color: var(--accent); }
.card.flag { border-color: var(--warn); } .card .note { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 6px 8px; }
.open-folder { font-size: 12px; font-weight: 600; white-space: nowrap; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel h3 { margin-bottom: 8px; } .panel ol, .panel ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.panel dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; } .panel dt { font-weight: 600; white-space: nowrap; } .panel dd { margin: 0; color: var(--ink-2); }
.panel.accent { border-color: var(--accent); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.list li:last-child { border-bottom: 0; }
.list .when { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 62px; }
.list .grow { flex: 1; min-width: 0; }
.list .who { font-size: 12px; color: var(--muted); }

/* meetings */
.meet { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; }
@media (max-width: 880px) { .meet { grid-template-columns: 1fr; } }
.meetlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.meetlist button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-2); padding: 10px 12px; font: inherit; color: var(--ink); cursor: pointer; }
.meetlist button:hover { background: var(--surface-2); } .meetlist button.active { background: var(--accent-soft); border-left: 3px solid var(--accent); }
.meetlist .d { font-family: var(--mono); font-size: 12px; color: var(--muted); } .meetlist .t { font-weight: 600; font-size: 13px; }
.meetlist .next { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-left: 6px; }
.meeting-editor { display: flex; flex-direction: column; gap: 12px; }
.meeting-editor textarea { width: 100%; min-height: 96px; font-size: 13px; line-height: 1.5; }
.meeting-editor .meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.meeting-editor label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.attendees { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 500; color: var(--ink); }
.attendees label { flex-direction: row; align-items: center; gap: 6px; }
.savestate { font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* hiring */
.stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.stage .k { font-size: 11px; color: var(--muted); font-weight: 600; } .stage .v { font-family: var(--mono); font-size: 20px; }
td input.cell { width: 100%; min-width: 90px; font-size: 12px; } td select.cell { font-size: 12px; } td input.score { width: 60px; }
.rank { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--navy); color: var(--navy-ink); padding: 8px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; } .toast.bad { background: var(--bad); color: #fff; }
.loader { display: grid; place-items: center; padding: 60px; color: var(--muted); }
.footer { color: var(--muted); font-size: 12px; text-align: center; margin-top: 8px; }

/* to-do lists */
.todo-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.todo-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.todo-col.mine { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.todo-col .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.todo-col .head b { font-size: 16px; }
.todo-col .head .pct { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.todo { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.todo:last-child { border-bottom: 0; }
.todo input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ok); cursor: pointer; }
.todo .txt { line-height: 1.35; }
.todo.done .txt { color: var(--muted); text-decoration: line-through; }
.todo .meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.todo .meta .due.over { color: var(--bad); font-weight: 600; } .todo .meta .due.soon { color: var(--warn); font-weight: 600; }
.todo .del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 4px; }
.todo .del:hover { color: var(--bad); }
.todo-add { display: flex; gap: 6px; margin-top: 6px; }
.todo-add input[type="text"] { flex: 1; min-width: 0; }
.todo-add input[type="date"] { width: 130px; }
.big-todo { background: var(--surface); border: 2px solid var(--accent); border-radius: 14px; padding: 16px 18px; }
.big-todo h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.big-todo h2 .pct { font-family: var(--mono); font-size: 14px; color: var(--muted); font-weight: 500; }
.big-todo .todo { font-size: 15px; }

/* data room files */
.files { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; }
@media (max-width: 880px) { .files { grid-template-columns: 1fr; } }
.tree { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; align-self: start; position: sticky; top: 60px; max-height: calc(100vh - 80px); overflow: auto; }
.tree button { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.tree button:hover { background: var(--surface-2); } .tree button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tree .cnt { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tree .depth1 { padding-left: 22px; } .tree .depth2 { padding-left: 36px; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; align-items: center; margin-bottom: 10px; }
.crumbs a { color: var(--accent); } .crumbs span { color: var(--muted); }
.filerow td { vertical-align: middle; }
.filerow .fname { font-weight: 500; } .filerow .fname a { color: var(--ink); }
.filerow .ftype { font-family: var(--mono); font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.filerow .where { font-size: 11px; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); font-size: 13px; background: var(--surface); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone input { display: none; }
.dropzone .btn { margin-top: 8px; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; max-width: 900px; line-height: 1.55; font-size: 14.5px; }
.doc h1 { font-size: 24px; margin: 0 0 12px; } .doc h2 { font-size: 19px; margin: 22px 0 8px; } .doc h3 { font-size: 15px; margin: 18px 0 6px; }
.doc p { margin: 8px 0; } .doc ul, .doc ol { padding-left: 22px; } .doc li { margin: 3px 0; }
.doc table { border-collapse: collapse; min-width: 0; width: 100%; margin: 10px 0; font-size: 13px; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc th { background: var(--surface-2); position: static; }
.doc blockquote { border-left: 3px solid var(--accent); margin: 10px 0; padding: 4px 12px; color: var(--ink-2); background: var(--surface-2); }
.doc code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-head .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.preview-img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }

/* hiring: candidate file upload */
.hire-upload { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.hire-upload .dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 120px; }
.hire-upload .dropzone .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.hire-upload .dropzone .btn { margin-top: 4px; }
.import-preview { margin-top: 10px; }
.import-preview .tablewrap { max-height: 320px; overflow: auto; }
.import-preview th select { font-size: 11px; max-width: 120px; }
.import-preview .bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.import-preview .st-new { color: var(--ok); } .import-preview .st-upd { color: var(--warn); }
td .att { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; white-space: nowrap; }
td .att input { display: none; }
td .att .btn { padding: 2px 6px; font-size: 11px; }

/* hiring: candidate cards (no sideways scrolling) */
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.cands .empty { grid-column: 1 / -1; text-align: center; color: var(--muted); }
.cand { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cand .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cand .top .rank { font-size: 13px; font-weight: 700; color: var(--accent); min-width: 28px; }
.cand .top .name { flex: 1 1 140px; font-weight: 600; font-size: 14px; min-width: 0; }
.cand .scorebox { display: inline-flex; align-items: center; gap: 4px; }
.cand .scorebox .lbl { font-size: 11px; font-weight: 600; color: var(--muted); }
.cand .scorebox input.score { width: 62px; }
.cand .top select.st { max-width: 130px; }
.cand .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.cand .grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); min-width: 0; }
.cand .grid label.wide { grid-column: 1 / -1; }
.cand .grid input, .cand .grid select, .cand .grid textarea { width: 100%; min-width: 0; font-size: 12px; font-weight: 400; color: var(--ink); }
.cand .grid .lnk { font-size: 13px; font-weight: 500; padding: 5px 0; }
.cand .att { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.cand .att input { display: none; }
.import-preview table { min-width: 0; }
@media (max-width: 480px) { .cands { grid-template-columns: 1fr; } }

/* narrow screens: every table stacks into labelled rows, no sideways scrolling */
@media (max-width: 880px) {
  table { min-width: 0; }
  .tablewrap { overflow-x: hidden; }
  .tablewrap table { display: block; }
  .tablewrap thead { display: none; }
  .tablewrap tbody { display: block; }
  .tablewrap tbody tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 4px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .tablewrap tbody tr:last-child { border-bottom: 0; }
  .tablewrap td { display: block; padding: 2px 0; border: 0; min-width: 0; }
  .tablewrap td[data-label]::before { content: attr(data-label); display: block; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
  .tablewrap td:empty { display: none; }
  .tablewrap td.task, .tablewrap td[data-label="Task"], .tablewrap td[data-label="Notes"], .tablewrap td[data-label="Item"], .tablewrap td[data-label="Evidence"], .tablewrap td[data-label="Next step"] { grid-column: 1 / -1; min-width: 0; }
  .tablewrap tr.grp, .tablewrap tr.gate { display: block; }
  .tablewrap tr.grp td::before { content: none; }
  td input.cell, td select.cell, td textarea.cell { width: 100%; min-width: 0; }
  td.task { min-width: 0; }
  .import-preview .tablewrap { max-height: none; }
}

/* login: Google button + email fallback */
.login .gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; padding: 11px 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.login .gbtn:hover { border-color: var(--accent); background: var(--surface-2); }
.login details.alt summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.login details.alt[open] summary { margin-bottom: 4px; }
