/* Today (S6): the Arkham board (dashboard-today-board.js), every selector
   under .tb-room, and the top bar's Needs-you count (dashboard-topnav.js).
   Tokens only. Labels stay in normal case with no tracking; each count sits
   in its own mono chip. Every control is at least 32 px high. The lanes are
   five columns only when the board itself is wide enough (a container
   query, red team P2-7); below that a tablist shows one lane at a time, and
   nothing scrolls sideways at 390 px. */

.os-topnav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 8px;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
}

.tb-room {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1600px;
  min-width: 0;
  container-type: inline-size;
  container-name: today;
}
.tb-room .btn {
  min-height: 32px;
}
.tb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tb-heading {
  margin: 0;
  color: var(--text-1);
  font-size: 24px;
  font-weight: 300;
}
.tb-lenses-toggle {
  display: none;
}
.tb-viewer {
  margin: 0;
  padding: 8px 12px;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tb-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}
.tb-panel-host,
.tb-content,
.tb-since-host,
.tb-coverage-host,
.tb-brief-host,
.tb-main-host {
  min-width: 0;
}
.tb-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tb-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.tb-panel-title {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}
.tb-lenses,
.tb-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tb-filter {
  flex-direction: row;
  flex-wrap: wrap;
}
.tb-filter > .tb-panel-title {
  flex: 1 0 100%;
}
.tb-lens,
.tb-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.tb-filter-chip {
  border-color: var(--border);
}
.tb-lens:hover,
.tb-filter-chip:hover {
  color: var(--text-1);
  background: var(--bg-2);
}
.tb-lens[aria-pressed="true"],
.tb-filter-chip[aria-pressed="true"] {
  color: var(--text-1);
  background: var(--accent-wash);
  border-color: var(--accent-line);
}
.tb-lens:disabled {
  color: var(--text-3);
  cursor: not-allowed;
}
.tb-lens:focus-visible,
.tb-filter-chip:focus-visible,
.tb-lane-tab:focus-visible,
.tb-card-main:focus-visible,
.tb-since-chip:focus-visible,
.tb-menu-item:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.tb-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 8px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tb-why,
.tb-muted {
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
}
.tb-time {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

/* Since your last visit: one row of wrapping chips, never a sideways scroll. */
.tb-since {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tb-since-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
}
.tb-since-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tb-since-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  color: var(--text-1);
  font-size: 13px;
  text-decoration: none;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tb-since-chip:hover {
  border-color: var(--border-strong);
}
.tb-coverage {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tb-coverage-row {
  margin: 0;
  padding: 8px 12px;
  color: var(--text-2);
  font-size: 13px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left: 2px solid var(--status-warn);
  border-radius: var(--radius-sm);
}

/* The Brief: three large cards at 1024 px and up, stacked below. */
.tb-brief {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tb-brief-title {
  margin: 0;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.tb-outcome {
  margin: 0;
  color: var(--text-1);
  font-size: 16px;
  font-weight: 300;
}
.tb-brief-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.tb-empty {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}
.tb-brief-facts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0 0 0 16px;
  color: var(--text-2);
  font-size: 13px;
}

/* A card: a link to its sheet, its chips, its one visible action. */
.tb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.tb-card-gate {
  border-left: 2px solid var(--accent);
}
.tb-brief-card {
  padding: 16px;
}
.tb-card-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.tb-card-main:hover .tb-title {
  text-decoration: underline;
}
.tb-card-top,
.tb-card-state,
.tb-card-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tb-card-top {
  justify-content: space-between;
}
.tb-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  font-size: 12px;
}
.tb-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.tb-brief-card .tb-title {
  font-size: 16px;
}
.tb-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  color: var(--text-2);
  font-size: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}
.tb-chip-ok {
  color: var(--text-1);
  border-color: var(--status-ok);
}
.tb-chip-warn {
  color: var(--text-1);
  border-color: var(--status-warn);
}
.tb-chip-bad {
  color: var(--text-1);
  border-color: var(--status-bad);
}
.tb-chip-muted {
  color: var(--text-3);
}
.tb-chip-neutral {
  color: var(--text-2);
}
.tb-action-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tb-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tb-primary {
  min-height: 32px;
}
.tb-confirm-host:empty,
.tb-status:empty {
  display: none;
}
.tb-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tb-confirm p {
  flex: 1 0 100%;
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}
.tb-status {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}
.tb-status-bad {
  color: var(--text-1);
  padding-left: 8px;
  border-left: 2px solid var(--status-bad);
}
.tb-more {
  position: relative;
}
.tb-kebab {
  min-width: 32px;
  min-height: 32px;
}
.tb-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: 4px;
  background: var(--bg-hovercard);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
}
.tb-menu[hidden] {
  display: none;
}
.tb-menu-item {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  color: var(--text-1);
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.tb-menu-item:hover {
  background: var(--bg-2);
}
.tb-menu-item:disabled {
  color: var(--text-3);
  cursor: not-allowed;
}

/* Lanes: a tablist and one lane at a time until the board is wide enough. */
.tb-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.tb-lane-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tb-lane-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.tb-lane-tab[aria-selected="true"] {
  color: var(--text-1);
  background: var(--accent-wash);
  border-color: var(--accent-line);
}
.tb-lanes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}
.tb-lane[data-active="false"] {
  display: none;
}
.tb-lane,
.tb-day {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.tb-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tb-lane-title,
.tb-wait-title {
  margin: 0;
  /* As tall as the count chip beside it, so a heading sits nearest what it heads. */
  line-height: 20px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.tb-wait-title {
  color: var(--text-3);
}
/* A reason group's heading sits nearer its cards than what comes before it. */
.tb-wait-group {
  padding-top: 16px;
}
.tb-lane-body,
.tb-wait-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.tb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tb-list-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tb-week {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tb-week-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tb-week-label {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
}
.tb-days {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.tb-elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.tb-empty-board,
.tb-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.tb-error p {
  margin: 0;
  color: var(--text-1);
}
.tb-skeleton {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.tb-skeleton-lane {
  height: 120px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* The sheet: 420 px on the right; the whole screen on a phone. */
.tb-sheet {
  position: fixed;
  z-index: 30;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 420px;
  max-width: 100%;
  padding: 16px;
  overflow-y: auto;
  background: var(--pane-bg);
  border-left: 1px solid var(--pane-border);
  box-shadow: var(--shadow-popover);
}
.tb-sheet[hidden] {
  display: none;
}
.tb-sheet:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}
.tb-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.tb-sheet-title {
  margin: 0;
  color: var(--text-1);
  font-size: 18px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.tb-sheet-close {
  flex: none;
}
.tb-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
  font-size: 13px;
}
.tb-facts dt {
  color: var(--text-3);
}
.tb-facts dd {
  margin: 0;
  color: var(--text-1);
  overflow-wrap: anywhere;
}
.tb-owner:empty {
  display: none;
}
.tb-open {
  align-self: flex-start;
}
.tb-check,
.tb-delivery,
.tb-delivery-task,
.tb-since-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.tb-check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tb-check-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

@container today (min-width: 1024px) {
  .tb-brief-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Five lanes of 200 px and their gaps need 1,048 px, and the panel takes 256
   more, so the board is five columns from 1,320 px of its own width: a 1440
   screen shows them, a 1280 one shows the tablist (tools/today-browser-smoke.js). */
@container today (min-width: 1320px) {
  .tb-lane-tabs {
    display: none;
  }
  .tb-lanes,
  .tb-skeleton {
    grid-template-columns: repeat(5, minmax(200px, 1fr));
  }
  .tb-lane[data-active="false"] {
    display: flex;
  }
  .tb-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@container today (max-width: 760px) {
  .tb-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .tb-lenses-toggle {
    display: inline-flex;
  }
  .tb-panel-host {
    display: none;
  }
  .tb-room.tb-panel-open .tb-panel-host {
    display: block;
  }
}

@media (max-width: 600px) {
  .tb-sheet {
    left: 0;
    width: auto;
  }
}

/* With a sheet open on a wide screen, the board keeps clear of it. */
@media (min-width: 1700px) {
  .tb-room.tb-has-sheet {
    padding-right: 436px;
  }
}

.tb-notice {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}
.tb-notice:empty {
  display: none;
}
