:root {
  color-scheme: light;
  --page: #f7f6f3;
  --ink: #212421;
  --focus: #156b91;
  --c-review: #d39213;
  --c-deferred: #8654b3;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
p { margin: 0; }
h2 { margin: 0 0 12px; font-size: 1.25rem; line-height: 1.3; }

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1;
  padding: 8px 12px;
  color: #fff;
  background: var(--ink);
  transform: translateY(calc(-100% - 16px));
}

.skip-link:focus { transform: none; }
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-header-inner, .content { max-width: 1320px; margin-inline: auto; }
.site-header-inner { display: flex; align-items: center; gap: 16px; padding: 10px 22px; }
.wordmark { font-size: 1.25rem; font-weight: 800; letter-spacing: -.045em; white-space: nowrap; }
.wordmark span { color: #1c6b49; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }

.content { padding-top: 30px; }
.embedded body { background: transparent; }
.embedded .site-header { display: none; }
.embedded .content { max-width: none; padding: 22px clamp(14px, 2vw, 28px); }

.board-nav { margin-bottom: 12px; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .875rem;
}
.breadcrumbs li {
  display: flex;
  align-items: baseline;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.breadcrumbs li + li::before {
  content: "/";
  margin-inline: 8px;
  color: var(--muted);
}
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 650; }
.dashboard-link, .timeline a .timeline-title {
  color: #215c70;
  text-decoration: underline;
  text-underline-offset: .16em;
}
.dashboard-link:hover, .timeline a:hover .timeline-title { color: #143d4c; }
.head { margin-bottom: 16px; }
h1.title { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.12; overflow-wrap: anywhere; }
.subtitle { max-width: 76ch; margin-top: 8px; font-size: 1rem; }
.route-notice { margin-bottom: 16px; color: #825007; font-size: .9375rem; }

.snapshot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 12px;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  font-size: .875rem;
  color: var(--muted);
}

.snapshot time { margin-inline-start: 5px; color: var(--ink); font-weight: 650; }
.snapshot-warning { color: #825007; }
.snapshot.has-error #load-message { color: #9c231a; }
.snapshot #load-message:empty { display: none; }

[data-status="done"] { --tc: var(--c-ready); }
[data-status="in_progress"] { --tc: var(--c-progress); }
[data-status="in_review"] { --tc: var(--c-review); }
[data-status="blocked"] { --tc: var(--c-qc); }
[data-status="planned"] { --tc: var(--c-downloaded); }
[data-status="deferred"] { --tc: var(--c-deferred); }

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 10px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

.timeline .row { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.phase-card { display: block; height: 100%; padding: 12px 14px; border-radius: 5px; }
.timeline a.phase-card:hover { background: #f0f7fa; }
.timeline-title { display: block; margin-bottom: 6px; font-size: 1rem; line-height: 1.3; }
.timeline-description { margin-top: 8px; color: var(--muted); font-size: .875rem; }
.status-chip { color: var(--ink); font-size: .8125rem; line-height: 1.3; }
.status-icon { font-size: 1em; font-weight: 800; }

.board-details {
  margin-bottom: 26px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  overflow-wrap: anywhere;
}
.board-details ul { margin: 0; padding-inline-start: 1.25rem; }
.board-details li + li { margin-top: 5px; }
#board-facts > * + * { margin-top: 10px; }
.board-details .cell-prog { max-width: 380px; }
.board-details .prog-bar { margin-top: 5px; }
.board-details .prog-fill { background: #38798c; }
.board-details .prog-txt { white-space: normal; }

.tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); }
[data-status="waiting"] { --tc: #b39561; }
.activity-note { margin-top: 6px; color: #665034; font-size: .875rem; }
.active-work { margin-bottom: 22px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; }
.active-work ul { margin: 8px 0 0; padding-left: 20px; font-size: .875rem; }
.tile { min-width: 0; background: var(--panel); color: var(--ink); text-align: left; font: inherit; }
.tile:disabled { cursor: default; }
.tile.on { background: #f0f7fa; }
.tile-n, .tile-l { display: block; }
.tile-l { color: #505350; font-size: .875rem; }
.tile-l .status-icon { margin-inline-end: 3px; }

.toolbar { align-items: flex-end; gap: 10px 12px; }
.search-field { flex: 1 1 250px; max-width: 440px; }
.phase-field { flex: 0 1 210px; }
.toolbar label { margin-bottom: 4px; color: var(--ink); font-weight: 650; }
.toolbar input, .toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #aaa79d;
  border-radius: 7px;
  padding: 7px 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.result-count { margin-bottom: 14px; color: var(--muted); font-size: .875rem; }
.bucket-head { font-size: 1.0625rem; overflow-wrap: anywhere; }
.bucket-n { flex-shrink: 0; font-size: .8125rem; }
.bucket-empty, .msg { color: var(--muted); font-size: .9375rem; }
.item-row { overflow-wrap: anywhere; }

.item-row .row-main {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr) minmax(0, 180px) max-content 44px;
  grid-template-areas: "title summary coverage status toggle";
  align-items: center;
  gap: 8px 16px;
}

.item-row .row-main > * { grid-column: auto; grid-row: auto; overflow: visible; }
.item-row .cell-sec { grid-area: title; }
.item-row .cell-meta { grid-area: summary; }
.item-row .cell-prog { grid-area: coverage; }
.item-row .cell-status { grid-area: status; }
.item-row .row-main > .expand { grid-area: toggle; justify-self: end; }
.item-row .sec-title { margin: 0; white-space: normal; }
.item-row .sec-name { overflow: visible; font-size: 1rem; line-height: 1.3; white-space: normal; }
.open-dashboard { display: inline-block; margin-top: 4px; font-size: .875rem; font-weight: 600; }
.item-row .sec-sub, .item-row .cov, .item-row .prog-txt { font-size: .875rem; }
.item-row .cov { line-height: 1.4; }
.item-row .prog-bar { margin-top: 5px; }
.item-row .prog-fill { background: #38798c; }
.item-row .prog-txt { margin-top: 3px; white-space: normal; }

.item-row .expand {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #46514c;
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
}

.item-row .expand:hover, .item-row.open .expand { background: var(--page); color: var(--ink); }
.drawer { font-size: .9375rem; }
.drawer ul { margin: 0; padding-inline-start: 1.25rem; }
.drawer li, .board-details li, .item-row .cell-meta .cov, .subtitle { white-space: pre-line; }
.drawer li + li { margin-top: 5px; }
.drawer p + ul, .drawer ul + ul { margin-top: 10px; }
.drawer .tool-grid { list-style: none; padding: 0; }
.drawer .tool-btn { margin: 0; cursor: auto; }
.drawer .tool-btn:hover { border-color: rgba(0, 0, 0, .12); }
.drawer .tool-btn-name, .drawer .tool-btn-meta { font-size: .875rem; }
.drawer .tool-btn-meta { color: var(--muted); }

.project-context { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 20px; }
.project-context h2 { font-size: 1.125rem; }
.project-context ul { list-style: none; padding: 0; margin: 0; }
.project-context .ev { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .875rem; overflow-wrap: anywhere; }
.project-context .ev .when { color: var(--muted); white-space: nowrap; }
.project-context .event-label { flex: 1 1 200px; }

@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-row .row-main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) max-content 44px;
    grid-template-areas: "title summary status toggle" "coverage summary status toggle";
  }
}

@media (max-width: 640px) {
  .site-header-inner, .content { padding-inline: 14px; }
  .site-header-inner { flex-wrap: wrap; gap: 4px 10px; }
  .site-header .head-actions { gap: 5px; }
  .site-header .btn { padding-inline: 8px; }
  .content { padding-top: 22px; }
  .timeline { grid-template-columns: 1fr; }
  .tiles { gap: 6px; }
  .tile { padding: 9px 8px; }
  .tile-l { font-size: .8125rem; }
  .search-field { flex: 1 0 100%; max-width: none; }
  .phase-field { flex: 1 1 140px; }
  .item-row .row-main {
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-areas: "title toggle" "status status" "summary summary" "coverage coverage";
    padding: 10px 12px;
    column-gap: 8px;
  }
  .item-row .drawer { padding-inline: 12px; }
}

@media (max-width: 350px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
