/* «Свой сервер» — the owner's page.

   The look is przma's design system "Lumen", COPIED here, not imported: this
   server ships on its own and its code reaches into no other package (the wall
   between the products). Origins:
     tokens     packages/przma/web/src/styles/theme.css   (only the ones this page reads)
     scale      packages/przma/web/src/styles/global.css  (10px root, 11px at <= 900px;
                the motion tokens and the Manrope @font-face)
     fonts      packages/przma/web/public/fonts           (Manrope, OFL: fonts/OFL.txt)
     the page   packages/przma/web/lab/mockups/home-server.css, the approved mockup (removed from the lab 2026-11-07, in git)
   If przma's theme changes, this is changed by hand, on purpose.

   Colour only through var(--c-*). Chrome 79 / Safari 13 floor: no flex gap, inset,
   aspect-ratio, :is(). No inline style anywhere: the server's policy forbids it. */

/* Manrope, served from this server: the page loads nothing from anywhere else. */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  font-size: 10px;
  color-scheme: dark;

  --ramp-violet-400: #6f5cff;
  --ramp-sky-400: #7fc4ff;
  --ramp-mint-300: #6ff0d0;
  --ramp-beam-600: #3560c8;
  --ramp-beam-700: #5344cc;
  --ramp-white: #eef2ff;
  --ramp-ink: #04101f;
  --ramp-red-400: #ff4f6b;
  --ramp-amber-400: #ffb454;
  --ramp-green-400: #4fd98a;

  --c-bg: #04060e;
  --c-bg-elevated: #090d1a;
  --c-bg-tint: #0b1024;
  --c-surface: rgba(12, 17, 32, 0.78);
  --c-surface-strong: rgba(24, 34, 62, 0.86);
  --c-surface-soft: rgba(170, 195, 255, 0.05);
  --c-border: rgba(170, 195, 255, 0.12);
  --c-border-strong: rgba(170, 195, 255, 0.26);
  --c-rim: rgba(255, 255, 255, 0.1);

  --c-accent: #8ccdff;
  --c-accent-dim: rgba(79, 141, 255, 0.34);
  --c-accent-soft: rgba(79, 141, 255, 0.14);
  --c-on-accent: var(--ramp-ink);

  --gradient-spectrum: linear-gradient(90deg, var(--ramp-violet-400), var(--ramp-sky-400) 52%, var(--ramp-mint-300));
  --gradient-beam-deep: linear-gradient(160deg, var(--ramp-beam-600), var(--ramp-beam-700));
  --gradient-beam-lit: linear-gradient(160deg, #4d84ee, #6b5df0);

  --c-text: var(--ramp-white);
  --c-text-soft: rgba(238, 242, 255, 0.86);
  --c-text-dim: rgba(238, 242, 255, 0.66);
  --c-text-faint: rgba(238, 242, 255, 0.4);

  --c-danger: var(--ramp-red-400);
  --c-warn: var(--ramp-amber-400);
  --c-ok: var(--ramp-green-400);
  --c-source-soft: rgba(255, 180, 84, 0.14);
  --c-focus-ring: rgba(255, 255, 255, 0.55);
  --c-hover-border: rgba(230, 238, 255, 0.45);
  --c-hover-bg: var(--c-surface-strong);
  --c-track: rgba(255, 255, 255, 0.14);

  --shadow-rim: inset 0 0.1rem 0 var(--c-rim), inset 0 -0.1rem 0 rgba(0, 0, 0, 0.25);
  --plates-idle: -0.15rem 0.15rem 0 rgba(124, 108, 255, 0.85), 0.15rem -0.15rem 0 rgba(111, 240, 208, 0.8);
  --plates-focus: -0.32rem 0.32rem 0 #7c6cff, 0.32rem -0.32rem 0 var(--ramp-mint-300);
  --plates-lift: -0.22rem 0.22rem 0 #7c6cff, 0.22rem -0.22rem 0 var(--ramp-mint-300);
  --plates-hover-micro: -0.12rem 0.12rem 0 rgba(111, 92, 255, 0.4), 0.12rem -0.12rem 0 rgba(111, 240, 208, 0.35);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 120ms;
  --dur-slow: 320ms;
  --fx-loop: running;

  --font: 'Manrope', 'Segoe UI Variable Display', 'Segoe UI', Roboto, system-ui, sans-serif;
}

/* A phone: the same prism on a denser scale. */
@media (max-width: 900px) {
  :root { font-size: 11px; }
}

/* Less motion, asked for in the system: loops stop, tweens are instant. */
@media (prefers-reduced-motion: reduce) {
  :root { --fx-loop: paused; --dur-fast: 0.01ms; --dur-slow: 0.01ms; }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--c-bg); color: var(--c-text); font-family: var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }

/* ---- the page (from the mockup) --------------------------------------- */

/* The page scrolls as a document; global.css pins html/body for the TV. */
html { overflow: auto; }
body { overflow: visible; }
html, body { height: auto; }
body { background: var(--c-bg); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---- frame ------------------------------------------------------------- */

.shell {
  position: relative;
  min-height: 100vh;
  padding-bottom: calc(9rem + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(120% 50rem at 50% 0%, var(--c-bg-tint) 0%, var(--c-bg) 70%) no-repeat;
}
.side { position: relative; }

.top { padding: 1.6rem 6.4rem 0 1.6rem; }
.brand { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.1rem; align-items: center; }
.brand img { width: 3.4rem; height: 3.4rem; display: block; }
.brand b { display: block; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.brand small { display: block; font-size: 1.1rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-text-faint); margin-bottom: 0.2rem; }

.logout {
  position: absolute;
  top: 1.2rem;
  right: 0.8rem;
  padding: 1rem 0.8rem;
  min-height: 4.4rem;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--c-text-dim);
  background: none;
  border: 0;
  cursor: pointer;
}
.logout:hover { color: var(--c-text); }
.logout:focus-visible { outline: none; color: var(--c-text); box-shadow: 0 0.2rem 0 var(--c-accent); }

/* Phone: the four places sit in a bar under the thumb. */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--c-bg-elevated);
  border-top: 0.1rem solid var(--c-border-strong);
}
.nav a {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  row-gap: 0.4rem;
  min-height: 6.8rem;
  padding: 0.8rem 0.4rem;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--c-text-dim);
}
.nav a svg { width: 2.4rem; height: 2.4rem; }
.nav a[aria-current='page'] { color: var(--c-text); background: var(--c-accent-soft); box-shadow: inset 0 0.3rem 0 var(--c-accent); }
.nav a:focus-visible { outline: none; color: var(--c-text); box-shadow: inset 0 0 0 0.2rem var(--c-focus-ring); }
.nav .ico { position: relative; }
.nav a > .badge { display: none; }

/* A number that needs the owner: on the icon at the bar, after the label at the side. */
.badge {
  position: absolute;
  top: -0.6rem;
  right: -1.2rem;
  min-width: 1.8rem;
  padding: 0.1rem 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: var(--c-on-accent);
  background: var(--c-accent);
}

/* ---- content ----------------------------------------------------------- */

.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 2.8rem;
  align-content: start;
  max-width: 70rem;
  margin: 0 auto;
  padding: 2.4rem 1.6rem 2rem;
}
.content > * { min-width: 0; animation: rise var(--dur-slow) var(--ease) both; }
.content > *:nth-child(2) { animation-delay: 60ms; }
.content > *:nth-child(3) { animation-delay: 120ms; }
.content > *:nth-child(4) { animation-delay: 180ms; }
@keyframes rise { from { opacity: 0; transform: translateY(1.2rem); } to { opacity: 1; transform: none; } }

.title h1 { font-size: 3.2rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.title p { margin-top: 0.8rem; font-size: 1.6rem; line-height: 1.5; color: var(--c-text-dim); max-width: 52ch; }

.sec-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 1rem; margin-bottom: 1.2rem; }
.sec-head h2 { font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; }
.count { justify-self: start; padding: 0.2rem 0.9rem; font-size: 1.3rem; font-weight: 700; color: var(--c-text-dim); background: var(--c-surface-soft); border: 0.1rem solid var(--c-border); }
.count.live { color: var(--c-on-accent); background: var(--c-accent); border-color: var(--c-accent); }

.card {
  position: relative;
  background: var(--c-surface);
  border: 0.1rem solid var(--c-border);
  box-shadow: var(--shadow-rim);
  padding: 2rem;
}
.card > h2 { font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; }
.card > h2 + p, .card .lead { margin-top: 0.8rem; font-size: 1.5rem; line-height: 1.5; color: var(--c-text-dim); }

/* ---- controls ---------------------------------------------------------- */

.field { display: block; margin-top: 2rem; }
.field > span, .field > .lbl { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; font-size: 1.4rem; color: var(--c-text-dim); margin-bottom: 0.8rem; }
.field > .lbl label { cursor: pointer; }
.field > .lbl button { font: inherit; font-size: 1.3rem; font-weight: 600; color: var(--c-accent); background: none; border: 0; padding: 0.4rem 0; cursor: pointer; }
.field input, .code-in {
  display: block;
  width: 100%;
  min-height: 5.2rem;
  padding: 1.3rem 1.6rem;
  font: inherit;
  font-size: 1.8rem;
  color: var(--c-text);
  background: var(--c-bg-elevated);
  border: 0.1rem solid var(--c-border-strong);
  box-shadow: inset 0 0.1rem 0.4rem rgba(0, 0, 0, 0.35);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder, .code-in::placeholder { color: var(--c-text-faint); }
.field input:focus, .code-in:focus { outline: none; border-color: var(--c-focus-ring); box-shadow: var(--plates-focus); }
.hint { margin-top: 0.8rem; font-size: 1.3rem; line-height: 1.4; color: var(--c-text-faint); }

/* The TV's four characters: read at a glance, typed on a phone. */
.code-in { font-size: 2.8rem; font-weight: 700; letter-spacing: 0.5em; text-align: center; text-transform: uppercase; padding-left: 2.1rem; }
.code-in::placeholder { letter-spacing: 0.5em; }

.btn {
  display: block;
  width: 100%;
  min-height: 5.2rem;
  padding: 1.3rem 2.2rem;
  font: inherit;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--gradient-beam-deep);
  border: 0;
  border-radius: 0;
  box-shadow: var(--plates-idle), inset 0 0 0 0.1rem rgba(200, 220, 255, 0.28);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease);
}
@media (hover: hover) {
  .btn:hover { background: var(--gradient-beam-lit); box-shadow: var(--plates-lift), inset 0 0 0 0.1rem rgba(200, 220, 255, 0.28); }
}
.btn:focus-visible { outline: none; background: var(--gradient-beam-lit); box-shadow: var(--plates-focus), inset 0 0 0 0.1rem var(--c-focus-ring); }
.btn:active { transform: translateY(0.1rem); }
.btn:disabled { cursor: default; opacity: 0.55; box-shadow: none; background: var(--c-surface-strong); color: var(--c-text-dim); transform: none; }
.btn.quiet {
  color: var(--c-text);
  background: var(--c-surface-strong);
  box-shadow: inset 0 0 0 0.1rem var(--c-border-strong);
}
@media (hover: hover) {
  .btn.quiet:hover { background: var(--c-hover-bg); box-shadow: inset 0 0 0 0.1rem var(--c-hover-border), var(--plates-hover-micro); }
}
.btn.quiet:focus-visible { box-shadow: inset 0 0 0 0.1rem var(--c-focus-ring), var(--plates-focus); background: var(--c-surface-strong); }
.btn.danger { color: var(--c-danger); }
.btn.small { width: auto; min-height: 4.4rem; padding: 1rem 1.6rem; font-size: 1.5rem; }
.btn.link { width: auto; min-height: 4.4rem; background: none; box-shadow: none; color: var(--c-accent); padding: 1rem 0; text-align: left; }
.btn.link:hover { background: none; box-shadow: none; text-decoration: underline; text-underline-offset: 0.25em; }
.btn.link:focus-visible { background: none; box-shadow: none; text-decoration: underline; text-underline-offset: 0.25em; }

.error { margin-top: 1.4rem; padding: 1.2rem 1.4rem; font-size: 1.4rem; line-height: 1.45; color: var(--c-text); background: rgba(255, 79, 107, 0.12); box-shadow: inset 0.3rem 0 0 var(--c-danger); }

/* ---- sign-in ----------------------------------------------------------- */

.auth { min-height: 100vh; background: radial-gradient(120% 50rem at 50% 0%, var(--c-bg-tint) 0%, var(--c-bg) 70%) no-repeat; display: grid; align-items: center; justify-items: center; padding: 3rem 1.6rem 4rem; }
.auth .card { width: 100%; max-width: 46rem; padding: 3rem 2.4rem 2.6rem; animation: rise var(--dur-slow) var(--ease) both; }
.auth .card::before { content: ''; position: absolute; top: -0.1rem; left: -0.1rem; right: -0.1rem; height: 0.3rem; background: var(--gradient-spectrum); }
.auth .logo { display: grid; grid-auto-flow: column; justify-content: start; align-items: center; column-gap: 1.2rem; margin-bottom: 2.6rem; }
.auth .logo img { width: 4.4rem; height: 4.4rem; display: block; }
.auth .logo b { font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; }
.auth .logo small { display: block; font-size: 1.1rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-text-faint); font-weight: 500; margin-bottom: 0.2rem; }
.auth h1 { font-size: 3rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.auth h1 + p { margin-top: 1rem; font-size: 1.6rem; line-height: 1.5; color: var(--c-text-dim); }
.auth .btn { margin-top: 2.4rem; }

/* ---- connect a TV ------------------------------------------------------ */

.connect form { margin-top: 2rem; }
.connect h2 { font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; }
.connect .field { margin-top: 0; }
.connect .btn { margin-top: 1.4rem; }

.waiting { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.6rem; align-items: start; }
.waiting .sent { padding: 0.8rem 0 0.8rem 0.5em; font-size: 2.6rem; font-weight: 700; letter-spacing: 0.5em; color: var(--c-accent); background: var(--c-accent-soft); text-align: center; min-width: 12rem; }
.waiting h2 { font-size: 2rem; font-weight: 600; line-height: 1.25; }
.waiting p { margin-top: 0.6rem; font-size: 1.5rem; line-height: 1.5; color: var(--c-text-dim); }
.waiting .btn.link { margin-top: 0.4rem; }
.dots { display: inline-grid; grid-auto-flow: column; column-gap: 0.3rem; margin-left: 0.6rem; vertical-align: 0.1rem; }
.dots i { width: 0.5rem; height: 0.5rem; background: var(--c-accent); animation: blink 1.2s var(--ease) infinite; animation-play-state: var(--fx-loop, running); }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* A live request: the thing the owner came to do. */
.req { padding: 0; box-shadow: inset 0.3rem 0 0 var(--c-accent), var(--shadow-rim); background: linear-gradient(90deg, var(--c-accent-soft), var(--c-surface) 60%); }
.req .in { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 1.6rem; padding: 2rem 2rem 2rem 2.3rem; }
.req h3 { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1rem; align-items: center; font-size: 1.8rem; font-weight: 600; line-height: 1.3; }
.req p { margin-top: 0.6rem; font-size: 1.4rem; line-height: 1.5; color: var(--c-text-dim); }
.code { display: inline-block; padding: 0.1rem 0.7rem; font-size: 1.5rem; font-weight: 700; letter-spacing: 0.12em; color: var(--c-text); background: var(--c-surface-strong); border: 0.1rem solid var(--c-border-strong); font-variant-numeric: tabular-nums; }
.pulse { width: 1rem; height: 1rem; background: var(--c-accent); box-shadow: 0 0 0 0 var(--c-accent-dim); animation: ping 1.8s var(--ease) infinite; animation-play-state: var(--fx-loop, running); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--c-accent-dim); } 70%, 100% { box-shadow: 0 0 0 0.9rem rgba(79, 141, 255, 0); } }

/* ---- lists ------------------------------------------------------------- */

.list { background: var(--c-surface); border: 0.1rem solid var(--c-border); box-shadow: var(--shadow-rim); }
.list > li { padding: 1.6rem 1.8rem; border-top: 0.1rem solid var(--c-border); }
.list > li:first-child { border-top: 0; }

.tv { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 1.4rem; align-items: center; }
.tv .ic { display: grid; place-items: center; width: 4.4rem; height: 4.4rem; color: var(--c-accent); background: var(--c-accent-soft); }
.tv .ic svg { width: 2.4rem; height: 2.4rem; }
.tv b { display: block; font-size: 1.7rem; font-weight: 600; line-height: 1.3; }
.tv span { display: block; margin-top: 0.2rem; font-size: 1.4rem; line-height: 1.4; color: var(--c-text-faint); }
.tv .btn { justify-self: end; }
.tv.ask { grid-template-columns: minmax(0, 1fr); row-gap: 1.4rem; }
.tv.ask p { font-size: 1.5rem; line-height: 1.5; color: var(--c-text); }
.tv.ask .acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
.tv.ask .btn { width: 100%; }

.steps { counter-reset: s; margin-top: 1.6rem; display: grid; row-gap: 1.4rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.4rem; align-items: start; font-size: 1.5rem; line-height: 1.5; color: var(--c-text-soft); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 3rem; height: 3rem; font-size: 1.4rem; font-weight: 700; color: var(--c-accent); background: var(--c-accent-soft); }
.steps li span { padding-top: 0.3rem; }
.empty .tvmark { width: 5.6rem; height: 5.6rem; display: grid; place-items: center; color: var(--c-accent); background: var(--c-accent-soft); margin-bottom: 1.4rem; }
.empty .tvmark svg { width: 3.2rem; height: 3.2rem; }

/* ---- folders ----------------------------------------------------------- */

.folders { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 1.6rem; }
.folder { display: grid; row-gap: 1.6rem; }
.folder h2 { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.015em; }
.counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.2rem; }
.counts div { padding: 1.2rem 1.4rem; background: var(--c-surface-soft); box-shadow: inset 0 0.2rem 0 var(--c-border-strong); }
.counts dt { order: 2; font-size: 1.3rem; color: var(--c-text-dim); }
.counts dd { font-size: 3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.counts div { display: grid; }
.counts .zero dd { color: var(--c-text-faint); }
.folder .when { font-size: 1.4rem; color: var(--c-text-faint); }
.scan { display: grid; row-gap: 0.9rem; }
.scan p { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1rem; align-items: center; font-size: 1.5rem; color: var(--c-text); }
.scan p b { font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 0.5rem; overflow: hidden; background: var(--c-track); }
.bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 38%; background: var(--gradient-spectrum); animation: slide 1.6s var(--ease) infinite; animation-play-state: var(--fx-loop, running); }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(270%); } }

/* ---- files that do not play yet ---------------------------------------- */

.note { padding: 1.6rem 1.8rem; font-size: 1.5rem; line-height: 1.5; color: var(--c-text); background: var(--c-accent-soft); box-shadow: inset 0.3rem 0 0 var(--c-accent); }
.note b { font-weight: 600; }
.file b { display: block; font-size: 1.5rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.file .why { margin-top: 0.8rem; display: flex; flex-wrap: wrap; margin-left: -0.6rem; }
.file .why > * { margin: 0.6rem 0 0 0.6rem; }
.file .where { margin-top: 0.3rem; font-size: 1.3rem; line-height: 1.4; color: var(--c-text-faint); overflow-wrap: anywhere; }
.file p { margin-top: 0.8rem; font-size: 1.3rem; line-height: 1.45; color: var(--c-text-faint); }
.tag { display: inline-block; padding: 0.3rem 1rem; font-size: 1.3rem; font-weight: 600; line-height: 1.3; color: var(--c-warn); background: var(--c-source-soft); border: 0.1rem solid rgba(255, 180, 84, 0.28); }
.tag.bad { color: var(--c-danger); background: rgba(255, 79, 107, 0.12); border-color: rgba(255, 79, 107, 0.3); }
.more { font-size: 1.3rem; color: var(--c-text-faint); }

/* ---- approve (the TV's QR) --------------------------------------------- */

.approve { text-align: center; padding: 3rem 2rem 2.6rem; }
.approve::before { content: ''; position: absolute; top: -0.1rem; left: -0.1rem; right: -0.1rem; height: 0.3rem; background: var(--gradient-spectrum); }
.approve .tvmark { width: 6.4rem; height: 6.4rem; margin: 0 auto 1.8rem; display: grid; place-items: center; color: var(--c-accent); background: var(--c-accent-soft); }
.approve .tvmark svg { width: 3.6rem; height: 3.6rem; }
.approve h1 { font-size: 2.8rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.approve .lead { margin: 1rem auto 0; max-width: 34ch; font-size: 1.6rem; line-height: 1.5; color: var(--c-text-dim); }
.approve .big { display: block; margin: 2.2rem auto 0; padding: 1.2rem 1.4rem 1.2rem 2rem; max-width: 34rem; font-size: 2.6rem; font-weight: 700; letter-spacing: 0.18em; background: var(--c-bg-elevated); border: 0.1rem solid var(--c-border-strong); font-variant-numeric: tabular-nums; }
.approve .hint { max-width: 34ch; margin: 1rem auto 0; }
.approve .btn { margin: 2.4rem auto 0; max-width: 34rem; }
.approve .btn.link { display: block; margin: 0.8rem auto 0; text-align: center; max-width: none; width: auto; }

/* ---- the shelf on the TV ------------------------------------------------ */

/* A picture of the row the TV will get: five posters under its name. */
.tvrow { padding: 1.8rem 1.8rem 2rem; overflow: hidden; background: linear-gradient(180deg, var(--c-bg-elevated), var(--c-surface)); }
.tvrow .rowname { font-size: 1.5rem; font-weight: 600; letter-spacing: 0.01em; color: var(--c-text-dim); }
.posters { margin-top: 1.2rem; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 0.8rem; }
.posters i { display: block; height: 0; padding-top: 148%; box-shadow: inset 0 0 0 0.1rem rgba(255, 255, 255, 0.08); transition: opacity var(--dur-slow) var(--ease); }
.posters i:nth-child(1) { background: linear-gradient(160deg, #27406f, #101a33); }
.posters i:nth-child(2) { background: linear-gradient(160deg, #6a3a52, #241426); }
.posters i:nth-child(3) { background: linear-gradient(160deg, #2f6a5d, #0f2a2a); }
.posters i:nth-child(4) { background: linear-gradient(160deg, #7a5a2c, #2a1e0f); }
.posters i:nth-child(5) { background: linear-gradient(160deg, #4a3d85, #17133a); }
.tvrow.dim .posters { opacity: 0.55; filter: saturate(0.6); }
.tvrow.half .posters i:nth-child(n + 4) { opacity: 0.4; }
.sub { margin: -0.4rem 0 1.4rem; font-size: 1.5rem; line-height: 1.5; color: var(--c-text-dim); max-width: 56ch; }

.key form { margin-top: 0; }
.key .lead { max-width: 56ch; }
.key .field { margin-top: 1.8rem; }
.key .field.bad input { border-color: var(--c-danger); }
.key .error { margin-top: 1.4rem; }
.key .error b { font-weight: 600; }
.how { display: inline-grid; grid-template-columns: auto auto; column-gap: 0.6rem; align-items: center; min-height: 4.4rem; margin-top: 0.4rem; font-size: 1.5rem; font-weight: 600; color: var(--c-accent); text-decoration: none; }
.how svg { width: 1.6rem; height: 1.6rem; }
.how:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.how:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 0.25em; box-shadow: 0 0.2rem 0 var(--c-accent); }
.key .btn { margin-top: 1rem; }
.key .btn.link { margin-top: 0.4rem; }

/* Counting: the big number is what the owner glances at. */
.status .head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.8rem; align-items: baseline; }
.status h2 { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1rem; align-items: center; font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.status .num { white-space: nowrap; font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.status .num small { font-size: 1.3rem; font-weight: 500; color: var(--c-text-dim); letter-spacing: 0; }
.status .done { width: 2.2rem; height: 2.2rem; color: var(--c-ok); stroke-width: 2.4; }
.bar.fill { margin-top: 1.4rem; height: 0.8rem; }
.bar.fill i { right: auto; width: 0; animation: none; transition: width var(--dur-slow) var(--ease); }
.bar.fill.ok i { background: var(--c-ok); }
.status .lead { margin-top: 1.2rem; }

.keyset { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.4rem; row-gap: 1.4rem; align-items: center; padding: 1.6rem 1.8rem; }
.keyset .ic { display: grid; place-items: center; width: 4.4rem; height: 4.4rem; color: var(--c-accent); background: var(--c-accent-soft); }
.keyset .ic svg { width: 2.4rem; height: 2.4rem; }
.keyset .what b { display: block; font-size: 1.7rem; font-weight: 600; line-height: 1.3; }
.keyset .mask { display: block; margin-top: 0.2rem; font-size: 2rem; line-height: 1.2; letter-spacing: 0.08em; color: var(--c-text-faint); }
.keyset .acts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
.keyset .acts .btn { width: 100%; }

/* «Убрать ключ?»: asked once, like disconnecting a TV. */
.keyask { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 1.4rem; padding: 1.6rem 1.8rem; }
.keyask p { font-size: 1.5rem; line-height: 1.5; color: var(--c-text); }
.keyask p b { font-weight: 600; }
.keyask .acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }

/* One file the server could not recognise: its name, where it lies, a link. */
.miss b { display: block; font-size: 1.6rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.miss .where { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.7rem; align-items: center; margin-top: 0.5rem; font-size: 1.3rem; line-height: 1.4; color: var(--c-text-faint); overflow-wrap: anywhere; }
.miss .where svg { width: 1.6rem; height: 1.6rem; }
.miss .link { margin-top: 0.4rem; }
.miss .link .field { margin-top: 1.2rem; }
.miss .link .field input { min-height: 4.8rem; font-size: 1.6rem; padding: 1rem 1.4rem; }
.miss .link .btn { margin-top: 1rem; }
.miss .error { margin-top: 1rem; }
.list > li.accepted { background: linear-gradient(90deg, rgba(60, 200, 130, 0.1), transparent 70%); box-shadow: inset 0.3rem 0 0 var(--c-ok); }
.got { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.9rem; align-items: start; margin-top: 1.2rem; font-size: 1.5rem; line-height: 1.5; color: var(--c-text); }
.got svg { width: 2rem; height: 2rem; margin-top: 0.1rem; color: var(--c-ok); stroke-width: 2.4; }
.got span b { display: inline; font-size: inherit; font-weight: 600; }
.showmore { margin-top: 1.2rem; }

/* ---- laptop ------------------------------------------------------------ */

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 30rem minmax(0, 1fr); padding-bottom: 0; }
  .side {
    position: sticky;
    top: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 3.6rem 2rem 3rem;
    border-right: 0.1rem solid var(--c-border);
    background: linear-gradient(to bottom, rgba(9, 13, 26, 0.6), rgba(9, 13, 26, 0.2));
  }
  .top { padding: 0 1.2rem; }
  .brand img { width: 4rem; height: 4rem; }
  .brand b { font-size: 2.2rem; }
  .nav { position: static; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; row-gap: 0.6rem; margin-top: 3.2rem; padding: 0; background: none; border: 0; }
  .nav a {
    grid-template-columns: auto minmax(0, 1fr) auto;
    justify-items: start;
    column-gap: 1.4rem;
    min-height: 5.2rem;
    padding: 1rem 1.4rem;
    font-size: 1.6rem;
    text-align: left;
    background: transparent;
  }
  .nav a[aria-current='page'] { background: var(--c-surface-strong); box-shadow: inset 0.3rem 0 0 var(--c-accent), var(--shadow-rim); }
  .nav a:hover:not([aria-current='page']) { color: var(--c-text); background: var(--c-surface-soft); }
  .nav .ico { display: grid; }
  .nav a > .badge { display: block; position: static; justify-self: end; }
  .nav .ico .badge { display: none; }
  .logout { position: absolute; top: auto; right: auto; bottom: 0; left: 1.4rem; padding: 1rem 0; font-size: 1.5rem; }

  .content { max-width: 82rem; padding: 4.8rem 5.6rem 6rem; margin: 0; row-gap: 3.2rem; }
  .title h1 { font-size: 3.8rem; }
  .title p { font-size: 1.8rem; }
  .card { padding: 2.6rem 2.8rem; }
  .connect { display: grid; grid-template-columns: minmax(0, 1fr) 31rem; column-gap: 4rem; align-items: center; }
  .connect form { margin-top: 0; }
  .connect > div > .lead { max-width: 40ch; }
  .req .in { grid-template-columns: minmax(0, 1fr) auto; column-gap: 2.4rem; align-items: center; padding: 2.4rem 2.8rem 2.4rem 3.1rem; }
  .req .btn { width: auto; min-width: 18rem; }
  .list > li { padding: 1.8rem 2.4rem; }
  .folders { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  .folder .btn { width: auto; justify-self: start; }
  .auth .card { padding: 4rem 3.6rem 3.4rem; }
  .approve { padding: 4.4rem 4rem 3.6rem; }
  .tvrow { padding: 2.2rem 2.8rem 2.6rem; }
  .posters { column-gap: 1.2rem; max-width: 58rem; }
  .keyset { grid-template-columns: auto minmax(0, 1fr) auto; }
  .keyset .acts { grid-column: auto; column-gap: 1rem; }
  .keyset .acts .btn { width: auto; }
  .keyask { grid-template-columns: minmax(0, 1fr) auto; column-gap: 2.4rem; align-items: center; padding: 2rem 2.8rem; }
  .keyask .acts .btn { width: auto; }
  .key form { max-width: 52rem; }
  .miss { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); column-gap: 3rem; align-items: start; }
  .miss > b, .miss > .where { grid-column: 1; }
  .miss .link, .miss .got { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; align-self: center; }
  .miss .link { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; align-items: end; }
  .miss .link .field { margin-top: 0; }
  .miss .link .btn { width: auto; margin-top: 0; min-height: 4.8rem; }
  .miss > .error { grid-column: 2; grid-row: 3; }
  .showmore { width: auto; }
}


/* ---- what the live page adds to the mockup ---------------------------- */

/* One section of the shell at a time; app.js sets data-route. */
.shell[data-route='tvs'] [data-view]:not([data-view='tvs']),
.shell[data-route='folders'] [data-view]:not([data-view='folders']),
.shell[data-route='not-playing'] [data-view]:not([data-view='not-playing']),
.shell[data-route='shelf'] [data-view]:not([data-view='shelf']) { display: none; }

.boot { min-height: 100vh; display: grid; place-items: center; padding: 3rem 1.6rem; font-size: 1.5rem; color: var(--c-text-faint); }

.auth .card .btn + .btn.link { margin-top: 0.8rem; }
.auth .error { margin-top: 1.8rem; }
.auth .error + .btn { margin-top: 1.4rem; }
.connect .btn:disabled, .auth .btn:disabled { cursor: default; }

/* An answered request waits for its TV: calm instead of urgent. */
.req.done { box-shadow: inset 0.3rem 0 0 var(--c-border-strong), var(--shadow-rim); background: var(--c-surface); }
.req.done .pulse { background: var(--c-text-faint); box-shadow: none; animation: none; }
.req.done .btn { color: var(--c-text-dim); }

/* Scanning is the whole library's, so it is told once, over the folders. */
.scanning { grid-column: 1 / -1; }
.folder .when + .btn { margin-top: 0; }
.folder .error { margin-top: 0; }

.empty-line { font-size: 1.5rem; line-height: 1.5; color: var(--c-text-dim); }
.more { padding: 1.2rem 1.8rem; border: 0.1rem solid var(--c-border); border-top: 0; background: var(--c-surface); }
/* Under «Не узнал» it is a quiet line after the list (and its «Показать ещё»), as in the mockup. */
.more.rest { margin-top: 1.2rem; padding: 0; border: 0; background: none; }
.file .tag { white-space: normal; }
.approve .error { text-align: left; }

@media (min-width: 1024px) {
  .folders .scanning { padding: 2rem 2.8rem; }
}
