/* ALLOT-1907 (P3): the shared components, loaded by the TV web app (/, Settings, Login, Activate,
   the Remote) and the phone PWA (/phone/ and its offline page), after tokens.css and before each
   page's own stylesheet, so a page adds layout to a component but does not restyle it.

   G16: every control is square. Buttons, chips, inputs, the toast, the sheet and the notice carry no
   border-radius (or var(--radius-0)); tiles use var(--radius-tile) (6px TV, 4px phone); round dots
   use var(--radius-dot); var(--radius-pill) is for the neon tubes only. app/test/square-controls.test.mjs
   scans every stylesheet for this.

   Fixed for UX (they animate these): the class names and DOM of the toast (.ps-toast), the sheet
   (.pw-sheet, .pw-sheet-card), the status line (.statusline) and the offline wordmark (.ps-brand
   .ps-logo on the phone, img.mark on the dark screen). Flag any change to UX before making it.

   Everything here loads on the TV, so Chromium 53 rules apply: no grid, no flex gap, no inset, no
   sticky, no aspect-ratio. Custom properties are fine. env() is ignored there and only the phone
   rules use it. No animation or transition hooks are added here. */

/* ---------- button ---------- */
/* TV, desk and the player on a phone */
.btn {
  border-radius: var(--radius-button);
  font-size: var(--type-body);
  color: var(--ink);
  border: 2px solid var(--sky-plum);
  padding: 8px 32px;
  background: var(--sky-top);
  cursor: pointer;
  font-family: var(--font-terminal);
  letter-spacing: 0.04em;
  /* transform only: a box-shadow transition repaints the glow every frame (ZIG-17, M1) */
  transition: transform 120ms ease;
}
/* ALLOT-1519 (G7): focus is the border, the ring and the sky-violet fill (DS L98), as on every
   other focus target (.chip, .tile, .busy-ctl) */
.btn.focus { border-color: var(--neon-pink); box-shadow: var(--focus-ring); background: var(--sky-violet); transform: scale(1.06); }
/* the phone PWA */
.ps-button {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 16px;
  border: 2px solid var(--neon-pink); border-radius: var(--radius-button);
  color: var(--ink); text-decoration: none;
}

/* ---------- status line ---------- */
/* status line (ident family): muted with pink glow; .err = proposed error variant */
.statusline {
  font-size: 37px;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  text-shadow: 0 0 11px var(--neon-pink);
}
.statusline::after { content: "_"; }
.statusline.err { color: var(--error); text-shadow: none; }
.banner .statusline { margin-top: 16px; }

/* ---------- notice (proposed error/prompt component) ---------- */
/* z-index 2: over the title detail's poster and column (z 1) and Home's rails and region list
   (z 2, earlier in the page), so a notice never paints underneath them; under the wayfinding and
   hints (z 2, later in the page), the number entry (3) and the browse nav (50), as before. */
.notice-wrap {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: none;
  z-index: 2;
}
.notice-wrap.on { display: block; }
.notice {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 960px;
  box-sizing: border-box;
  background: var(--sky-top);
  border-top: 4px solid var(--error);
  padding: 40px 48px 48px;
}
.notice.prompt { border-top-color: var(--neon-pink); }
.notice .h { font-size: var(--type-body); color: var(--error); margin: 0 0 12px; }
.notice.prompt .h { color: var(--ink); }
.notice .b { font-size: var(--type-small); color: var(--ink-muted); margin: 0 0 36px; }

/* ---------- toast (phone PWA) ---------- */
.ps-toast { position: fixed; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 3; margin: 0; padding: 12px 16px; background: var(--sky-top); border: 2px solid var(--neon-pink); border-radius: var(--radius-0); color: var(--ink); }

/* ---------- sheet (phone PWA: the choice sheet over Watch) ---------- */
.pw-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 6;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--ground-a85);
}
.pw-sheet-card {
  width: 100%; max-width: 560px;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--ground);
  border-top: 2px solid var(--neon-pink);
  border-radius: var(--radius-0);
  display: flex; flex-direction: column;
}
.pw-sheet-head { margin: 0; font-family: var(--font-display); font-size: var(--type-title); }
.pw-sheet-body { margin: 0; color: var(--ink-muted); }
/* 12px between the card's lines; a margin, as flex gap is newer than the TV's Chromium 53 */
.pw-sheet-card > * + * { margin-top: 12px; }
/* tablets and an open Fold centre the sheet (phone-watch.css), so it takes a full frame */
@media (min-width: 600px) and (min-height: 480px) {
  .pw-sheet-card { border: 2px solid var(--neon-pink); }
}

/* ---------- offline wordmark: the logo in the phone header and on its offline page ---------- */
.ps-brand { display: flex; align-items: center; flex: none; }
/* the Wordmark at 150px (founder decision D2); the alt text reads "Ziggy iPTV Network" */
/* -18px: ZIGGY's ink starts about 18px into the logo's box at 150px, as on the player's phone header */
.ps-logo { display: block; width: 150px; height: 54px; margin-left: -18px; }

/* ---------- channel logos and name tiles (ALLOT-1971, channel-logo-and-fallback-tiles) ----------
   One component on the TV, the phone, Settings and the remote, drawn by assets/ziggy-art.js.
   A logo tile: the logo trimmed of its own empty margins and drawn at about 72% of the tile,
   centred, on a plate picked from its ink (dark plate for light ink, light plate for dark ink, its
   own colour for a logo with a solid background), so the image fills the tile 1:1 and no CSS
   inset is added on top. A name tile: the name in the display face on one of eight tints, picked
   from the cleaned name; it steps down to a short name, then initials, only when it won't fit.
   The name tile is drawn first and the logo only replaces it once drawn: nothing moves. */
.zart-fb {
  position: absolute !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  width: auto !important; height: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 6% 8% !important;
  overflow: hidden;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: 0 !important;
  text-align: center;
  text-transform: none;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  color: var(--ink) !important;
  transform: none !important;
  text-shadow: none;
  background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, 0.18)) !important;
}
.zart-fb[data-mode="initials"] { letter-spacing: 0.04em !important; }
.zart-t1 { background-color: var(--tile-tint-1) !important; }
.zart-t2 { background-color: var(--tile-tint-2) !important; }
.zart-t3 { background-color: var(--tile-tint-3) !important; }
.zart-t4 { background-color: var(--tile-tint-4) !important; }
.zart-t5 { background-color: var(--tile-tint-5) !important; }
.zart-t6 { background-color: var(--tile-tint-6) !important; }
.zart-t7 { background-color: var(--tile-tint-7) !important; }
.zart-t8 { background-color: var(--tile-tint-8) !important; }
/* the plate: the same rounded tile behind every logo; "self" carries the logo's own colour inline */
[data-plate] { border-radius: var(--radius-tile); }
[data-plate="dark"] { background: var(--logo-plate-dark) !important; }
[data-plate="light"] { background: var(--logo-plate-light) !important; }
[data-plate="self"] { background-image: none !important; }
/* ALLOT-1971: an opaque logo is drawn as its own rounded card, in its own shape, on the dark plate */
[data-plate="card"] { background: var(--logo-plate-dark) !important; }
/* the drawn logo is already the tile's size and fit: no stretch, no extra inset */
img[data-fmt="1"] { object-fit: fill !important; padding: 0 !important; box-sizing: border-box; }
