:root {
  color-scheme: light;
  --ink-950: #10171d;
  --ink-900: #152029;
  --ink-800: #1e2a33;
  --ink-700: #34424b;
  --ink-600: #53616a;
  --ink-500: #596770;
  --ink-400: #96a0a5;
  --stone-50: #f7f8f6;
  --stone-100: #f0f2ef;
  --stone-150: #e9ece8;
  --stone-200: #dce1dc;
  --stone-300: #cbd2cc;
  --white: #ffffff;
  --green-100: #e9f9e3;
  --green-300: #b9ec9f;
  --green-400: #9be27d;
  --green-500: #79c75a;
  --green-700: #34762f;
  --blue-100: #eaf3fc;
  --blue-500: #4a8fd2;
  --amber-100: #fff4d8;
  --amber-500: #c48a20;
  --red-100: #fdebea;
  --red-500: #cf5c55;
  --violet-100: #f1ecfb;
  --violet-500: #7d64b7;
  --focus: #4d98e6;
  --sidebar-width: 252px;
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 16px;
  --shadow-float: 0 18px 48px rgba(16, 23, 29, 0.16), 0 3px 10px rgba(16, 23, 29, 0.08);
  --shadow-card: 0 8px 24px rgba(16, 23, 29, 0.08), 0 2px 6px rgba(16, 23, 29, 0.05);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--stone-100);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink-900);
  background: var(--stone-100);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

::selection {
  color: var(--ink-950);
  background: var(--green-300);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 62%, transparent);
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--ink-400) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--ink-400);
  border: 3px solid transparent;
  border-radius: 99px;
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #f7faf8;
  background: var(--ink-950);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar__top {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 19px 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ink-950);
  background: var(--green-400);
  border-radius: 11px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand__text strong {
  font-size: 17px;
  font-weight: 820;
  letter-spacing: 0.08em;
}

.brand__text span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.24em;
}

.sidebar__close {
  display: none !important;
  color: rgba(255, 255, 255, 0.76);
}

.nav-list {
  display: grid;
  gap: 4px;
  padding: 16px 12px 13px;
}

.nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.64);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-weight: 650;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.065);
}

.nav-item:active {
  transform: translateY(1px);
}

.nav-item--active {
  color: var(--ink-950);
  background: var(--green-400);
}

.nav-item--active:hover {
  color: var(--ink-950);
  background: var(--green-300);
}

.sidebar__section {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 13px 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__section-title {
  padding: 7px 12px 10px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.workstream-nav {
  display: grid;
  gap: 1px;
}

.workstream-link {
  display: flex;
  min-height: 35px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 12px;
  color: rgba(255, 255, 255, 0.58);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 570;
  text-align: left;
  transition: color 160ms ease, background 160ms ease;
}

.workstream-link:hover,
.workstream-link--active {
  color: #fff;
  background: rgba(255, 255, 255, 0.065);
}

.workstream-link__count {
  min-width: 22px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.workstream-link--active .workstream-link__count {
  color: var(--green-300);
}

.sidebar__footer {
  display: grid;
  gap: 10px;
  padding: 16px 18px 19px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.save-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
}

.save-status--button {
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
  transition: color 160ms ease;
}

.save-status--button:hover {
  color: rgba(255, 255, 255, 0.82);
}

.save-status__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--ink-400);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(150, 160, 165, 0.12);
}

.save-status--synced .save-status__dot {
  background: var(--green-400);
  box-shadow: 0 0 0 3px rgba(155, 226, 125, 0.12);
}

.save-status--connecting .save-status__dot,
.save-status--saving .save-status__dot {
  background: #f1bd59;
  box-shadow: 0 0 0 3px rgba(241, 189, 89, 0.13);
  animation: sync-pulse 1.1s var(--ease-out) infinite alternate;
}

.save-status--error .save-status__dot {
  background: #e47c74;
  box-shadow: 0 0 0 3px rgba(228, 124, 116, 0.14);
}

@keyframes sync-pulse {
  from {
    opacity: 0.52;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .save-status--connecting .save-status__dot,
  .save-status--saving .save-status__dot {
    animation: none;
  }
}

.sidebar-action {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 620;
  text-align: left;
}

.sidebar-action:hover {
  color: #fff;
}

.sidebar-backdrop {
  display: none;
}

.main-shell {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(247, 248, 246, 0.94);
  border-bottom: 1px solid var(--stone-200);
  backdrop-filter: blur(14px);
}

.topbar__left,
.topbar__actions {
  display: flex;
  align-items: center;
}

.topbar__left {
  gap: 12px;
}

.topbar__actions {
  gap: 10px;
}

.topbar__title {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.topbar__title > span {
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 730;
}

.topbar__title small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 11px;
}

.mobile-menu {
  display: none !important;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  padding: 0;
  color: var(--ink-600);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  color: var(--ink-950);
  background: var(--stone-150);
}

.icon-button--small {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.icon-button--disabled {
  color: var(--ink-600);
  cursor: default;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 710;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  color: var(--ink-950);
  background: var(--green-400);
  border-color: var(--green-400);
}

.button--primary:hover {
  background: var(--green-300);
  border-color: var(--green-300);
  box-shadow: 0 6px 16px rgba(52, 118, 47, 0.16);
}

.button--secondary {
  color: var(--white);
  background: var(--ink-900);
  border-color: var(--ink-900);
}

.button--secondary:hover {
  background: var(--ink-800);
  border-color: var(--ink-800);
}

.button--quiet {
  color: var(--ink-700);
  background: var(--white);
  border-color: var(--stone-200);
}

.button--quiet:hover {
  color: var(--ink-950);
  background: var(--stone-50);
  border-color: var(--stone-300);
}

.button--danger-quiet {
  color: var(--red-500);
  background: transparent;
  border-color: transparent;
}

.button--danger-quiet:hover {
  background: var(--red-100);
}

.button--icon-label svg {
  margin-right: -2px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: var(--green-700);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 720;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 160ms ease, color 160ms ease;
}

.text-button:hover {
  color: var(--ink-900);
  text-decoration-color: currentColor;
}

.menu-wrap {
  position: relative;
}

.data-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: 218px;
  padding: 7px;
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: 12px;
  box-shadow: var(--shadow-float);
}

.data-menu button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: var(--ink-700);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 620;
  text-align: left;
}

.data-menu button:hover {
  color: var(--ink-950);
  background: var(--stone-100);
}

.data-menu .data-menu__danger {
  color: var(--red-500);
  border-top: 1px solid var(--stone-150);
  border-radius: 0 0 8px 8px;
  margin-top: 5px;
  padding-top: 4px;
}

.data-menu__separator {
  height: 1px;
  margin: 5px 8px;
  background: var(--stone-150);
}

.page-content {
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px;
}

.overview-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding: 4px 2px 25px;
}

.overview-intro h1 {
  max-width: 780px;
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(30px, 3.2vw, 50px);
  font-weight: 790;
  line-height: 1.04;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.overview-intro p {
  max-width: 720px;
  margin: 15px 0 0;
  color: var(--ink-600);
  font-size: 15px;
  line-height: 1.65;
}

.metric-strip {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  overflow: hidden;
  background: var(--ink-950);
  border-radius: var(--radius-lg);
}

.metric-strip__item {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  justify-content: center;
  padding: 22px 24px;
  color: var(--white);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-strip__item:last-child {
  border-right: 0;
}

.metric-strip__item > span {
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
  font-weight: 660;
}

.metric-strip__item strong {
  margin-top: 8px;
  font-size: 29px;
  font-weight: 760;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.metric-strip__item strong small {
  color: rgba(255, 255, 255, 0.64);
  font-size: 14px;
  font-weight: 600;
}

.metric-strip__item > small {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 10.5px;
}

.metric-bar {
  height: 5px;
  overflow: hidden;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}

.metric-bar span {
  display: block;
  height: 100%;
  background: var(--green-400);
  border-radius: inherit;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
}

.panel--wide {
  margin-top: 18px;
}

.panel__header {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--stone-150);
}

.panel__header h2,
.backlog-group__header h2,
.plan-phase__header h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.015em;
}

.panel__header p,
.backlog-group__header p,
.plan-phase__header p {
  margin: 4px 0 0;
  color: var(--ink-500);
  font-size: 11px;
}

.focus-list {
  padding: 4px 0;
}

.focus-row {
  display: grid;
  width: 100%;
  min-height: 64px;
  grid-template-columns: 30px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--stone-100);
  text-align: left;
  transition: background 160ms ease;
}

.focus-row:last-child {
  border-bottom: 0;
}

.focus-row:hover {
  background: var(--stone-50);
}

.focus-row__index {
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.focus-row__content {
  min-width: 0;
}

.focus-row__content strong,
.plan-task__content strong {
  display: block;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 12.5px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-row__content small,
.plan-task__content small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-row > svg,
.workstream-progress__row > svg,
.plan-task > svg {
  color: var(--ink-600);
}

.phase-summary {
  padding: 7px;
}

.phase-summary__row {
  display: flex;
  width: 100%;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  transition: background 160ms ease;
}

.phase-summary__row:hover {
  background: var(--stone-100);
}

.phase-summary__row strong {
  display: block;
  color: var(--ink-900);
  font-size: 12.5px;
}

.phase-summary__row small {
  display: block;
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 10.5px;
}

.phase-summary__number {
  color: var(--ink-950);
  font-size: 21px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.workstream-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.workstream-progress__row {
  display: grid;
  min-height: 78px;
  grid-template-columns: minmax(140px, 0.9fr) minmax(90px, 1fr) 40px 18px;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--stone-100);
  text-align: left;
}

.workstream-progress__row:nth-child(odd) {
  border-right: 1px solid var(--stone-100);
}

.workstream-progress__row:hover {
  background: var(--stone-50);
}

.workstream-progress__label strong {
  display: block;
  color: var(--ink-900);
  font-size: 12px;
}

.workstream-progress__label small {
  display: block;
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 10px;
}

.workstream-progress__track {
  display: block;
  height: 5px;
  overflow: hidden;
  background: var(--stone-150);
  border-radius: 99px;
}

.workstream-progress__track span {
  display: block;
  height: 100%;
  background: var(--green-500);
  border-radius: inherit;
}

.workstream-progress__percent {
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.search-field {
  display: flex;
  width: min(370px, 100%);
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  color: var(--ink-500);
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: 11px;
}

.search-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent);
}

.search-field input {
  width: 100%;
  min-width: 0;
  color: var(--ink-900);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12.5px;
}

.search-field input::placeholder {
  color: var(--ink-600);
}

.filter-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.compact-select {
  position: relative;
  display: inline-flex;
  min-width: 134px;
  min-height: 42px;
  align-items: center;
  color: var(--ink-700);
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: 11px;
}

.compact-select--wide {
  min-width: 162px;
}

.compact-select select {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 12px;
  color: var(--ink-700);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 11.5px;
  font-weight: 620;
  appearance: none;
}

.compact-select svg {
  position: absolute;
  right: 10px;
  pointer-events: none;
}

.clear-filters {
  min-height: 36px;
  padding: 0 8px;
  color: var(--red-500);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 680;
}

.clear-filters:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.board {
  overflow-anchor: none;
  display: grid;
  grid-auto-columns: minmax(280px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  min-height: calc(100vh - 170px);
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.board-column {
  position: relative;
  display: flex;
  min-width: 280px;
  flex-direction: column;
  background: color-mix(in srgb, var(--stone-150) 68%, transparent);
  border: 1px solid transparent;
  border-radius: 14px;
  scroll-snap-align: start;
  transition: border-color 160ms ease, background 160ms ease;
}

.board-column:has(.task-card--placeholder) {
  background: var(--green-100);
  border-color: var(--green-500);
}

.board-column__header {
  position: absolute;
  inset: 0 0 auto;
  pointer-events: none;
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.board-column__header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-column__header h2 {
  margin: 0;
  color: var(--ink-700);
  font-size: 11.5px;
  font-weight: 740;
}

.board-column__header > span {
  color: var(--ink-500);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.board-column__dot {
  width: 7px;
  height: 7px;
  background: var(--ink-400);
  border-radius: 50%;
}

.board-column__dot--planned {
  background: var(--blue-500);
}

.board-column__dot--in-progress {
  background: var(--amber-500);
}

.board-column__dot--review {
  background: var(--violet-500);
}

.board-column__dot--done {
  background: var(--green-500);
}

.board-column__body {
  display: grid;
  align-content: start;
  gap: 9px;
  flex: 1;
  min-height: 192px;
  padding: 52px 8px 10px;
}

.task-card {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  min-width: 0;
  padding: 14px;
  background: var(--white);
  border: 0;
  border-radius: 12px;
  cursor: grab;
  transition: box-shadow 180ms ease;
}

.task-card:hover {
  box-shadow: var(--shadow-card);
}

.task-card:active,
.task-card--chosen {
  cursor: grabbing;
}

.task-card--chosen {
  box-shadow: 0 0 0 2px var(--green-500), var(--shadow-card);
}

.task-card--done {
  opacity: 0.72;
}

.task-card--placeholder {
  opacity: 0.4;
  outline: 2px dashed var(--green-500);
}

.task-card--done h3 {
  text-decoration: line-through;
  text-decoration-color: var(--ink-600);
}

.task-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-500);
  font-size: 9.5px;
  font-weight: 650;
}

.task-card h3 {
  margin: 12px 0 0;
  color: var(--ink-950);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.35;
  letter-spacing: -0.012em;
}

.task-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 0;
  color: var(--ink-600);
  font-size: 10.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.task-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  color: var(--ink-500);
  border-top: 1px solid var(--stone-100);
  font-size: 9.5px;
}

.task-card__footer > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.board-column__body:empty::before {
  content: attr(data-empty-label);
  display: grid;
  min-height: 110px;
  place-items: center;
  color: var(--ink-600);
  border: 1px dashed var(--stone-300);
  border-radius: 11px;
  font-size: 10px;
}

.priority-badge {
  display: inline-grid;
  min-width: 28px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  color: var(--ink-700);
  background: var(--stone-150);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.priority-badge--p1 {
  color: #8b302b;
  background: var(--red-100);
}

.priority-badge--p2 {
  color: #885e12;
  background: var(--amber-100);
}

.priority-badge--p3 {
  color: #28679e;
  background: var(--blue-100);
}

.priority-badge--p4 {
  color: var(--ink-600);
  background: var(--stone-150);
}

.status-badge {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--ink-600);
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
}

.status-badge > span {
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--ink-400);
  border-radius: 50%;
}

.status-badge--planned > span {
  background: var(--blue-500);
}

.status-badge--in-progress > span {
  background: var(--amber-500);
}

.status-badge--review > span {
  background: var(--violet-500);
}

.status-badge--done > span {
  background: var(--green-500);
}

.backlog-shell {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
}

.backlog-header-row,
.backlog-row {
  display: grid;
  grid-template-columns: 70px minmax(290px, 1.7fr) minmax(110px, 0.55fr) minmax(105px, 0.52fr) 55px minmax(92px, 0.5fr) 20px;
  align-items: center;
  gap: 12px;
}

.backlog-header-row {
  min-height: 42px;
  padding: 0 18px;
  color: var(--ink-500);
  background: var(--stone-50);
  border-bottom: 1px solid var(--stone-200);
  font-size: 9.5px;
  font-weight: 720;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.backlog-group {
  border-bottom: 1px solid var(--stone-200);
}

.backlog-group:last-child {
  border-bottom: 0;
}

.backlog-group__header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 18px;
  background: var(--stone-50);
  border-bottom: 1px solid var(--stone-150);
}

.backlog-group__header > span {
  color: var(--ink-500);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.backlog-list {
  display: grid;
}

.backlog-row {
  width: 100%;
  min-height: 66px;
  padding: 7px 18px;
  background: var(--white);
  border: 0;
  border-bottom: 1px solid var(--stone-100);
  text-align: left;
  transition: background 140ms ease;
}

.backlog-row:last-child {
  border-bottom: 0;
}

.backlog-row:hover {
  background: var(--stone-50);
}

.backlog-row--done {
  opacity: 0.68;
}

.backlog-row__title {
  min-width: 0;
}

.backlog-row__title strong {
  display: block;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backlog-row--done .backlog-row__title strong {
  text-decoration: line-through;
}

.backlog-row__title small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backlog-row__workstream,
.backlog-row__phase,
.backlog-row__checklist {
  overflow: hidden;
  color: var(--ink-600);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backlog-row__checklist {
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.backlog-row__arrow {
  color: var(--ink-600);
}

.plan-grid {
  display: grid;
  gap: 16px;
}

.plan-phase {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
}

.plan-phase__header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding: 18px 20px;
  background: var(--stone-50);
  border-bottom: 1px solid var(--stone-150);
}

.plan-phase__number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink-950);
  background: var(--green-400);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.plan-phase__header p {
  max-width: 800px;
  line-height: 1.5;
}

.plan-phase__progress {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-variant-numeric: tabular-nums;
}

.plan-phase__progress strong {
  color: var(--ink-950);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.plan-phase__progress span {
  color: var(--ink-500);
  font-size: 10px;
}

.plan-phase__body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plan-task {
  display: grid;
  min-height: 64px;
  grid-template-columns: 38px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: var(--white);
  border: 0;
  border-bottom: 1px solid var(--stone-100);
  text-align: left;
}

.plan-task:nth-child(odd) {
  border-right: 1px solid var(--stone-100);
}

.plan-task:hover {
  background: var(--stone-50);
}

.plan-task__content {
  min-width: 0;
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  padding: 24px;
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: 12px;
}

.empty-state strong {
  margin-top: 12px;
  color: var(--ink-900);
  font-size: 12px;
}

.empty-state p {
  max-width: 320px;
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 10.5px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(9, 14, 18, 0.34);
  border: 0;
  animation: fade-in 180ms ease both;
}

.task-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 90;
  width: min(560px, calc(100vw - 28px));
  background: var(--white);
  box-shadow: -18px 0 48px rgba(16, 23, 29, 0.18), -3px 0 10px rgba(16, 23, 29, 0.06);
  animation: drawer-in 280ms var(--ease-out) both;
}

.task-drawer form {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.task-drawer__header {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--stone-200);
}

.task-drawer__header > div > span {
  color: var(--ink-500);
  font-size: 9.5px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-drawer__header h2 {
  margin: 5px 0 0;
  color: var(--ink-950);
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.task-drawer__body {
  overflow-y: auto;
  padding: 22px;
}

.task-drawer__footer {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: var(--stone-50);
  border-top: 1px solid var(--stone-200);
}

.task-drawer__secondary-actions,
.task-drawer__primary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 17px;
}

.field > span {
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 720;
}

.field input,
.field textarea,
.field select,
.checklist-editor__row input[type="text"],
.link-editor__row input {
  width: 100%;
  color: var(--ink-900);
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: 9px;
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input,
.field select,
.checklist-editor__row input[type="text"],
.link-editor__row input {
  min-height: 40px;
  padding: 0 11px;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
  padding: 10px 11px;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.checklist-editor__row input[type="text"]:focus,
.link-editor__row input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 14%, transparent);
}

.field input::placeholder,
.field textarea::placeholder,
.checklist-editor__row input::placeholder,
.link-editor__row input::placeholder {
  color: var(--ink-600);
}

.field--title input {
  min-height: 48px;
  color: var(--ink-950);
  font-size: 15px;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-grid--three {
  grid-template-columns: repeat(3, 1fr);
}

.drawer-section {
  margin: 24px 0;
  padding-top: 21px;
  border-top: 1px solid var(--stone-150);
}

.drawer-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.drawer-section__header h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 12px;
  font-weight: 760;
}

.drawer-section__header p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 9.5px;
}

.checklist-editor,
.link-editor {
  display: grid;
  gap: 7px;
}

.checklist-editor__row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
}

.checklist-editor__row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green-500);
}

.link-editor__row {
  display: grid;
  grid-template-columns: 0.7fr minmax(0, 1.3fr) 30px 30px;
  align-items: center;
  gap: 7px;
}

.checklist-editor__empty,
.link-editor__empty {
  padding: 16px;
  color: var(--ink-600);
  background: var(--stone-50);
  border-radius: 9px;
  font-size: 10.5px;
  text-align: center;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 130;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 14px;
  color: var(--white);
  background: var(--ink-900);
  border-radius: 10px;
  box-shadow: var(--shadow-float);
  font-size: 11.5px;
  font-weight: 620;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms var(--ease-out);
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--success {
  color: #183218;
  background: var(--green-300);
}

.toast--danger {
  background: var(--red-500);
}

@keyframes drawer-in {
  from {
    transform: translateX(42px);
    opacity: 0.6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1180px) {
  .page-content {
    padding: 22px;
  }

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

  .search-field {
    width: 100%;
  }

  .filter-controls {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    grid-template-columns: 1fr 1fr;
  }

  .metric-strip__item:nth-child(2) {
    border-right: 0;
  }

  .metric-strip__item:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .backlog-header-row,
  .backlog-row {
    grid-template-columns: 58px minmax(260px, 1.7fr) 110px 100px minmax(90px, 0.5fr) 20px;
  }

  .backlog-header-row span:nth-child(5),
  .backlog-row__checklist {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 272px;
  }

  .sidebar {
    transform: translateX(-102%);
    transition: transform 260ms var(--ease-out);
    box-shadow: 18px 0 48px rgba(16, 23, 29, 0.2);
  }

  .sidebar--open {
    transform: translateX(0);
  }

  .sidebar__close,
  .mobile-menu {
    display: inline-grid !important;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    background: rgba(9, 14, 18, 0.36);
    border: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .sidebar-backdrop--visible {
    opacity: 1;
    visibility: visible;
  }

  .main-shell {
    margin-left: 0;
  }

  .topbar {
    min-height: 68px;
    padding: 10px 16px;
  }

  .topbar__actions .button--quiet span,
  .topbar__actions .button--primary span {
    display: none;
  }

  .topbar__actions .button {
    width: 40px;
    padding: 0;
  }

  .data-menu {
    right: -48px;
  }

  .page-content {
    padding: 18px 16px 24px;
  }

  .overview-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .overview-intro h1 {
    font-size: clamp(30px, 8vw, 44px);
  }

  .overview-intro .button {
    width: 100%;
  }

  .workstream-progress {
    grid-template-columns: 1fr;
  }

  .workstream-progress__row:nth-child(odd) {
    border-right: 0;
  }

  .plan-phase__body {
    grid-template-columns: 1fr;
  }

  .plan-task:nth-child(odd) {
    border-right: 0;
  }

  .backlog-shell {
    overflow-x: auto;
  }

  .backlog-header-row,
  .backlog-row {
    min-width: 830px;
  }
}

@media (max-width: 640px) {
  .topbar__title small {
    display: none;
  }

  .page-content {
    padding: 16px 12px 24px;
  }

  .overview-intro {
    padding-top: 2px;
  }

  .overview-intro h1 {
    font-size: 34px;
  }

  .overview-intro p {
    font-size: 13px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric-strip__item {
    min-height: 104px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .metric-strip__item:last-child {
    border-bottom: 0;
  }

  .panel__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .focus-row {
    grid-template-columns: 25px minmax(0, 1fr) 18px;
  }

  .focus-row .status-badge {
    display: none;
  }

  .workstream-progress__row {
    grid-template-columns: minmax(125px, 1fr) minmax(70px, 0.9fr) 34px 16px;
    gap: 9px;
    padding: 12px 14px;
  }

  .filter-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: visible;
  }

  .compact-select,
  .compact-select--wide {
    min-width: 0;
  }

  .clear-filters {
    grid-column: 1 / -1;
  }

  .board {
    min-height: calc(100vh - 200px);
    grid-auto-columns: minmax(270px, calc(100vw - 50px));
  }

  .plan-phase__header {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .plan-phase__progress {
    grid-column: 2;
  }

  .plan-task {
    grid-template-columns: 34px minmax(0, 1fr) 18px;
  }

  .plan-task .status-badge {
    display: none;
  }

  .task-drawer {
    width: 100vw;
  }

  .task-drawer__header,
  .task-drawer__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .task-drawer__footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .task-drawer__primary-actions,
  .task-drawer__secondary-actions {
    width: 100%;
  }

  .task-drawer__primary-actions .button,
  .task-drawer__secondary-actions .button {
    flex: 1;
  }

  .field-grid,
  .field-grid--three {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .link-editor__row {
    grid-template-columns: 1fr 30px;
  }

  .link-editor__row input:nth-child(2) {
    grid-column: 1;
  }

  .link-editor__row a,
  .link-editor__row .icon-button--disabled {
    grid-column: 2;
    grid-row: 1;
  }

  .link-editor__row button {
    grid-column: 2;
    grid-row: 2;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .toast {
    width: 100%;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .filter-bar,
  .drawer-backdrop,
  .task-drawer {
    display: none !important;
  }

  .main-shell {
    margin: 0;
  }

  .page-content {
    max-width: none;
    padding: 0;
  }
}

.workspace-entry { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.workspace-entry section, #key-dialog { width: min(100%, 420px); background: var(--white); padding: 28px; color: var(--ink-900); border: 1px solid var(--stone-200); border-radius: 14px; }
.workspace-entry h1 { font-size: 2rem; margin: 20px 0 8px; }
.entry-brand { color: var(--ink-600); font-weight: 700; }
.workspace-entry p, #key-dialog p { color: var(--ink-600); line-height: 1.5; }
.workspace-entry p:empty { display: none; }
.workspace-entry button { margin-top: 8px; }
#key-dialog { margin: auto; max-width: calc(100vw - 32px); }
#key-dialog h2 { margin: 0 0 22px; }
#key-dialog::backdrop { background: rgb(16 23 29 / 55%); }
.key-actions { display: flex; justify-content: flex-end; gap: 8px; }
.task-card h3, .task-card p, .plan-task, .backlog-row, .focus-row { overflow-wrap: anywhere; }
.save-status--conflict { color: #ffd493; }
