:root {
  /* Surfaces */
  --surface-0: #fdfcfa;
  --surface-1: #f8f6f2;
  --surface-2: #f1eee8;
  --surface-3: #efebe4;
  --surface-invert: #16181a;

  /* Ink */
  --ink-1: #16181a;
  --ink-2: #26292d;
  --ink-3: #4a4e54;
  --ink-4: #565b61;
  --ink-5: #6b7076;
  --ink-on-invert: #fdfcfa;

  /* Accent */
  --accent: #1f4e8c;
  --accent-hover: #163a68;
  --accent-tint: #eef2f8;

  /* Borders */
  --border-subtle: rgba(22, 24, 26, 0.08);
  --border-default: rgba(22, 24, 26, 0.12);
  --border-strong: rgba(22, 24, 26, 0.22);

  /* Status */
  --status-ok-fg: #1b5e43;
  --status-ok-bg: #e8f1ec;
  --status-warn-fg: #8a5a12;
  --status-warn-bg: #faf0df;
  --status-risk-fg: #9b2c2c;
  --status-risk-bg: #faebeb;

  /* Spacing & radius */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 99px;
  --shadow-overlay: 0 8px 28px rgba(22, 24, 26, 0.12);

  /* Roadmap layout */
  --topbar-h: 56px;
  --gutter: 24px;
  --lane-w: 200px;
  --name-w: 336px;
  --col-min: 56px;
  --row-h: 36px;
  --add-row-h: 34px;
  --bar-h: 24px;
  --bar-h-packed: 40px;
  --track-pad: 8px;
  --stack-gap: 6px;
  --previous-tint: rgba(22, 24, 26, 0.035);

  --ease: 150ms ease-out;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--surface-1);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
  user-select: none;
}

.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-5);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-inline: var(--gutter);
  padding-top: 8px;
  background: var(--surface-0);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-brand {
  display: flex;
  flex: none;
  align-self: stretch;
  align-items: center;
  gap: var(--space-3);
}

.wordmark {
  font-size: 19px;
  /* font-style: italic; */
  font-weight: 600;
  color: var(--ink-1);
  text-decoration: none;
}

.horizon-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The date label is the only shrinkable item, so it ellipsises before anything else is squeezed. */
.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
}

.topbar-actions .btn {
  flex: none;
}

.view-tabs {
  display: flex;
  align-self: stretch;
  flex: none;
  gap: var(--space-3);
}

.view-tab {
  padding: 0 2px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  transition: color var(--ease), box-shadow var(--ease);
}

.view-tab:hover {
  color: var(--ink-1);
}

.view-tab.is-active {
  font-weight: 600;
  color: var(--ink-1);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.view-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toolbar-field[hidden] {
  display: none;
}

.toolbar-field {
  display: flex;
  flex: none;
  align-items: center;
  white-space: nowrap;
  gap: var(--space-2);
  margin-right: var(--space-2);
}

.select-sm {
  height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-0);
  font-size: 13.5px;
  color: var(--ink-1);
  cursor: pointer;
}

.select-sm:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-1);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--ease),
    border-color var(--ease),
    color var(--ease);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.rag-dot:focus-visible,
.range-hint:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-primary {
  background: var(--surface-invert);
  color: var(--ink-on-invert);
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-secondary {
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--ink-1);
}

.btn-ghost {
  color: var(--ink-3);
}

.btn-ghost:hover {
  background: rgba(22, 24, 26, 0.05);
  color: var(--ink-1);
}

.btn-destructive {
  border-color: var(--status-risk-fg);
  color: var(--status-risk-fg);
}

.btn-destructive:hover {
  background: var(--status-risk-bg);
}

.icon-btn {
  width: 26px;
  height: 26px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-4);
  cursor: pointer;
  transition:
    background-color var(--ease),
    color var(--ease),
    opacity var(--ease);
}

.icon-btn:hover {
  background: rgba(22, 24, 26, 0.06);
  color: var(--ink-1);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: transparent;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn.is-danger:hover:not(:disabled) {
  background: var(--status-risk-bg);
  color: var(--status-risk-fg);
}

/* ---------- Shell ---------- */

.app-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5) var(--gutter) var(--space-8);
}

.roadmap-panel,
.impediments-panel {
  background: var(--surface-0);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.roadmap-panel {
  overflow: auto;
  max-height: calc(100vh - var(--topbar-h) - var(--space-5) * 2);
}

/* ---------- Help page ---------- */

.help-badge {
  gap: 6px;
}

.help {
  max-width: 760px;
  padding: var(--space-2) 0 var(--space-8);
}

.help h1 {
  margin: 0 0 var(--space-3);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-1);
}

.help h2 {
  margin: var(--space-8) 0 var(--space-3);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-1);
}

.help p,
.help li {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.help p {
  margin: 0 0 var(--space-3);
}

.help-lead {
  font-size: 16px;
}

.help ul {
  margin: 0;
  padding-left: var(--space-5);
  display: grid;
  gap: 10px;
}

.help strong {
  font-weight: 600;
  color: var(--ink-1);
}

.help a {
  color: var(--accent);
}

/* ---------- Storage notice ---------- */

.notice[hidden] {
  display: none;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid rgba(138, 90, 18, 0.24);
  border-radius: var(--radius-lg);
  background: var(--status-warn-bg);
}

.notice-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.notice-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.notice-body strong {
  font-weight: 600;
  color: var(--status-warn-fg);
}

.notice-body p[lang="en"] {
  color: var(--ink-3);
}

.notice-body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notice-body a:hover,
.notice-body a:focus-visible {
  color: var(--accent);
}

.notice .btn {
  flex: none;
}

/* ---------- Roadmap grid ---------- */

.roadmap {
  position: relative;
  --cols: 12;
  --name-w-live: min(var(--name-w), 40vw);
  min-width: calc(var(--lane-w) + var(--name-w-live) + var(--cols) * var(--col-min));
}

.roadmap-header,
.lane {
  display: grid;
  grid-template-columns: var(--lane-w) var(--name-w-live) minmax(0, 1fr);
}

/* Quarterly lanes pack their bars into one track, so the item-name column is dropped entirely —
   a zero-width cell would still paint its border. */
.roadmap.is-packed {
  --col-min: 132px;
  min-width: calc(var(--lane-w) + var(--cols) * var(--col-min));
}

.roadmap.is-packed .roadmap-header,
.roadmap.is-packed .lane {
  grid-template-columns: var(--lane-w) minmax(0, 1fr);
}

.roadmap.is-packed .lane-track {
  grid-column: 2;
}

.roadmap-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-default);
}

.header-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 52px;
  padding: 0 var(--space-4);
  border-right: 1px solid var(--border-subtle);
}

.prev-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-4);
  cursor: pointer;
  user-select: none;
}

.prev-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.period-header {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
}

.period-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 0 6px;
  border-right: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  container-type: inline-size;
}

.period-cell:last-child {
  border-right: 0;
}

.period-cell > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.period-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-5);
}

.period-date {
  font-size: 13px;
  color: var(--ink-3);
}

.period-cell.is-previous {
  background: var(--previous-tint);
}

.period-cell.is-current {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.period-cell.is-current .period-label {
  color: var(--accent);
}

.period-cell.is-current .period-date {
  color: var(--ink-1);
  font-weight: 600;
}

@container (max-width: 92px) {
  .week-part {
    display: none;
  }
}

@container (max-width: 52px) {
  .week-end {
    display: none;
  }
}

/* ---------- Lanes ---------- */

.lane {
  border-bottom: 1px solid var(--border-default);
}

.lane:last-child {
  border-bottom: 0;
}

.lane-label {
  grid-column: 1;
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  min-width: 0;
  padding: 5px 6px var(--space-2) var(--space-3);
  border-left: 4px solid var(--lane-color, var(--ink-5));
  border-right: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--lane-color, var(--ink-5)) 50%, var(--surface-0));
}

.lane-label-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lane-collapse-btn svg {
  transition: transform var(--ease);
}

.lane-collapse-btn.is-collapsed svg {
  transform: rotate(-90deg);
}

.lane-drag-handle {
  cursor: grab;
}

.lane-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 3px;
}

/* The lane tint can get dark, so the item count needs more contrast than the default eyebrow ink. */
.lane-label .eyebrow {
  color: var(--ink-3);
}

.lane-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-1);
  overflow-wrap: break-word;
  text-wrap: balance;
}

.lane-delete {
  opacity: 0;
}

.lane-label:hover .lane-delete,
.lane-delete:focus-visible {
  opacity: 1;
}

.lane.lane-drop-target .lane-label {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* Item name column */

.item-cell,
.lane-add-cell {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 0 var(--space-2) 0 var(--space-2);
  border-right: 1px solid var(--border-subtle);
}

.item-cell {
  border-bottom: 1px solid var(--border-subtle);
}

.rag-dot {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
  transition: background-color var(--ease);
}

.rag-dot:hover {
  background: rgba(22, 24, 26, 0.06);
}

.rag-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--dot-color);
}

.rag-dot[data-rag="green"] {
  --dot-color: var(--status-ok-fg);
}

.rag-dot[data-rag="amber"] {
  --dot-color: #c0841f;
}

.rag-dot[data-rag="red"] {
  --dot-color: var(--status-risk-fg);
}

.item-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-1);
  text-overflow: ellipsis;
  transition:
    border-color var(--ease),
    background-color var(--ease);
}

.item-input::placeholder {
  color: var(--ink-5);
  font-weight: 400;
}

.item-input:hover {
  border-color: var(--border-default);
}

.item-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-0);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.row-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--ease);
}

.item-cell:hover .row-actions,
.item-cell:focus-within .row-actions {
  opacity: 1;
}

.lane-add-cell .btn {
  padding-inline: 10px 14px;
}

/* Timeline track */

.lane-track {
  grid-column: 3;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.lane-track.is-add-row {
  border-bottom: 0;
}

/* Floored at two rows: one row (56px) is shorter than the lane label's stacked icons (95px), which
   left a lane a few pixels short of fitting a second item. */
.lane-track.is-packed {
  min-height: calc(
    var(--track-pad) * 2 - var(--stack-gap) + max(2, var(--packed-rows, 1)) * (var(--bar-h-packed) + var(--stack-gap))
  );
}

.lane-track.is-packed .roadmap-item {
  height: var(--bar-h-packed);
  top: calc(var(--track-pad) + var(--bar-row, 0) * (var(--bar-h-packed) + var(--stack-gap)));
}

.lane-track.is-packed .range-hint {
  top: calc(var(--track-pad) + var(--bar-row, 0) * (var(--bar-h-packed) + var(--stack-gap)));
  transform: none;
}

.track-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  pointer-events: none;
}

.track-col {
  border-right: 1px solid var(--border-subtle);
}

.track-col:last-child {
  border-right: 0;
}

.track-col.is-previous {
  background: var(--previous-tint);
}

.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  width: 0;
  border-left: 1.5px solid var(--accent);
  opacity: 0.55;
  pointer-events: none;
}

.roadmap-item {
  position: absolute;
  top: calc((var(--row-h) - 1px - var(--bar-h)) / 2);
  z-index: 1;
  height: var(--bar-h);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: var(--bar-bg);
  border: 1px solid var(--bar-border);
  border-left: 3px solid var(--bar-fg);
  border-radius: var(--radius-sm);
  user-select: none;
}

.roadmap-item[data-rag="green"] {
  --bar-bg: var(--status-ok-bg);
  --bar-fg: var(--status-ok-fg);
  --bar-border: rgba(27, 94, 67, 0.22);
}

.roadmap-item[data-rag="amber"] {
  --bar-bg: var(--status-warn-bg);
  --bar-fg: #c0841f;
  --bar-border: rgba(138, 90, 18, 0.24);
}

.roadmap-item[data-rag="red"] {
  --bar-bg: var(--status-risk-bg);
  --bar-fg: var(--status-risk-fg);
  --bar-border: rgba(155, 44, 44, 0.24);
}

.roadmap-item.is-clipped-left {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.roadmap-item.is-clipped-right {
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 2px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: grab;
}

.item-name {
  min-width: 0;
  flex: 0 1 auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-name-link {
  text-decoration: none;
}

.item-name-link:hover,
.item-name-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.item-owner {
  min-width: 0;
  flex: 0 1000 auto;
  font-size: 13px;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Floated over the trailing end of the bar rather than laid out in it, so the name keeps the full
   width while the buttons are hidden. `right` clears the resize handle. */
.bar-actions {
  position: absolute;
  top: 0;
  right: 6px;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding-inline: var(--space-1);
  background: var(--bar-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
}

.roadmap-item:hover .bar-actions,
.roadmap-item:focus-within .bar-actions {
  opacity: 1;
  pointer-events: auto;
}

.bar-comment {
  flex: none;
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  color: var(--ink-4);
}

.bar-comment svg {
  width: 14px;
  height: 14px;
}

.bar-comment:hover {
  color: var(--ink-1);
}

.bar-action {
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
}

.bar-action svg {
  width: 15px;
  height: 15px;
}

.item-owner-link {
  text-decoration: none;
}

.item-owner-link:hover,
.item-owner-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.resize-handle {
  width: 6px;
  flex: none;
  cursor: ew-resize;
  transition: background-color var(--ease);
}

.resize-handle:hover {
  background: rgba(22, 24, 26, 0.1);
}

.name-col-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--lane-w) + var(--name-w-live) - 6px);
  width: 6px;
  z-index: 6;
  cursor: col-resize;
  background: transparent;
  transition: background-color var(--ease);
}

.name-col-handle:hover,
body.is-resizing-col .name-col-handle {
  background: rgba(22, 24, 26, 0.12);
}

body.is-resizing-col,
body.is-resizing-col * {
  cursor: col-resize !important;
  user-select: none;
}

.range-hint {
  position: absolute;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  padding: 2px 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--ink-4);
  cursor: pointer;
}

.range-hint:hover {
  color: var(--ink-1);
}

.range-hint.is-left {
  left: 6px;
}

.range-hint.is-right {
  right: 6px;
}

/* Empty state */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: 64px var(--space-6);
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-1);
}

.empty-state p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-3);
}

/* ---------- Impediments table ---------- */

.impediments-panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-default);
}

.panel-header h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-1);
}

.counter {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(22, 24, 26, 0.08);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--ink-3);
}

.table-wrap {
  overflow-x: auto;
}

.impediments-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.impediments-table th {
  padding: var(--space-3) var(--space-6);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-default);
  text-align: left;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-5);
}

.impediments-table td {
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid rgba(22, 24, 26, 0.09);
  vertical-align: middle;
  color: var(--ink-2);
}

.impediments-table tbody tr:last-child td {
  border-bottom: 0;
}

.impediments-table tbody tr:hover td {
  background: var(--surface-1);
}

.impediments-table th:nth-child(1) {
  width: 26%;
}

.impediments-table th:nth-child(2) {
  width: 14%;
}

.impediments-table th:nth-child(3) {
  width: 12%;
}

.cell-title {
  font-weight: 500;
  color: var(--ink-1);
}

.cell-meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.empty-dash {
  color: var(--ink-5);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.badge-amber {
  background: var(--status-warn-bg);
  color: var(--status-warn-fg);
}

.badge-red {
  background: var(--status-risk-bg);
  color: var(--status-risk-fg);
}

.impediment-input {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-0);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-1);
  resize: vertical;
}

.impediment-input::placeholder {
  color: var(--ink-5);
}

.impediment-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.table-empty {
  padding: 40px var(--space-6) !important;
  text-align: center;
  color: var(--ink-3) !important;
}

/* ---------- Modals & forms ---------- */

.modal {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-0);
  color: var(--ink-2);
  box-shadow: var(--shadow-overlay);
}

.modal::backdrop {
  background: rgba(22, 24, 26, 0.4);
}

.modal-form {
  display: grid;
  gap: var(--space-5);
  padding: 28px;
}

.modal-form h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink-1);
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-1);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.field input,
.field select {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-0);
  font-size: 14.5px;
  font-weight: 400;
  color: var(--ink-1);
}

.field textarea {
  width: 100%;
  min-height: 76px;
  padding: 9px var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-0);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-1);
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-5);
}

.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.field input[type="color"] {
  width: 72px;
  padding: 4px;
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.required::after {
  content: " *";
  color: var(--accent);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin: var(--space-1) 0 0;
  padding: 0;
}

.modal-actions .btn-destructive {
  margin-right: auto;
}

/* ---------- Responsive ---------- */

@media (max-width: 1279px) {
  .horizon-label {
    display: none;
  }

  /* The tabs widened the left side, so the toolbar wraps rather than clipping its last button. */
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding-block: 8px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 1023px) {
  :root {
    --lane-w: 160px;
  }
}

@media (max-width: 767px) {
  :root {
    --gutter: 16px;
    --lane-w: 130px;
  }

  .roadmap-panel {
    max-height: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .lane-header-label {
    display: none;
  }

  .notice {
    flex-direction: column;
    align-items: stretch;
  }
}
