/* Phase-02 reskin (DEC-127): summary screens. Tokens come from app.css :root.
   This file loads on every screen (app/index.html), not only Summary — the ring gauge rules
   below are shared with the Server tab's own card, which draws the exact same app/rings.mjs
   element, and `.card h4`'s flex layout (title + chevron, one line) is the approved design's own
   general card-header rule (design/phase02/deckpost-phase02.html line ~91), missing from
   app.css's own copy of it — completed here rather than duplicated per skin file. */

.card h4 { display: flex; justify-content: space-between; align-items: center; gap: 4px; }

/* The design's small round chevron affordance (blocks "03 Ring card" and "04 Metric tiles") — a
   real button here (an actual "see all"/"open Server" control, not decoration), grown to the
   shared 44px tap target with an invisible ::after overlay so its own 26px circle keeps the
   design's exact size. */
.chev {
  position: relative; width: 26px; height: 26px; flex: none; padding: 0; border: 0;
  border-radius: 50%; background: var(--card-2); color: var(--text-2);
  display: grid; place-items: center; font-size: 15px;
}
.chev::after { content: ""; position: absolute; inset: -9px; }
.chev svg { width: 14px; height: 14px; }
a.chev { text-decoration: none; }

/* ── 03 Server ring card ─────────────────────────────────────────────────────────────────── */
.rings { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.rings svg.ring { width: 150px; height: 150px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 15; stroke-linecap: round; }
.ring .t { opacity: .22; }
.ring .v { animation: dp-ring-fill 900ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes dp-ring-fill { from { stroke-dasharray: 0 100; } }
@media (prefers-reduced-motion: reduce) { .ring .v { animation: none; } }

.legend { display: flex; flex-direction: column; gap: 12px; }
.legend div { font-size: 15px; font-weight: 600; }
.legend .lk { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.legend .num {
  display: block; color: var(--text); font-size: 22px; font-weight: 600; letter-spacing: -.01em;
  line-height: 1.05; font-family: var(--round); font-variant-numeric: tabular-nums;
}
.legend .num small { font-size: 15px; font-weight: 600; margin-left: 2px; }
.legend .warn .num { color: var(--ask-tx); }

.card.stale .ring .v { opacity: .45; }
.card.stale .legend .num { opacity: .55; }

.meta { font-size: 13px; color: var(--text-2); margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.meta svg.i { font-size: 15px; }
.livet { color: var(--ok); font-weight: 700; }
.downt { color: var(--bad); font-weight: 600; }

/* ── 04 Metric tiles — four equal tiles, label left / big number right on one line (v6.1),
   the projects/apps/questions/sessions behind that number underneath ────────────────────────── */
/* minmax(0, 1fr), not 1fr: a plain 1fr column grows to its widest content, which pushed the Apps
   tile 22px past a 375px screen (2026-09-29). */
.tiles.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.tile.t4 { min-height: 172px; display: flex; flex-direction: column; }
.tile.t4 h5 { font-size: 17px; font-weight: 700; margin: 0; }
.tile.t4 .lrow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 8px; }
.tile.t4 .lbl { display: block; font-size: 13px; color: var(--text-2); margin: 0; min-width: 0; }
.tile.t4 .big { font-family: var(--round); font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1; margin: 0; }
.tile.t4 .big small { font-size: 17px; }

.tile.t4 .tls { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.tile.t4 .tl { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
.tile.t4 .tl > span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.t4 .tl em { font-style: normal; color: var(--text-2); font-family: var(--round); font-weight: 600; }
.tile.t4 .tl em.q { color: var(--ask-tx); font-weight: 700; }
.tile.t4 .tl em.ok { color: var(--ok); }
.tile.t4 .tl em.bad { color: var(--bad); }
.tile.t4 .tth { width: 20px; height: 20px; border-radius: 6px; overflow: hidden; flex: none; }
.tile.t4 .tth svg { width: 100%; height: 100%; display: block; }
.tile.t4 .tic { width: 20px; height: 20px; border-radius: 6px; background: var(--card-2); display: grid; place-items: center; font-size: 13px; color: var(--text-2); flex: none; }
.tile.t4 .tl.pr { flex-wrap: wrap; row-gap: 4px; }
.tile.t4 .tbar { flex-basis: 100%; height: 4px; border-radius: 2px; background: var(--card-2); overflow: hidden; margin-left: 28px; }
.tile.t4 .tbar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }

/* ── Import card (v6 "first run") — the design's own round check mark, decorative (DEC-086: one
   Import-all button, never a per-row toggle) ────────────────────────────────────────────────── */
.card.import .irow .ick {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--text-3);
  display: grid; place-items: center; color: transparent; flex: none; margin-left: auto;
}
.card.import .irow .ick svg { width: 14px; height: 14px; }
.card.import .irow .ick.on { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }

/* ── 05 Session rows — thumb, bold title, recency dot + the report's own fields, chevron ────── */
.sessions.list { background: var(--card); border-radius: var(--r-card); overflow: hidden; list-style: none; margin: 0; padding: 0; }
.grp + .sessions.list, .sessions.list + .grp { margin-top: 16px; }
a.session.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px;
  position: relative; text-decoration: none; color: inherit;
}
.sessions.list li + li a.session.row::before {
  content: ""; position: absolute; top: 0; left: 66px; right: 0; height: 1px; background: var(--line);
}
a.session.row .thumb { width: 40px; height: 40px; border-radius: 12px; }
a.session.row .tx { flex: 1; min-width: 0; }
a.session.row .tx b.project { display: block; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.session.row .tx small { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 2px; }
a.session.row .end { color: var(--text-3); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.gdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.gdot.idle { background: var(--text-3); }
.grp { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: 16px 4px 8px; }
.grp:first-child { margin-top: 0; }

/* QA pass on the merged reskin: the older phase-01 `.tile`, `.tile h5`, `.tile .see-all` and
   `.card.import h4` rules in app.css outrank or undercut the design here — title and chevron on
   one line, the 26px chevron circle (its ::after keeps the 44px tap area), and the design card. */
.tile.t4 { background: var(--card); border: 0; box-shadow: none; border-radius: var(--r-card); padding: 16px; gap: 0; }
.tile.t4 h5 { display: flex; justify-content: space-between; align-items: center; gap: 4px; color: var(--text); line-height: 1.15; }
.tile.t4 .chev.see-all { min-height: 26px; margin: 0; }
.card.import h4 { font-size: 22px; margin-bottom: 8px; }
.tile.t4 .tl em { white-space: nowrap; }
/* "Not on server yet" is too long for a half-width tile at phone size. When the name and it don't
   fit on one line, the status drops to its own line, right-aligned, so the app's name keeps its
   full width (squeezing the status beside the name left the name 0px wide at 375px). */
.tile.t4 .tl:has(em.long) { flex-wrap: wrap; row-gap: 2px; }
.tile.t4 .tl:has(em.long) > span:nth-child(2) { flex: 1 1 auto; }
.tile.t4 .tl em.long { white-space: normal; text-align: right; line-height: 1.15; margin-left: auto; }
