/* Kleto Pulse Overview site cards (owner approved variant B, 2026-10-26;
   docs/DESIGN-METRIC-PRIORITY.md section 19). Anchors: the Plausible "My
   sites" card grid (site, sparkline, one number) and the house Apple
   Health Summary card (one ink series, a muted reference, a hairline base).
   A monochrome base and ONE accent for interactive and selected states
   only, the --home-accent token in app.css that the header shares. No
   iridescent, pearlescent or chrome effect anywhere (owner, 2026-10-26). */

/* Inside the homepage body every focus ring and selected state wears the
   accent. */
#app .pulse-home, #app .pulse-home .portfolio, #app .pulse-home .portfolio-card {
  --ring: var(--home-accent); --ui-ring-color: var(--home-accent); --ui-accent: var(--home-accent); --ui-accent-ink: var(--home-on-accent);
}
#app .pulse-home :focus-visible { outline: 2px solid var(--home-accent); outline-offset: 2px; }
#app .pulse-home .ui-btn.solid:hover:not(:disabled) { box-shadow: none; }
#app .pulse-home .ui-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── summary row: one short row, fixed boxes ────────────────────────────── */
#home-sum { margin: 4px 0 0; }
.sc-sum { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.sc-sum__lead { min-width: 0; }
.sc-sum__k { margin: 0; font-size: 13px; line-height: 18px; height: 18px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-sum__row { display: flex; align-items: baseline; flex-wrap: nowrap; gap: 10px; margin: 2px 0 0; height: 38px; min-width: 0; }
.sc-sum__v { font-size: 30px; line-height: 38px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sc-sum__d { font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sc-sum__side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sc-mini { min-width: 0; }
.sc-mini__k { margin: 0; font-size: 12px; line-height: 16px; height: 16px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-mini__v { margin: 2px 0 0; font-size: 16px; line-height: 22px; height: 22px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 860px) {
  .sc-sum { grid-template-columns: minmax(0, auto) 1fr; align-items: center; gap: 32px; padding: 16px 20px; }
  .sc-sum__side { grid-template-columns: repeat(2, auto); justify-content: end; gap: 40px; }
}
.sc-notes { position: relative; margin: 6px 0 0; }
.sc-note { margin: 0; font-size: 12px; color: var(--dim); }
.sc-note summary { white-space: nowrap; }
/* the one quiet line while a comparison is limited: on the summary's row,
   out of the flow, so it never moves or wraps anything */
.sc-cmp { position: absolute; top: 0; right: 0; left: 9em; font-size: 12px; line-height: 32px; text-align: right; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: auto; }
.sc-note summary { display: inline-flex; align-items: center; min-height: 32px; cursor: pointer; list-style: none; }
.sc-note summary::-webkit-details-marker { display: none; }
.sc-note summary::before { content: 'i'; display: inline-grid; place-items: center; width: 14px; height: 14px; margin-right: 6px; border: 1px solid var(--line-strong); border-radius: 50%; font: 600 9px/1 var(--body); }
.sc-note[open] summary { color: var(--text); }
.sc-note p { margin: 0 0 4px; line-height: 1.5; }

/* the change: a percentage when one exists, else an empty slot */
.sc-d { position: relative; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-d--up { color: var(--up); }
.sc-d--down { color: var(--down); }
.sc-d--flat { color: var(--dim); }

/* ── Sites bar: wrapped chips, no carousel ──────────────────────────────── */
#app .pulse-home .portfolio { margin: 20px 0 6px; padding-bottom: 0; border-bottom: 0; }
#app .pulse-home .portfolio__head h2.pf-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.pf-title .portfolio__result-count { font: 13px var(--body); color: var(--dim); margin-left: 4px; }
.pf-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pf-wrap .portfolio__filter { min-height: 36px; }
#app .pulse-home .portfolio__filter[aria-pressed="true"] { color: var(--home-accent); border-color: var(--home-accent); background: color-mix(in srgb, var(--home-accent) 10%, var(--card)); }
#app .pulse-home .portfolio__filter[aria-pressed="true"] .portfolio__count { color: inherit; }
#app .pulse-home .portfolio__filter.is-over { outline-color: var(--home-accent); }
.pf-more { margin-top: 8px; }
.pf-more__s { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; font-size: 13px; color: var(--dim); list-style: none; }
.pf-more__s::-webkit-details-marker { display: none; }
.pf-more__s::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease-settle); }
.pf-more[open] .pf-more__s { color: var(--text); }
.pf-more[open] .pf-more__s::after { transform: rotate(-135deg) translateY(-1px); border-color: var(--home-accent); }
.pf-more__n:not(:empty) { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--home-accent); color: var(--home-on-accent); font-size: 11px; line-height: 18px; text-align: center; }
.pf-more__body { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.pf-more__body .pf-wrap { margin-top: 0; flex: 1 1 100%; }
.sc-mode { flex: 0 0 auto; }
#app .pulse-home .sc-mode button[aria-pressed="true"] { background: var(--home-accent); color: var(--home-on-accent); }
@media (max-width: 767px) {
  #app .pulse-home .portfolio__tools { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "sort mode" "search new"; }
  #app .pulse-home .portfolio__new { padding-inline: 14px; }
  #app .pulse-home .pf-sort__select select { height: 44px; min-height: 44px; }
  .sc-mode { grid-area: mode; }
  .pf-wrap .portfolio__filter { min-height: 44px; }
  .sc-mode { --ui-seg-h: 48px; }
}
@media (pointer: coarse) { .pf-wrap .portfolio__filter, .pf-more__s { min-height: 44px; } }

/* ── groups ─────────────────────────────────────────────────────────────── */
#sites { display: block; }
.sgrp { margin-top: 18px; }
.sgrp:first-child { margin-top: 10px; }
.sgrp__h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 10px; padding: 0 2px; }
.sgrp__h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.sgrp__c, .sgrp__n { font-size: 13px; font-weight: 400; color: var(--dim); font-variant-numeric: tabular-nums; }
.sgrp--flat > .sgrp__h { display: none; }
.sgrp__grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .sgrp__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .sgrp__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .sgrp__grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
.sgrp__grid > .project-cluster { grid-column: 1 / -1; }
.sgrp--later { border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.sgrp--later > .sgrp__h { align-items: center; min-height: 48px; margin: 0; padding: 0 16px; cursor: pointer; list-style: none; }
.sgrp--later > .sgrp__h::-webkit-details-marker { display: none; }
.sgrp--later > .sgrp__h h3 { flex: 1 1 auto; font-size: 14px; }
.sgrp--later[open] > .sgrp__h .sc-chev { transform: rotate(180deg); color: var(--home-accent); }
.sgrp--later > .sgrp__grid { padding: 0 10px 10px; }

/* ── card ───────────────────────────────────────────────────────────────── */
#sites .card { padding: 0; border-radius: 8px; min-width: 0; overflow: hidden; }
#sites .card.is-open { grid-column: 1 / -1; border-color: var(--line-strong); box-shadow: inset 2px 0 0 var(--home-accent); }
.card__face {
  display: block; width: 100%; padding: 14px 14px 12px; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; transition: background-color .15s ease;
}
.card__face:hover { background: #0e0e0e; }
.card__face:disabled { cursor: default; }
.sc-head { display: flex; align-items: center; gap: 10px; height: 32px; }
.sc-tile { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); font-size: 14px; font-weight: 600; text-transform: lowercase; }
.sc-name { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 500; line-height: 20px; }
.sc-name__txt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-mark { flex: 0 0 auto; font-size: 13px; line-height: 20px; }
.sc-st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-st i { width: 8px; height: 8px; border-radius: 50%; background: var(--up); flex: 0 0 auto; }
.sc-st.is-warn i { background: var(--warn); border-radius: 1px; transform: rotate(45deg); }
.sc-st.is-down i { background: var(--down); border-radius: 1px; }
.sc-st.is-down { color: var(--down); }
.sc-body { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 16px; height: 62px; margin-top: 12px; }
.sc-lead { display: block; min-width: 0; }
.sc-k { display: block; height: 16px; font-size: 12px; line-height: 16px; color: var(--dim); }
.sc-v { display: block; height: 28px; font-size: 24px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-dl { display: block; height: 18px; font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; }
.sc-spark { position: relative; display: block; height: 44px; min-width: 0; }
.sc-spark__tip { position: absolute; right: 0; top: -18px; font-size: 11px; line-height: 14px; color: var(--dim); white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.sc-spark__box { display: block; height: 44px; }
.sc-spark__box svg { display: block; width: 100%; height: 44px; overflow: visible; }
.sc-spark__base { stroke: var(--border); stroke-width: 1; }
.sc-spark__prev { fill: none; stroke: var(--mark); stroke-width: 1.5; stroke-linejoin: round; }
.sc-spark__cur { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sc-spark__x { stroke: var(--line-strong); stroke-width: 1; }
.sc-foot { display: flex; align-items: center; gap: 16px; height: 20px; margin-top: 10px; font-size: 12px; line-height: 20px; color: var(--dim); }
.sc-f b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.sc-chev { width: 16px; height: 16px; margin-left: auto; color: var(--dim); flex: 0 0 auto; transition: transform .2s var(--ease-settle); }
.card__face[aria-expanded="true"] .sc-chev { transform: rotate(180deg); color: var(--home-accent); }
/* Not live yet: the same face height as every card. The reads place a
   card in that group after the skeleton painted, so a compact face moved
   the layout (84px per site on 2026-10-26, e2e/layout-shift.spec.mjs).
   The change slot says "Staging only"; the details skip traffic classes. */
.card--later .sc-dt__tcx { display: none; }

/* ── details ────────────────────────────────────────────────────────────── */
.card__more { border-top: 1px solid var(--border); background: var(--panel); }
.sc-dt { display: grid; gap: 20px; padding: 16px; }
.sc-dt__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .sc-dt__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 860px) { .sc-dt { grid-template-columns: 1fr 1fr; column-gap: 32px; } .sc-dt__stats { grid-column: 1 / -1; } }
.sc-dt__sec h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.sc-dt__n { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--dim); }
.sc-dt__wait { margin: 0; font-size: 13px; color: var(--dim); }
.sc-dom { list-style: none; margin: 0; padding: 0; }
.sc-dom li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 4px 12px; padding: 6px 0 5px; border-bottom: 1px solid var(--border); }
.sc-dom li:last-child { border-bottom: 0; }
.sc-dom li[hidden] { display: none; }
.sc-dom__n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sc-dom__k { font-size: 12px; color: var(--dim); white-space: nowrap; }
.sc-dom__v { font-size: 13px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.sc-dom__bar { grid-column: 1 / -1; height: 2px; border-radius: 2px; background: var(--border); overflow: hidden; }
.sc-dom__bar b { display: block; height: 100%; background: var(--mark); }
.sc-more { min-height: 36px; padding: 6px 0 0; border: 0; background: none; color: var(--home-accent); font: inherit; font-size: 13px; cursor: pointer; }
/* Every reading the old card carried, beneath the details. */
.card__legacy { padding: 16px; border-top: 1px solid var(--border); }
.card__legacy:empty { display: none; }
.card__legacy .card__name { font-size: 15px; }
.sc-open { margin: 0; padding: 4px 16px 14px; text-align: right; }
.sc-open a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; color: var(--home-accent); font-size: 13px; font-weight: 500; text-decoration: none; }
.sc-open a:hover { text-decoration: underline; }

/* ── portfolio panels beneath the cards ─────────────────────────────────── */
.home-panels { margin: 28px 0 10px; font-size: 15px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { .sc-chev, .pf-more__s::after, .card__face { transition: none; } }
