/* Shiplog — monochrome, square, quiet.
   Ink on paper, hairline rules, one signal colour (red) for things that are late or destructive.
   Game and label colours appear only as small square swatches. */

:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #3d3d3d;
  --muted: #737373;
  --rule: #e5e5e5;
  --rule-strong: #0a0a0a;
  --wash: #f5f5f4;      /* lanes, hovers */
  --wash-2: #ebebea;    /* weekends, other-month days */
  --signal: #d4290f;
  --signal-wash: #fdecea;
  --shadow: 3px 3px 0 var(--ink);

  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a0a0a;
    --ink: #f5f5f4;
    --ink-2: #c8c8c6;
    --muted: #8a8a88;
    --rule: #262626;
    --rule-strong: #f5f5f4;
    --wash: #151515;
    --wash-2: #1d1d1d;
    --signal: #ff5a3c;
    --signal-wash: #2a110c;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin: .25rem 0 1.25rem; }
h2 { font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
h1 .muted.small { font-family: var(--mono); font-size: .8rem; font-weight: 500; letter-spacing: 0; vertical-align: middle; margin-left: .5rem; }

.icon {
  width: 1em; height: 1em; flex-shrink: 0; vertical-align: -.14em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter;
}

/* --- brand --- */
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand-mark {
  width: 18px; height: 18px; background: var(--ink); position: relative; flex-shrink: 0;
}
.brand-mark::after { content: ""; position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; background: var(--paper); }
.brand-name { font-family: var(--mono); font-weight: 700; font-size: .95rem; letter-spacing: -.02em; }

/* --- top bar --- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 2rem;
  height: 52px; padding: 0 1.5rem; background: var(--paper); border-bottom: 1px solid var(--rule-strong);
}
.topbar nav { display: flex; gap: 1.5rem; flex: 1; height: 100%; }
.topbar nav a {
  display: flex; align-items: center; height: 100%; text-decoration: none;
  color: var(--muted); font-size: .9rem; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.topbar nav a:hover { color: var(--ink); }
.topbar nav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.me { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.me form { margin: 0; }
.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0;
  background: var(--ink); color: var(--paper); font-family: var(--mono); font-weight: 700; font-size: .8rem;
  text-transform: uppercase; text-decoration: none;
}
a.avatar:hover { box-shadow: var(--shadow); transform: translate(-1px, -1px); }
.avatar.mini { width: 18px; height: 18px; font-size: .62rem; }
.avatars { display: inline-flex; gap: 2px; flex-shrink: 0; }

/* --- bell --- */
.bell { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--muted); text-decoration: none; font-size: 1.1rem; }
.bell:hover { color: var(--ink); background: var(--wash); }
.bell.has-unread { color: var(--ink); }
.bell-count {
  position: absolute; top: 1px; right: -4px; min-width: 16px; padding: 0 3px;
  background: var(--signal); color: #fff; font-family: var(--mono); font-size: .62rem; font-weight: 700;
  line-height: 16px; text-align: center;
}

/* --- page frames --- */
main.app { padding: 2rem 1.5rem 3rem; max-width: 1120px; margin: 0 auto; }
main.center {
  display: grid; place-items: center; min-height: 100vh; padding: 1rem;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 32px 32px;
}
.card {
  width: 100%; max-width: 400px; background: var(--paper);
  border: 1px solid var(--rule-strong); box-shadow: 6px 6px 0 var(--ink); padding: 2.25rem;
}
.card h1 { font-size: 1.6rem; margin-bottom: .75rem; }
.logo { margin-bottom: 2rem; }
.logo .brand-mark { width: 22px; height: 22px; }
.logo { display: flex; align-items: center; gap: .6rem; }
.logo .brand-name { font-size: 1.15rem; }

.stack { display: flex; flex-direction: column; gap: .5rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row > .stack { flex: 1; min-width: 140px; }

/* --- form controls --- */
label, legend { font-family: var(--mono); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: .92rem; padding: .5rem .65rem;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
  transition: border-color .1s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
textarea { resize: vertical; }
input[type=color] { padding: 3px; width: 2.6rem; height: 2.4rem; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 15px; height: 15px; margin: 0; padding: 0; }
label.check, label.choice, .label-pick {
  font-family: var(--sans); font-size: .9rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink);
}
label.check { display: inline-flex; gap: .4rem; align-items: center; cursor: pointer; }
label.choice { display: flex; gap: .65rem; align-items: flex-start; padding: .5rem 0; cursor: pointer; }
label.choice input { margin-top: .2rem; }
fieldset.picker { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1.1rem; }
fieldset.picker legend { padding: 0; margin-bottom: .45rem; }

/* --- buttons --- */
button { font: inherit; cursor: pointer; }
button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .45rem .85rem; font-size: .88rem; font-weight: 600; line-height: 1.2; text-decoration: none;
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  transition: transform .08s, box-shadow .08s;
}
button:hover, a.button:hover { box-shadow: var(--shadow); transform: translate(-1px, -1px); }
button:active, a.button:active { box-shadow: none; transform: none; }
button.primary { background: var(--ink); color: var(--paper); padding: .6rem 1.1rem; margin-top: .5rem; }
a.button.primary { background: var(--ink); color: var(--paper); }
button.danger { border-color: var(--signal); color: var(--signal); }
button.danger:hover { box-shadow: 3px 3px 0 var(--signal); }
a.button.ghost { border-color: transparent; color: var(--muted); font-weight: 500; }
a.button.ghost:hover { border-color: var(--ink); color: var(--ink); }
button.link {
  border: 0; background: none; padding: 0; color: var(--muted); font-weight: 500;
}
button.link:hover { color: var(--ink); box-shadow: none; transform: none; text-decoration: underline; }
.actions { display: flex; gap: .6rem; align-items: center; margin-top: .75rem; }
.actions button.primary { margin-top: 0; }
.actions .small { margin-left: auto; font-family: var(--mono); font-size: .72rem; }

/* --- alerts --- */
.alert { padding: .6rem .8rem; font-size: .88rem; border: 1px solid; border-left-width: 4px; }
.alert.error { background: var(--signal-wash); color: var(--signal); }
.alert.ok { background: var(--wash); color: var(--ink); }

/* --- panels & lists --- */
.panel { border-top: 1px solid var(--rule-strong); padding: 1rem 0 .5rem; margin-top: 1.75rem; }
.panel h2, .my-group h2 {
  font-family: var(--mono); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  margin: 0 0 .5rem; display: flex; align-items: center; gap: .5rem;
}
.count {
  display: inline-block; min-width: 1.4em; padding: 0 .3em; font-family: var(--mono); font-size: .7rem; font-weight: 600;
  text-align: center; background: var(--wash-2); color: var(--ink-2); letter-spacing: 0;
}
.dot { display: inline-block; width: .62em; height: .62em; margin-right: .5em; vertical-align: .06em; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 0; }
.page-head form { margin: 0; }

.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li + li { border-top: 1px solid var(--rule); }
.item-line {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: .6rem .5rem;
  color: var(--ink); text-decoration: none;
}
.item-line:hover { background: var(--wash); }
.item-line-title { flex: 1; min-width: 12rem; display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.item-line .badge { align-self: center; }
.item-line > .muted.small { font-family: var(--mono); font-size: .72rem; }
.my-group { max-width: 900px; }

/* --- games --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; margin-top: .5rem; }
.tile { border: 1px solid var(--rule-strong); padding: 1.1rem 1.25rem 1.25rem; background: var(--paper); }
.tile h3 { margin: 0 0 1rem; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; }
.tile p { margin: 0; color: var(--muted); }
.tile.disabled { opacity: .6; }
.game-tile { transition: transform .08s, box-shadow .08s; }
.game-tile:hover { box-shadow: 5px 5px 0 var(--ink); transform: translate(-2px, -2px); }
.game-tile h3 a { color: var(--ink); text-decoration: none; }
.game-tile h3 a::after { content: " →"; opacity: 0; transition: opacity .1s; }
.game-tile:hover h3 a::after { opacity: 1; }
.game-tile p { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.game-tile p a {
  display: flex; align-items: center; gap: .5rem; padding: .45rem 0; text-decoration: none; color: var(--ink-2);
  border-bottom: 1px solid var(--rule); font-size: .9rem;
}
.game-tile p a:hover { color: var(--ink); background: var(--wash); }
.game-tile p a .count { margin-left: auto; }
.game-tile .dot { width: .7em; height: .7em; }
.new-tile { border-style: dashed; border-color: var(--muted); }
.new-tile h3 { color: var(--muted); font-size: 1rem; }
.new-tile .row input:not([type=color]) { flex: 1; }
details.archived { margin-top: 2.5rem; font-size: .9rem; }
details.archived summary { cursor: pointer; font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
details.archived ul { padding-left: 1.1rem; }

/* --- tabs (board kind, calendar/timeline) --- */
.tabs { display: flex; border: 1px solid var(--ink); }
.tabs a {
  padding: .35rem .85rem; text-decoration: none; color: var(--ink); font-size: .85rem; font-weight: 600;
}
.tabs a + a { border-left: 1px solid var(--ink); }
.tabs a:hover { background: var(--wash); }
.tabs a.active { background: var(--ink); color: var(--paper); }

/* --- board --- */
main.app:has(.board) { max-width: none; }
.board-head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.board-head h1 { margin: 0; display: flex; align-items: center; }
.board-head .button.ghost { margin-left: auto; }
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding: 0 6px 1.5rem 0; }
.column {
  flex: 0 0 272px; background: var(--wash); border-top: 3px solid var(--ink);
  padding: .55rem .55rem .4rem; display: flex; flex-direction: column; gap: .5rem;
  max-height: calc(100vh - 175px);
}
.column.done-col { border-top-color: var(--muted); }
.column.done-col h2 { color: var(--muted); }
.column h2 {
  font-family: var(--mono); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  margin: .2rem .2rem .1rem; display: flex; justify-content: space-between; align-items: center;
}
.column h2 .count { background: var(--paper); }
.col-items { display: flex; flex-direction: column; gap: 6px; min-height: 2.5rem; overflow-y: auto; padding: 0 4px 4px 0; }
.card-item {
  display: flex; flex-direction: column; gap: .4rem; padding: .6rem .7rem;
  background: var(--paper); border: 1px solid var(--rule);
  color: var(--ink); text-decoration: none; cursor: grab; font-size: .92rem;
  transition: transform .08s, box-shadow .08s, border-color .08s;
}
.card-item:hover { border-color: var(--ink); box-shadow: var(--shadow); transform: translate(-1px, -1px); }
.card-item.dragging { opacity: .35; border-style: dashed; box-shadow: none; transform: none; }
.card-item.done .card-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
.card-title { overflow-wrap: anywhere; font-weight: 500; }
.card-meta { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.card-meta .avatars { margin-left: auto; }
.badge {
  display: inline-flex; align-items: center; gap: .3rem; align-self: flex-start;
  font-family: var(--mono); font-size: .68rem; font-weight: 500; padding: .12rem .35rem;
  color: var(--ink-2); border: 1px solid var(--rule); background: var(--paper);
}
.badge.complete { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.badge.overdue { border-color: var(--signal); background: var(--signal-wash); color: var(--signal); }
.quick-add input {
  width: 100%; background: transparent; border-color: transparent; color: var(--muted); font-size: .88rem;
}
.quick-add input::placeholder { color: var(--muted); }
.quick-add input:hover { background: var(--paper); border-color: var(--rule); }
.quick-add input:focus { background: var(--paper); color: var(--ink); }

/* --- labels --- */
.labels { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.label {
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
  font-family: var(--mono); font-size: .66rem; font-weight: 600; line-height: 1.4; text-transform: uppercase; letter-spacing: .04em;
  padding: .05rem .4rem .05rem .3rem; border: 1px solid var(--ink-2); color: var(--ink);
}
.swatch { width: 7px; height: 7px; flex-shrink: 0; }
.label-pick { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }

/* --- item dialog / page --- */
dialog#modal, dialog#keys {
  width: min(680px, 94vw); max-height: 90vh; padding: 1.5rem 1.75rem 1.75rem;
  border: 1px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: var(--paper); color: var(--ink);
}
dialog#modal::backdrop, dialog#keys::backdrop { background: rgb(10 10 10 / .5); }
dialog#modal[open] { animation: pop .12s ease-out; }
@keyframes pop { from { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); } }
.item-head {
  display: flex; align-items: center; gap: .2rem; padding-bottom: .75rem; margin-bottom: .25rem;
  border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
}
.item-head .close { margin-left: auto; font-size: 1.1rem; padding: .25rem; }
.item-form input[name=title] {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; border-color: transparent; padding: .25rem .4rem; margin-left: -.4rem;
}
.item-form input[name=title]:hover { border-color: var(--rule); }
.item-form input[name=title]:focus { border-color: var(--ink); }
.item-form label[for^=title-] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.item-page { max-width: 700px; }
.item-page .close { display: none; }

.item-view h3 {
  font-family: var(--mono); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  margin: 1.25rem 0 0; display: flex; align-items: center; gap: .5rem;
}
.checklist, .feed { border-top: 1px solid var(--ink); padding-top: .1rem; }
.checklist progress {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border: 0; background: var(--wash-2);
}
.checklist progress::-webkit-progress-bar { background: var(--wash-2); }
.checklist progress::-webkit-progress-value { background: var(--ink); }
.checklist progress::-moz-progress-bar { background: var(--ink); }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: center; gap: .5rem; padding: .25rem .3rem; }
.checks li:hover { background: var(--wash); }
.checks li form:first-child { flex: 1; margin: 0; }
.checks li form { margin: 0; }
.checks li .link { visibility: hidden; }
.checks li:hover .link, .checks li .link:focus { visibility: visible; }
.checks li.done .check-text { text-decoration: line-through; color: var(--muted); }
.add-check input { flex: 1; }
.add-comment textarea { width: 100%; }
.feed-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.feed-meta { display: flex; align-items: center; gap: .45rem; font-size: .88rem; }
.feed-meta time { font-family: var(--mono); font-size: .7rem; }
.feed-meta form { margin: 0 0 0 auto; }
.comment-body {
  white-space: pre-wrap; overflow-wrap: anywhere; margin: .3rem 0 0 calc(18px + .45rem); padding: .5rem .7rem;
  border-left: 2px solid var(--ink); background: var(--wash); font-size: .92rem;
}
.activity { padding-left: calc(18px + .45rem); }
.activity time { font-family: var(--mono); font-size: .7rem; }

/* --- settings --- */
.settings, .settings-game { max-width: 40rem; }
.settings-game .row input:not([type=color]) { flex: 1; }
.columns-table { border-collapse: collapse; margin-bottom: .75rem; }
.columns-table td { padding: .3rem .5rem .3rem 0; border-bottom: 1px solid var(--rule); }
.columns-table form { margin: 0; }

/* --- calendar / timeline shared --- */
main.app:has(.timeline) { max-width: none; }
.view-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pager { display: flex; }
.pager a.button { padding: .38rem .65rem; }
.pager a.button + a.button { margin-left: -1px; }
.filters { margin: 0 0 0 auto; }
.filters select { font-size: .85rem; padding: .38rem .5rem; }

.bar {
  display: flex; align-items: center; gap: .3rem; min-width: 0; margin: 1px 3px; padding: .1rem .35rem;
  font-size: .76rem; font-weight: 500; line-height: 1.35; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 1px solid var(--ink); border-left: 4px solid var(--game, var(--ink));
  position: relative; z-index: 1;
}
.bar:hover { background: var(--ink); color: var(--paper); z-index: 3; }
.bar.cont-left { margin-left: 0; }
.bar.cont-right { border-right-style: dashed; margin-right: 0; }
.bar.done { color: var(--muted); border-color: var(--rule); border-left-color: var(--game, var(--rule)); }
.bar.done .bar-title { text-decoration: line-through; }
.bar.overdue { border-color: var(--signal); background: var(--signal-wash); color: var(--signal); border-left-color: var(--game, var(--signal)); }
.bar.overdue:hover { background: var(--signal); color: #fff; }
.bar .kind { display: inline-flex; font-size: .72rem; opacity: .7; }
/* Events: filled, so they read differently from board items. */
.bar.event { background: var(--wash-2); border-color: var(--ink-2); font-weight: 600; }
.bar.event:hover { background: var(--ink); color: var(--paper); }
.bar-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- month calendar --- */
.month { border: 1px solid var(--ink); }
.month-weekdays, .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-weekdays div {
  padding: .4rem .5rem; font-family: var(--mono); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  background: var(--ink); color: var(--paper);
}
.week { min-height: 7rem; padding-bottom: .25rem; }
.week + .week { border-top: 1px solid var(--rule); }
.day { grid-row: 1 / -1; border-left: 1px solid var(--rule); }
.day:first-of-type { border-left: 0; }
.day.weekend { background: var(--wash); }
.day.other { background: repeating-linear-gradient(135deg, var(--wash) 0 6px, var(--paper) 6px 12px); }
.day.today { background: var(--wash-2); }
.day-num { grid-row: 1; padding: .3rem .45rem; font-family: var(--mono); font-size: .75rem; color: var(--ink-2); position: relative; z-index: 1; }
.day-num.other { color: var(--muted); opacity: .7; }
.page-head + .view-head { margin-top: 1rem; }
.day-num { display: flex; align-items: center; justify-content: space-between; }
.day-add {
  display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; color: var(--ink-2);
  text-decoration: none; opacity: 0; transition: opacity .1s;
}
.day-add:hover { background: var(--ink); color: var(--paper); }
.day-num:hover .day-add, .day-add:focus-visible { opacity: 1; }
@media (hover: none) { .day-add { opacity: .6; } }
.day-num.today time {
  display: inline-grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 .2rem;
  background: var(--ink); color: var(--paper); font-weight: 700;
}

/* --- timeline --- */
.timeline-wrap { overflow-x: auto; border: 1px solid var(--ink); }
.timeline { --day: 1.9rem; --label: 11rem; width: max-content; min-width: 100%; }
.tl-row { display: grid; grid-template-columns: var(--label) repeat(var(--days), var(--day)); }
.tl-label {
  grid-column: 1; position: sticky; left: 0; z-index: 2; background: var(--paper);
  padding: .35rem .7rem; border-right: 1px solid var(--ink); font-size: .88rem; overflow: hidden;
}
.tl-label a { color: var(--ink); text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; }
.tl-label a:hover { text-decoration: underline; }
.tl-label .studio { font-weight: 700; display: inline-flex; align-items: center; }
.tl-label .studio .dot { background: var(--ink); }
.tl-months { background: var(--ink); color: var(--paper); }
.tl-months .tl-label { background: var(--ink); }
.tl-months .tl-month {
  font-family: var(--mono); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  padding: .35rem .45rem; border-left: 1px solid var(--muted); white-space: nowrap; overflow: hidden;
}
.tl-days { border-bottom: 1px solid var(--ink); }
.tl-day { font-family: var(--mono); font-size: .66rem; color: var(--muted); text-align: center; padding: .2rem 0; }
.tl-day.weekend { background: var(--wash); }
.tl-day.today { color: var(--paper); background: var(--ink); font-weight: 700; }
.tl-group { min-height: 2.3rem; padding: .2rem 0; border-bottom: 1px solid var(--rule); }
.tl-bg { grid-row: 1 / -1; }
.tl-bg.weekend { background: var(--wash); }
.tl-bg.today { background: var(--wash-2); box-shadow: inset 1px 0 0 var(--ink), inset -1px 0 0 var(--ink); }
.tl-group .bar { margin: 2px 1px; }
.tl-empty { padding: 1.25rem; }

/* --- notifications --- */
.notifications li.unread .item-line { font-weight: 600; }
.notifications .item-line::before { content: ""; width: 7px; height: 7px; flex-shrink: 0; }
.notifications li.unread .item-line::before { background: var(--ink); }
.notifications .item-line-title .icon { color: var(--muted); }

@media (max-width: 720px) {
  .topbar { gap: 1rem; padding: 0 1rem; overflow-x: auto; }
  .me > span { display: none; }
  main.app { padding: 1.25rem 1rem 2rem; }
  h1 { font-size: 1.6rem; }
  .filters { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --- top search & shortcuts --- */
.top-search { margin: 0; }
.top-search input { width: 11rem; padding: .3rem .55rem; font-size: .85rem; transition: width .12s; }
.top-search input:focus { width: 16rem; }
dialog#keys { width: min(460px, 94vw); }
.keys { margin: .5rem 0 0; display: grid; gap: .15rem; }
.keys div { display: grid; grid-template-columns: 7.5rem 1fr; gap: .75rem; padding: .3rem 0; border-bottom: 1px solid var(--rule); }
.keys dt, .keys dd { margin: 0; font-size: .88rem; }
kbd {
  display: inline-block; min-width: 1.4em; padding: 0 .35em; font-family: var(--mono); font-size: .75rem; text-align: center;
  border: 1px solid var(--ink-2); border-bottom-width: 2px; background: var(--paper);
}

/* --- shared bits --- */
input.grow { flex: 1; min-width: 14rem; }
h2.sub { margin: 0; font-size: 1.1rem; }
.late { color: var(--signal); }
.page-head + .key-dates, .board-head + .key-dates { margin-top: 1rem; }
.panel h2 a.small { margin-left: auto; font-family: var(--sans); text-transform: none; letter-spacing: 0; font-weight: 500; }
button.small-button { padding: .25rem .55rem; font-size: .75rem; font-weight: 500; white-space: nowrap; }

/* --- today & overview layout --- */
main.app:has(.today) { max-width: 1280px; }
.today { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 0 2.5rem; align-items: start; }
.today-main > .panel:first-child, .today-side > .panel:first-child { margin-top: 1.25rem; }
.load { width: 100%; border-collapse: collapse; font-size: .88rem; }
.load th { font-family: var(--mono); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: right; padding: .2rem 0 .35rem; }
.load td { padding: .35rem 0; border-top: 1px solid var(--rule); text-align: right; font-family: var(--mono); font-size: .8rem; }
.load td:first-child { text-align: left; font-family: var(--sans); font-size: .88rem; }
.load td:first-child .avatar { margin-right: .35rem; }
.load td.late { font-weight: 700; }
.event-list, .activity-list { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.event-list li, .activity-list li { padding: .4rem 0; border-top: 1px solid var(--rule); }
.event-list li:first-child, .activity-list li:first-child { border-top: 0; }
.event-list a { color: var(--ink); text-decoration: none; font-weight: 600; }
.event-list a:hover { text-decoration: underline; }
.event-list .muted { display: block; font-family: var(--mono); font-size: .7rem; }
.activity-list a { color: var(--ink); }
.activity-list .muted.small { display: block; font-family: var(--mono); font-size: .68rem; margin-top: .1rem; }

/* --- key dates --- */
.key-dates { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; margin: .5rem 0 .25rem; }
.key-date {
  display: flex; flex-direction: column; gap: .15rem; padding: .7rem .85rem; text-decoration: none; color: var(--ink);
  border: 1px solid var(--ink); border-left: 5px solid var(--game, var(--ink)); background: var(--paper);
  transition: transform .08s, box-shadow .08s;
}
.key-date:hover { box-shadow: var(--shadow); transform: translate(-1px, -1px); }
.key-when { font-family: var(--mono); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.key-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.key-date .muted.small { font-family: var(--mono); font-size: .68rem; }

/* --- game overview --- */
.game-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.game-links .button { font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--ink); margin-top: 1.25rem; }
.stat { display: flex; flex-direction: column; gap: .2rem; padding: .75rem .9rem; color: var(--ink); text-decoration: none; }
.stat + .stat { border-left: 1px solid var(--ink); }
a.stat:hover { background: var(--wash); }
.stat-value { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat-label { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat.late .stat-value { color: var(--signal); }
.apply-plan { max-width: 40rem; }

/* --- metrics --- */
.metric-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.metric-tile {
  display: flex; flex-direction: column; gap: .15rem; padding: .7rem .85rem .5rem; border: 1px solid var(--rule);
  color: var(--ink); text-decoration: none;
}
.metric-tile:hover { border-color: var(--ink); }
.metric-name { font-family: var(--mono); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.metric-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.spark { width: 100%; height: 32px; margin-top: .35rem; overflow: visible; }
.spark polyline { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark.big { height: 64px; flex: 1; min-width: 12rem; margin: 0; }
.log-metric { align-items: flex-end; border-top: 1px solid var(--rule-strong); }
.log-metric .stack { flex: 0 1 14rem; }
.log-metric .stack:first-child { flex-basis: 18rem; }
.log-metric button.primary { margin-top: 0; }
.metric-head { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; margin: .25rem 0 .75rem; }
.metric-head .metric-value { font-size: 2.4rem; }
.metric-changes { display: flex; gap: 1.5rem; margin: 0; }
.metric-changes dt { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.metric-changes dd { margin: 0; font-family: var(--mono); font-weight: 600; }
.metric-table { border-collapse: collapse; margin: .5rem 0; font-size: .86rem; }
.metric-table th { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: left; padding: .2rem 1.5rem .3rem 0; }
.metric-table td { padding: .25rem 1.5rem .25rem 0; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: .8rem; }
.metric-table form { margin: 0; }
.metric details summary { cursor: pointer; }

/* --- contacts --- */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--ink); margin: 1rem 0; }
.pipeline a {
  display: flex; flex-direction: column; gap: .1rem; padding: .55rem .75rem; text-decoration: none; color: var(--ink-2);
  font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
}
.pipeline a + a { border-left: 1px solid var(--ink); }
.pipeline a:hover { background: var(--wash); }
.pipeline a.active { background: var(--ink); color: var(--paper); }
.pipeline-count { font-family: var(--sans); font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; text-transform: none; color: inherit; }
.contact-filters { margin: 0 0 .5rem; }
.contact-filters input[type=search] { flex: 1; min-width: 14rem; font-size: .85rem; padding: .38rem .55rem; }
.contacts .contact-row { display: flex; align-items: center; gap: .5rem; }
.contacts .contact-row .item-line { flex: 1; min-width: 0; }
.contacts .contact-row form { margin: 0; padding-right: .25rem; }
.status {
  display: inline-block; font-family: var(--mono); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  padding: .1rem .4rem; border: 1px solid var(--ink-2);
}
.status-todo { border-style: dashed; color: var(--ink-2); }
.status-replied { background: var(--wash-2); }
.status-covered { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.status-declined { color: var(--muted); border-color: var(--rule); text-decoration: line-through; }

/* --- launch plans --- */
.plan-tile { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: .5rem; }
.plan-tile h3 { margin-bottom: 0; }
.plan-tile p { color: var(--ink-2); font-size: .9rem; }
.new-tile input { width: 100%; }
.steps { list-style: none; margin: 0 0 .75rem; padding: 0; }
.steps li { border-top: 1px solid var(--rule); }
.step-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .4rem .6rem; padding: .55rem 0; margin: 0; }
.step-form input[name=title] { flex: 1 1 16rem; font-weight: 600; }
.step-form textarea { flex: 1 1 100%; margin-left: 3.6rem; font-size: .82rem; font-family: var(--mono); }
.step-when { flex: 0 0 3rem; padding-top: .55rem; font-family: var(--mono); font-size: .78rem; font-weight: 700; }
.step-actions { display: flex; gap: .4rem; margin-left: auto; }
label.inline { display: inline-flex; align-items: center; gap: .35rem; padding-top: .25rem; }
label.inline input { width: 4.2rem; padding: .35rem .45rem; font-family: var(--mono); }
.new-step { border-top: 1px dashed var(--muted); }

/* --- recap & search --- */
.recap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
.recap-game h3 { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; margin: .75rem 0 .25rem; display: flex; gap: .5rem; align-items: center; }
.recap-game h2 a { color: var(--ink); text-decoration: none; }
.recap-metrics { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0; }
.recap-metrics .badge { font-size: .74rem; }
.search-page { max-width: 40rem; margin-bottom: .5rem; }
.search-page input { flex: 1; }

@media (max-width: 960px) {
  .today { grid-template-columns: 1fr; }
  .recap-cols { grid-template-columns: 1fr; }
  .top-search input, .top-search input:focus { width: 8rem; }
}
@media (max-width: 720px) {
  .stats, .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat + .stat, .pipeline a + a { border-left: 0; }
  .stat, .pipeline a { border-bottom: 1px solid var(--ink); }
  .step-form textarea { margin-left: 0; }
}
