*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --header-surface: #103e5c;
  --header-text: #ffffff;
  --header-muted: #d9effa;
}
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #fff;
  background: linear-gradient(
    160deg,
    #a8d8f0 0%,
    #1a85c2 40%,
    #0d5a8a 70%,
    #062540 100%
  );
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: 0;
}
a { color: #d4efff; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  min-width: 260px;
  background: rgba(6, 37, 64, 0.45);
  backdrop-filter: blur(6px);
  border-right: 1px solid rgba(255,255,255,0.12);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-header {
  padding: 0 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-logo {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}
.sidebar-pages { list-style: none; padding: 12px 0 4px; }
.sidebar-pages li a {
  display: block;
  padding: 7px 20px 7px 24px;
  font-size: 14px;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar-pages li a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.sidebar-pages li.active a {
  color: #fff;
  border-left-color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  font-weight: 600;
}
.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer a {
  font-size: 13px;
  color: rgba(255,255,255,0.52);
  text-decoration: none;
}
.content {
  width: calc(100% - 260px);
  max-width: 1500px;
  padding: 36px 44px 72px;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin: -36px -44px 28px;
  padding: 28px 44px 24px;
  color: var(--header-text);
  background: var(--header-surface);
  border-bottom: 1px solid rgba(255,255,255,0.2);
}
.page-header > div:first-child { min-width: 0; }
.eyebrow {
  color: var(--header-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
h1 { font-size: 28px; font-weight: 800; text-shadow: 0 1px 4px rgba(0,0,0,0.2); }
/* The header flexes the badge to the right, so the text block already stops
   short of it. A second width cap on top of that only wraps the line early. */
.page-intro { color: var(--header-muted); margin-top: 5px; }
.evidence-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: min(270px, 100%);
  flex-shrink: 0;
}
.evidence {
  padding: 4px 9px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(6,37,64,0.24);
  border-radius: 4px;
  font-size: 12px;
  color: var(--header-text);
  text-align: right;
}
.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border-top: 1px solid rgba(255,255,255,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  background: rgba(6,37,64,0.18);
  margin-bottom: 24px;
}
.metric { padding: 17px 20px; min-height: 92px; border-right: 1px solid rgba(255,255,255,0.13); }
.metric:last-child { border-right: 0; }
.metric-value { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.metric-value.unavailable { font-size: 17px; padding-top: 7px; }
.metric-label { display: block; color: rgba(255,255,255,0.68); font-size: 12px; margin-top: 3px; }
/* Social: the platform cards select which follower chart shows above them. */
button.metric-select { text-align: left; font: inherit; color: inherit; background: none; cursor: pointer; border-top: 0; border-bottom: 0; border-left: 0; }
button.metric-select:hover:not([disabled]) { background: rgba(255,255,255,0.08); }
button.metric-select[aria-pressed="true"] { background: rgba(255,255,255,0.14); box-shadow: inset 0 3px 0 #ffffff; }
button.metric-select[disabled] { cursor: default; opacity: 0.7; }
.lead-switch[hidden] { display: none; }
.band {
  padding: 20px 0 26px;
  margin-bottom: 18px;
  border-top: 1px solid rgba(255,255,255,0.18);
}
.band + .band { margin-top: 4px; }
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.section-heading h2 { font-size: 18px; }
.section-heading p { color: rgba(255,255,255,0.7); font-size: 13px; margin-top: 2px; }
.note { color: rgba(255,255,255,0.7); font-size: 13px; margin-top: 12px; max-width: 78ch; }
.property-evidence {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
}
.property-state, .property-last-good, .status-label {
  color: rgba(255,255,255,0.62);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.property-last-good {
  font-size: 11px;
  text-transform: none;
}
.status-grid, .period-grid, .data-grid, .link-grid { display: grid; gap: 16px; }
.status-grid > *, .period-grid > *, .data-grid > *, .link-grid > * { min-width: 0; }
.data-grid .subsection { overflow-x: auto; }
.status-grid, .period-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.status-grid > div, .period-grid > div, .subsection {
  background: rgba(6,37,64,0.18);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 6px;
  padding: 14px 16px;
}
.status-grid strong, .status-label { display: block; }
.link-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.link-grid a {
  min-height: 92px;
  padding: 14px;
  border-left: 3px solid rgba(255,255,255,0.65);
  background: rgba(6,37,64,0.16);
  color: #fff;
  text-decoration: none;
}
.link-grid a:hover { background: rgba(255,255,255,0.12); }
.link-grid strong, .link-grid span { display: block; }
.link-grid span { color: rgba(255,255,255,0.68); font-size: 12px; margin-top: 4px; }
.compact-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.compact-metrics div { border-left: 2px solid rgba(255,255,255,0.35); padding-left: 9px; }
.compact-metrics dt { color: rgba(255,255,255,0.62); font-size: 11px; }
.compact-metrics dd { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; }
.subsection { margin-top: 14px; }
.subsection h3 { font-size: 14px; margin-bottom: 10px; }
/* Four breakdown tables forced into four fixed columns crushed every one of
   them; at this width a heading like VISITORS wrapped to one letter per line.
   Auto-fit keeps a table readable and lets the row reflow instead. */
.data-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.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;
}
th, td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  text-align: left;
  vertical-align: top;
}
thead th { color: rgba(255,255,255,0.68); font-size: 11px; text-transform: uppercase; }
.compact-table th { font-weight: 500; }
.compact-table { table-layout: auto; width: 100%; }
/* The label column is the first cell of a row, which these tables mark up as
   a row header rather than a data cell. It carries long URL paths, so it is
   the only column allowed to break mid-word; every numeric column and all
   headings stay whole. */
.compact-table td:first-child,
.compact-table tbody th[scope="row"] {
  text-align: left;
  overflow-wrap: anywhere;
  font-weight: 400;
}
.compact-table thead th { white-space: nowrap; vertical-align: bottom; }
/* Numbers read down a column only when the heading sits over the digits. */
.compact-table thead th + th,
.compact-table td + td,
.compact-table tbody th[scope="row"] + td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.empty-state { color: rgba(255,255,255,0.58); font-size: 13px; }
.warning {
  padding: 9px 12px;
  background: rgba(125,38,38,0.3);
  border-left: 3px solid #ffd1d1;
  font-size: 13px;
  margin-bottom: 12px;
}
.trend { display: flex; align-items: flex-end; gap: 5px; height: 136px; overflow-x: auto; padding-top: 20px; }
.trend-column { width: 28px; min-width: 28px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.trend-value, .trend-date { font-size: 9px; color: rgba(255,255,255,0.64); }
.trend-bar { display: block; width: 14px; min-height: 2px; max-height: 88px; background: #9ee0ff; margin: 3px 0; }
.funnel-list > div { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.13); }
.funnel-list strong { font-variant-numeric: tabular-nums; }
.recommendation-list { list-style-position: inside; }
.recommendation-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.recommendation-list a { font-size: 13px; }
.login-page { display: grid; place-items: center; padding: 20px; }
.login-panel {
  width: min(100%, 370px);
  padding: 28px;
  background: rgba(6,37,64,0.42);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  backdrop-filter: blur(7px);
}
.login-panel .logo { font-size: 21px; font-weight: 800; }
.login-panel .subtitle { color: rgba(255,255,255,0.65); font-size: 13px; margin-bottom: 22px; }
.login-panel label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.login-panel input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 15px;
}
.login-panel input:focus { outline: 2px solid #a8d8f0; outline-offset: 1px; }
.login-panel button {
  width: 100%;
  margin-top: 13px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.login-panel button:hover { background: rgba(255,255,255,0.28); }
.error { color: #ffe0e0; font-size: 13px; margin-bottom: 10px; }

@media (max-width: 1050px) {
  .data-grid, .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .layout { display: block; }
  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding: 12px 0;
  }
  .sidebar-header { padding: 0 16px 10px; }
  .nav-toggle { display: block; }
  .sidebar-pages, .sidebar-footer { display: none; }
  .sidebar.nav-open .sidebar-pages, .sidebar.nav-open .sidebar-footer { display: block; }
  .content { width: 100%; padding: 24px 18px 52px; }
  .page-header {
    display: block;
    margin: -24px -18px 28px;
    padding: 24px 18px;
  }
  .evidence-stack { align-items: flex-start; margin-top: 14px; }
  .evidence { white-space: normal; }
  .property-evidence { align-items: flex-start; text-align: left; }
  .status-grid, .period-grid, .data-grid, .link-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(even) { border-right: 0; }
  .compact-metrics { grid-template-columns: 1fr 1fr 1fr; }
  .recommendation-list li { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 430px) {
  .metric-strip { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.13); }
  .compact-metrics { grid-template-columns: 1fr; }
}

/* Habit funnel rows share one grid so the counts stay a single aligned
   column; the trailing 14px cell holds the disclosure caret on rows that
   expand into a name list and stays empty on rows that do not. */
.funnel-list > div,
.funnel-list summary {
  display: grid;
  grid-template-columns: 1fr auto 14px;
  gap: 0 20px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.13);
}
.funnel-list > div::after { content: ""; }
.funnel-list details { border-bottom: 1px solid rgba(255,255,255,0.13); }
.funnel-list details summary { border-bottom: none; cursor: pointer; }
.funnel-list summary::-webkit-details-marker { display: none; }
.funnel-list summary::after { content: "\25BE"; font-size: 11px; opacity: 0.7; align-self: center; }
.funnel-list details[open] summary::after { content: "\25B4"; }
.name-list {
  list-style: none;
  margin: 0;
  padding: 0 0 12px 0;
  columns: 2;
  column-gap: 32px;
  font-size: 13px;
}
.name-list li { padding: 2px 0; break-inside: avoid; }
.name-list small { color: rgba(255,255,255,0.58); margin-left: 6px; }
.compact-table small.kind { color: rgba(255,255,255,0.58); margin-left: 6px; font-size: 11px; }
@media (max-width: 560px) { .name-list { columns: 1; } }


/* Members page: history line chart and sortable roster headers. */
.member-chart { display: block; width: 100%; height: auto; margin-top: 4px; }
.member-chart .chart-grid { stroke: rgba(255,255,255,0.13); }
.member-chart .chart-tick { fill: rgba(255,255,255,0.58); font-size: 11px; }
.member-chart .chart-label { fill: #ffffff; font-size: 12px; }
.member-chart .chart-dot { fill: #ffffff; }

/* Leading chart: the page's primary statistic since April 1, kept short. */
.lead-band { padding: 8px 0 4px; margin-bottom: 4px; border-top: 0; }
.lead-band .section-heading h2 { font-size: 15px; }
.lead-band .section-heading p { font-size: 12px; }
.lead-chart { display: block; width: 100%; max-width: 900px; height: auto; margin-top: 2px; }
.lead-chart .chart-grid { stroke: rgba(255,255,255,0.13); }
.lead-chart .chart-tick { fill: rgba(255,255,255,0.58); font-size: 11px; }
.lead-chart .chart-label { fill: #ffffff; font-size: 12px; }
.lead-chart .chart-dot { fill: #ffffff; }
.lead-chart .chart-marker { stroke: rgba(255,255,255,0.8); stroke-width: 1.5; }
.lead-chart .chart-marker-text { fill: rgba(255,255,255,0.85); font-size: 10px; }
/* Hover readout: guide line, a mark per series point, the day's values on a plate. */
.lead-chart { touch-action: pan-y; }
.lead-chart .chart-hover { pointer-events: none; }
.lead-chart .chart-hover-line { stroke: rgba(255,255,255,0.45); stroke-width: 1; stroke-dasharray: 3 3; }
.lead-chart .chart-hover-mark { fill: #ffffff; stroke: rgba(0,0,0,0.35); stroke-width: 1; }
.lead-chart .chart-hover-plate { fill: rgba(0,0,0,0.62); }
.lead-chart .chart-hover-text { fill: #ffffff; font-size: 11px; }
th.sort-col { cursor: pointer; user-select: none; }
th.sort-col:hover { text-decoration: underline; }
th.sort-col::after { content: "\2195"; margin-left: 5px; opacity: 0.45; font-size: 10px; }
th.sort-col[aria-sort="ascending"]::after { content: "\25B4"; opacity: 0.9; }
th.sort-col[aria-sort="descending"]::after { content: "\25BE"; opacity: 0.9; }
