/* ===========================================================================
   main.css — Overview (ov-), Apps + app detail (ap-), Activity (ac-).

   Every class here carries one of those three prefixes (DESIGN.md §7.1); the
   shared components (card, kpi, chip, seg, avatar, app-icon …) are console.css's
   and are only ever adjusted THROUGH a prefixed ancestor (".ap-tile .seg"),
   never restyled globally. Colour follows §7.4: app hues arrive through
   HC.appColor (--hue/--cs on a .hued element → --h-c/--h-tint/--h-ink/--h-strong),
   the accent marks interaction only, and every coloured mark also carries a
   word or a number.
   =========================================================================== */

/* ============================================================ OVERVIEW ===== */
.ov-page { display: grid; gap: var(--gap); min-width: 0; }
/* The page is a grid: spacing comes from `gap`, not from the sibling margins
   console.css gives adjacent bentos/cards. */
.ov-page > * { margin-top: 0; }

.ov-skel { display: grid; gap: 14px; padding: 4px 0; }
.ov-skel-row { display: flex; align-items: center; gap: 12px; }
.ov-skel-row > div { flex: 1; min-width: 0; }
.ov-note { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--ink2); font-size: 12.5px; }
.ov-note .material-symbols-rounded { font-size: 16px; }
.ov-mini-label {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--ink2);
  font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.ov-mini-label .material-symbols-rounded { font-size: 15px; }
.ov-foot-link { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--accent-ink); font-family: var(--font-display); font-weight: 500; text-decoration: none; border-radius: 8px; padding: 2px 4px; }
.ov-foot-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ov-foot-link .material-symbols-rounded { font-size: 17px; }

/* ---- hero ---- */
.ov-hero {
  --ov-c1: var(--accent); --ov-c2: var(--accent);
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: stretch; gap: 24px; min-height: 196px;
  padding: 28px 30px; border-radius: calc(var(--radius) + 4px); border: 1px solid var(--line); box-shadow: var(--e1);
  background:
    radial-gradient(520px 260px at 100% 0%, color-mix(in srgb, var(--ov-c1) 24%, transparent), transparent 72%),
    radial-gradient(460px 240px at 62% 130%, color-mix(in srgb, var(--ov-c2) 20%, transparent), transparent 70%),
    var(--panel);
}
.ov-hero-main { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.ov-hero-date { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.ov-hero-greet { margin-top: 6px; font-size: clamp(26px, 1.6vw + 16px, 36px); font-weight: 500; letter-spacing: -.025em; line-height: 1.1; overflow-wrap: anywhere; }
.ov-hero-line { margin-top: 10px; max-width: 62ch; color: var(--ink2); font-size: 15px; line-height: 1.55; }
.ov-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ov-hero-stack { display: inline-flex; align-items: center; gap: 10px; margin-left: 6px; color: var(--ink2); font-size: 13px; text-decoration: none; border-radius: 999px; padding: 3px 12px 3px 3px; }
.ov-hero-stack:hover { background: color-mix(in srgb, var(--panel2) 70%, transparent); color: var(--ink); }
.ov-hero-stack .avatar-stack > * { box-shadow: 0 0 0 2px var(--panel); }
/* The month's most-used apps, as a loose stack of tiles: the page's colour
   comes from what people actually used, not from decoration. */
.ov-hero-art { position: relative; flex: 0 0 210px; min-height: 140px; }
.ov-hero-tile { position: absolute; display: block; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .16)); animation: ovFloat 7s var(--ease) infinite alternate; }
.ov-hero-tile:nth-child(1) { right: 34px; top: 8px; transform: rotate(-8deg); }
.ov-hero-tile:nth-child(2) { right: 120px; top: 54px; transform: rotate(7deg); animation-delay: -2s; }
.ov-hero-tile:nth-child(3) { right: 12px; top: 96px; transform: rotate(10deg); animation-delay: -4s; }
.ov-hero-tile:nth-child(4) { right: 150px; top: 2px; transform: rotate(-12deg); animation-delay: -1s; opacity: .9; }
.ov-hero-tile:nth-child(5) { right: 94px; top: 124px; transform: rotate(-4deg); animation-delay: -3s; opacity: .85; }
@keyframes ovFloat { to { translate: 0 -6px; } }

/* ---- KPIs: five across on a wide screen (12 columns don't divide by 5) ---- */
.ov-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.ov-kpis > .kpi { min-width: 0; }
.ov-kpis .kpi-value { font-size: clamp(26px, 1.4vw + 12px, 34px); }
.ov-kpi-skel { gap: 0; padding-bottom: var(--pad); }

/* ---- needs attention ---- */
.ov-attn { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ov-attn-item {
  --tone: var(--accent); --tone-ink: var(--accent-ink);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--tone) 7%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--tone) 18%, var(--line));
}
.ov-attn-item.is-warn { --tone: var(--danger); --tone-ink: var(--danger); }
.ov-attn-item.is-caution { --tone: var(--warn); --tone-ink: var(--warn); }
.ov-attn-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--tone) 15%, transparent); color: var(--tone-ink); }
.ov-attn-ic .material-symbols-rounded { font-size: 21px; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.ov-attn-text { min-width: 0; }
.ov-attn-text strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: 14.5px; line-height: 1.35; }
.ov-attn-text p { color: var(--ink2); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.ov-clear { display: flex; align-items: center; gap: 18px; padding: 6px 0; }
.ov-clear-art { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; flex: none; background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.ov-clear-art .material-symbols-rounded { font-size: 34px; }
.ov-clear strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: 17px; }
.ov-clear p { color: var(--ink2); font-size: 13.5px; margin: 2px 0 10px; }

/* ---- right now ---- */
.ov-now { display: grid; gap: 4px; }
.ov-now-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 12px; color: inherit; text-decoration: none; min-width: 0; }
.ov-now-row:hover { background: var(--panel2); }
.ov-now-av { position: relative; flex: none; }
.ov-now-av .live-dot { position: absolute; right: -1px; bottom: -1px; box-shadow: 0 0 0 2.5px var(--panel); }
.ov-now-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ov-now-main strong { font-family: var(--font-display); font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-now-where { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); font-size: 13px; min-width: 0; }
.ov-now-where span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-now-ago { color: var(--ink2); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-now-quiet { display: flex; align-items: center; gap: 8px; color: var(--ink2); font-size: 14px; padding: 6px 0; }
.ov-now-quiet .material-symbols-rounded { font-size: 19px; }
.ov-now-earlier { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ov-now-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ov-person-chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 3px 10px 3px 3px; border-radius: 999px;
  background: var(--panel2); color: var(--ink); text-decoration: none; font-size: 13px; transition: background var(--dur);
}
.ov-person-chip:hover { background: var(--panel3); }
.ov-person-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ov-person-chip small { color: var(--ink2); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ---- 30-day chart ---- */
.ov-chart-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; color: var(--ink2); font-size: 13px; }
.ov-chart-foot > span { display: inline-flex; align-items: center; gap: 5px; }
.ov-chart-foot .material-symbols-rounded { font-size: 17px; }
.ov-chart-foot strong { color: var(--ink); font-weight: 500; }
.ov-chart-utc { margin-left: auto; font-family: var(--font-mono); font-size: 11px; }
/* A card with a control in its header: the control drops under the title on
   a narrow card instead of squeezing the title into a column of words. */
.ov-chart-card .card-head, .ap-usage-card .card-head, .ac-chart-card .card-head { flex-wrap: wrap; row-gap: 12px; }
.ov-chart-card .card-heading, .ap-usage-card .card-heading, .ac-chart-card .card-heading { flex: 1 1 200px; }

/* ---- new faces ---- */
.ov-faces-block + .ov-faces-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ov-faces-block .lr { padding-left: 0; padding-right: 0; min-height: 50px; }
.ov-faces-block a.lr { margin: 0 -8px; padding: 6px 8px; width: calc(100% + 16px); border-radius: 12px; border-top: 0; }
.ov-more { display: inline-block; margin-top: 6px; color: var(--accent-ink); font-size: 13px; text-decoration: none; }
.ov-more:hover { text-decoration: underline; }
.ov-bdays { display: grid; gap: 6px; }
.ov-bday { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: var(--panel2); color: inherit; text-decoration: none; min-width: 0; }
.ov-bday:hover { background: var(--panel3); }
.ov-bday > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ov-bday strong { font-family: var(--font-display); font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-bday small { color: var(--ink2); font-size: 12px; }
.ov-bday-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink2); }
/* ≤ 14 days: the pink of Dates (hue 350) — a birthday is the one thing here
   that's good news, so it gets the warm colour. */
.ov-bday.is-soon { background: var(--h-tint); }
.ov-bday.is-soon small, .ov-bday.is-soon .ov-bday-date { color: var(--h-ink); }

/* ---- latest sign-ins feed ---- */
.ov-feed { list-style: none; margin: 0; padding: 0; }
.ov-feed > li + li .ov-feed-row { border-top: 1px solid var(--line); }
.ov-feed-row { display: flex; align-items: center; gap: 12px; padding: 9px var(--pad); color: inherit; text-decoration: none; min-width: 0; }
a.ov-feed-row:hover { background: color-mix(in srgb, var(--panel2) 70%, transparent); }
.ov-feed-lead { position: relative; flex: none; }
.ov-feed-anon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); color: var(--ink2); }
.ov-feed-anon .material-symbols-rounded { font-size: 19px; }
.ov-feed-method {
  position: absolute; right: -4px; bottom: -3px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--panel); color: var(--ink2); box-shadow: 0 0 0 1.5px var(--line-strong);
}
.ov-feed-method .material-symbols-rounded { font-size: 12px; }
.ov-feed-lead.is-bad .ov-feed-method { background: var(--danger); color: var(--on-danger); box-shadow: 0 0 0 2px var(--panel); }
.ov-feed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ov-feed-title { display: flex; align-items: center; gap: 7px; min-width: 0; font-family: var(--font-display); font-weight: 500; font-size: 14px; }
.ov-feed-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ov-feed-sub { color: var(--ink2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-feed-at { flex: none; color: var(--ink2); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- top of the tables ---- */
.ov-leaders { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.ov-leader {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 14px 12px; border-radius: 16px;
  background: linear-gradient(160deg, var(--h-tint), color-mix(in srgb, var(--h-tint) 40%, var(--panel)));
  border: 1px solid color-mix(in srgb, var(--h-c) 20%, var(--line)); color: var(--ink); text-decoration: none;
  transition: transform var(--dur), box-shadow var(--dur);
}
a.ov-leader:hover { transform: translateY(-2px); box-shadow: var(--e2); }
.ov-leader-skel { background: var(--panel2); border-color: transparent; }
.ov-leader-app { display: flex; align-items: center; gap: 8px; min-width: 0; font-family: var(--font-display); font-weight: 500; font-size: 13px; color: var(--h-ink); }
.ov-leader-app > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-leader-num { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.ov-leader-num strong { font-family: var(--font-display); font-weight: 500; font-size: 30px; line-height: 1; letter-spacing: -.02em; color: var(--h-ink); font-variant-numeric: tabular-nums; }
.ov-leader-num span { color: var(--ink2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ov-leader-who { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; }
.ov-leader-who > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ov-leader-who small { color: var(--ink2); font-size: 11.5px; white-space: nowrap; }

/* ---- system health strip ---- */
.ov-health-card .card-body { padding-top: 12px; }
.ov-health { display: flex; flex-wrap: wrap; gap: 8px; }
.ov-hpill {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 12px 5px 10px; border-radius: 999px;
  background: var(--panel2); font-size: 13px; max-width: 100%;
}
.ov-hpill > .material-symbols-rounded { font-size: 17px; color: var(--ink2); }
.ov-hpill-label { font-family: var(--font-display); font-weight: 500; white-space: nowrap; }
.ov-hpill-val { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ov-hpill.is-warn { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.ov-hpill.is-warn .ov-hpill-val { color: var(--warn); }
.ov-hpill.is-err { background: color-mix(in srgb, var(--danger) 11%, transparent); }
.ov-hpill.is-err .ov-hpill-val { color: var(--danger); }

@media (max-width: 1180px) {
  .ov-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-hero-art { flex-basis: 150px; }
}
@media (max-width: 720px) {
  .ov-hero { padding: 22px 20px; flex-direction: column; min-height: 0; }
  .ov-hero-art { display: none; }
  .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-kpis > .kpi:last-child:nth-child(odd) { grid-column: span 2; }
  .ov-attn-item { grid-template-columns: auto minmax(0, 1fr); }
  .ov-attn-item > .btn { grid-column: 2; justify-self: start; }
  .ov-chart-utc { margin-left: 0; }
  .ov-leaders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ov-leader-num strong { font-size: 24px; }
}

/* ================================================================ APPS ===== */
.ap-note { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--ink2); font-size: 12.5px; }
.ap-note .material-symbols-rounded { font-size: 16px; }
.ap-muted { color: var(--ink2); font-size: 13px; }
.ap-mini-label { margin: 0 0 10px; color: var(--ink2); font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* ---- toolbar: search + access filters ---- */
.ap-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 8px; }
.ap-toolbar:empty { display: none; }
.ap-search { flex: 1 1 240px; max-width: 360px; }
.ap-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-filter {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink2); cursor: pointer;
  font-family: var(--font-display); font-weight: 500; font-size: 13px; transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.ap-filter .material-symbols-rounded { font-size: 17px; }
.ap-filter:hover { color: var(--ink); border-color: var(--line-strong); }
.ap-filter-n { font-family: var(--font-mono); font-size: 11px; min-width: 22px; text-align: center; padding: 2px 6px; border-radius: 999px; background: var(--panel2); }
.ap-filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.ap-filter[aria-pressed="true"] .ap-filter-n { background: color-mix(in srgb, var(--bg) 22%, transparent); color: inherit; }

/* ---- groups ---- */
.ap-group > .sect { margin-top: 30px; }
.ap-board > .ap-group:first-child > .sect { margin-top: 10px; }
.ap-skel-head { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--gap); }
/* 320 px, not 250: a mini tile spends ~200 px on padding, icon, gaps and the
   mode/status column, and 250 left short names ("Admin center") cut off. */
.ap-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }
.ap-grid + .ap-mini-grid { margin-top: 12px; }
/* Grid cells take their spacing from `gap`; console.css's card+card margin
   would push every tile after the first one down. */
.ap-grid > .card, .ap-mini-grid > .card { margin-top: 0; }

/* ---- a gated app's tile ---- */
.ap-tile { position: relative; gap: 14px; padding: 18px 18px 16px; overflow: hidden; }
/* A thin band of the app's own colour, so a grid of tiles reads as a set of
   distinct apps at a glance without shouting. */
.ap-tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--h-c), color-mix(in srgb, var(--h-c) 30%, transparent)); }
.ap-tile:hover { box-shadow: var(--e2); border-color: var(--line-strong); }
.ap-tile:focus-within { border-color: color-mix(in srgb, var(--h-c) 45%, var(--line)); }
.ap-tile-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ap-tile-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* The name is the tile's link; ::after stretches it over the whole card, and
   the controls below sit above it (z-index) so they stay clickable — a card
   can't be an <a> when it contains buttons. */
.ap-tile-link { font-family: var(--font-display); font-weight: 500; font-size: 16.5px; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-tile-link::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.ap-tile-link:focus-visible { outline: none; }
.ap-tile-link:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.ap-tile-host { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Two lines reserved even for a one-line blurb, so the numbers below line up
   across a row of tiles. */
.ap-tile-blurb { color: var(--ink2); font-size: 13px; line-height: 1.45; min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-tile-mid { display: grid; gap: 8px; padding: 12px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.ap-tile-usage { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; min-width: 0; }
.ap-tile-data { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-usage-big { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.ap-usage-big strong { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -.02em; color: var(--h-ink); white-space: nowrap; }
.ap-usage-big small { color: var(--ink2); font-size: 12px; white-space: nowrap; }
.ap-usage-sub, .ap-data-sub { color: var(--ink2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-usage-none { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); font-size: 12.5px; }
.ap-usage-none .material-symbols-rounded { font-size: 17px; }
.ap-data-line { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 6px; font-size: 13px; line-height: 1.4; min-width: 0; }
.ap-data-line strong { font-weight: 500; }
.ap-data-line > .material-symbols-rounded { align-self: center; }
.ap-data-line .material-symbols-rounded { font-size: 17px; color: var(--h-ink); margin-top: -1px; }
.ap-data-line.is-muted { color: var(--ink2); }
.ap-data-line.is-muted .material-symbols-rounded { color: var(--ink2); }
.ap-tile-people { display: flex; align-items: center; gap: 10px; min-height: 28px; margin-top: auto; font-size: 13px; color: var(--ink2); }
.ap-tile-people .avatar-stack > * { box-shadow: 0 0 0 2px var(--panel); }
.ap-open { display: inline-flex; align-items: center; gap: 6px; }
.ap-open .material-symbols-rounded { font-size: 18px; }
.ap-tile .seg { position: relative; z-index: 1; }
.ap-tile .seg button { padding: 6px 8px; }
.ap-tile[data-mode="public"] .seg button[aria-pressed="true"] { color: var(--ok); }
.ap-tile[data-mode="contribute"] .seg button[aria-pressed="true"] { color: var(--warn); }
.ap-tile[data-mode="private"] .seg button[aria-pressed="true"] { color: var(--accent-ink); }

/* Status: a dot AND a word (colour is never the only signal). */
.ap-status { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; color: var(--ink2); white-space: nowrap; }
.ap-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink3); }
.ap-status[data-state="checking"] .ap-status-dot { animation: apPulse 1s var(--ease) infinite alternate; }
.ap-status[data-state="online"] .ap-status-dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.ap-status[data-state="online"] { color: var(--ok); }
.ap-status[data-state="offline"] .ap-status-dot { background: var(--danger); }
.ap-status[data-state="offline"] { color: var(--danger); }
@keyframes apPulse { to { opacity: .3; } }

/* ---- an ungated page: a compact link card ---- */
.ap-mini { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 11px 14px; color: inherit; text-decoration: none; }
.ap-mini:hover { box-shadow: var(--e2); border-color: var(--line-strong); }
.ap-mini-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ap-mini-id strong { font-family: var(--font-display); font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-mini-id span { font-family: var(--font-mono); font-size: 11px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-mini-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }

/* ============================================================ APP DETAIL === */
.ap-page { display: grid; gap: var(--gap); min-width: 0; }
.ap-page > * { margin-top: 0; }
.ap-hero {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 22px;
  padding: 26px 28px; border-radius: calc(var(--radius) + 4px); color: #fff;
  background: linear-gradient(135deg, var(--h-strong), color-mix(in srgb, var(--h-strong) 72%, #000));
  box-shadow: var(--e2);
}
/* The app's icon, blown up and faded into the band — its identity, not decoration. */
.ap-hero::after {
  content: ""; position: absolute; z-index: -1; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--h-c) 70%, transparent), transparent 68%); opacity: .75;
}
.ap-hero-skel { background: var(--panel); color: var(--ink); box-shadow: var(--e1); border: 1px solid var(--line); }
.ap-hero-icon .app-icon { box-shadow: 0 0 0 4px rgba(255, 255, 255, .22), 0 14px 30px -12px rgba(0, 0, 0, .5); }
.ap-hero-main { flex: 1; min-width: 0; }
.ap-hero-host { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 13px; color: rgba(255, 255, 255, .88); text-decoration: none; border-radius: 6px; overflow-wrap: anywhere; }
.ap-hero-host:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.ap-hero-host .material-symbols-rounded { font-size: 15px; }
.ap-hero-blurb { margin-top: 6px; font-family: var(--font-display); font-size: 18px; line-height: 1.4; max-width: 60ch; }
.ap-hero-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ap-hero-badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); font-size: 13px; font-weight: 500;
}
.ap-hero-badge .material-symbols-rounded { font-size: 17px; }
.ap-hero-badge .ap-status, .ap-hero-badge .ap-status[data-state] { color: #fff; }
.ap-hero-badge .ap-status[data-state="online"] .ap-status-dot { background: #6ff0b0; box-shadow: 0 0 0 3px rgba(111, 240, 176, .3); }
.ap-hero-badge .ap-status[data-state="offline"] .ap-status-dot { background: #ffb3b8; }
.ap-hero-badge .icon-btn { width: 26px; height: 26px; margin: -2px -6px -2px 0; color: #fff; border-radius: 8px; }
.ap-hero-badge .icon-btn:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.ap-hero-badge .icon-btn .material-symbols-rounded { font-size: 17px; }
.ap-hero-actions { flex: none; }
.ap-hero .ap-hero-open { background: #fff; color: #17181c; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); }
.ap-hero .ap-hero-open:hover { background: rgba(255, 255, 255, .88); }

/* ---- access: the three modes as choosable cards ---- */
.ap-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ap-mode {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0;
  padding: 14px 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; transition: border-color var(--dur), background var(--dur), box-shadow var(--dur);
}
.ap-mode:hover:not(:disabled) { border-color: var(--line-strong); background: var(--panel2); }
.ap-mode:disabled { cursor: progress; }
.ap-mode-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--panel2); color: var(--ink2); }
.ap-mode-ic .material-symbols-rounded { font-size: 20px; }
.ap-mode-text { display: flex; flex-direction: column; gap: 4px; }
.ap-mode-text strong { font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.ap-mode-text span { color: var(--ink2); font-size: 12.5px; line-height: 1.45; }
.ap-mode-check { position: absolute; top: 12px; right: 12px; color: var(--accent); opacity: 0; transform: scale(.6); transition: opacity var(--dur), transform var(--dur); }
.ap-mode[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.ap-mode[aria-pressed="true"] .ap-mode-ic { background: var(--accent-fill); color: var(--on-accent); }
.ap-mode[aria-pressed="true"] .ap-mode-check { opacity: 1; transform: none; }
.ap-access-foot, .ap-advice { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--ink2); line-height: 1.45; }
.ap-access-foot .material-symbols-rounded, .ap-advice .material-symbols-rounded { font-size: 18px; flex: none; }
.ap-advice strong { font-weight: 500; color: inherit; }
.ap-advice.is-caution { color: var(--warn); padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 11%, transparent); }
/* "New users get this app by default" (the Access page's per-app switch). */
.ap-default { margin-top: 16px; padding-top: 6px; border-top: 1px dashed var(--line); }
.ap-default .switch-row { padding-bottom: 6px; }
.ap-default .switch-row.is-busy .switch { opacity: .6; cursor: progress; }
.ap-default-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent-ink); text-decoration: none; }
.ap-default-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.ap-default-link .material-symbols-rounded { font-size: 17px; }
.ap-tile-hostline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ap-tile-hostline .ap-tile-host { min-width: 0; }
.ap-tile-default { position: relative; z-index: 1; flex: none; display: inline-flex; }
.ap-tile-default:empty { display: none; }
.ap-tile-default .badge { height: 18px; padding: 0 6px; font-size: 11px; border-radius: 6px; }
.ap-tile-default .badge .material-symbols-rounded { font-size: 13px; }
.ap-advice.is-info { color: var(--accent-ink); padding: 10px 12px; border-radius: 12px; background: var(--accent-tint); }
.ap-ungated { display: flex; gap: 14px; align-items: flex-start; padding: 6px 0; }
.ap-ungated > .material-symbols-rounded { font-size: 26px; color: var(--ok); padding: 8px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 12%, transparent); }
.ap-ungated strong { font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.ap-ungated p { color: var(--ink2); font-size: 13.5px; margin-top: 3px; }

/* ---- live numbers ---- */
.ap-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.ap-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 10px 11px; border-radius: 13px; background: var(--h-tint); }
.ap-stat-ic { color: var(--h-ink); }
.ap-stat-ic .material-symbols-rounded { font-size: 19px; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.ap-stat strong { margin-top: 3px; font-family: var(--font-display); font-weight: 500; font-size: 20px; letter-spacing: -.01em; color: var(--h-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-stat span:last-child { color: var(--ink2); font-size: 12.5px; }
.ap-stat.is-warn { background: color-mix(in srgb, var(--danger) 11%, transparent); }
.ap-stat.is-warn strong, .ap-stat.is-warn .ap-stat-ic { color: var(--danger); }

.ap-saved { min-width: 0; }
.ap-stats + .ap-note + .ap-saved { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ap-saved .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---- who can enter ---- */
.ap-inset { margin: 4px var(--pad) 10px; }
.ap-who-empty { padding: 4px var(--pad) 12px; color: var(--ink2); font-size: 13px; }
.ap-skel-rows { padding: 4px 0; }

/* ---- grant picker ---- */
.ap-pick-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ap-pick-bar > .btn { margin-left: auto; }
.ap-pick-search { flex: 1; }
.ap-pick-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ap-pick-row { min-height: 54px; }
/* console.css stretches every plain span in a .chk tile (flex:1, for its
   label); an avatar must keep its circle. */
.ap-pick-grid .chk.ap-pick-row > span.avatar { flex: none; width: var(--size); overflow: hidden; }
.ap-pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ap-pick-text strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-pick-text small { color: var(--ink2); font-family: var(--font-body); font-weight: 400; font-size: 12px; }

/* ---- leaderboard ---- */
.ap-lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ap-lb-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 12px; color: inherit; text-decoration: none; min-width: 0; }
a.ap-lb-row:hover { background: var(--panel2); }
.ap-lb-row.is-gone { opacity: .6; }
.ap-lb-rank {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--ink2); background: var(--panel2);
}
/* Medal colours are fixed (gold, silver, bronze) — they mean the same thing
   in every app, so they don't take the app's hue. */
.ap-lb-rank.is-1 { background: #f5c542; color: #4a3500; }
.ap-lb-rank.is-2 { background: #cfd4dc; color: #2c3440; }
.ap-lb-rank.is-3 { background: #e0a370; color: #4a2508; }
.ap-lb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ap-lb-name { font-family: var(--font-display); font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-lb-sub { color: var(--ink2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-lb-main .progress { max-width: 240px; margin-top: 2px; }
.ap-lb-head { display: flex; flex-direction: column; align-items: flex-end; flex: none; max-width: 40%; text-align: right; }
.ap-lb-head strong { font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.05; color: var(--h-ink); font-variant-numeric: tabular-nums; }
.ap-lb-head small { color: var(--ink2); font-size: 12px; line-height: 1.3; }

/* ---- usage ---- */
.ap-usage-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.ap-chipstat { display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 12px; border-radius: 12px; background: var(--h-tint); font-size: 12.5px; color: var(--ink2); }
.ap-chipstat .material-symbols-rounded { font-size: 16px; color: var(--h-ink); align-self: center; }
.ap-chipstat strong { font-family: var(--font-display); font-weight: 500; font-size: 16px; color: var(--h-ink); }
.ap-chipstat.is-warn { background: color-mix(in srgb, var(--warn) 13%, transparent); }
.ap-chipstat.is-warn strong, .ap-chipstat.is-warn .material-symbols-rounded { color: var(--warn); }
.ap-usage-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ap-usage-donut .ch-donut { flex-direction: column; align-items: flex-start; }
.ap-usage-donut .ch-donut-legend { width: 100%; }
.ap-paths-card .ch-bar-label { font-family: var(--font-mono); font-size: 12.5px; font-weight: 400; }
.ap-about-note { margin: 16px 0 0; }

@media (max-width: 900px) {
  .ap-hero { flex-wrap: wrap; padding: 22px 20px; }
  .ap-hero-actions { width: 100%; }
  .ap-modes { grid-template-columns: minmax(0, 1fr); }
  .ap-mode { flex-direction: row; align-items: center; padding: 12px 40px 12px 12px; }
  .ap-usage-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .ap-search { max-width: none; flex-basis: 100%; }
  .ap-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; max-width: calc(100% + 32px); }
  .ap-filters::-webkit-scrollbar { display: none; }
  .ap-filter { flex: none; }
  .ap-grid { grid-template-columns: minmax(0, 1fr); }
  .ap-mini-grid { grid-template-columns: minmax(0, 1fr); }
  .ap-hero { flex-direction: column; align-items: flex-start; gap: 14px; }
  .ap-hero-icon .app-icon { --size: 56px !important; }
  .ap-hero-blurb { font-size: 16px; }
  .ap-lb-head strong { font-size: 18px; }
}

/* ============================================================ ACTIVITY ===== */
.ac-page, .ac-skel { display: grid; gap: var(--gap); min-width: 0; }
.ac-page > *, .ac-skel > * { margin-top: 0; }
.ac-page > .sect { margin: 14px 0 -2px; }
.ac-chart-note, .ac-method { display: flex; align-items: flex-start; gap: 7px; margin-top: 14px; color: var(--ink2); font-size: 13px; line-height: 1.5; }
.ac-chart-note .material-symbols-rounded, .ac-method .material-symbols-rounded { font-size: 17px; flex: none; margin-top: 1px; }
.ac-chart-note strong { color: var(--ink); font-weight: 500; }
.ac-method { font-size: 12.5px; margin-top: 10px; }

/* The numbers behind the chart, one click away (the chart also carries its
   own sr-only table; this one is for eyes). */
.ac-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.ac-details summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; padding: 5px 10px 5px 8px; margin-left: -8px; border-radius: 9px;
  color: var(--accent-ink); font-family: var(--font-display); font-weight: 500; font-size: 13.5px;
}
.ac-details summary::-webkit-details-marker { display: none; }
.ac-details summary:hover { background: var(--accent-tint); }
.ac-details summary .material-symbols-rounded { font-size: 18px; }
.ac-details[open] summary { margin-bottom: 8px; }
.ac-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.ac-table th, .ac-table td { padding: 8px 12px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.ac-table thead th { position: sticky; top: 0; z-index: 1; background: var(--panel2); border-top: 0; font-family: var(--font-display); font-weight: 500; color: var(--ink2); font-size: 12px; }
.ac-table th:first-child, .ac-table td:first-child { text-align: left; }
.ac-table tbody th { font-weight: 500; }
.ac-table tbody tr:hover { background: color-mix(in srgb, var(--panel2) 60%, transparent); }

/* ---- traffic mix ---- */
.ac-mix { display: grid; gap: 16px; }
.ac-mix-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--panel2); gap: 2px; }
.ac-mix-bar span { display: block; min-width: 4px; background: var(--h-c); }
.ac-mix-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ac-mix-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; font-size: 13px; }
.ac-mix-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--h-c); }
.ac-mix-legend strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.ac-mix-note { color: var(--ink2); font-size: 12.5px; line-height: 1.5; }
.ac-mix-legend em { font-style: normal; color: var(--ink2); font-size: 12px; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- people ---- */
.ac-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.ac-people > .card { margin-top: 0; }
.ac-person { gap: 12px; padding: 18px; color: inherit; text-decoration: none; }
a.ac-person:hover { box-shadow: var(--e2); border-color: var(--line-strong); transform: translateY(-1px); }
.ac-person.is-top { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: linear-gradient(170deg, var(--accent-tint), var(--panel) 55%); }
.ac-person-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ac-person-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ac-person-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ac-person-name strong { font-family: var(--font-display); font-weight: 500; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ac-person-seen { color: var(--ink2); font-size: 12.5px; }
.ac-rank { flex: none; align-self: flex-start; font-family: var(--font-mono); font-size: 12px; color: var(--ink2); padding: 2px 7px; border-radius: 999px; background: var(--panel2); }
.ac-person.is-top .ac-rank { background: var(--accent-fill); color: var(--on-accent); }
.ac-person-time { display: flex; align-items: baseline; gap: 8px; }
.ac-person-time strong { font-family: var(--font-display); font-weight: 500; font-size: 28px; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.ac-person-time span { color: var(--ink2); font-size: 12.5px; }
.ac-share { height: 6px; border-radius: 999px; background: var(--panel2); overflow: hidden; }
.ac-share span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.ac-person-stats { color: var(--ink2); font-size: 13px; }
.ac-apps { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-app { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px 3px 3px; border-radius: 999px; background: var(--h-tint); color: var(--h-ink); font-size: 12.5px; font-weight: 500; }
.ac-app .app-icon { border-radius: 50%; }
.ac-app > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* No opacity: faded, the duration fell to 4.2:1 on the tint. Weight alone sets it back. */
.ac-app small { font-size: 11.5px; font-weight: 400; font-variant-numeric: tabular-nums; }
.ac-app-more { align-self: center; color: var(--ink2); font-size: 12px; padding: 0 4px; }
.ac-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* ---- apps + blocked tries ---- */
.ac-more { margin-top: 12px; }
.ac-ask-lead { position: relative; display: inline-block; }
/* Below the initials' baseline (≈ 20.5 px into a 34 px avatar), so the
   badge never hides the second letter ("AL" read as "AI"). */
.ac-ask-app { position: absolute; right: -6px; bottom: -6px; border-radius: 6px; box-shadow: 0 0 0 2px var(--panel); line-height: 0; }
.ac-ask-app .app-icon { border-radius: 5px; }
.ac-ask-n { font-family: var(--font-mono); }

@media (max-width: 1180px) {
  .ac-page .bento > .ac-knock { grid-column: span 12; }
}
@media (max-width: 720px) {
  .ac-people { grid-template-columns: minmax(0, 1fr); }
  .ac-person-time strong { font-size: 24px; }
}
