/* ==========================================================================
   Switchboard — team task inbox
   Visual direction: dark operations console. Condensed display type, mono
   metadata, square-cut panels, status routed into colour-coded lines.
   ========================================================================== */

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #080b10;
  --bg-deep: #05070a;
  --surface: #10151c;
  --surface-2: #161d26;
  --surface-3: #1d2630;
  --line: #27323f;
  --line-soft: #1b232d;
  --text: #e8eef5;
  --text-dim: #9fb0c0;
  --text-faint: #6d7f90;

  --accent: #5ee9b5;
  --accent-ink: #04231a;

  --todo: #7aa2ff;
  --in-progress: #ffb454;
  --blocked: #ff6b81;
  --done: #5ee9b5;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Oswald", "Haettenschweiler", "Arial Narrow", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 4px;
  --radius-lg: 6px;
  --shell-max: 1320px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* author-level display rules below would otherwise beat the UA [hidden] rule */
[hidden] {
  display: none !important;
}

html {
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* fine engineering grid, kept very low contrast */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(rgba(126, 162, 196, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 162, 196, 0.045) 1px, transparent 1px),
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(94, 233, 181, 0.09), transparent 70%);
  background-size: 64px 64px, 64px 64px, 100% 100%;
}

body > * {
  position: relative;
  z-index: 1;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 60;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(8, 11, 16, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 28px;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}
.brand-mark .m1 { fill: var(--todo); }
.brand-mark .m2 { fill: var(--in-progress); }
.brand-mark .m3 { fill: var(--blocked); }
.brand-mark .m4 { fill: var(--done); }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 3px;
}

.topnav {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.topnav-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.topnav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.topnav-link.is-current {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
}

.line-status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.line-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 233, 181, 0.16);
}

.line-sep {
  color: var(--text-faint);
}

/* ----------------------------------------------------------------- shell */

.shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 34px 28px 72px;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 24px 40px;
  align-items: end;
  padding-bottom: 20px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

#view-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(38px, 5.2vw, 60px);
  line-height: 0.98;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.masthead-sub {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 14px;
  max-width: 46ch;
}
.masthead-sub b {
  color: var(--text);
  font-weight: 600;
}

/* --------------------------------------------------------------- controls */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  justify-content: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-search {
  flex: 1 1 240px;
  max-width: 300px;
}

.field-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.field-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 11px;
  height: 40px;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.field-shell:hover {
  border-color: #33414f;
}
.field-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 233, 181, 0.14);
}

.field-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--text-faint);
}

.field-shell input,
.field-shell select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
}
.field-shell input:focus,
.field-shell select:focus {
  outline: none;
}
.field-shell input::placeholder {
  color: var(--text-faint);
}
.field-shell input::-webkit-search-cancel-button {
  filter: invert(0.7);
}

.select-shell {
  position: relative;
  padding-right: 30px;
}
.select-shell::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--text-dim);
  border-bottom: 1.6px solid var(--text-dim);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.field-shell select option {
  background: var(--surface-2);
  color: var(--text);
}

.segmented {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
  height: 40px;
}

.seg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  border-radius: 2px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.seg svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.seg:hover {
  color: var(--text);
}
.seg.is-on {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ----------------------------------------------------------- signal strip */

.signal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 0;
  margin-top: 4px;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.chip:hover {
  color: var(--text);
  border-color: #38485a;
}
.chip .chip-rail {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: currentColor;
}
.chip .chip-count {
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.chip[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--text);
  border-color: currentColor;
}
.chip[data-status="all"] { --hue: var(--text-dim); }
.chip[data-status="todo"] { --hue: var(--todo); }
.chip[data-status="in-progress"] { --hue: var(--in-progress); }
.chip[data-status="blocked"] { --hue: var(--blocked); }
.chip[data-status="done"] { --hue: var(--done); }
.chip .chip-rail { background: var(--hue); }
.chip[aria-pressed="true"] { border-color: var(--hue); }

/* ----------------------------------------------------------------- board */

.board-region {
  margin-top: 26px;
  scroll-margin-top: 80px;
}
.board-region:focus {
  outline: none;
}

.board[data-view="board"] {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.column {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(16, 21, 28, 0.55) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.column-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px 12px;
  border-bottom: 1px solid var(--line-soft);
  border-top: 3px solid var(--hue);
}

.column-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

.column-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--hue);
  background: color-mix(in srgb, var(--hue) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--hue) 34%, transparent);
  border-radius: 2px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}

.column-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  min-height: 72px;
}

.column.is-solo .column-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  align-items: start;
  gap: 12px;
}

.card-heading {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.column-quiet {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 10px 2px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

/* ------------------------------------------------------------------ card */

.card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--hue);
  border-radius: var(--radius);
  padding: 12px 13px 11px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.card:hover {
  background: var(--surface-3);
  border-color: #3a4a5c;
  border-left-color: var(--hue);
}
.card:has(.card-open:focus-visible) {
  border-color: var(--accent);
  border-left-color: var(--hue);
}
.card.is-open {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue) 45%, transparent);
}
.card.just-moved {
  animation: flash 0.9s ease;
}

@keyframes flash {
  0% { background: color-mix(in srgb, var(--hue) 26%, var(--surface-2)); }
  100% { background: var(--surface-2); }
}

.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.card-id {
  color: var(--hue);
}

.card-project {
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bars {
  margin-left: auto;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}
.bars i {
  display: block;
  width: 3px;
  background: var(--line);
  border-radius: 1px;
}
.bars i:nth-child(1) { height: 4px; }
.bars i:nth-child(2) { height: 7.5px; }
.bars i:nth-child(3) { height: 11px; }
.bars[data-level="1"] i:nth-child(-n + 1),
.bars[data-level="2"] i:nth-child(-n + 2),
.bars[data-level="3"] i:nth-child(-n + 3) {
  background: var(--prio);
}
.bars[data-level="1"] { --prio: #6d7f90; }
.bars[data-level="2"] { --prio: var(--in-progress); }
.bars[data-level="3"] { --prio: var(--blocked); }

.card-open {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--body);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.34;
  letter-spacing: -0.004em;
  cursor: pointer;
}
.card-open:hover {
  color: #fff;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(126, 162, 196, 0.09);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 2px 6px;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  color: #06090d;
  background: var(--who, #7aa2ff);
  flex: 0 0 auto;
}

.card-who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.card-due {
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.card-notes {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card-notes svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

/* ------------------------------------------------------------- list view */

.board[data-view="list"] {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.list-head {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 150px 132px 96px 84px;
  gap: 14px;
  align-items: center;
  padding: 11px 16px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 150px 132px 96px 84px;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid var(--hue);
  cursor: pointer;
  background: var(--surface);
  transition: background 0.14s ease;
}
.row:last-child {
  border-bottom: 0;
}
.row:hover {
  background: var(--surface-2);
}
.row.is-open {
  background: var(--surface-3);
}
.row.just-moved {
  animation: flashrow 0.9s ease;
}
@keyframes flashrow {
  0% { background: color-mix(in srgb, var(--hue) 22%, var(--surface)); }
  100% { background: var(--surface); }
}

.row-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hue);
}
.row-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.row-title {
  min-width: 0;
}
.row-title .card-open {
  font-size: 15px;
}
.row-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 4px;
}

.row-cell {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-who {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ------------------------------------------------------------ empty state */

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 46px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-mark {
  width: 56px;
  height: 56px;
  color: var(--text-faint);
}

.empty-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.empty-copy {
  color: var(--text-dim);
  max-width: 48ch;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}

/* --------------------------------------------------------------- buttons */

.btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn:hover {
  background: var(--surface-3);
  border-color: #3a4a5c;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}
.btn-primary:hover {
  background: #7df0c6;
  border-color: #7df0c6;
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover {
  color: var(--text);
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
}
.icon-btn svg {
  width: 15px;
  height: 15px;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--surface-3);
  border-color: #3a4a5c;
}

/* ---------------------------------------------------------------- panels */

.panels {
  margin-top: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px 20px;
  scroll-margin-top: 80px;
}

.panel-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
}

.roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px 18px;
}

.roster-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.roster-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-load {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.legend-list {
  margin: 0;
  display: grid;
  gap: 9px;
}
.legend-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}
.legend-row dt {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}
.legend-row dd {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: 0 0 auto;
}
.s-todo { background: var(--todo); }
.s-in-progress { background: var(--in-progress); }
.s-blocked { background: var(--blocked); }
.s-done { background: var(--done); }

.legend-note {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 12.5px;
}

/* ---------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-deep);
}
.footer p {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 20px 28px 26px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------------------------------------------------------------- detail */

.detail {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  width: min(720px, calc(100vw - 48px));
  max-width: none;
  max-height: min(860px, calc(100vh - 72px));
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65);
}

dialog:not([open]) {
  display: none;
}

.detail::backdrop {
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(3px);
}

.detail[open] {
  animation: dialog-in 0.18s ease-out;
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
}

.detail-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  border-top: 3px solid var(--hue, var(--accent));
}

.detail-head,
.detail-foot {
  flex: 0 0 auto;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-deep);
}

.detail-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-right: auto;
}

.detail-id {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.detail-status-pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hue, var(--accent));
  border: 1px solid color-mix(in srgb, var(--hue, var(--accent)) 45%, transparent);
  background: color-mix(in srgb, var(--hue, var(--accent)) 13%, transparent);
  border-radius: 2px;
  padding: 3px 8px;
}

.detail-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 26px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-title {
  font-size: clamp(22px, 3.4vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
}

.detail-breadcrumb {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.console-row {
  margin: 20px 0 22px;
  padding: 15px 16px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-left: 3px solid var(--hue, var(--accent));
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
}

.console-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
}
.console-field .field-shell {
  background: var(--surface-2);
}

.console-feedback {
  flex: 1 1 200px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.console-feedback.is-fresh {
  color: var(--accent);
}

.detail-prose p {
  margin: 0 0 14px;
  font-size: 15.5px;
  line-height: 1.68;
  color: #d9e3ec;
}
.detail-prose p:last-child {
  margin-bottom: 0;
}
.detail-prose p.outcome {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: 14.5px;
  color: var(--text-dim);
}
.detail-prose p.outcome b {
  color: var(--text);
  font-weight: 600;
}

.detail-subhead {
  margin: 24px 0 12px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px 18px;
}
.detail-grid > div {
  min-width: 0;
}
.detail-grid dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 5px;
}
.detail-grid dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-deep);
}

.detail-foot-note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: auto;
}

/* ----------------------------------------------------------------- toast */

.toast-dock {
  flex: 0 0 auto;
  padding: 0 18px 14px;
}
.toast-dock:empty {
  display: none;
}
.toast-dock .toast {
  max-width: none;
}

.toast-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--hue, var(--accent));
  border-radius: var(--radius);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
}
.toast-text b {
  font-weight: 600;
}
.toast-text span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hue, var(--accent));
  margin-bottom: 3px;
}

.toast-undo {
  margin-left: auto;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  padding: 7px 11px;
  cursor: pointer;
}
.toast-undo:hover {
  background: var(--surface-3);
  border-color: #3a4a5c;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .board[data-view="board"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .list-head,
  .row {
    grid-template-columns: 96px minmax(0, 1fr) 140px 110px;
  }
  .list-head .col-notes,
  .row .cell-notes,
  .list-head .col-prio,
  .row .cell-prio {
    display: none;
  }
}

@media (max-width: 960px) {
  .masthead {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .controls {
    justify-content: flex-start;
  }
  .panels {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    padding: 10px 16px;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 0;
  }
  .topnav {
    order: 3;
    width: 100%;
    margin-right: 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .topnav-link {
    white-space: nowrap;
  }
  .line-status {
    margin-left: auto;
    font-size: 10px;
  }
  .line-week {
    display: none;
  }
  .line-sep {
    display: none;
  }

  .shell {
    padding: 22px 16px 56px;
  }
  #view-title {
    font-size: 40px;
  }
  .controls {
    width: 100%;
    gap: 12px;
  }
  .field-search {
    flex: 1 1 100%;
    max-width: none;
  }
  .field:not(.field-search) {
    flex: 1 1 140px;
  }
  .field-view {
    flex: 1 1 100%;
  }
  .segmented {
    width: 100%;
  }
  .seg {
    flex: 1;
    justify-content: center;
  }

  .signal-strip {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 14px;
    scrollbar-width: thin;
  }
  .chip {
    flex: 0 0 auto;
  }

  .board[data-view="board"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .board[data-view="list"] {
    border: 0;
    background: transparent;
    gap: 10px;
  }
  .list-head {
    display: none;
  }
  .row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--hue);
    border-radius: var(--radius);
    background: var(--surface-2);
    padding: 12px 13px;
  }
  .row-cell {
    font-size: 10.5px;
  }
  .row .cell-notes,
  .row .cell-prio {
    display: none;
  }

  .detail {
    width: 100vw;
    max-width: 100vw;
    max-height: 94vh;
    margin: 0 0 0 auto;
    position: fixed;
    inset: auto 0 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 0;
  }
  .detail-body {
    padding: 18px 18px 22px;
  }
  .console-row {
    flex-direction: column;
    align-items: stretch;
  }
  .console-field {
    min-width: 0;
  }
  .detail-foot {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }
  .detail-foot .btn {
    width: 100%;
  }
  .detail-foot-note {
    text-align: center;
  }

  .toast-wrap {
    left: 12px;
    right: 12px;
    bottom: 12px;
    align-items: stretch;
  }
  .toast {
    max-width: none;
  }

  .legend-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
