@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --page: #f4f4f1;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --line: rgba(11, 11, 11, 0.1);
  --brand: #13294b;
  --brand-ink: #ffffff;
  --accent: #2a78d6;
  --you: #2a78d6;
  --comp: #c2410c;          /* comp-set orange, darkened to 4.6:1 on the page background */
  --third: #1baf7a;
  --bench: #898781;
  --pos: #2a78d6;
  --neg: #e34948;
  --up: #006300;
  --down: #b42a2a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --comp-dot: #eb6834;      /* the lighter orange stays for map dots and chart lines, which are not text */
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme='light'])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --line: rgba(255, 255, 255, 0.1); --brand: #0f1d33; --accent: #3987e5;
    --you: #3987e5; --comp: #d95926; --third: #199e70; --pos: #3987e5; --neg: #e66767; --up: #0ca30c; --down: #e66767;
    --shadow: none;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --line: rgba(255, 255, 255, 0.1); --brand: #0f1d33; --accent: #3987e5;
  --you: #3987e5; --comp: #d95926; --third: #199e70; --pos: #3987e5; --neg: #e66767; --up: #0ca30c; --down: #e66767;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page); color: var(--ink);
  font: 14px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
header.top {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 20px;
  padding: 10px 24px; background: var(--brand); color: var(--brand-ink);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
  background: #fff; color: var(--brand); font-weight: 800; font-size: 16px;
}
.protos { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.protos a { color: rgba(255, 255, 255, 0.72); padding: 6px 12px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
.protos a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.protos a.on { color: #fff; background: rgba(255, 255, 255, 0.16); }
.switch { position: relative; width: 300px; flex: none; }
.switch input { width: 100%; font: inherit; font-size: 13px; padding: 7px 34px 7px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; }
.switch input::placeholder { color: rgba(255,255,255,.62); }
.switch input:focus { outline: none; background: #fff; color: #0b0b0b; border-color: #fff; }
.switch input:focus::placeholder { color: #898781; }
.switch kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 11px Inter, system-ui, sans-serif; color: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.3); border-radius: 4px; padding: 0 5px; pointer-events: none; }
.switch input:focus + kbd, .switch input:not(:placeholder-shown) + kbd { display: none; }
.switch .ac { left: auto; right: 0; width: 360px; max-width: calc(100vw - 20px); color: var(--ink); }
.ac-head { padding: 8px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 900px) { header.top { flex-wrap: wrap; } .switch { order: 5; width: 100%; } .switch kbd { display: none; } .switch .ac { left: 0; right: 0; width: auto; } }
.theme { background: transparent; border: 1px solid rgba(255, 255, 255, 0.25); color: #fff; border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 12px; }

/* ---------- layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.grid > *, .kpis > * { min-width: 0; }
.protos { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card h2 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.card .sub { color: var(--muted); font-size: 12px; margin: 0 0 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } main { padding: 14px; } header.top { padding: 10px 14px; gap: 10px; } .brand span:last-child { display: none; } }

.eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.subject-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.subject-head h1 { margin: 2px 0 4px; font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.subject-head .meta { color: var(--ink-2); font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.fresh { color: var(--muted); font-size: 12px; }
a.pill { color: var(--ink-2); } a.pill:hover { text-decoration: none; background: var(--grid); color: var(--ink); }

/* ---------- stat tiles ---------- */
.tile .k { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.tile .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 2px; }
.tile .d { font-size: 12px; color: var(--muted); }
.up { color: var(--up); font-weight: 600; }
.down { color: var(--down); font-weight: 600; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.t th, table.t td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--axis); }
table.t tbody tr:hover { background: var(--surface-2); }
table.t tr.you td { background: color-mix(in srgb, var(--you) 9%, transparent); font-weight: 600; }
table.t tr.agg td { font-weight: 600; border-top: 1px solid var(--axis); }
table.t td.name { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
table.t th.grp { text-align: center; border-bottom: 1px solid var(--grid); color: var(--ink-2); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* ---------- charts ---------- */
.chartbox { position: relative; }
svg.chart { display: block; overflow: visible; }
svg.chart .grid { stroke: var(--grid); stroke-width: 1; }
svg.chart .baseline { stroke: var(--axis); stroke-width: 1; }
svg.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.chart .endlab { fill: var(--ink-2); font-size: 11px; font-weight: 500; }
svg.chart .endval { fill: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
svg.chart .xhair { stroke: var(--axis); stroke-width: 1; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 170px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); font-size: 12px;
}
.tip .th { font-weight: 600; margin-bottom: 4px; }
.tip .tr { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.tip .tr i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tip .tr span { color: var(--ink-2); flex: 1; }
.tip .tr b { font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

/* ---------- controls ---------- */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 12px; font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 7px 12px; cursor: pointer; font-weight: 500; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.searchbox { position: relative; }
.searchbox input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px;
}
.searchbox input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ac { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16); overflow: hidden; max-height: 420px; overflow-y: auto; }
.ac { color: var(--ink); }
.ac-row { color: var(--ink);
  display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 9px 14px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.ac-row.on, .ac-row:hover { background: var(--surface-2); }
.ac-n { font-weight: 600; }
.ac-m { color: var(--muted); font-size: 12px; }
.ac-n { color: var(--ink); }
.picker-page { max-width: 640px; margin: 8vh auto; padding: 0 16px; }
.picker-page h1 { font-size: 26px; margin: 4px 0 6px; }
.picker-page .searchbox input { font-size: 17px; padding: 15px 16px; }
.picker-page .recents { margin-top: 18px; display: grid; gap: 8px; }
.picker-page .recents a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.picker-page .recents a:hover { text-decoration: none; border-color: var(--accent); }
.picker-page .recents small { display: block; color: var(--muted); font-size: 12px; }
.note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- stacked mix bars ---------- */
.mix { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.mix span { display: block; height: 100%; }
.mixrow { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 132px; gap: 12px; align-items: center; padding: 5px 0; font-size: 12px; }
.mixrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.mixrow.you .nm { color: var(--ink); font-weight: 600; }
.mixrow .vals { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
@media (max-width: 640px) { .mixrow { grid-template-columns: 1fr; gap: 3px; } .mixrow .vals { text-align: left; } }

@media print {
  header.top, .noprint, .filters { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* market share inside the comp set */
.share-story { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.share-bottom { display: grid; grid-template-columns: 1fr; gap: 4px; }
.share-bottom > *, .cardhead > *, .card > * { min-width: 0; }
.tbl-wrap { max-width: 100%; }
.share-compact { display: none; }
.share-kv { display: grid; grid-template-columns: 1fr auto; margin: 12px 0 0; font-size: 13px; }
.share-kv dt, .share-kv dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--grid); }
.share-kv dt { color: var(--ink-2); }
.share-kv dd { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; padding-left: 12px; white-space: nowrap; }
@media (max-width: 640px) { .share-grid { display: none; } .share-compact { display: block; } .share-story { font-size: 13px; } }
.cardhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cardhead .sub { margin: 0; }

/* facility finder */
.picker-page.wide { max-width: 860px; margin-top: 4vh; }
.finder .f-grid { display: grid; grid-template-columns: 1.2fr 1.2fr 1.2fr .7fr; gap: 10px; }
@media (max-width: 760px) { .finder .f-grid { grid-template-columns: 1fr 1fr; } }
.f-field { display: flex; flex-direction: column; gap: 4px; position: relative; min-width: 0; }
.f-field > span { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.f-field input, .f-field select { font: inherit; font-size: 14px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; }
.f-field .ac { top: 100%; }
.f-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.f-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: #fff; border-radius: 999px; padding: 4px 5px 4px 11px; font-size: 12px; font-weight: 600; }
.f-pill button { border: 0; background: rgba(255,255,255,.22); color: #fff; border-radius: 999px; width: 19px; height: 19px; cursor: pointer; line-height: 1; }
.f-clear { border: 0; background: transparent; color: var(--accent); font: 600 12px Inter, system-ui, sans-serif; cursor: pointer; }
.f-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.f-meta select { font: inherit; font-size: 12px; padding: 4px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); margin-left: 6px; }
.f-list { border-top: 1px solid var(--grid); }
.f-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--grid); color: var(--ink); }
.f-row:hover { background: var(--surface-2); text-decoration: none; }
.f-main { min-width: 0; }
.f-main b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-main small { color: var(--muted); font-size: 12px; }
.f-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.f-num small { display: block; font-size: 11px; font-weight: 600; }
.f-more { margin: 14px auto; display: block; }
.finder-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.45); display: grid; place-items: start center; padding: 5vh 14px; overflow-y: auto; }
.finder-box { width: min(900px, 100%); background: var(--page); color: var(--ink); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 18px 20px 10px; }
.finder-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.finder-head h2 { margin: 2px 0 0; font-size: 19px; }
@media (max-width: 640px) { .finder-modal { padding: 0; } .finder-box { border-radius: 0; min-height: 100vh; padding: 14px; } }
body.noscroll { overflow: hidden; }
.ac-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--surface-2); color: var(--ink-2); border-radius: 4px; padding: 1px 5px; margin-right: 6px; vertical-align: 1px; }
.ac-browse { border-top: 1px solid var(--grid); }
.ac-browse .ac-n { color: var(--accent); }

/* phones: use the full width, no sideways page scroll */
@media (max-width: 560px) {
  main { padding: 12px; }
  .card { padding: 16px 14px; }
  .subject-head h1 { font-size: 22px; }
  table.t th, table.t td { padding: 8px 8px; }
  .share-story { padding: 11px 12px; }
  .picker-page { padding: 0 12px; }
}

/* benchmark ladder (report, dashboard, brief) */
.ladder-card table.ladder { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.ladder th { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 0 6px 6px; }
table.ladder th.bmh { text-align: left; padding-left: 0; }
table.ladder th:nth-child(1), table.ladder td:nth-child(1) { width: 25%; }
/* the "yours" cells are one number spanning every row: tint them so the eye reads across to each benchmark */
table.ladder td.own { background: var(--surface-2); vertical-align: middle; text-align: center; border-left: 1px solid var(--grid); border-right: 1px solid var(--grid); }
table.ladder td.own b { font-size: 20px; }
table.ladder th.ownh { background: var(--surface-2); }
table.ladder th.grp2 { border-left: 1px solid var(--grid); }
table.ladder td small { white-space: nowrap; }
table.ladder .m-only { display: none; }
table.ladder th.grp { text-align: center; border-bottom: 1px solid var(--grid); padding-bottom: 4px; }
table.ladder thead tr:first-child th[rowspan] { vertical-align: bottom; }
.ladder-you { display: none; flex-wrap: wrap; gap: 6px 26px; margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.ladder-you b { font-size: 18px; font-weight: 700; color: var(--ink); margin-right: 5px; font-variant-numeric: tabular-nums; }
.ladder-you b.up { color: var(--up); } .ladder-you b.down { color: var(--neg); }
table.ladder td { padding: 9px 6px; text-align: center; font-variant-numeric: tabular-nums; border-top: 1px solid var(--grid); font-size: 15px; }
table.ladder td:first-child { text-align: left; font-weight: 600; font-size: 14px; padding-right: 10px; white-space: normal; overflow-wrap: anywhere; }
table.ladder td small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); white-space: normal; }
table.ladder td b { font-size: 17px; }
table.ladder td b small { display: inline; margin-left: 5px; font-size: 11px; }
table.ladder tr.sep td { border-top: 2px solid var(--line); background: var(--surface-2); }
table.ladder tr.sep td:first-child { box-shadow: inset 3px 0 0 var(--comp); padding-left: 8px; }
@media (max-width: 560px) {
  /* A six-column comparison table cannot be read on a phone. Stack each benchmark into its own labeled block
     instead; "yours" moves to the summary line above, since a merged cell has nothing to merge across here. */
  .ladder-you { display: flex; }
  table.ladder { display: block; min-width: 0; table-layout: auto; }
  table.ladder thead { display: none; }
  table.ladder tbody { display: block; }
  table.ladder tr { display: block; padding: 11px 0 12px; border-top: 1px solid var(--grid); }
  table.ladder tr.sep { background: var(--surface-2); border-top: 2px solid var(--line); box-shadow: inset 3px 0 0 var(--comp); padding-left: 9px; }
  table.ladder td { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px;
                    width: auto !important; padding: 3px 0; border: 0; font-size: 14px; text-align: right; }
  table.ladder td::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 400; margin-right: auto; }
  table.ladder td:first-child { display: block; font-size: 15px; font-weight: 700; padding-bottom: 6px; }
  table.ladder td:first-child::before { content: none; }
  table.ladder td.own, table.ladder td.occ-abs { display: none; }
  table.ladder td small { display: inline; margin-left: 6px; }
  table.ladder td b { font-size: 16px; }
}

/* ---- performance tables (Monthly Report, Facility Profile) ---- */
/* ---- performance tables: centered figures, one quiet rule per group, periods separated by a hairline ---- */
table.star { border-collapse: separate; border-spacing: 0; width: 100%; }
table.star th, table.star td { text-align: center; padding: 11px 7px; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
/* let long benchmark names wrap so all four periods fit without a sideways scroll */
table.star td:first-child { white-space: normal; width: 205px; max-width: 205px; }
table.star .was, table.star .arr { white-space: nowrap; }
table.star th:first-child, table.star td:first-child { text-align: left; padding-left: 14px; }
table.star thead th { font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 0; }
table.star thead tr:first-child th.grp { color: var(--ink-2); font-size: 10.5px; padding: 0 10px 8px; border-bottom: 2px solid var(--line); }
table.star thead tr:first-child th:first-child { border-bottom: 0; }
table.star thead tr:nth-child(2) th { padding: 8px 10px 9px; font-size: 9.5px; border-bottom: 1px solid var(--line); }
table.star-pc thead th { border-bottom: 1px solid var(--line); padding: 0 10px 10px; }
table.star tbody td { font-size: 14.5px; }
table.star tbody td:first-child { font-weight: 500; font-size: 14px; }
table.star tbody tr:last-child td { border-bottom: 0; }
/* hairline before each period so four groups read as four groups */
table.star-p td:nth-child(2n), table.star-p thead tr:nth-child(2) th:nth-child(2n),
table.star-p thead tr:first-child th.grp { box-shadow: inset 1px 0 0 var(--grid); }
table.star-pc td:not(:first-child), table.star-pc th:not(:first-child) { box-shadow: inset 1px 0 0 var(--grid); }
/* the change column is secondary: smaller, colored, never bold */
table.star-p td:nth-child(2n+3) b { font-size: 15px; }
table.star-p td:nth-child(2n+3) small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 1px; }
table.star-p tr.you td.span { box-shadow: inset 1px 0 0 var(--grid); }
table.star-p tr.you td.span b, table.star-p tr.you td.span > span:not(.was):not(.arr) { font-size: 15px; font-weight: 700; }
table.star .was { color: var(--muted); font-size: 11px; font-weight: 400; font-style: italic; opacity: .8; }
table.star .gap { display: block; font-size: 10.5px; font-weight: 500; margin-top: 2px; white-space: nowrap; }
table.star .gap:not(.up):not(.down) { color: var(--muted); }
table.star .arr { color: var(--muted); font-size: 11px; margin: 0 5px; }
table.star-p td:nth-child(2n) b { font-weight: 700; }
table.star-p thead tr:nth-child(2) th:nth-child(2n+3) { color: var(--muted); }
table.star tr.you td { background: color-mix(in srgb, var(--you) 7%, transparent); font-weight: 700; }
table.star tr.you td:first-child { box-shadow: inset 3px 0 0 var(--you); }
table.star tr.idx td { font-weight: 700; border-top: 1px solid var(--line); }
table.star tr.idx td:first-child { color: var(--ink); }
table.star tbody tr:last-child td { color: var(--ink-2); }
table.star .chg { color: var(--muted); font-size: 12px; }
table.star .sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 9px; vertical-align: 0; }
table.star tr.bm td:first-child small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 1px; }
table.star tr.bm td:first-child .sw ~ small { padding-left: 18px; }
table.star tr.bm td:first-child:not(:has(.sw)) { padding-left: 32px; }
/* the portfolio is not a wider ring of geography, it is the rest of this owner's buildings wherever they are */
table.star tr.sep td { background: var(--surface-2); border-top: 1px solid var(--line); }
table.star tr.sep td:first-child { box-shadow: inset 3px 0 0 var(--bench); }
.pswitch { display: none; margin: 4px 0 12px; }
@media (max-width: 640px) {
  /* one period at a time on a phone: the switch picks it, the table hides the other three */
  .pswitch { display: inline-flex; }
  table.star[data-p="0"] :is(.p1, .p2, .p3), table.star[data-p="1"] :is(.p0, .p2, .p3),
  table.star[data-p="2"] :is(.p0, .p1, .p3), table.star[data-p="3"] :is(.p0, .p1, .p2) { display: none; }
  table.star th, table.star td { padding: 11px 8px; }
  table.star td:first-child, table.star th:first-child { padding-left: 10px; }
  table.star tbody td { font-size: 14px; }
  /* long benchmark names ("Riverside-San Bernardino-Ontario metro") must wrap, or they push the figures off-screen */
  table.star td:first-child { white-space: normal; max-width: 190px; }
  table.star tr.bm td:first-child small { white-space: normal; }
}

/* market share card: the change sits under its figure, small and italic */
.subchg { display: block; font-size: 11px; font-style: italic; font-weight: 500; margin-top: 2px; }
.share-kv .subchg { display: inline; margin: 0 0 0 6px; }

/* house style for every table: the name column reads left, every figure to its right is centered under its header */
table.t th:not(:first-child), table.t td:not(:first-child) { text-align: center; }

/* rolling-12 index small multiples on the Monthly Report */
.minis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 1000px) { .minis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.mini { border: 1px solid var(--grid); border-radius: 10px; padding: 10px 6px 2px; background: var(--surface); min-width: 0; }
.mini .mh { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; }
.mini .mh span { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mini .mh b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini .mh small { font-size: 11px; font-style: italic; color: var(--muted); }
.mini .mh small.up { color: var(--up); } .mini .mh small.down { color: var(--down); }

/* site footer */
footer.site { margin-top: 28px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; }
footer.site .inner { max-width: 1160px; margin: 0 auto; padding: 14px 22px 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
footer.site b { color: var(--ink-2); font-weight: 600; }
footer.site a { color: var(--ink-2); text-decoration: underline; }
/* keyboard focus has to be visible: the ring is drawn for keyboard users only, so mouse clicks stay clean */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
.tbl-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* a heading that only screen readers get: pages that are nothing but a map still need one */
.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; }
@media print { footer.site { display: none; } }

/* CSV download on every table: a slim right-aligned row just above it */
.csv-bar { display: flex; justify-content: flex-end; margin: 2px 0 -2px; }
.csv-btn { font: 600 10.5px Inter, system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; cursor: pointer; }
.csv-btn:hover { color: var(--ink); border-color: var(--ink-2); }
@media print { .csv-bar { display: none !important; } }

/* the occupancy basis, stated where the number is read */
table.star thead th.basis { text-align: left; font-size: 9px; letter-spacing: .02em; text-transform: none; color: var(--muted); font-weight: 500; padding-left: 14px; }
.basis-note { font-size: 11px; color: var(--muted); }

.idxrank { margin: 10px 0 0; font-size: 12px; line-height: 1.5; }
