/* Workspace: dense by design. A small staff reads tables, not cards; the home page is the short one. */
body { font-size: .875rem; }
.loading { padding: 4rem 1.25rem; text-align: center; color: var(--ink-3); }
.dim { color: var(--ink-3); }
.small { font-size: .8rem; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
b.num { font-weight: 700; }
td .num, dd .num { white-space: nowrap; }
.big { font-size: 1.3rem; }
.note { color: var(--ink-3); font-size: .8rem; font-weight: 400; margin-top: .15rem; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--action); cursor: pointer; text-decoration: underline; }
.tags { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }

/* sign-in */
.signin { max-width: 46rem; margin: 0 auto; padding: 3rem 1.25rem; }
.signin .mark svg rect { fill: var(--rail); } .signin .mark svg circle { fill: #e6eaef; } .signin .mark svg path:first-of-type { stroke: #56c8d2; }
.signin h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 1.75rem 0 .5rem; }
.signin .sub { color: var(--ink-2); font-size: 1rem; margin-bottom: 1.4rem; }
.signin .sub.small { font-size: .9rem; margin-top: 2rem; }
.desks { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 34rem) { .desks { grid-template-columns: 1fr; } }
.desk { text-align: left; font: inherit; cursor: pointer; background: var(--surface); color: var(--ink);
        border: 1px solid var(--line); border-top: .2rem solid var(--ink); border-radius: var(--radius); padding: .9rem 1rem 1rem; }
.desk:hover { border-color: var(--action); box-shadow: var(--shadow); }
.desk b { display: block; font-size: 1.15rem; font-weight: 750; }
.desk span { display: block; color: var(--ink-2); font-size: .9rem; margin: .15rem 0 .7rem; }
.desk i { font-style: normal; font-weight: 650; font-size: .82rem; color: var(--action); font-family: var(--mono); }
.signin details { margin-top: 1.5rem; color: var(--ink-2); }
.signin summary { cursor: pointer; }
.manual { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; margin-top: .9rem; }
.manual label { display: grid; gap: .25rem; font-size: .85rem; }

input, textarea, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--ink-3);
                          border-radius: var(--radius); padding: .4rem .55rem; max-width: 100%; }
textarea { width: 100%; resize: vertical; }

/* shell: the rail is dark in both themes */
.shell { display: grid; grid-template-columns: 13.5rem 1fr; min-height: calc(100vh - 2rem); }
aside { background: var(--rail); color: var(--rail-ink); padding: 1.1rem .9rem; display: flex; flex-direction: column; gap: 1.4rem;
        position: sticky; top: 0; height: 100vh; align-self: start; }
aside :focus-visible { outline-color: var(--rail-action); }
aside nav { display: grid; gap: .15rem; }
aside nav a { color: var(--rail-dim); text-decoration: none; padding: .45rem .65rem; border-radius: var(--radius); font-size: .92rem; }
aside nav a:hover { color: var(--rail-ink); background: var(--rail-2); }
aside nav a.on { color: var(--rail-ink); background: var(--rail-2); font-weight: 650; box-shadow: inset .19rem 0 0 var(--rail-action); }
.me { margin-top: auto; display: grid; gap: .3rem; font-size: .82rem; border-top: 1px solid var(--rail-line); padding-top: .9rem; }
.me b { font-size: 1rem; }
.me span { color: var(--rail-dim); font-family: var(--mono); font-size: .78rem; }
.me .switch { display: grid; gap: .25rem; margin-top: .6rem; color: var(--rail-dim); }
.me select { width: 100%; padding: .3rem .4rem; font-size: .82rem; background: var(--rail-2); color: var(--rail-ink); border-color: var(--rail-line); }
.me .linkish { color: var(--rail-dim); justify-self: start; margin-top: .4rem; }
main { padding: 1.5rem 1.75rem 4rem; min-width: 0; max-width: 80rem; }
@media (max-width: 54rem) {
  .shell { grid-template-columns: 1fr; }
  aside { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem .9rem; position: static; height: auto; }
  aside nav { display: flex; }
  .me { margin: 0 0 0 auto; border: 0; padding: 0; grid-auto-flow: column; align-items: center; gap: .6rem; }
  .me b, .me > span { display: none; }
  .me .switch { margin: 0; grid-auto-flow: column; align-items: center; }
  .me .linkish { margin: 0; }
  main { padding: 1.1rem .9rem 3rem; }
}
@media (max-width: 30rem) { .me .switch { font-size: 0; gap: 0; } }

header.page { margin-bottom: 1rem; }
header.page h1 { font-size: 1.5rem; display: flex; align-items: center; gap: .3rem .65rem; flex-wrap: wrap; }
header.page h1 .num { font-weight: 700; color: var(--ink-3); }
header.page p { color: var(--ink-2); margin-top: .3rem; font-size: .95rem; max-width: 52rem; }
.crumb { margin-bottom: .6rem; }
.crumb a { text-decoration: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: .3rem; margin-bottom: 1rem; overflow: hidden; }
.card-head { padding: .75rem .9rem .6rem; }
.card-head h2 { font-size: .95rem; font-weight: 750; letter-spacing: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-head p { color: var(--ink-3); font-size: .82rem; margin-top: .15rem; }
.count { font-size: .72rem; font-weight: 700; background: var(--sunk); color: var(--ink-2); border-radius: .2rem; padding: .1rem .4rem; font-family: var(--mono); }
.empty { padding: .1rem .9rem .9rem; color: var(--ink-3); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; }
thead th { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
           font-weight: 700; padding: .4rem .9rem; background: var(--sunk); border-block: 1px solid var(--line-2); white-space: nowrap; }
td, tbody th { padding: .5rem .9rem; border-bottom: 1px solid var(--line-2); vertical-align: top; font-weight: 400; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tr[data-open] { cursor: pointer; }
tr[data-open]:hover td { background: var(--sunk); }
tr[data-open]:focus-visible { outline-offset: -.19rem; }
td .chip { vertical-align: baseline; }

.stages { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: .3rem; overflow-x: auto; margin-bottom: 1rem; }
.stages a { flex: 1 0 auto; background: var(--surface); padding: .5rem .8rem; text-decoration: none; color: var(--ink-2); font-size: .8rem; white-space: nowrap; }
.stages a b { display: block; font-family: var(--mono); font-size: 1.15rem; color: var(--ink); }
.stages a.on { box-shadow: inset 0 -.19rem 0 var(--action); color: var(--ink); font-weight: 650; }
.stages a:hover { background: var(--sunk); }

.stepper { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line);
           border: 1px solid var(--line); border-radius: .3rem; overflow: hidden; font-size: .8rem; }
.stepper li { background: var(--surface); padding: .45rem .6rem; color: var(--ink-3); display: flex; gap: .45rem; align-items: baseline; }
.stepper li.past { color: var(--ink-2); }
.stepper li.past .num::after { content: " ✓"; }
.stepper li.now { background: var(--ink); color: var(--ground); font-weight: 700; }
@media (max-width: 60rem) { .stepper { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 30rem) { .stepper { grid-template-columns: repeat(2, 1fr); } }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line);
         border-radius: .3rem; overflow: hidden; margin: 0 0 1rem; }
.facts div { background: var(--surface); padding: .65rem .9rem; }
.facts .wide { grid-column: 1 / -1; }
@media (max-width: 60rem) { .facts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 30rem) { .facts { grid-template-columns: 1fr; } }
.facts dt { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.facts dd { margin: .2rem 0 0; font-weight: 650; }
.facts dd.plain { font-weight: 400; font-size: 1rem; max-width: 60rem; }
.facts small { font-weight: 400; color: var(--ink-3); }

.actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.card > .actions { padding: 0 .9rem .8rem; }
.card > .actions:empty, .course .actions:empty { display: none; }
.card > .scroll + .actions, .card > .courses + .actions, .card > details + .actions { padding-top: .7rem; border-top: 1px solid var(--line-2); }
.gate { list-style: none; margin: 0; padding: 0 .9rem .7rem; display: grid; gap: .35rem; }
.next { border-left: .25rem solid var(--action); }
.inline { flex-basis: 100%; display: grid; gap: .55rem; background: var(--sunk); border-radius: var(--radius); padding: .75rem; max-width: 34rem; text-align: left; white-space: normal; }
.inline label { display: grid; gap: .2rem; font-size: .82rem; font-weight: 650; }
.inline .row { display: flex; gap: .5rem; }
td .inline { margin-top: .4rem; min-width: 15rem; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 70rem) { .pair { grid-template-columns: 1fr; gap: 0; } }

.courses { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .75rem; padding: 0 .9rem .9rem; }
.course { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .85rem; background: var(--ground); display: flex; flex-direction: column; gap: .4rem; }
.course.ai { border-style: dashed; border-color: var(--ink-3); }
.course.selected { box-shadow: inset .25rem 0 0 var(--ok); }
.course.rejected h3, .course.rejected p { color: var(--ink-3); }
.course h3 { font-size: 1rem; }
.course p { color: var(--ink-2); }
.course dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .9rem; margin: .2rem 0 0; font-size: .82rem; }
.course dt { color: var(--ink-3); } .course dd { margin: 0; font-weight: 650; }
.course .actions { margin-top: .3rem; }

.matrix thead th { white-space: normal; text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--ink); vertical-align: bottom; min-width: 9rem; }
.matrix thead th:nth-child(-n+2) { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); min-width: 0; }
.matrix thead .tags { margin-top: .35rem; font-weight: 400; }
.matrix tbody th { font-weight: 650; min-width: 9rem; }
.matrix td.num { white-space: nowrap; font-size: 1rem; }
.matrix td.num small { color: var(--ink-3); margin-left: .6rem; font-size: .82rem; }
.matrix tfoot td { background: var(--sunk); font-weight: 700; padding: .55rem .9rem; border-top: 1px solid var(--line); }
.why { padding: .6rem .9rem .8rem; border-top: 1px solid var(--line-2); color: var(--ink-2); }
.why summary { cursor: pointer; font-weight: 650; }
.why ul { margin: .5rem 0 0; padding-left: 1.1rem; display: grid; gap: .25rem; }

.decision { margin: 0 .9rem .8rem; border: 1px solid var(--line); border-left: .25rem solid var(--wait-mark); border-radius: var(--radius); padding: .7rem .85rem; background: var(--ground); display: grid; gap: .35rem; }
.decision.approved { border-left-color: var(--ok); }
.decision.superseded { border-left-color: var(--ink-3); }
.decision.superseded p, .decision.superseded b { color: var(--ink-3); }
.decision small { color: var(--ink-3); }

.timeline { list-style: none; margin: 0; padding: 0 .9rem .9rem; columns: 2 22rem; column-gap: 2rem; }
.timeline li { break-inside: avoid; padding: .3rem 0 .3rem .9rem; border-left: 2px solid var(--line); font-size: .82rem; }
.timeline li.success { border-left-color: var(--ok); }
.timeline b { display: block; font-weight: 650; font-size: .875rem; }

.done, .refused { border-radius: var(--radius); padding: .65rem .9rem; margin-bottom: 1rem; }
.done { background: var(--ok-soft); color: var(--ok); font-weight: 650; border-left: .25rem solid var(--ok); }
.refused { background: var(--bad-soft); color: var(--ink); border-left: .25rem solid var(--bad); }
.refused b { color: var(--bad); }
.refused .rule { display: block; font-family: var(--mono); font-size: .76rem; color: var(--ink-2); margin-top: .25rem; }

.legal-bar { border-top: 1px solid var(--line); background: var(--surface); padding: 1rem 1.25rem; font-size: .76rem; color: var(--ink-3); position: relative; z-index: 1; }
.legal-bar p { max-width: 72rem; margin: 0 auto; }
