@import url("./ui/tokens.css");
@import url("./ui/components.css");
body { margin: 0; font: var(--text-base)/1.5 var(--font); color: var(--ink); background: var(--ground); display: flex; flex-wrap: wrap; min-height: 100vh; }
h1 { font-size: var(--text-xl); margin: 0; line-height: 1.2; }
button, input, select { font: inherit; }
a { color: var(--blue); }
code { font-size: var(--text-s); }
.right { margin-left: auto; }
.grow { flex: 1; min-width: 0; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font: 600 var(--text-m) var(--font); cursor: pointer; text-decoration: none; }
.link:hover { color: var(--blue-ink); }
/* Rail */
.rail-item[hidden] { display: none; }
.rail-wrap { flex: 1 1 220px; max-width: 232px; }
.rail-wrap[data-collapsed="true"] { flex: 0 0 64px; max-width: 64px; }
.rail-wrap[data-collapsed="true"] .rail { align-items: center; }
.rail-wrap[data-collapsed="true"] .rail-label, .rail-wrap[data-collapsed="true"] .count, .rail-wrap[data-collapsed="true"] .brand div { display: none; }
.rail-wrap[data-collapsed="true"] .rail-item { width: 40px; height: 40px; padding: 0; justify-content: center; }
.rail-wrap[data-collapsed="true"] .brand { flex-direction: column; padding-bottom: 8px; }
.rail-wrap[data-collapsed="true"] .brand button { margin: 0; }
/* The rail's column is white the whole page down; the rail itself stays in view while the page scrolls. */
.rail-wrap { background: var(--surface); border-right: 1px solid var(--line); }
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; line-height: 1.2; }
.brand .mark { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); flex-shrink: 0; display: grid; place-items: center; }
.brand strong { font-size: var(--text-l); }
.brand .sub { font-size: var(--text-xs); color: var(--muted); }
.brand button { margin-left: auto; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.rail-wrap[data-collapsed="true"] .brand button svg { transform: rotate(180deg); }
.who { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: var(--text-m); line-height: 1.25; }
.who .muted { font-size: var(--text-xs); }
/* Pages */
main { flex: 999 1 560px; min-width: 0; box-sizing: border-box; padding: 22px 28px 32px; }
.page { display: flex; flex-direction: column; gap: 16px; }
.page[hidden] { display: none; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head.column { flex-direction: column; align-items: stretch; gap: 10px; }
.page-head .title { line-height: 1.2; margin-right: 6px; }
.page-head .title .muted { margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: var(--text-s); color: var(--muted); }
.crumbs a { text-decoration: none; }
.pill-select { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; }
.pill-select select { border: 0; background: transparent; font-weight: 600; color: var(--ink); max-width: 200px; }
.search { flex: 1 1 220px; max-width: 340px; display: flex; align-items: center; gap: 8px; height: 36px; box-sizing: border-box; padding: 0 12px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line-2); margin-left: auto; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.search.soft { flex: 0 0 auto; max-width: none; margin: 0; height: 34px; border-radius: var(--radius-s); background: var(--ground); border-color: var(--line); font-size: var(--text-m); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); display: flex; flex-direction: column; gap: 2px; font-size: var(--text-s); color: var(--muted); }
.kpi b { font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cols.wide { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
.cols.tree-cols { grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); }
.card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card h2 { margin: 0; flex-wrap: wrap; }
.card h2 .muted { font-weight: 400; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: var(--text-m); }
th { text-align: left; font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-3); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr[data-tone="amber"] { background: #fffbf0; }
td .site-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.tile { width: 26px; height: 26px; border-radius: var(--radius-s); background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: var(--text-s); flex-shrink: 0; }
.tile.big { width: 36px; height: 36px; border-radius: var(--radius-m); font-size: 16px; }
/* Flow */
.flow-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.flow-bar span { height: 8px; border-radius: var(--radius-pill); background: var(--line); }
.flow-bar span[data-done="true"] { background: var(--green); } .flow-bar span[data-current="true"] { background: var(--amber); }
.flow-labels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; font-size: var(--text-s); }
.flow-labels div { display: flex; flex-direction: column; } .flow-labels b { font-weight: 600; }
.next { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--amber-tint-2); border: 1px solid var(--amber-line); }
.next .eyebrow { color: var(--amber-ink-2); }
.next-label { font-weight: 600; }
.links { display: flex; flex-direction: column; gap: 8px; }
.links a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-m); border: 1px solid var(--line-3); color: inherit; text-decoration: none; }
.links a:hover { background: var(--ground); }
.links a b { display: block; font-size: var(--text-m); } .links a span.muted { display: block; }
.empty { padding: 12px 14px; border-radius: var(--radius-m); background: var(--ground); font-size: var(--text-s); color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: var(--text-m); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack:empty { display: none; }
.proposal { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--amber-tint-2); border: 1px solid var(--amber-line); }
.proposal .head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.proposal .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; font-size: var(--text-s); }
.proposal .facts div { padding: 8px 10px; border-radius: var(--radius-s); background: var(--surface); color: var(--muted); }
.proposal .facts b { display: block; font-size: 16px; color: var(--ink); }
.proposal .facts b[data-tone="red"] { color: var(--red-ink); }
.proposal .acts { display: flex; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 8px 2px; font-size: var(--text-m); }
.timeline { display: grid; grid-template-columns: 44px 14px minmax(0, 1fr); gap: 0 10px; align-items: start; font-size: var(--text-m); }
.timeline .t { font-size: var(--text-s); color: var(--muted); padding-top: 2px; }
.timeline .line { display: flex; flex-direction: column; align-items: center; align-self: stretch; }
.timeline .line i { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--faint); flex-shrink: 0; }
.timeline .line i[data-tone="red"] { background: var(--red); } .timeline .line i[data-tone="amber"] { background: var(--amber); } .timeline .line i[data-tone="ok"] { background: var(--green); } .timeline .line i[data-tone="blue"] { background: var(--blue); }
.timeline .line span { flex: 1; width: 2px; background: var(--line); margin-top: 4px; }
.timeline .body { padding-bottom: 12px; } .timeline .body b { display: block; }
.timeline:empty { display: none; }
.rows-plain { display: flex; flex-direction: column; }
.rows-plain .row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-3); flex-wrap: wrap; }
.rows-plain .row:last-child { border-bottom: 0; }
.rows-plain .row b { display: block; font-size: var(--text-m); }
.rows-plain .row .muted { display: block; }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-s); color: var(--muted); }
.state[data-tone="ok"] { color: var(--green-ink); } .state[data-tone="red"] { color: var(--red-ink); } .state[data-tone="amber"] { color: var(--amber-ink-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Maps page */
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-m); background: #e9eef4; flex-wrap: wrap; }
.segmented:empty { display: none; }
.seg { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-s); font-size: var(--text-m); font-weight: 600; color: var(--ink-2); border: 0; background: transparent; cursor: pointer; }
.seg[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(24,39,57,.12); }
.seg.small { height: 28px; }
.legend { display: flex; gap: 12px; font-size: var(--text-xs); color: var(--muted); flex-wrap: wrap; font-weight: 400; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.shape { display: grid; gap: 3px; height: 40px; grid-auto-flow: column; }
.shape a { border-radius: 6px; color: #fff; display: flex; align-items: flex-end; padding: 4px 8px; font-size: var(--text-s); font-weight: 600; text-decoration: none; overflow: hidden; white-space: nowrap; min-width: 0; background: var(--green); }
.shape a[data-tone="amber"] { background: var(--amber); } .shape a[data-tone="red"] { background: var(--red); } .shape a[data-tone="grey"] { background: var(--faint); }
.shape:empty::after { content: "No pages yet."; color: var(--muted); font-size: var(--text-s); font-weight: 400; align-self: center; }
.chips { display: inline-flex; gap: 4px; margin-left: 6px; }
.chips .chip { cursor: pointer; border: 0; }
.chips .chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tree { display: flex; flex-direction: column; }
.node { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-s); font-size: var(--text-m); color: inherit; background: none; border: 0; text-align: left; width: 100%; box-sizing: border-box; cursor: pointer; }
.node:hover { background: var(--ground); }
.node[aria-current="true"] { background: var(--blue-tint); color: var(--blue); font-weight: 600; }
.node .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .meta { font-size: var(--text-s); color: var(--muted); white-space: nowrap; }
.node .caret { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); display: grid; place-items: center; }
.kids { margin-left: 15px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.kids[hidden] { display: none; }
.foot { padding-top: 10px; border-top: 1px solid var(--line-3); }
#page-card .crumbs { margin-bottom: -4px; }
#page-card h2 { font-size: 17px; }
#page-card .url { font-size: var(--text-s); overflow-wrap: anywhere; text-decoration: none; }
#page-card .chiprow { display: flex; gap: 6px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tiles div { padding: 8px 10px; border-radius: var(--radius-m); background: var(--ground); line-height: 1.2; }
.tiles b { display: block; font-size: 18px; } .tiles span { font-size: var(--text-xs); color: var(--muted); }
.evidence { font-size: var(--text-s); color: var(--muted); }
.fn { display: grid; grid-template-columns: minmax(0, 1fr) 76px 60px 52px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-3); font-size: var(--text-m); }
.fn.head { font-size: var(--text-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; padding: 4px 0; }
.fn .risk[data-risk="high"] { color: var(--red-ink); font-weight: 600; } .fn .risk[data-risk="medium"] { color: var(--amber-ink-2); font-weight: 600; } .fn .risk[data-risk="low"] { color: var(--green-ink); font-weight: 600; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--text-m); }
.plain li { overflow-wrap: anywhere; }
@media (max-width: 900px) { .cols, .cols.wide, .cols.tree-cols, .kpis { grid-template-columns: minmax(0, 1fr); } .rail { min-height: 0; } .proposal .facts, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The dashboard as a website: a sign-in first, and nothing that needs the extension. */
.web-only { display: none; }
body[data-web] .web-only { display: inline; }
body[data-web] .ext-only { display: none !important; }
body[data-web="signed-out"] .rail-wrap, body[data-web="signed-out"] main { display: none; }
body[data-web="signed-out"] { display: block; }
.web-gate { max-width: 380px; margin: 12vh auto 0; height: max-content; padding: 28px 24px; border: 1px solid var(--line); border-radius: var(--radius-l, 14px); background: var(--surface); box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,.08)); }
.web-gate .mark { width: 44px; height: 44px; border-radius: 50%; background: var(--blue, #2563eb); display: grid; place-items: center; margin-bottom: 14px; }
.web-gate h1 { margin: 0 0 4px; }
.web-gate label { display: grid; gap: 6px; margin: 14px 0 0; font-size: var(--text-m, 14px); }
.web-gate input { padding: 10px 12px; border: 1px solid var(--line-2, #cbd5e1); border-radius: var(--radius-m, 8px); font: inherit; }
.web-gate .btn { width: 100%; justify-content: center; margin-top: 18px; }
.web-gate [role=status]:not(:empty) { margin-top: 12px; }
#web-sign-out { margin-top: 4px; padding: 0; }

/* An element the code hides stays hidden whatever display its class gives it. */
[hidden] { display: none !important; }
#status:empty { margin: 0; min-height: 0; }
#maps-status:empty { display: none; }
.brand .sub, .who .rail-label > div { overflow: hidden; text-overflow: ellipsis; }
.who .rail-label { min-width: 0; }
.who .rail-label > div:first-child { white-space: nowrap; }
.rows-plain .row .grow { flex: 1 1 240px; }
.rows-plain .row .actions { display: flex; gap: 8px; align-items: center; }
.versions { flex-basis: 100%; margin: 4px 0 0; }
.versions summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: var(--text-m); }
.version-row { display: flex; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-3); }
.version-row > span:first-child { min-width: 9em; font-weight: 600; }
.version-row .link { margin-left: auto; }
#header-download { margin-left: auto; }
body[data-web] #header-download + .search { margin-left: 0; }
/* Phones: the rail becomes a bar across the top that scrolls sideways; the page follows below it. */
@media (max-width: 760px) {
  .rail-wrap, .rail-wrap[data-collapsed="true"] { flex: 1 1 100%; width: 100%; min-width: 0; max-width: 100vw; border-right: 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .rail { position: static; height: auto; min-width: 0; flex-direction: row; align-items: center; gap: 4px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; }
  .brand { padding: 0 6px 0 0; white-space: nowrap; flex-shrink: 0; }
  .brand .sub, .brand button, .rail .count, .who .rail-label > div { display: none; }
  .rail-item { white-space: nowrap; padding: 6px 10px; }
  .who { margin: 0 0 0 auto; padding: 0 0 0 8px; border-top: 0; flex-shrink: 0; }
  .who .avatar { display: none; }
  main { padding: 16px 16px 28px; }
  .page-head .search { flex: 1 1 100%; }
  #header-download { margin-left: 0; }
  .table-wrap { overflow-x: auto; }
}

/* The site tree's page card: long function names wrap instead of running under the chips. */
#page-card td:first-child { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  #maps-table th:nth-child(2), #maps-table td:nth-child(2),
  #maps-table th:nth-child(4), #maps-table td:nth-child(4),
  #maps-table th:nth-child(6), #maps-table td:nth-child(6),
  #maps-table th:nth-child(7), #maps-table td:nth-child(7),
  #recordings-table th:nth-child(2), #recordings-table td:nth-child(2),
  #recordings-table th:nth-child(5), #recordings-table td:nth-child(5) { display: none; }
  td, th { padding-left: 8px; padding-right: 8px; }
  #maps-table td .site-cell > .tile { display: none; }
  .card h2 > .muted.right { margin-left: 0; flex-basis: 100%; }
}

/* A page's path segment beside its own name in the site tree. */
.tree .node .name .segment { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: var(--text-s); }
