:root {
  color-scheme: light;
  --canvas: #f4f6f9;
  --surface: #fff;
  --text: #192638;
  --muted: #4e5d71;
  --line: #dce3eb;
  --link: #174e9c;
  font-family: system-ui, sans-serif;
  color: var(--text);
  background: var(--canvas);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--link); text-underline-offset: .18em; }
button { font: inherit; }
:focus-visible { outline: 2px solid #235db6; outline-offset: 2px; }

.frame {
  width: min(100% - 3rem, 90rem);
  margin-inline: auto;
}

.topbar {
  background: #17283d;
  color: #d4dfed;
  font-size: .875rem;
}

.topbar nav {
  display: flex;
  gap: .75rem;
  align-items: center;
  min-height: 3.25rem;
}

.topbar a { color: #fff; font-weight: 650; }
.topbar a:focus-visible { outline-color: #fff; }
main { padding-block: 1.8rem 3rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.45rem); letter-spacing: -.035em; }
.lede { margin-top: .5rem; color: var(--muted); line-height: 1.5; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  list-style: none;
  margin: 1rem 0 1.25rem;
  padding: 0;
}

.status {
  display: inline-block;
  padding: .31rem .48rem;
  border-radius: .3rem;
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--state-bg);
  color: var(--state-ink);
}

[data-state="live"] { --state-bg: #dff3e6; --state-ink: #125b38; }
[data-state="built"] { --state-bg: #dceafa; --state-ink: #174f8c; }
[data-state="in_progress"] { --state-bg: #fff0cc; --state-ink: #704b08; }
[data-state="needed"] { --state-bg: #fae3e4; --state-ink: #8a3039; }
[data-state="planned_na"] { --state-bg: #edf0f4; --state-ink: #45546a; }

.modules { display: grid; gap: 1rem; }
.module { min-width: 0; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.module summary {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  padding: .85rem 1rem;
  min-height: 2.75rem;
  cursor: pointer;
  list-style: none;
  border-radius: .65rem;
}

.module summary::-webkit-details-marker { display: none; }
.module summary::before {
  content: "";
  flex: 0 0 .42rem;
  height: .42rem;
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-right: .2rem;
}

.module[open] summary::before { transform: translateY(-.13rem) rotate(45deg); }
.module-name { font-weight: 700; overflow-wrap: anywhere; }
.rollup {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.scroll-hint { display: none; }
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-radius: 0 0 .65rem .65rem;
}

table { width: 100%; min-width: 86rem; border-spacing: 0; text-align: left; table-layout: fixed; }
thead { background: #eef2f7; }
th, td { padding: .48rem .22rem; border-bottom: 1px solid var(--line); text-align: center; }
thead th { font-size: .73rem; line-height: 1.2; }
tbody tr:last-child > * { border-bottom: 0; }
tr > :first-child {
  position: sticky;
  left: 0;
  min-width: 9rem;
  width: 13%;
  max-width: 12rem;
  padding-inline: .8rem;
  text-align: left;
  overflow-wrap: anywhere;
  z-index: 1;
}

thead tr > :first-child { background: #eef2f7; }
tbody th { background: var(--surface); font-size: .8rem; }
.status-cell { border: 1px solid transparent; min-height: 2.75rem; cursor: pointer; }
.status-cell:hover { border-color: currentColor; }

.message {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  padding: 1rem;
  background: var(--surface);
}
.message p { margin: .5rem 0 .75rem; }
.button {
  min-height: 2.75rem;
  padding: .4rem .75rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.button:hover { background: #eef2f7; }
.button { white-space: nowrap; flex: none; }

dialog {
  width: min(29rem, 100% - 2rem);
  max-height: calc(100% - 2rem);
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--surface);
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}
dialog::backdrop { background: rgb(12 24 40 / .55); }
dialog h2, dialog p { margin-bottom: .65rem; }
.panel-top { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.panel-context, #detail-updated { color: var(--muted); font-size: .875rem; }
#detail-text { white-space: pre-wrap; line-height: 1.55; }

@media (max-width: 76rem) {
  .scroll-hint { display: block; margin-bottom: .6rem; color: var(--muted); font-size: .8rem; }
  .table-scroll { scroll-padding-inline-start: 9.25rem; }
  tr > :first-child { width: 9rem; border-right: 1px solid var(--line); }
}

@media (max-width: 38rem) {
  .frame { width: calc(100% - 1.5rem); }
  main { padding-top: 1.25rem; }
  .module summary { padding-inline: .65rem; }
  .rollup { font-size: .75rem; }
  .table-scroll { scroll-padding-inline-start: 7.5rem; }
  tr > :first-child { width: 7.25rem; min-width: 7.25rem; padding-inline: .55rem; }
}

/* chips inside grid cells: smaller and allowed to wrap, so no chip overlaps its neighbour at 1440 */
td .status { padding: .28rem .3rem; font-size: .7rem; white-space: normal; max-width: 100%; box-sizing: border-box; }

/* platform-full.css gives table headers white uppercase text for its own dark band; the dashboard uses a light header band, so win on specificity and importance */
html body .module table thead th,
html body .module table thead th[scope="col"] { color: #24344a !important; background: #eef2f7 !important; text-transform: none !important; letter-spacing: 0 !important; font-weight: 700; }
