/* Phase-02 reskin (DEC-127): server screens. Tokens come from app.css :root. */

/* ============================================================================================
   03 · Server rings card (Server screen, `showServer`'s own `renderResourcesCard`).
   `renderRings` (app/rings.mjs) draws `div.rings` itself; the rest of this shape — the card, the
   heading, the SVG ring geometry, the legend numbers and the Live/offline footer — is the
   approved design's own (deckpost-phase02.html), copied here since this is the one screen that
   assembles the card around it.
   ============================================================================================ */
.card h4 {
  font-size: 22px; font-weight: 700; letter-spacing: -.01em;
  display: flex; justify-content: space-between; align-items: center;
}
.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 .num { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.05; color: var(--text); }
.legend .num small { font-size: 15px; font-weight: 600; margin-left: 2px; }
.legend .warn .num { color: var(--ask-tx); }
.lk { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.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; margin-right: 4px; }
/* A stale reading: the design's own "stage stale" — faded rings and numbers, never hidden. */
.card.stale .ring .v { opacity: .45; }
.card.stale .legend .num { opacity: .55; }

/* ============================================================================================
   v3 apps rows (`.arow`), reused by both the Server screen and Summary's own Apps "See all"
   (app/apps-list.mjs's `renderAppRow` — DASH-2's "the full component, not a lighter stand-in").
   ============================================================================================ */
.hsub { font-size: 15px; font-weight: 600; color: var(--text-2); margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
li.arow { padding: 8px 0; list-style: none; }
li.arow + li.arow { border-top: 1px solid var(--line); }
/* Overrides app.css's own older `ul.apps { display:flex; flex-direction:column; gap:10px }`
   (phase-01 e-ink row list) — the design's own apps card stacks `.arow` rows as plain blocks,
   spaced only by their own padding and the `.arow + .arow` divider above, not a flex gap on top. */
ul.apps { list-style: none; margin: 0; padding: 0; display: block; }
a.approw.an {
  display: flex; align-items: center; margin-bottom: 8px;
  background: transparent; border: 0; border-radius: 0; padding: 0;
  text-decoration: none; color: inherit;
}
a.approw.an b { font-size: 15px; font-weight: 600; flex: 1; }
.aic {
  width: 28px; height: 28px; border-radius: 8px; background: var(--card-2);
  display: grid; place-items: center; color: var(--text-2); font-size: 17px; margin-right: 12px; flex: none;
}
.approw .st, .apphead .st { font-size: 13px; color: var(--text-2); }
.approw .st.up, .apphead .st.up { color: var(--ok); font-weight: 600; }
.approw .st.bad, .apphead .st.bad { color: var(--bad); font-weight: 600; }
.approw .res { font-size: 12px; color: var(--text-3); margin-left: 8px; }
.rchev { color: var(--text-3); font-size: 15px; margin-left: 8px; flex: none; }
a.approw.an:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.strip { display: flex; gap: 2px; height: 14px; margin-left: 40px; }
.strip i { flex: 1 1 0; min-width: 1px; border-radius: 2px; background: color-mix(in srgb, var(--ok) 45%, var(--card-2)); opacity: 1; }
.strip i.d { background: var(--bad); }
.strip i.n { background: var(--text-3); }
/* A half-hour with no check at all (collector not yet running then): an empty grey slot. */
.strip i.e { background: var(--card-2); }
/* As the approved design draws it: 4px above, text-2 (its late `.axis{color:var(--text-2)}` override). */
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); margin-top: 4px; }
/* Lines up with the strips above it, which sit 40px in (past the icon tile), as in the design. */
.card > .axis { margin-left: 40px; }

/* ============================================================================================
   App detail (`showAppDetail`): `.apphead`, the current-numbers `.dlist` card.
   ============================================================================================ */
.apphead { display: flex; align-items: center; gap: 16px; }
.apphead .aic.big { width: 52px; height: 52px; border-radius: 14px; font-size: 22px; margin: 0; }
.apphead b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.apphead .st { display: block; }
.apphead .st + .st { margin-top: 2px; }
.dlist { margin-top: 4px; }
.dlist div { display: flex; justify-content: space-between; padding: 12px 0; font-size: 15px; border-top: 1px solid var(--line); }
.dlist div:first-child { border-top: 0; }
.dlist span:last-child { color: var(--text-2); }

/* ============================================================================================
   Empty & error blocks (design's own shared shape) — used here by `emptyCard` (Server, app
   detail) and by `errorScreenWithRetry` (shared across every phase-02 screen, per this round's
   own brief).
   ============================================================================================ */
.card.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 20px; }
.card.empty .ic { font-size: 34px; line-height: 1; }
.card.empty b { font-size: 17px; font-weight: 700; }
.card.empty p { margin: 0; color: var(--text-2); font-size: 15px; }
.card.empty .btn.inline { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; }

/* ============================================================================================
   Account (`showAccount`): centred header, the toggles' own grouped card, the switch look, the
   danger Sign out row.
   ============================================================================================ */
.acct { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 4px; }
.avatar.xl { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: transparent; }
.avatar.xl i {
  width: 76px; height: 76px; border-radius: 50%; border: 2.5px solid var(--accent);
  display: grid; place-items: center; color: var(--accent); font-size: 38px;
}
.acct b { font-size: 22px; margin-top: 12px; }
.acct small { display: block; color: var(--text-2); font-size: 15px; }
.acctgrp {
  font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase;
  letter-spacing: .04em; margin: 24px 4px 8px;
}
.togcard { background: var(--card); border-radius: var(--r-card); overflow: hidden; }
ul.toggles { margin: 0; padding: 0; }
.togrow { padding: 12px 16px; min-height: 60px; }
/* The real `<input type="checkbox">` these switches must stay (tests read them) — restyled to
   look like the design's own iOS switch (`.tog`, 51x31) rather than a native checkbox. */
.togrow input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 51px; height: 31px; min-width: 51px;
  border-radius: 16px; background: var(--card-2); position: relative; flex: none; cursor: pointer;
  transition: background .2s;
}
.togrow input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: left .2s;
}
.togrow input[type="checkbox"]:checked { background: var(--ok); }
.togrow input[type="checkbox"]:checked::after { left: 22px; }
.togrow input[type="checkbox"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .togrow input[type="checkbox"], .togrow input[type="checkbox"]::after { transition: none; }
}
.togcard.signout { margin-top: 24px; }
/* `.btn.ghost.signout-btn` (3 classes) beats app.css's own `.btn.ghost` (2 classes) on specificity
   alone, regardless of file load order — the same reason `input.txt.pw` above is written with
   both classes rather than `.pw` alone. */
.btn.ghost.signout-btn {
  width: 100%; height: auto; min-height: 60px; padding: 12px 16px;
  background: transparent; color: var(--bad); font-size: 17px; font-weight: 600; text-align: left;
  border-radius: 0; justify-content: flex-start; display: flex; align-items: center;
}

/* ============================================================================================
   Sign-in (`renderPassword`, design block "15 Sign-in").
   ============================================================================================ */
/* `.screen.center` (app.css) only centers along the main axis (`justify-content`) — the design's
   own `.signin` also centers cross-axis (the icon, otherwise a fixed-width flex item left-aligned
   under the base `align-items: stretch`) and centers its own text. */
.signin { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 32px 8px 12px; }
.signin .appicon {
  width: 84px; height: 84px; border-radius: 20px; overflow: hidden; position: relative;
  box-shadow: 0 10px 30px rgba(110,134,255,.35);
  background: radial-gradient(circle at 30% 25%, #9DB0FF, #4656E0 55%, #1E2584);
}
.signin .appicon svg.i { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; color: #fff; }
.signin h3 { font-size: 34px; font-weight: 700; margin: 16px 0 24px; letter-spacing: -.02em; }
.signin .pwlabel {
  position: absolute; width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
  clip: rect(0 0 0 0); margin: 0; padding: 0;
}
input.txt.pw {
  width: 100%; height: 52px; font-size: 22px; letter-spacing: .15em; text-align: left;
  border: 1.5px solid transparent; background: var(--card); border-radius: var(--r-ctl); padding: 0 16px;
}
input.txt.pw[aria-invalid="true"] { border-color: var(--bad); }
.signin .errtx {
  background: transparent; color: var(--bad); font-size: 13px; font-weight: 400;
  margin: 8px 0 0; padding: 0; align-self: flex-start;
}
/* Explicit `width: 100%` — centering the column (above) would otherwise leave this auto-width
   button shrunk to its own text, not the design's own full-width blue button. */
.signin .btn { width: 100%; margin-top: 16px; }

/* QA pass: the per-app CPU/RAM line sits on its own line under the name, as a quiet caption,
   so the name and the status never squeeze each other at phone width. */
a.approw.an { flex-wrap: wrap; row-gap: 2px; }
a.approw.an .st { white-space: nowrap; }
a.approw.an .rchev { order: 4; }
a.approw.an .res { order: 5; flex-basis: 100%; margin-left: 40px; }
