/* ==========================================================================
   Base / layout — designed on a 1920x1080 canvas.
   1rem = 16px at 1920px wide and scales with the viewport, so the layout is
   identical whether the WebView reports 1920x1080 or 960x540 @2x.
   ========================================================================== */
:root {
  --bg: #0b0b0d;
  --surface: #1b1b20;
  --surface-2: #26262d;
  --border: #33333d;
  --text: #ffffff;
  --muted: #b9bec9;
  --accent: #00a8e8;
  --ok: #3ddc84;
  --safe: 5vw; /* TV overscan-safe margin */
}

* { box-sizing: border-box; }

html {
  font-size: calc(100vw / 120);
  background: var(--bg);
}

body {
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden; /* the window itself never scrolls */
  padding: var(--safe);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: radial-gradient(120% 120% at 20% 0%, #15151b 0%, var(--bg) 60%);
  color: var(--text);
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.5rem; /* 24px @1080p — readable from a couch */
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* Top bar ------------------------------------------------------------- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 1rem; }
.brand h1 { margin: 0; font-size: 2.5rem; letter-spacing: .01em; }
.brand__mark {
  width: 2.75rem; height: 2.75rem; border-radius: .75rem;
  background: var(--accent);
  box-shadow: inset 0 0 0 .3rem #0b0b0d, 0 0 0 .2rem var(--accent);
}
.clock { text-align: right; }
.clock__time { font-size: 2.5rem; font-weight: 700; }
.clock__date { font-size: 1.25rem; color: var(--muted); }

/* Dashboard grid -------------------------------------------------------- */
.dashboard {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 1.5rem 1.25rem .5rem;
  background: var(--surface);
  border: .125rem solid var(--border);
  border-radius: 1.25rem;
}
.card__head {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 0 .5rem .75rem;
}
.card__head h2 { margin: 0; font-size: 2rem; }
.card__sub { margin-top: .15rem; font-size: 1.2rem; color: var(--muted); }
.card--error { grid-column: 1 / -1; align-items: flex-start; gap: 1rem; }
.muted { color: var(--muted); }

/* Scrolling lists. Padding leaves room for the focus scale + glow. */
.scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem 1.1rem 1.5rem;
}
.scroll::-webkit-scrollbar { display: none; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.empty { padding: 1.5rem .5rem; color: var(--muted); font-size: 1.4rem; }

/* Footer hints / toast -------------------------------------------------- */
.hints {
  flex: none;
  display: flex;
  gap: 2.5rem;
  color: var(--muted);
  font-size: 1.2rem;
}
kbd {
  display: inline-block;
  margin-right: .5rem;
  padding: .1rem .6rem;
  border: .1rem solid var(--muted);
  border-radius: .4rem;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe) + 2.5rem);
  transform: translate(-50%, 1rem);
  max-width: 60vw;
  padding: .9rem 2rem;
  background: #ffffff;
  color: #101014;
  border-radius: 999px;
  font-size: 1.4rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
