:root {
  --bg: #0d1117;
  --panel: #f7f8fa;
  --ink: #14181f;
  --muted: #5b6473;
  --line: #e2e5ea;
  --brand: #2f6fed;
  --brand-ink: #17408f;
  --ok: #1f8a4c;
  --ok-bg: #e7f6ed;
  --warn: #a15c00;
  --warn-bg: #fdf2df;
  --bad: #b3261e;
  --bad-bg: #fdecea;
  --info: #14539a;
  --info-bg: #e8f0fd;
  --idle: #5b6473;
  --idle-bg: #eef0f3;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: #f2f4f7;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--brand-ink); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
small, .small { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .84rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.topbar {
  background: var(--bg);
  color: #e6edf3;
  padding: .55rem 1.1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.topbar .brand { font-weight: 700; letter-spacing: .14em; color: #fff; text-decoration: none; }
.topbar nav { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }
.topbar nav a { color: #c9d5e2; text-decoration: none; font-size: .9rem; }
.topbar nav a:hover { color: #fff; text-decoration: underline; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .85rem; color: #9fb0c3; }
.topbar .pill-role {
  background: #1f2a37; color: #cfe0f5; border: 1px solid #2d3c4d;
  border-radius: 999px; padding: .12rem .55rem; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .06em;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.2rem 1.1rem 4rem; }
.narrow { max-width: 760px; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin-bottom: 1rem;
}
.card.tight { padding: .8rem .9rem; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.1rem; align-items: start; }
@media (max-width: 900px) { .grid.two, .grid.three, .split { grid-template-columns: 1fr; } }

.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .6rem; }

/* ---------------------------------------------------------------- pieces */
.btn {
  display: inline-block; background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: 8px; padding: .45rem .8rem; font-size: .9rem; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--brand-ink); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: #f0f2f5; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand-ink); padding-left: 0; }
.btn.danger { background: #fff; color: var(--bad); border-color: #f0c8c4; }
.btn.small { padding: .28rem .6rem; font-size: .82rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tbody tr:hover { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: .22rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local],
select, textarea {
  width: 100%; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff;
}
textarea { min-height: 90px; }
form.inline { display: inline; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .8rem; margin: 0; }

.flash { border-radius: 10px; padding: .6rem .8rem; margin-bottom: .8rem; font-size: .9rem; border: 1px solid; }
.flash.ok { background: var(--ok-bg); border-color: #bfe3cd; color: #14512f; }
.flash.warn { background: var(--warn-bg); border-color: #f0dcb6; color: #6c3d00; }
.flash.error { background: var(--bad-bg); border-color: #f2c7c3; color: #7d1b16; }

.errors { background: var(--bad-bg); border: 1px solid #f2c7c3; color: #7d1b16; border-radius: 10px; padding: .6rem .8rem; }
.errors ul { margin: .2rem 0 0; padding-left: 1.1rem; }

.tag {
  display: inline-block; background: var(--idle-bg); color: var(--idle); border-radius: 999px;
  padding: .1rem .5rem; font-size: .74rem; letter-spacing: .03em; text-transform: uppercase;
}
.tag.track { background: var(--info-bg); color: var(--info); text-transform: none; letter-spacing: 0; }
.tag.draft { background: var(--warn-bg); color: var(--warn); }
.tag.submitted { background: var(--ok-bg); color: var(--ok); }

.kpi { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.kpi div { min-width: 90px; }
.kpi .v { font-size: 1.5rem; font-weight: 700; }
.kpi .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.bar { height: 8px; background: #e7eaee; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); }

.empty { border: 1px dashed var(--line); border-radius: 10px; padding: 1rem; color: var(--muted); }

/* --------------------------------------------------------- runbook card */
.rb-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.rb-step-no {
  width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--bg); color: #fff;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700;
}
.status {
  display: inline-block; border-radius: 999px; padding: .14rem .6rem; font-size: .72rem;
  font-weight: 700; letter-spacing: .08em; border: 1px solid;
}
.status.UPCOMING { background: var(--idle-bg); color: var(--idle); border-color: #d6dae0; }
.status.ACTIVE { background: var(--info-bg); color: var(--info); border-color: #c3d7f7; }
.status.COMPLETE { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cd; }
.status.BLOCKED { background: var(--bad-bg); color: var(--bad); border-color: #f2c7c3; }
.status.STALE { background: var(--warn-bg); color: var(--warn); border-color: #f0dcb6; }

.rb-card { border-left: 5px solid var(--line); }
.rb-card.BLOCKED { border-left-color: var(--bad); }
.rb-card.ACTIVE { border-left-color: var(--info); }
.rb-card.COMPLETE { border-left-color: var(--ok); }
.rb-card.STALE { border-left-color: var(--warn); }
.rb-card.UPCOMING { border-left-color: #c9ced6; }
.rb-metric { font-weight: 600; font-size: 1rem; }
.rb-next {
  margin-top: .6rem; padding: .55rem .7rem; background: #f8fafc; border: 1px dashed var(--line);
  border-radius: 8px; font-size: .9rem;
}
.rb-next strong { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
details.evidence { margin-top: .5rem; }
details.evidence summary { cursor: pointer; font-size: .82rem; color: var(--muted); }
details.evidence ul { margin: .35rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--muted); }

.banner {
  background: var(--bg); color: #e6edf3; border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem;
}
.banner h2 { color: #fff; margin-bottom: .2rem; }
.banner .next { color: #ffd479; font-weight: 600; }

.overview { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: .2rem .65rem; font-size: .8rem;
}
.chip b { font-variant-numeric: tabular-nums; }

.criteria-row { display: grid; grid-template-columns: 1fr 7rem 6rem 7rem; gap: .6rem; align-items: center; }
.criteria-row .c-name { font-weight: 600; }
@media (max-width: 720px) { .criteria-row { grid-template-columns: 1fr 1fr; } }

.sticky-note { background: #fffbe8; border: 1px solid #f0e4b0; border-radius: 10px; padding: .7rem .8rem; font-size: .86rem; }
footer.foot { color: var(--muted); font-size: .82rem; text-align: center; padding: 1.4rem 0 2rem; }
.code { background: #0d1117; color: #d7e3f0; border-radius: 10px; padding: .7rem .9rem; font-family: var(--mono); font-size: .82rem; overflow-x: auto; }

/* Keep dense organizer tables usable on narrow screens and keyboard controls visible. */
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 480px; }
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid #2f6fed; outline-offset: 2px;
}
button:disabled { opacity: .55; cursor: not-allowed; }

/* Focused finish: hierarchy, readable actions and mobile-safe data. */
:root { --surface: #fff; --shadow: 0 8px 28px rgba(20,35,57,.05); }
html { scroll-behavior: smooth; }
body { background: #f3f5f8; }
.wrap { max-width: 1240px; }
.card { box-shadow: var(--shadow); }
.page-header { margin-bottom: 1.15rem; }
.page-header h1 { margin: .15rem 0 0; font-size: clamp(1.65rem, 2.6vw, 2.2rem); letter-spacing: -.03em; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--brand-ink); }
.banner .eyebrow { color: #c7d8f5; }
.action-hero { padding: clamp(1.15rem, 3vw, 2rem); border: 1px solid #263b56; }
.action-hero .next { color: #fff; font-size: clamp(1.5rem, 3.8vw, 2.65rem); line-height: 1.15; letter-spacing: -.035em; margin-top: .35rem; }
.action-hero .btn { background: #e9f1ff; color: #123b7b; border-color: #e9f1ff; font-weight: 700; }
.action-hero .btn:hover { background: #fff; color: #123b7b; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; margin-bottom: .9rem; }
.metric { padding: .8rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; display:flex; flex-direction:column; min-width:0; }
.metric span { color: var(--muted); font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.metric strong { font-size: clamp(1.25rem,2vw,1.75rem); font-variant-numeric: tabular-nums; line-height:1.25; margin: .2rem 0; overflow-wrap:anywhere; }
.metric small { color: var(--muted); }
.rb-card.is-next { border-left-width: 6px; box-shadow: 0 10px 28px rgba(25,75,145,.12); }
.rb-next { background: transparent; border: 0; border-top: 1px solid var(--line); padding: .5rem 0 0; }
.rb-next:not(.priority) { color: var(--muted); }
.rb-next:not(.priority) .btn { background: transparent; border: 0; padding-left: 0; color: var(--brand-ink); }
.rb-next.priority { color: var(--ink); font-weight: 600; }
.freshness-panel.STALE { border-left: 5px solid var(--warn); }
.freshness-panel.COMPLETE { border-left: 5px solid var(--ok); }
.freshness-panel.UPCOMING { border-left: 5px solid var(--idle); }
.quiet-card { background: #fafbfc; }
.gallery-card { display:flex; flex-direction:column; }
.gallery-card .row:last-child { margin-top:auto !important; padding-top:.7rem; }
.gallery-card h3 { font-size:1.15rem; }
.public-hero { padding: clamp(1.2rem,3vw,2rem); }
.public-hero h1 { color:#fff; font-size:clamp(1.8rem,4vw,3rem); margin: .25rem 0; }
.hero-subtitle { font-size:1.15rem; color:#e1eaf7; }
.topbar nav a[aria-current="page"] { color:#fff; border-bottom: 2px solid #8db5ff; padding-bottom:.2rem; }
.topbar .brand { font-size: 1.05rem; }
.skip-link { position:absolute; left:1rem; top:-4rem; background:#fff; color:#123b7b; padding:.6rem 1rem; z-index:20; }
.skip-link:focus { top:.5rem; }
.sr-only { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.btn:active { transform: translateY(1px); }
:where(button,input[type=submit],select) { min-height: 38px; }
.table-scroll { margin-inline:-.15rem; }
td,th { overflow-wrap:anywhere; }
@media (max-width: 900px) { .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 600px) {
  .wrap { padding: 1rem .85rem 3rem; }
  .topbar { gap:.55rem; }
  .topbar nav { width:100%; order:3; overflow-x:auto; flex-wrap:nowrap; white-space:nowrap; padding-bottom:.4rem; }
  .topbar .who { display:none; }
  .metric-grid { gap:.5rem; }
  .metric { padding:.7rem; }
  .metric strong { font-size:1.2rem; }
  .card { padding:.9rem; }
  .page-header.row { align-items:stretch; }
  .page-header form select { max-width: calc(100vw - 6.5rem); }
  .row .btn { min-height:40px; }
  .gallery-card { min-height:0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior:auto; } .btn:active { transform:none; } }
/* Grid items need an explicit min-width reset; otherwise a 480px data table
   can enlarge its grid track and force the entire mobile page to scroll. */
.grid > *, .split > *, .grid.two > *, .grid.three > * { min-width: 0; }
.table-scroll { width: 100%; }


