/* CEO Overview page-specific styles (docs/CEO_OVERVIEW_REDESIGN_PLAN.md).
   Loaded AFTER dashboard.css (shared :root tokens + components: .btn*,
   .link-btn, .note*, .status-pill, .detail-card*, .field*, .chip*,
   dialog base rules) AND admin-shell.css (the .sidebar/.workspace shell
   shared with Inquiry Inbox — see that file). Nothing here redeclares a
   token or a shell rule. */

.demo-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-wash);
  border: 1px solid var(--teal);
  border-radius: 999px;
  padding: 2px 9px;
  cursor: default;
}

/* ---- Page heading (docs/CEO_OVERVIEW_REFINEMENT_ROUND2_PLAN.md) ----- */

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-heading h1 { margin: 0; font-size: 22px; }
.page-heading__subtitle { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }

/* ---- Page grid ------------------------------------------------------ */

.ceo-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  /* align-items: start — NOT the grid default (stretch). Without this,
     every card in a row is forced to the tallest row-mate's height,
     which is exactly the "large unused space in equal-height panels"
     bug this redesign fixes (confirmed via getComputedStyle before
     changing anything — see docs/CEO_OVERVIEW_REDESIGN_PLAN.md).
     Section order (round 2): Brief, Metrics, Attention+Pipeline side by
     side, then Projects/Follow-ups/Invoices each full-width in their own
     row — matches the DOM order in ceo-overview.html. */
  align-items: start;
  grid-template-areas:
    "brief brief"
    "metrics metrics"
    "attention pipeline"
    "traffic traffic"
    "projects projects"
    "followups followups"
    "invoices invoices";
}
@media (max-width: 1099px) {
  .ceo-grid {
    /* minmax(0, 1fr), not bare 1fr — a bare 1fr track's implicit minimum
       is `auto` (its content's own intrinsic width), so a wide child
       (round 2's invoice table, min-width: 640px) grew this whole grid
       track to fit it instead of letting .invoice-table-wrap's own
       overflow-x:auto contain the scroll — confirmed via
       getComputedStyle: #ceo-grid's gridTemplateColumns reported 674px
       at a 390px viewport before this fix. Same root-cause class as the
       .hero__grid/.industry-list incidents already on record for the
       public site (CLAUDE.md §10a). */
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brief"
      "metrics"
      "attention"
      "pipeline"
      "traffic"
      "projects"
      "followups"
      "invoices";
  }
}

/* ---- Brief: visually distinct dark panel, two-column body ----------- */

.brief {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 22px;
}
.brief__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.brief__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 6px;
}
.brief__greeting { margin: 0; font-size: 15px; color: rgba(255, 255, 255, 0.85); }
.brief__updated { margin: 2px 0 0; font-size: 11.5px; color: rgba(255, 255, 255, 0.5); white-space: nowrap; }
.brief__summary { margin: 0 0 16px; font-size: 15px; line-height: 1.55; }
.brief__summary strong { color: #fff; font-weight: 700; }

.brief__body { display: flex; gap: 22px; align-items: flex-start; }
.brief__actions-col { flex: 1 1 auto; min-width: 0; }
.brief__calls {
  flex: 0 0 220px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  padding-left: 18px;
}
@media (max-width: 899px) {
  .brief__body { flex-direction: column; }
  .brief__calls { border-left: none; border-top: 1px solid rgba(255, 255, 255, 0.16); padding: 14px 0 0; flex-basis: auto; width: 100%; }
}
.brief__calls-heading { margin: 0 0 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: rgba(255, 255, 255, 0.6); }
.brief__calls-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.brief__call-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #fff;
  cursor: pointer;
}
.brief__call-item:hover .brief__call-title { text-decoration: underline; }
.brief__call-item:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.brief__call-time { display: block; font-size: 11px; color: rgba(255, 255, 255, 0.55); }
.brief__call-title { display: block; font-size: 12.5px; font-weight: 600; }
.brief__calls-empty { font-size: 12.5px; color: rgba(255, 255, 255, 0.55); margin: 0 0 12px; }

/* Round 2: horizontal row of up to 3 cards on wide screens, instead of
   full-width stacked strips — wraps naturally (flex-wrap, a sensible
   min-width per card) rather than a hand-tuned breakpoint, since the
   available width here depends on both the sidebar and the "Today's
   Calls" column next to it. */
.brief__actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.brief__action { flex: 1 1 200px; display: flex; }
.brief__action-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  cursor: pointer;
  font: inherit;
}
.brief__action-btn:hover { background: rgba(255, 255, 255, 0.1); }
.brief__action-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
/* A real row for the tags — kept OUT of the column-flex directly, which
   is what caused the full-width-badge bug this redesign fixes: a flex
   item's outer display is always blockified regardless of its own
   `display`, so a tag placed directly in .brief__action-btn stretched
   to the full column width. Wrapping tags in their own row-flex
   container keeps them sized to content. */
.brief__action-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.brief__action-headline { font-weight: 700; font-size: 13.5px; }
.brief__action-reason { font-size: 12.5px; color: rgba(255, 255, 255, 0.7); }
.brief__action-next { font-size: 12.5px; color: rgba(255, 255, 255, 0.55); font-style: italic; }
.brief__action-cta { font-size: 12px; font-weight: 700; color: #8fe0d2; margin-top: 2px; }
.brief__empty { color: rgba(255, 255, 255, 0.8); margin: 0; }
.brief__workload { display: flex; gap: 8px; flex-wrap: wrap; }
.brief .chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}
/* Tags on the dark brief panel need their own light-on-dark palette —
   the default .tag styling (below) targets white cards. */
.brief .tag { border-color: rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.08); }
.brief .tag--blocking { color: #ffb3ac; border-color: #ffb3ac; background: rgba(255, 179, 172, 0.14); }
.brief .tag--category[data-category="cash"] { color: #8fe0d2; border-color: #8fe0d2; background: rgba(143, 224, 210, 0.14); }
.brief .tag--category[data-category="delivery"] { color: #ffb3ac; border-color: #ffb3ac; background: rgba(255, 179, 172, 0.14); }
.brief .tag--category[data-category="decision"] { color: #ffd479; border-color: #ffd479; background: rgba(255, 212, 121, 0.14); }
.brief .tag--category[data-category="sales"] { color: #9fc2ff; border-color: #9fc2ff; background: rgba(159, 194, 255, 0.14); }
.brief .tag--category[data-category="task"] { color: rgba(255, 255, 255, 0.7); }

/* ---- Metrics row: explicit responsive tiers, not implicit auto-fit -- */

.metrics-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
@media (max-width: 1279px) { .metrics-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 699px) { .metrics-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px) { .metrics-row { grid-template-columns: 1fr; } }

.metric-tile {
  position: relative;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.metric-tile__jump {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  /* Reserves room for the absolutely-positioned .metric-tile__info button
     (24px wide, right: 10px) so a long label never runs under it — this
     only became visible once the redesign's explicit 6-column breakpoint
     narrowed each tile below what the old auto-fit grid allowed. */
  padding: 0 26px 0 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.metric-tile__jump:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.metric-tile__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
/* Round 2: value_display (already one pre-formatted string from the
   backend) is split client-side on its first " · "/" (" into a bold
   primary line and a smaller secondary line — see renderMetrics(). A
   metric with no separator renders only .metric-tile__value--primary. */
.metric-tile__value--primary { display: block; font-size: 17px; font-weight: 700; color: var(--ink); }
.metric-tile__value--secondary { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 1px; }
.metric-tile__info {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px;
  min-width: 24px;
  min-height: 24px;
}
.metric-tile__info:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.metric-tile__definition { margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---- Workspace cards -------------------------------------------------- */

.workspace-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.workspace-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.workspace-card__head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.workspace-card h2 { margin: 0 0 8px; }

/* ---- Tags (small inline signals distinct from .status-pill) --------- */

.tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--muted);
}
.tag--blocking { color: var(--danger); border-color: var(--danger); background: var(--danger-wash); }
.tag--overdue { color: var(--danger); border-color: var(--danger); background: var(--danger-wash); }
.tag--stalled { color: #8a5a00; border-color: #f0d38a; background: #fff4e0; }

/* ---- Needs Your Attention -------------------------------------------- */

.attention-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.attention-list--secondary { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
/* De-nested row treatment (matches dashboard.css's .inquiry-row
   convention: no box border, a left accent on hover, tight margin —
   not another bordered card). */
.attention-row {
  border: none;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px 8px 9px;
  margin-bottom: 2px;
}
.attention-row:hover { background: var(--vellum); }
.attention-row--done { opacity: 0.55; }
.attention-row--done .attention-row__title { text-decoration: line-through; }
.attention-row__head { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.status-pill[data-kind="task"] { color: var(--slate); }
.status-pill[data-kind="decision"] { color: var(--teal); border-color: var(--teal); background: var(--teal-wash); }
.status-pill[data-kind="waiting_on_others"] { color: var(--muted); }
.tag[data-urgency="overdue"] { color: var(--danger); border-color: var(--danger); background: var(--danger-wash); }
.tag[data-urgency="due_today"] { color: var(--teal); border-color: var(--teal); background: var(--teal-wash); }
.attention-row__title {
  display: block;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.attention-row__title:hover { text-decoration: underline; }
.attention-row__title:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.attention-row__reason { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.row-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.snooze-control { display: inline-flex; align-items: center; }
.snooze-control__form { display: inline-flex; gap: 6px; margin-left: 6px; align-items: center; }
.snooze-control__form input[type="date"] {
  font: inherit;
  padding: 4px 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

/* ---- Sales Pipeline: real stage bars, one consistent scale ----------- */

.stage-bars { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.stage-bar {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  cursor: pointer;
  font: inherit;
}
.stage-bar:hover { background: var(--vellum); }
.stage-bar:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.stage-bar[aria-pressed="true"] { background: var(--teal-wash); }
.stage-bar__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.stage-bar__label { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.stage-bar__count { font-weight: 400; color: var(--muted); margin-left: 4px; }
.stage-bar__value { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.stage-bar__unknown { color: #8a5a00; }
.stage-bar__track { display: block; height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.stage-bar__fill { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.stage-bars__closed { margin: 0 0 12px; font-size: 12px; color: var(--muted); }

.opportunity-list, .opportunity-list--stalled { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.opportunity-row__btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 8px 7px 7px;
  margin-bottom: 2px;
  cursor: pointer;
  font: inherit;
}
.opportunity-row__btn:hover { background: var(--vellum); border-left-color: var(--teal); }
.opportunity-row__btn:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.opportunity-row__title { font-weight: 600; font-size: 13px; color: var(--ink); }
.opportunity-row__meta { font-size: 12px; color: var(--muted); }
.list-more { margin-top: 6px; }
.list-count-note { font-size: 11.5px; color: var(--muted); margin: 4px 0 0; }

/* ---- Follow-up tabs ---------------------------------------------------- */

.tablist { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tab {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tab--active { color: var(--teal); border-color: var(--teal); background: var(--teal-wash); }
.tab:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }

.followup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
/* Round 2: content (type tag, title, purpose) on the left, scheduled
   time + actions on the right — was 4 stacked lines, now a two-block
   row that wraps to stacked on narrow screens. */
.followup-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  border: none;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 8px 7px 7px;
  margin-bottom: 2px;
}
.followup-row:hover { background: var(--vellum); }
.followup-row__main { flex: 1 1 220px; min-width: 0; }
.followup-row__side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.followup-row__time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.followup-row__title { display: block; margin-top: 3px; background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; }
.followup-row__title:hover { text-decoration: underline; }
.followup-row__title:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.followup-row__purpose { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.followup-row__side .row-actions { margin-top: 0; justify-content: flex-end; }
@media (max-width: 479px) {
  .followup-row__side { align-items: flex-start; text-align: left; width: 100%; }
}

/* ---- Client projects --------------------------------------------------- */

/* Round 2: a real 3-across grid (was flex-wrap, which approximates but
   doesn't guarantee 3 per row) — reliable now that Projects is its own
   full-width grid row (see .ceo-grid's grid-template-areas above). */
.project-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 899px) { .project-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .project-cards { grid-template-columns: 1fr; } }
.project-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.project-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.project-card__title { background: none; border: none; padding: 0; font: inherit; font-weight: 700; font-size: 13px; text-align: left; color: var(--ink); cursor: pointer; }
.project-card__title:hover { text-decoration: underline; }
.project-card__title:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.status-pill[data-status="on_track"] { color: var(--teal); border-color: var(--teal); background: var(--teal-wash); }
.status-pill[data-status="at_risk"] { color: #8a5a00; border-color: #f0d38a; background: #fff4e0; }
.status-pill[data-status="blocked"] { color: var(--danger); border-color: var(--danger); background: var(--danger-wash); }
.project-card__milestone { font-size: 12.5px; margin: 4px 0; }
.milestone-bar { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin: 4px 0 2px; }
.milestone-bar__fill { height: 100%; background: var(--teal); }
.project-card__next { font-size: 12.5px; margin: 6px 0 0; font-weight: 600; }

/* ---- Invoices: a real table (round 2) ---------------------------------- */
/* Real <table> markup at every breakpoint — never switched to a div-based
   row layout — so header-cell associations stay intact for screen
   readers at every width. Below the table's own min-width, the WRAPPER
   scrolls horizontally (contained, tabbable, labeled), never the page —
   explicitly one of the two accessible mobile options in
   docs/CEO_OVERVIEW_REFINEMENT_ROUND2_PLAN.md. */
.invoice-table-wrap { overflow-x: auto; }
.invoice-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 12.5px; }
.invoice-table th, .invoice-table td { padding: 7px 10px; text-align: left; vertical-align: middle; }
.invoice-table thead th {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.invoice-table tbody tr { border-bottom: 1px solid var(--line-soft); }
.invoice-table tbody tr:last-child { border-bottom: none; }
.invoice-table tbody tr:hover { background: var(--vellum); }
.invoice-table__num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.invoice-table__client-btn {
  display: block;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.invoice-table__client-btn:hover { text-decoration: underline; }
.invoice-table__client-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.invoice-table__ref { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.invoice-table__status-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.status-pill[data-status="unpaid"] { color: var(--muted); }
.status-pill[data-status="partially_paid"] { color: #8a5a00; border-color: #f0d38a; background: #fff4e0; }
.status-pill[data-status="paid"] { color: var(--teal); border-color: var(--teal); background: var(--teal-wash); }
.invoice-list__summary { font-size: 12.5px; color: var(--muted); padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line-soft); }

/* ---- Detail dialog: same visual language as the Inquiry Inbox's own
   Activity/Compose dialogs (dashboard.css), not redeclared, just matched. */

.record-detail {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--graphite);
  overflow-y: auto;
}
.record-detail[open] { display: flex; flex-direction: column; gap: 10px; }
.record-detail::backdrop { background: rgba(15, 27, 45, 0.45); }
.record-detail__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.record-detail__foot { display: flex; gap: 8px; }

/* ---- Disabled-state screen (feature flag off) -------------------------- */

#disabled-view .login-card { max-width: 420px; }


/* ---- Website Traffic card (docs/WEBSITE_TRAFFIC_PLAN.md) -------------- */
/* Built from the same tokens and shapes as the metric tiles and the
   pipeline's stage bars — no new colors. Every grid track is
   minmax(0, 1fr) for the same reason .ceo-grid's is (see its comment). */

.traffic-card__updated { margin: 0; font-size: 12px; color: var(--muted); }
.traffic-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
@media (max-width: 899px) { .traffic-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 399px) { .traffic-stats { grid-template-columns: minmax(0, 1fr); } }
.traffic-stat {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-width: 0;
}
.traffic-stat dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.traffic-stat dd { margin: 2px 0 0; }
.traffic-stat__value { display: block; font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.traffic-stat__detail { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 1px; }

.traffic-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 899px) { .traffic-columns { grid-template-columns: minmax(0, 1fr); } }
.traffic-subhead { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: var(--ink); }
/* Separate the full-width Recent visits list from the trend/countries/regions
   columns above it, which otherwise sit flush against its heading. */
.traffic-columns + .traffic-subhead { margin-top: 20px; }

/* Trend: one row per day, a proportional bar and the number. Plain text
   values stay readable without the bar, so nothing is color- or
   shape-only. */
.traffic-trend, .traffic-list { list-style: none; margin: 0; padding: 0; }
.traffic-trend li {
  display: grid;
  grid-template-columns: 3.2em minmax(0, 1fr) 2.6em;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 2px 0;
}
.traffic-trend__day { color: var(--muted); }
.traffic-trend__bar { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.traffic-trend__fill { display: block; height: 100%; background: var(--teal); }
.traffic-trend__value { text-align: right; font-weight: 600; color: var(--ink); }
.traffic-trend li[data-today="true"] .traffic-trend__day { color: var(--ink); font-weight: 700; }

.traffic-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-soft);
}
.traffic-list li:last-child { border-bottom: none; }
.traffic-list__name { min-width: 0; overflow-wrap: anywhere; }
.traffic-list__count { flex-shrink: 0; font-weight: 600; color: var(--ink); }
.traffic-list__empty { font-size: 12.5px; color: var(--muted); }
.traffic-recent { list-style: none; margin: 0 0 12px; padding: 0; }
.traffic-recent__item { border-bottom: 1px solid var(--line-soft); }
.traffic-recent__item:last-child { border-bottom: none; }
/* The row is a real <button> so it is keyboard-operable; reset the button
   chrome and lay it out as the same four-column row as before, with a
   chevron that turns when expanded. */
.traffic-recent__row {
  display: grid;
  grid-template-columns: 1rem minmax(0, 13rem) minmax(0, 16rem) minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: baseline;
  width: 100%;
  margin: 0;
  padding: 6px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.traffic-recent__row::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  justify-self: center;
}
.traffic-recent__row[aria-expanded="true"]::before { transform: rotate(45deg); }
.traffic-recent__row:hover { background: var(--teal-wash); }
.traffic-recent__row:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.traffic-recent__children { list-style: none; margin: 0 0 8px; padding: 0 0 0 1.75rem; }
.traffic-recent__children[hidden] { display: none; }
.traffic-recent__children li { border-top: 1px solid var(--line-soft); }
.traffic-recent__child {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) auto;
  gap: 4px 12px;
  width: 100%;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.traffic-recent__child:hover { background: var(--teal-wash); }
.traffic-recent__child:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
/* Selected: a teal edge, a wash and heavier text, so it never relies on
   color alone. */
.traffic-recent__child[aria-pressed="true"] {
  background: var(--teal-wash);
  border-left-color: var(--teal);
  font-weight: 600;
}
.traffic-visit-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 8px 16px;
  margin: 4px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  font-size: 12.5px;
}
.traffic-visit-detail[hidden] { display: none; }
.traffic-visit-detail dt { color: var(--muted); font-size: 11.5px; }
.traffic-visit-detail dd { margin: 2px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.traffic-class-badge {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  font-size: 11px;
  color: var(--ink);
}
.traffic-network { margin: 0 0 8px; padding: 0 0 0 1.75rem; font-size: 12.5px; }
.traffic-network > summary { cursor: pointer; color: var(--muted); padding: 2px 0; }
.traffic-network > summary:hover { color: var(--ink); }
.traffic-network > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.traffic-network__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 8px 16px;
  margin: 6px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--teal);
  border-radius: 6px;
}
.traffic-network__list dt { color: var(--muted); font-size: 11.5px; }
.traffic-network__list dd { margin: 2px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.traffic-recent__children li.traffic-recent__more { display: block; color: var(--muted); }
.traffic-recent__time { color: var(--muted); }
.traffic-recent__ip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.traffic-recent__page { min-width: 0; overflow-wrap: anywhere; }
.traffic-recent__where { color: var(--muted); }
.traffic-recent__where-label { display: block; font-size: 11px; opacity: 0.85; }
@media (max-width: 899px) {
  .traffic-recent__row { grid-template-columns: 1rem minmax(0, 1fr) auto; }
  .traffic-recent__row .traffic-recent__time { grid-column: 2; }
  .traffic-recent__row .traffic-recent__where { grid-column: 3; grid-row: 1; }
  .traffic-recent__row .traffic-recent__ip,
  .traffic-recent__row .traffic-recent__page { grid-column: 2 / -1; }
  .traffic-recent__child { grid-template-columns: minmax(0, 1fr) auto; }
  .traffic-recent__child .traffic-recent__page { grid-column: 1 / -1; }
  .traffic-recent__child .traffic-recent__where { grid-column: 2; grid-row: 1; }
}
.traffic-card__note { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
