@import url('./poker.css?v=b01f7bc2e77c');
@import url('./blackjack.css?v=72f9f233eb6d');
@import url('./solitaire.css?v=b0d3b2d5df03');
@import url('./game-rules.css?v=2e67dad3bbe0');
@import url('./game-results.css?v=e8955aa1c101');
@import url('./music-runner.css?v=a41804e620a8');
@import url('./song-quiz.css?v=b096332e5fb0');
@import url('./document-pages.css?v=86f0191e4211');
@import url('./memory-game.css?v=594d8067ef46');
@import url('./music-games.css?v=fa7c556f4f4c');
@import url('./catalog-hero.css?v=399e8a94e356');
@import url('./footer.css?v=cb5208be1316');
@import url('./station-marquee.css?v=2290439078eb');
@import url('./consent.css?v=279fd00572a2');
@import url('./news-ticker.css?v=b07d0d9a2b37');
@import url('./about.css?v=0b47a9943810');
@import url('./home.css?v=95b80b7698c0');
@import url('./home-hero.css?v=f78756874bb2');
@import url('./home-on-air.css?v=7a577a10ca39');
@import url('./home-weather.css?v=cd9752342f33');
@import url('./home-genre-sections.css?v=9a6027da94b9');
@import url('./mobile-navigation.css?v=008ffbd26d8d');
@import url('./genre.css?v=eeb8403db275');
@import url('./weather.css?v=345218d09b2d');
@import url('../assets/phosphor/phosphor-subset.css?v=6c6c12f01df6');
@import url('./radio-player.css?v=dc97c08a70b9');
@import url('./radio-history.css?v=9c2db3cb8c94');
@import url('./station-player.css?v=c890cf055729');
@import url('./track-transition.css?v=d53cf0b689cb');
@import url('./tv-player.css?v=5af2b6e4665c');
@import url('./player-bar.css?v=84346dc876da');
@import url('./song-links.css?v=1a9a6b765f32');
@import url('./radio-schedule.css?v=cdc491671c1e');
@import url('./game-room.css?v=4e332006b18a');

/*
 * radio-stanice.rs - main stylesheet
 * Source of truth: _documents/SPEC.md (S2.5, S3, S4, S5, S6, S7, S8, S10, S11; 2026-10-05
 * amendment: big player S3.13, element pass and radius budget S3.14, sleep timer S3.4.1).
 * Order: fonts (@font-face, S6) → tokens (:root, S7 verbatim + S4.2 motion + S5.5 elevation)
 * → base → components (BEM) → preference/feature fallbacks (S4.3 reduced motion, S5.6).
 * Breakpoints: 768 / 1024 / 1280, min-width only (EB). Native CSS nesting, shallow, no `&__`.
 */

/* ==========================================================================
   0. Fonts
   Montserrat v31 (google-webfonts-helper, subsets latin + latin-ext, WOFF2),
   SIL OFL 1.1, see ../assets/fonts/montserrat/OFL.txt
   ========================================================================== */

/* montserrat-regular - latin_latin-ext */
@font-face {
  font-display: swap;
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  src: url('../assets/fonts/montserrat/montserrat-v31-latin_latin-ext-regular.woff2') format('woff2');
  unicode-range: U+0, U+D, U+20-7E, U+A0-AC, U+AE-183, U+186-18C, U+18E-194, U+196-1A1, U+1A4-1A6, U+1A9, U+1AC-1B9, U+1C0-1F5, U+1F8-220, U+222-223, U+226-233, U+237, U+23A-23E, U+241-251, U+253-254, U+256-259, U+25B-25C, U+25F-260, U+263-266, U+268-26C, U+26F, U+271-272, U+274-275, U+27D-27E, U+280, U+283, U+287-28C, U+28E, U+292, U+294-295, U+298, U+29D, U+2B0, U+2B7-2C1, U+2C6-2CC, U+2D7, U+2DA, U+2DC-2DD, U+2EC, U+2EE, U+2FB-2FC, U+300-301, U+303-304, U+308-309, U+323, U+329, U+1D3A, U+1D43, U+1D49, U+1D4B, U+1D52-1D53, U+1D58, U+1D5B, U+1D7B, U+1D7D-1D7E, U+1D91, U+1DA4, U+1DB6, U+1DBB, U+1DBF, U+1E00-1E9B, U+1E9E, U+1EF2-1EF9, U+2009, U+200B, U+2013-2014, U+2018-201A, U+201C-201E, U+2020, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20A1, U+20A3-20A4, U+20A6-20A7, U+20A9, U+20AB-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BC-20BD, U+20BF, U+2113, U+2122, U+2191, U+2193, U+2212, U+2215, U+2C60-2C66, U+2C6D-2C6F, U+2C72-2C73, U+A726-A727, U+A740-A741, U+A789-A78D, U+A792-A793, U+A7A8-A7AB, U+A7AD-A7AE, U+A7B1-A7B9, U+A7C7-A7C8, U+A7CB-A7CD, U+A7DA-A7DC;
}

/* montserrat-500 - latin_latin-ext */
@font-face {
  font-display: swap;
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  src: url('../assets/fonts/montserrat/montserrat-v31-latin_latin-ext-500.woff2') format('woff2');
  unicode-range: U+0, U+D, U+20-7E, U+A0-AC, U+AE-183, U+186-18C, U+18E-194, U+196-1A1, U+1A4-1A6, U+1A9, U+1AC-1B9, U+1C0-1F5, U+1F8-220, U+222-223, U+226-233, U+237, U+23A-23E, U+241-251, U+253-254, U+256-259, U+25B-25C, U+25F-260, U+263-266, U+268-26C, U+26F, U+271-272, U+274-275, U+27D-27E, U+280, U+283, U+287-28C, U+28E, U+292, U+294-295, U+298, U+29D, U+2B0, U+2B7-2C1, U+2C6-2CC, U+2D7, U+2DA, U+2DC-2DD, U+2EC, U+2EE, U+2FB-2FC, U+300-301, U+303-304, U+308-309, U+323, U+329, U+1D3A, U+1D43, U+1D49, U+1D4B, U+1D52-1D53, U+1D58, U+1D5B, U+1D7B, U+1D7D-1D7E, U+1D91, U+1DA4, U+1DB6, U+1DBB, U+1DBF, U+1E00-1E9B, U+1E9E, U+1EF2-1EF9, U+2009, U+200B, U+2013-2014, U+2018-201A, U+201C-201E, U+2020, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20A1, U+20A3-20A4, U+20A6-20A7, U+20A9, U+20AB-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BC-20BD, U+20BF, U+2113, U+2122, U+2191, U+2193, U+2212, U+2215, U+2C60-2C66, U+2C6D-2C6F, U+2C72-2C73, U+A726-A727, U+A740-A741, U+A789-A78D, U+A792-A793, U+A7A8-A7AB, U+A7AD-A7AE, U+A7B1-A7B9, U+A7C7-A7C8, U+A7CB-A7CD, U+A7DA-A7DC;
}

/* montserrat-600 - latin_latin-ext */
@font-face {
  font-display: swap;
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  src: url('../assets/fonts/montserrat/montserrat-v31-latin_latin-ext-600.woff2') format('woff2');
  unicode-range: U+0, U+D, U+20-7E, U+A0-AC, U+AE-183, U+186-18C, U+18E-194, U+196-1A1, U+1A4-1A6, U+1A9, U+1AC-1B9, U+1C0-1F5, U+1F8-220, U+222-223, U+226-233, U+237, U+23A-23E, U+241-251, U+253-254, U+256-259, U+25B-25C, U+25F-260, U+263-266, U+268-26C, U+26F, U+271-272, U+274-275, U+27D-27E, U+280, U+283, U+287-28C, U+28E, U+292, U+294-295, U+298, U+29D, U+2B0, U+2B7-2C1, U+2C6-2CC, U+2D7, U+2DA, U+2DC-2DD, U+2EC, U+2EE, U+2FB-2FC, U+300-301, U+303-304, U+308-309, U+323, U+329, U+1D3A, U+1D43, U+1D49, U+1D4B, U+1D52-1D53, U+1D58, U+1D5B, U+1D7B, U+1D7D-1D7E, U+1D91, U+1DA4, U+1DB6, U+1DBB, U+1DBF, U+1E00-1E9B, U+1E9E, U+1EF2-1EF9, U+2009, U+200B, U+2013-2014, U+2018-201A, U+201C-201E, U+2020, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20A1, U+20A3-20A4, U+20A6-20A7, U+20A9, U+20AB-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BC-20BD, U+20BF, U+2113, U+2122, U+2191, U+2193, U+2212, U+2215, U+2C60-2C66, U+2C6D-2C6F, U+2C72-2C73, U+A726-A727, U+A740-A741, U+A789-A78D, U+A792-A793, U+A7A8-A7AB, U+A7AD-A7AE, U+A7B1-A7B9, U+A7C7-A7C8, U+A7CB-A7CD, U+A7DA-A7DC;
}

/* montserrat-700 - latin_latin-ext */
@font-face {
  font-display: swap;
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  src: url('../assets/fonts/montserrat/montserrat-v31-latin_latin-ext-700.woff2') format('woff2');
  unicode-range: U+0, U+D, U+20-7E, U+A0-AC, U+AE-183, U+186-18C, U+18E-194, U+196-1A1, U+1A4-1A6, U+1A9, U+1AC-1B9, U+1C0-1F5, U+1F8-220, U+222-223, U+226-233, U+237, U+23A-23E, U+241-251, U+253-254, U+256-259, U+25B-25C, U+25F-260, U+263-266, U+268-26C, U+26F, U+271-272, U+274-275, U+27D-27E, U+280, U+283, U+287-28C, U+28E, U+292, U+294-295, U+298, U+29D, U+2B0, U+2B7-2C1, U+2C6-2CC, U+2D7, U+2DA, U+2DC-2DD, U+2EC, U+2EE, U+2FB-2FC, U+300-301, U+303-304, U+308-309, U+323, U+329, U+1D3A, U+1D43, U+1D49, U+1D4B, U+1D52-1D53, U+1D58, U+1D5B, U+1D7B, U+1D7D-1D7E, U+1D91, U+1DA4, U+1DB6, U+1DBB, U+1DBF, U+1E00-1E9B, U+1E9E, U+1EF2-1EF9, U+2009, U+200B, U+2013-2014, U+2018-201A, U+201C-201E, U+2020, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20A1, U+20A3-20A4, U+20A6-20A7, U+20A9, U+20AB-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BC-20BD, U+20BF, U+2113, U+2122, U+2191, U+2193, U+2212, U+2215, U+2C60-2C66, U+2C6D-2C6F, U+2C72-2C73, U+A726-A727, U+A740-A741, U+A789-A78D, U+A792-A793, U+A7A8-A7AB, U+A7AD-A7AE, U+A7B1-A7B9, U+A7C7-A7C8, U+A7CB-A7CD, U+A7DA-A7DC;
}

/* ==========================================================================
   1. Tokens
   ========================================================================== */

/* montserrat-300 - latin_latin-ext */
@font-face {
  font-display: swap;
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300;
  src: url('../assets/fonts/montserrat/montserrat-v31-latin_latin-ext-300.woff2') format('woff2');
  unicode-range: U+0, U+D, U+20-7E, U+A0-AC, U+AE-183, U+186-18C, U+18E-194, U+196-1A1, U+1A4-1A6, U+1A9, U+1AC-1B9, U+1C0-1F5, U+1F8-220, U+222-223, U+226-233, U+237, U+23A-23E, U+241-251, U+253-254, U+256-259, U+25B-25C, U+25F-260, U+263-266, U+268-26C, U+26F, U+271-272, U+274-275, U+27D-27E, U+280, U+283, U+287-28C, U+28E, U+292, U+294-295, U+298, U+29D, U+2B0, U+2B7-2C1, U+2C6-2CC, U+2D7, U+2DA, U+2DC-2DD, U+2EC, U+2EE, U+2FB-2FC, U+300-301, U+303-304, U+308-309, U+323, U+329, U+1D3A, U+1D43, U+1D49, U+1D4B, U+1D52-1D53, U+1D58, U+1D5B, U+1D7B, U+1D7D-1D7E, U+1D91, U+1DA4, U+1DB6, U+1DBB, U+1DBF, U+1E00-1E9B, U+1E9E, U+1EF2-1EF9, U+2009, U+200B, U+2013-2014, U+2018-201A, U+201C-201E, U+2020, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20A1, U+20A3-20A4, U+20A6-20A7, U+20A9, U+20AB-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BC-20BD, U+20BF, U+2113, U+2122, U+2191, U+2193, U+2212, U+2215, U+2C60-2C66, U+2C6D-2C6F, U+2C72-2C73, U+A726-A727, U+A740-A741, U+A789-A78D, U+A792-A793, U+A7A8-A7AB, U+A7AD-A7AE, U+A7B1-A7B9, U+A7C7-A7C8, U+A7CB-A7CD, U+A7DA-A7DC;
}

/* montserrat-900 - latin_latin-ext */
@font-face {
  font-display: swap;
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 900;
  src: url('../assets/fonts/montserrat/montserrat-v31-latin_latin-ext-900.woff2') format('woff2');
  unicode-range: U+0, U+D, U+20-7E, U+A0-AC, U+AE-183, U+186-18C, U+18E-194, U+196-1A1, U+1A4-1A6, U+1A9, U+1AC-1B9, U+1C0-1F5, U+1F8-220, U+222-223, U+226-233, U+237, U+23A-23E, U+241-251, U+253-254, U+256-259, U+25B-25C, U+25F-260, U+263-266, U+268-26C, U+26F, U+271-272, U+274-275, U+27D-27E, U+280, U+283, U+287-28C, U+28E, U+292, U+294-295, U+298, U+29D, U+2B0, U+2B7-2C1, U+2C6-2CC, U+2D7, U+2DA, U+2DC-2DD, U+2EC, U+2EE, U+2FB-2FC, U+300-301, U+303-304, U+308-309, U+323, U+329, U+1D3A, U+1D43, U+1D49, U+1D4B, U+1D52-1D53, U+1D58, U+1D5B, U+1D7B, U+1D7D-1D7E, U+1D91, U+1DA4, U+1DB6, U+1DBB, U+1DBF, U+1E00-1E9B, U+1E9E, U+1EF2-1EF9, U+2009, U+200B, U+2013-2014, U+2018-201A, U+201C-201E, U+2020, U+2022, U+2026, U+2032-2033, U+2039-203A, U+2044, U+20A1, U+20A3-20A4, U+20A6-20A7, U+20A9, U+20AB-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BC-20BD, U+20BF, U+2113, U+2122, U+2191, U+2193, U+2212, U+2215, U+2C60-2C66, U+2C6D-2C6F, U+2C72-2C73, U+A726-A727, U+A740-A741, U+A789-A78D, U+A792-A793, U+A7A8-A7AB, U+A7AD-A7AE, U+A7B1-A7B9, U+A7C7-A7C8, U+A7CB-A7CD, U+A7DA-A7DC;
}

@font-face {
  font-family: 'Phosphor Radio';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('../assets/phosphor/src/light/Phosphor-Light-radio.woff2') format('woff2');
}

:root {
  /* Breakpoints (literal values repeat in each @media prelude; JS reads these) */
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;

  /* Color - light (default) */
  --color-bg: #f6f8f9;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-fill: #e8e8ed;            /* popover row hover/press, grabber track */
  --color-ink: #1d1d1f;             /* 15.5:1 on bg */
  --color-ink-2: #515154;           /* 7.3:1 bg, 6.5:1 fill */
  --color-ink-3: #636368;           /* 5.5:1 bg, 4.9:1 fill - smallest allowed text color */
  --color-line: #d2d2d7;            /* decorative separators only */
  --color-line-strong: #7a7a7f;     /* control borders: 3.9:1 bg, 3.5:1 fill (≥3:1) */
  --color-accent: #1d1d1f;          /* placeholder graphite */
  --color-on-accent: #ffffff;       /* 16.8:1 */
  --color-focus: var(--color-ink);
  --color-error: #c0271d;           /* 5.4:1 bg */
  --color-success: #1d7a36;         /* 5.0:1 bg */
  --color-warning: #8a5300;         /* 5.8:1 bg */
  --color-favorite: #e53950;
  --color-logo-well: #ffffff;
  --color-hairline-media: rgb(0 0 0 / 0.08);  /* inner edge of logo wells */
  --color-scrim-media: rgb(0 0 0 / 0.5);      /* tile state scrim; white glyph ≥3:1 even over a white logo (S8 non-text) */
  --color-scrim: rgb(0 0 0 / 1);    /* multiplied by 0.4 × progress in JS via opacity */

  /* Type - see S6 table (full clamp values); every --fs-* is a clamp() (wo-skill rule 3) */
  --fs-display: clamp(2.5rem, 1.25rem + 3.9vw, 5rem);                   /* 60 px @1024 → 80 px @1920 */
  --fs-tv-title: clamp(1.5rem, 0.5rem + 2vw, 2.75rem);                  /* 28 px @1024 → 44 px @1920 */
  --fs-hero: clamp(2rem, calc(1.5714rem + 2.1429vw), 3.5rem);           /* 32 → 56 px */
  --fs-title-1: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);                 /* 28 px @320 → 40 px @1440 */
  --fs-title-2: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);               /* 22 px @320 → 28 px @1440 */
  --fs-title-3: clamp(1.125rem, calc(1.05rem + 0.3vw), 1.3125rem);      /* 18 → 21 px */
  --fs-headline: clamp(1rem, calc(0.9643rem + 0.1786vw), 1.125rem);     /* 16 → 18 px */
  --fs-body: clamp(1rem, calc(0.9643rem + 0.1786vw), 1.125rem);         /* 16 → 18 px */
  --fs-callout: clamp(0.9375rem, calc(0.9196rem + 0.0893vw), 1rem);     /* 15 → 16 px */
  --fs-subhead: clamp(0.875rem, calc(0.8571rem + 0.0893vw), 0.9375rem); /* 14 → 15 px */
  --fs-footnote: clamp(0.78125rem, calc(0.7634rem + 0.0893vw), 0.84375rem); /* 12.5 → 13.5 px */
  --fs-caption: clamp(0.71875rem, calc(0.7009rem + 0.0893vw), 0.78125rem);  /* 11.5 → 12.5 px */
  --fs-nav: clamp(0.6836rem, calc(0.6454rem + 0.170vw), 0.7812rem);     /* ≈10.9 → 12.5 px, uppercase */

  /* Spacing - fixed 4 px scale; no intermediate values inline */
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.5rem;   /* 8 */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.25rem;  /* 20 */
  --space-6: 1.5rem;   /* 24 */
  --space-7: 2rem;     /* 32 */
  --space-8: 2.5rem;   /* 40 */
  --space-9: 3rem;     /* 48 */
  --space-10: 4rem;    /* 64 */

  /* Radius - the S3.14 budget, three tokens only (wo-skill rule 11) */
  --radius-media: 0.5rem;     /* logo wells, text inputs, popovers */
  --radius-sheet: 1rem;       /* sheet panel top corners, <1024 only */
  --radius-pill: 999px;       /* buttons, round play, grabber, spinner */

  /* Elevation - S5.5 */
  --shadow-popover: 0 2px 6px rgb(0 0 0 / 0.08), 0 12px 32px rgb(0 0 0 / 0.14);
  --shadow-sheet:   0 -1px 0 rgb(0 0 0 / 0.04), 0 -12px 40px rgb(0 0 0 / 0.16);

  /* Layering - documented order, low → high */
  --z-base: 0;
  --z-raised: 1;        /* content above a pseudo-element layer */
  --z-header: 100;
  --z-player: 200;      /* docked bar */
  --z-skip: 900;        /* skip links above everything when focused */
  /* sheet, TV stage, popover use the top layer (dialog/popover) - no z-index */

  /* Container */
  --wrap: 78rem;        /* 1248 px */
  --wrap-pad: 1rem;     /* 1.5rem ≥768, 2rem ≥1024 - override only this token */

  /* Motion - S4.2 */
  --ease-spring: linear(0, 0.1142, 0.3202, 0.5157, 0.6703, 0.7824, 0.8596, 0.9109, 0.9442,
    0.9654, 0.9788, 0.987, 0.9921, 0.9953, 0.9972, 0.9983, 1);
  /* exact mirror for the return path (§7): f'(t) = 1 − f(1 − t) */
  --ease-spring-in: linear(0, 0.0017, 0.0028, 0.0047, 0.0079, 0.013, 0.0212, 0.0346, 0.0558,
    0.0891, 0.1404, 0.2176, 0.3297, 0.4843, 0.6798, 0.8858, 1);
  --dur-spring-snappy: 370ms;  /* ζ1, response 0.25 */
  --dur-spring: 515ms;         /* ζ1, response 0.35 */
  --dur-spring-move: 590ms;    /* ζ1, response 0.40 (Apple "move/reposition") */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.8, 0, 0.8, 0.2);   /* inverse control points of --ease-out, §7 */
  --dur-press: 100ms;
  --dur-fade: 150ms;
  --dur-crossfade: 200ms;

  /* Materials */
  --material-chrome-alpha: 72%;   /* header and docked bar share it (S5.1) */
  --blur-chrome: 20px;

  /* ---- Builder additions (not in S7; named values the SPEC states in S3/S4/S8) ---- */
  /* Layout sizes (S3.1 header height, S3.4 bar height; overridden at 1024 below) */
  --header-h: 3.5rem;
  --bar-h: 4rem;
  /* Target sizes (S8: ≥44×44; 48 px targets in S3.4) */
  --size-target: 2.75rem;     /* 44 */
  --size-target-lg: 3rem;     /* 48 */
  --size-icon: 3.5rem;        /* list icon = one grid position, 56 px; 4rem ≥768 (S3.2, S7) */
  --size-cover-hero: 20rem;   /* shared square cover limit for hero and sheet */
  --size-cover-asset: 31.25rem; /* 500 px published artwork, never enlarged in TV view */
  --size-cover-compact: 4rem; /* compact list-page player cover */
  --cover-fallback-scale: 30%;
  --featured-large: min(75vw, 18rem); /* featured band: side of the large (square) card; 18 / 19.5 / 22rem at 768 / 1024 / 1280; wide = × 0.8165 (S3.2, S7) */
  /* Stroke widths: hairline borders, 2 px rings (S3.2, S3.13), 3 px focus ring (S8) */
  --line-width: 1px;
  --ring-width: 2px;
  --focus-width: 3px;
  --focus-offset: 2px;              /* S8 focus ring offset */
  /* Colors with a fixed role in both themes */
  --color-on-scrim: #ffffff;        /* S3.2 white glyph on the tile scrim */
  --color-well-light: #ffffff;      /* S3.11 light well for logo_on_light logos in dark */
  /* Extra motion values stated in S3.10 / S4.3 */
  --dur-spin: 900ms;                /* spinner, ~1.1 Hz */
  --dur-progress: 2s;               /* header progress 0 → 0.8 */
  --dur-theme: 250ms;               /* theme View Transition crossfade */
  --dur-fade-reduced: 120ms;        /* popover opacity under reduced motion */
  --dur-underline: 450ms;           /* CSS#9 grow-underline */
  --ease-underline: cubic-bezier(0.23, 1, 0.32, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #000000;
  --color-surface: #1c1c1e;
  --color-surface-elevated: #2c2c2e;
  --color-fill: #2c2c2e;
  --color-ink: #f5f5f7;             /* 19.3:1 bg, 15.6:1 surface */
  --color-ink-2: #aeaeb2;           /* 9.5:1 bg, 6.3:1 fill */
  --color-ink-3: #9a9a9f;           /* 7.5:1 bg, 5.0:1 fill */
  --color-line: #38383a;
  --color-line-strong: #7c7c80;     /* 5.1:1 bg, 3.4:1 fill */
  --color-accent: #f5f5f7;
  --color-on-accent: #1d1d1f;       /* 15.5:1 */
  --color-focus: var(--color-ink);
  --color-error: #ff6b5e;           /* 7.5:1 bg, 5.0:1 fill */
  --color-success: #4cd964;
  --color-warning: #ffb340;
  --color-logo-well: #2c2c2e;
  --color-hairline-media: rgb(255 255 255 / 0.12);
  --color-scrim-media: rgb(0 0 0 / 0.55);
  --material-chrome-alpha: 68%;

  /* S5.5 dark overrides: same geometry, alpha 0.4-0.6 (shadows read weaker on dark) */
  --shadow-popover: 0 2px 6px rgb(0 0 0 / 0.5), 0 12px 32px rgb(0 0 0 / 0.6);
  --shadow-sheet:   0 -1px 0 rgb(0 0 0 / 0.4), 0 -12px 40px rgb(0 0 0 / 0.6);
}

@media (min-width: 768px) {
  :root {
    --wrap-pad: 1.5rem;
    --size-icon: 4rem;
    --featured-large: 18rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --wrap-pad: 2rem;
    --header-h: 4rem;
    --bar-h: 4.5rem;
    --featured-large: 19.5rem;
  }
}

@media (min-width: 1280px) {
  :root {
    --featured-large: 22rem;
  }
}

/* ==========================================================================
   2. Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  hyphens: manual;
}

/* CSS-only scroll lock while a modal surface covers the page (no JS). */
html:has(.player-sheet[open], .tv-stage[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  min-block-size: 100vh;
  min-block-size: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  color: var(--color-ink);
  font-family: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

h1 {
  font-size: var(--fs-title-1);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-size: var(--fs-title-2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.014em;
  text-wrap: balance;
}

h3 {
  font-size: var(--fs-title-3);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img,
svg,
video,
audio {
  display: block;
  max-inline-size: 100%;
}

img {
  block-size: auto;
}

a {
  color: inherit;
  text-decoration-thickness: var(--line-width);
  text-underline-offset: 0.2em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a,
button,
input,
select,
textarea,
label,
summary {
  touch-action: manipulation;             /* S4.5: no double-tap delay */
  -webkit-tap-highlight-color: transparent; /* S4.5: the design supplies its own press state */
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus {
  outline: none;
}

.hero-player__fav:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}

/* Icons - S2.5 sprite, fill: currentColor, always decorative (aria-hidden) */
.icon {
  flex: none;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  fill: currentColor;
}

/* Visibility utilities */
.u-sr-only {
  /* 1px / -1px: the standard visually-hidden technique, not a spacing value */
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Visible only with / without JavaScript (theme-boot.js adds `js` to <html>) */
html:not(.js) .u-js-only,
.js .u-nojs-only {
  display: none !important;
}

/* Skip links - `.u-sr-only` pattern, visible on focus (S3.1) */
.skip-link {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-4);
  border-radius: 0;
  background: var(--color-surface-elevated);
  color: var(--color-ink);
  font-size: var(--fs-callout);
  font-weight: 600;
  box-shadow: var(--shadow-popover);
  text-decoration: none;

  &:not(:focus) {
    /* visually hidden until focused (same 1px technique as .u-sr-only) */
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  /* "Preskoči na plejer" only while the player is visible (S3.1) */
  body:has(.player[hidden]) &[href="#player"] {
    display: none;
  }
}

/* Container - defined once (EB) */
.container {
  inline-size: 100%;
  max-inline-size: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--wrap-pad);
}

/* Page - <main id="main" class="page page--<type> container"> */
.page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-block: var(--space-6) var(--space-9);

  &:focus,
  & h1[tabindex="-1"]:focus {
    outline: none; /* Programmatic navigation targets retain focus without a ring. */
  }

  &.is-entering {
    animation: page-in var(--dur-fade) var(--ease-out);
  }

  @media (min-width: 1024px) {
    padding-block: var(--space-8) var(--space-10);
  }
}

.page__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.page__lead {
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--color-ink-2);
  max-inline-size: 38em;
}

.page__note {
  font-size: var(--fs-footnote);
  line-height: 1.4;
  letter-spacing: 0.006em;
  color: var(--color-ink-2);
}

/* Generic icon button (44×44) - mixed into player/sheet/TV/close controls */
:is(.icon-button, .theme-toggle, .fav-toggle, .station-search__clear, .player-bar__play,
    .player-sheet__close, .player-sheet__play, .tv-stage__button) {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: var(--size-target);
  block-size: var(--size-target);
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

/* Text-entry control - shared by search and weather controls. */
.form-control {
  display: block;
  inline-size: 100%;
  min-block-size: var(--size-target-lg);
  padding: var(--space-2) var(--space-3);
  border: var(--line-width) solid var(--color-line-strong);
  border-radius: var(--radius-media);
  background-color: var(--color-surface);
  color: var(--color-ink);
  font-size: var(--fs-body); /* clamp() with a 1rem minimum: computes ≥16 px (EB, no iOS focus zoom) */
  line-height: 1.4;

  &::placeholder {
    color: var(--color-ink-3);
    opacity: 1;
  }

  &[aria-invalid="true"] {
    border-color: var(--color-error);
    box-shadow: inset 0 0 0 var(--line-width) var(--color-error);
  }
}

/* Buttons - pills only (S3.14 radius budget); secondary = 1 px ghost (wo-skill rule 9) */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: var(--size-target);
  padding-block: var(--space-2);
  padding-inline: var(--space-5);
  border: var(--line-width) solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background-color: transparent;
  color: var(--color-ink);
  font-size: var(--fs-callout);
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  cursor: pointer;

  &:disabled,
  &[aria-disabled="true"] {
    cursor: not-allowed;
    color: var(--color-ink-2);
  }
}

.button--secondary {
  background-color: transparent;
  color: var(--color-ink);
}

.button--primary {
  min-block-size: var(--size-target-lg);
  padding-inline: var(--space-6);
  border-color: var(--color-accent);
  background-color: var(--color-accent);
  color: var(--color-on-accent);

  &:disabled,
  &[aria-disabled="true"] {
    background-color: var(--color-ink-2);
    background-color: color-mix(in srgb, var(--color-accent) 50%, var(--color-bg) 50%);
    color: var(--color-on-accent);
  }
}

.button__icon {
  inline-size: 1.25rem;
  block-size: 1.25rem;
}

@media (hover: hover) and (pointer: fine) {
  /* ghost pills: the border darkens to ink */
  :is(.button:not(.button--primary), .player-bar__retry):not(:disabled):hover {
    border-color: var(--color-ink);
  }

  .button--primary:not(:disabled):hover {
    background-color: color-mix(in srgb, var(--color-accent) 86%, var(--color-bg) 14%);
  }

  /* bare icon controls: no fill, the glyph goes to ink */
  :is(.icon-button, .theme-toggle, .fav-toggle, .station-search__clear,
      .player-sheet__close, .sleep-timer__button, .player-more, .player-options__tv,
      .tv-stage__button):not(.tv-stage__button--play):hover {
    color: var(--color-ink);
  }

  /* accent buttons keep the accent (on-accent glyph contrast) */
  :is(.player-bar__play, .player-sheet__play, .tv-stage__button--play, .hero-player__play):hover {
    background-color: color-mix(in srgb, var(--color-accent) 86%, var(--color-bg) 14%);
  }

  .hero-player__eyebrow:hover {
    color: var(--color-ink);
  }
}

/* Press feedback (S4.3 "Button / round play press"): instant on pointer-down, spring release */
:is(.button, .icon-button, .theme-toggle, .fav-toggle, .station-search__clear,
    .player-bar__play, .player-bar__retry, .player-more, .player-options__tv,
    .player-sheet__close, .player-sheet__play, .tv-stage__button, .hero-player__play,
    .hero-player__tv, .sleep-timer__button) {
  transition: transform var(--dur-spring-snappy) var(--ease-spring);

  &:active:not(:disabled) {
    transform: scale(0.96);
    transition: transform var(--dur-press) var(--ease-out);
  }
}

/* Spinner - 2 px ring, 270° arc (S4.3) */
.spinner {
  display: block;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  border: var(--ring-width) solid currentColor;
  border-inline-end-color: transparent;
  border-radius: var(--radius-pill);
}

:is(.is-connecting, .is-reconnecting) .spinner {
  animation: spin var(--dur-spin) linear infinite;
}

/* Play / stop glyph stack (S4.3 "Play → stop glyph") */
.play-glyph {
  display: inline-grid;
  place-items: center;

  & > * {
    grid-area: 1 / 1;
    opacity: 0;
    transform: scale(0.8);
    transition:
      opacity var(--dur-fade) var(--ease-out),
      transform var(--dur-fade) var(--ease-out);
  }

  & > .play-glyph__play {
    opacity: 1;
    transform: none;
  }
}

/* stop: tile playing, and the player's cancellable states (S3.4 Controls column) -
   bar, sheet, TV and the big player while it shows the engine station */
:is(.is-playing,
    :is(.player, .player-sheet, .tv-stage, .hero-player):is([data-state="connecting"], [data-state="connecting-slow"],
      [data-state="playing"], [data-state="reconnecting"], [data-state="offline"])) .play-glyph {
  & > .play-glyph__play {
    opacity: 0;
    transform: scale(0.8);
  }

  & > .play-glyph__stop {
    opacity: 1;
    transform: none;
  }
}

/* spinner: tile while connecting / reconnecting (S3.2 table) */
.station-card:is(.is-connecting, .is-reconnecting) .play-glyph {
  & > :is(.play-glyph__play, .play-glyph__stop) {
    opacity: 0;
    transform: scale(0.8);
  }

  & > .play-glyph__spin {
    opacity: 1;
    transform: none;
  }
}

/* error: tile scrim only (S3.2 table) */
.station-card.is-error .play-glyph {
  & > :is(.play-glyph__play, .play-glyph__stop) {
    opacity: 0;
    transform: scale(0.8);
  }

  & > .play-glyph__error {
    opacity: 1;
    transform: none;
  }
}

/* Fresh text (S4.3 "Now-playing / status text change"): main.js re-adds .is-updated */
:is([data-player-slot], [data-hero-slot]).is-updated {
  animation: text-in var(--dur-crossfade) var(--ease-out);
}

/* ==========================================================================
   3. Header - .site-header (inc-header.php)
   ========================================================================== */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-header);
  transition: transform 180ms ease-out;
  /* material "chrome" (S5.1); static token first, then the translucent mix (EB) */
  background-color: var(--color-bg);
  background-color: color-mix(in srgb, var(--color-bg) var(--material-chrome-alpha), transparent);
  -webkit-backdrop-filter: blur(var(--blur-chrome)) saturate(180%);
  backdrop-filter: blur(var(--blur-chrome)) saturate(180%);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);

  /* Scroll edge effect instead of a divider (S5.4) */
  &::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-start: 100%;
    block-size: var(--space-4);
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(var(--color-bg), transparent);
    background: linear-gradient(color-mix(in srgb, var(--color-bg) 60%, transparent), transparent);
  }
}

.site-header.is-scroll-hidden:not(:focus-within):not(.is-mobile-open):not(.is-search-open) {
  transform: translateY(calc(-100% - var(--space-4)));
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

@supports (animation-timeline: scroll()) {
  .site-header::after {
    animation: edge-in linear both;
    animation-timeline: scroll(root);
    animation-range: 0 1.5rem;
  }
}

html[data-theme="dark"] .site-header {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-block-size: var(--header-h);
  padding-block: var(--space-2);
}

.header-status-item {
  display: inline-flex;
  align-items: center;
  column-gap: 0.35rem;
}

.header-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.125rem;
  column-gap: 0.75rem;
  padding: 0 0.875rem;
  -webkit-border-radius: 50rem;
  -moz-border-radius: 50rem;
  border-radius: 50rem;
  background-color: #ffffff;
  border: 1px solid #ffffff;
  color: #000000;
  box-sizing: border-box;
  white-space: nowrap;
}

html[data-theme="dark"] .header-status-pill {
  background-color: #2a2d38;
  border-color: #2a2d38;
  color: #ffffff;
}

.header-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85rem;
  height: 0.85rem;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}

.header-listeners-icon {
  width: 1.02rem;
  height: 1.02rem;
}

.listener-count {
  flex: none;
  order: 1;
  font-size: 0.5625rem;
  font-weight: 400;
  line-height: 1.5;

  @media (min-width: 768px) {
    order: 0;
  }
}

.site-header__inner:has(> .listener-count) .header-search {
  flex-basis: 8rem;

  @media (min-width: 1280px) {
    flex-basis: 16rem;
  }
}

.site-header .weather-chip {
  display: none;
  flex: none;
  inline-size: auto;
  min-block-size: 2.125rem;
  gap: 0.75rem;
  margin: 0;
  padding: 0 0.625rem;
  border: 1px solid #ffffff;
  border-radius: 50rem;
  background-color: #ffffff;
  color: var(--color-ink);
  font-size: 0.5625rem;
  font-weight: 400;

  & > .icon {
    inline-size: 0.85rem;
    block-size: 0.85rem;
  }

  & .weather-chip__temp {
    min-inline-size: 3.5ch;
    font-variant-numeric: tabular-nums;
  }

  & .weather-chip__city {
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  @media (min-width: 768px) {
    display: inline-flex;
  }
}

html[data-theme="dark"] .site-header .weather-chip {
  border-color: #2a2d38;
  background-color: #2a2d38;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 auto;
  min-inline-size: 0;
  min-block-size: var(--size-target);
  margin-inline-end: 0;
  color: var(--color-ink);
  font-size: var(--fs-headline);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-decoration: none;
  overflow-wrap: anywhere;

  @media (min-width: 768px) {
    flex: none;
  }
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 100%;
  order: 1;
  min-inline-size: 0;
  max-inline-size: 16rem; /* Compact header search, independent of spare space. */
  min-block-size: var(--size-target);

  @media (min-width: 768px) {
    flex: 0 1 12rem;
    order: 0;
    margin-inline: auto;
  }

  @media (min-width: 1024px) {
    flex-basis: 16rem;
  }
}

.header-search__form {
  position: relative;
  inline-size: 100%;
}

.header-search__input {
  inline-size: 100%;
  min-block-size: 2.125rem; /* Match the existing header pills. */
  block-size: 2.125rem;
  padding-block: 0;
  padding-inline: var(--space-7) var(--space-8);
  border-color: transparent;
  border-radius: var(--radius-pill);
  background-color: var(--color-surface);
  font-size: max(1rem, 16px);

  &::placeholder {
    font-size: 0.8125rem;
  }

  @media (min-width: 768px) {
    font-size: 0.8125rem;
  }

  &:focus-visible {
    outline-width: 2px;
    outline-offset: 3px;
  }

  &::-webkit-search-cancel-button,
  &::-webkit-search-decoration {
    -webkit-appearance: none;
  }
}

html[data-theme="dark"] .header-search__input {
  background-color: #2a2d38;
}

.header-search__icon {
  position: absolute;
  inset-inline-start: var(--space-3);
  inset-block-start: 50%;
  inline-size: var(--space-4);
  block-size: var(--space-4);
  transform: translateY(-50%);
  color: var(--color-ink-2);
  pointer-events: none;
}

.header-search__clear,
.header-search__submit {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: 50%;
  display: grid;
  place-items: center;
  inline-size: var(--size-target);
  block-size: var(--size-target);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-ink-2);
  cursor: pointer;
  transform: translateY(-50%);

  & > .icon {
    inline-size: var(--space-4);
    block-size: var(--space-4);
  }

  &:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -3px;
  }
}

/* Picker geometry and states from luxlineprevoz's reservation form. */
.header-search__panel {
  position: absolute;
  inset-block-start: calc(100% + var(--space-2));
  inset-inline-start: 0;
  inline-size: max(100%, 20rem); /* Fit the station name beside its logo. */
  max-inline-size: calc(100vw - var(--wrap-pad) * 2);
  max-block-size: min(20rem, 50dvh);
  padding: var(--space-2);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-media);
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: 0 24px 64px -24px rgb(0 0 0 / 30%), 0 2px 6px rgb(0 0 0 / 6%);
  font-size: max(1rem, 16px);
  line-height: 1.5;
}

.header-search__results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-search__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-block-size: var(--size-target);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-media);
  color: var(--color-ink);
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-out) var(--ease-out);

  &:hover,
  &[aria-selected="true"] {
    background: var(--color-tint);
    outline: none;
  }

  & > :is(img, .icon) {
    flex: none;
    inline-size: var(--space-7);
    block-size: var(--space-7);
    object-fit: contain;
    border-radius: var(--radius-media);
  }

  & > span {
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }
}

.header-search__empty {
  margin: 0;
  padding: var(--space-2) var(--space-3);
}

.brand-radio {
  position: relative;
  display: inline-flex;
  flex: none;
  inline-size: var(--space-7);
  block-size: var(--space-7);
}

.brand-radio__icon {
  font: normal 400 var(--space-7) / 1 'Phosphor Radio';

  &::before {
    content: "\e77e";
  }
}

.brand-radio__waves {
  position: absolute;
  inset-inline-start: 75%;
  inset-block-start: 12%;
  inline-size: 1em;
  block-size: 1em;
  transform: translate(-50%, -50%);
  pointer-events: none;

  &::before,
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    border-block-start-color: currentColor;
    border-radius: 50%;
    opacity: 0;
    animation: brand-broadcast 2.4s ease-out infinite;
  }

  &::after {
    animation-delay: -1.2s;
  }
}

@keyframes brand-broadcast {
  0% {
    transform: scale(0.2);
    opacity: 0;
  }

  15% {
    opacity: 0.7;
  }

  85%,
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-radio__waves::before,
  .brand-radio__waves::after {
    animation: none;
    opacity: 0;
  }
}

.site-header__nav {
  display: flex;
  align-items: center;
}

.site-header__players {
  display: none;
  align-items: center;
  gap: var(--space-2);

  @media (min-width: 1024px) {
    display: flex;
  }
}

.header-player-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 2.125rem;
  block-size: 2.125rem;
  padding: 0;
  border: 1px solid #ffffff;
  border-radius: 50rem;
  background-color: #ffffff;
  color: var(--color-ink);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;

  & > .icon {
    inline-size: 1.25rem;
    block-size: 1.25rem;
    font-size: 1.25rem;
    line-height: 1;
  }

  &:hover,
  &:focus-visible {
    border-color: rgba(0, 0, 0, 0.05);
  }

  &:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
  }

  &:disabled {
    cursor: default;
    opacity: 0.45;
  }
}

html[data-theme="dark"] .header-player-button {
  border-color: #2a2d38;
  background-color: #2a2d38;

  &:hover,
  &:focus-visible {
    border-color: rgba(255, 255, 255, 0.08);
  }
}

.remote-controls {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;

  & .header-player-button {
    inline-size: var(--size-target);
    block-size: var(--size-target);

    &:focus-visible {
      outline: 2px solid currentColor;
      outline-offset: 3px;
    }
  }

  & [aria-pressed="true"] {
    outline: 1px solid currentColor;
  }
}

.remote-controls--header .header-player-button {
  inline-size: 2.125rem;
  block-size: 2.125rem;
}

.remote-controls--header .remote-controls__device {
  min-inline-size: 0;
  max-inline-size: 6rem;
  padding: 2px 6px;
  border-radius: var(--radius-media);
  background: var(--color-bg);
}

@media (max-width: 767px) {
  .remote-controls--header:has(> .remote-controls__device:not([hidden])) {
    order: 1;
    max-inline-size: 8.5rem;
  }

  .site-header__inner:has(> .remote-controls--header > .remote-controls__device:not([hidden])) .header-search {
    flex-basis: calc(100% - 9rem);
  }
}

@media (min-width: 768px) {
  .site-header__inner:has(> .remote-controls--header > .remote-controls__device:not([hidden])) .header-search {
    flex-basis: 10rem;
  }
}

.remote-controls__device {
  max-inline-size: 6rem;
  overflow: hidden;
  font-size: 0.6875rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.remote-controls__notice {
  position: fixed;
  inset: auto 1rem 1rem auto;
  inline-size: max-content;
  max-inline-size: min(24rem, calc(100vw - 2rem));
  padding: 1rem 1.25rem;
  margin: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-media);
  background: var(--color-bg);
  color: var(--color-ink);
  box-shadow: 0 4px 24px #0002;
  font-size: 0.875rem;
  line-height: 1.5;
}

.hero-player__transport:has(> .remote-controls:not([hidden])) {
  flex-wrap: wrap;
}

.player-bar__actions > .remote-controls {
  order: 1;
}

.player-sheet__controls:has(> .remote-controls:not([hidden])) {
  flex-wrap: wrap;
  gap: 6px;

  & > .player-bar__fav {
    margin-inline-start: 0;
  }

  & > .player-bar__timeline {
    flex: 1 0 100%;
    order: -2;
  }

  & > .remote-controls {
    flex: none;
    order: 1;
  }
}

.is-popup .hero-player.hero-player--song .hero-player__transport {
  flex-wrap: wrap;
  gap: 8px;

  & > .hero-player__timeline {
    flex: 1 0 100%;
  }
}

@media (max-width: 1023px) {
  .site-header__inner :is(.header-player-button, .theme-toggle) {
    inline-size: 44px;
    block-size: 44px;
  }

  .site-header__inner {
    column-gap: 4px;
  }
}

@media (max-width: 359px) {
  .player-sheet__controls:has(> .remote-controls:not([hidden])) {
    gap: 4px;

    & > :is(.player-bar__prompt, .player-bar__live) {
      flex: 1 0 100%;
      order: -1;
    }
  }

  .js .site-header .site-header__inner {
    justify-content: flex-end;
  }

  .js .site-header .site-header__brand {
    flex-basis: 100%;
  }
}

.tv-stage .remote-controls {
  grid-column: 1 / -1;
  justify-self: center;
}

:is(.script-switch, .header-tooltip) {
  position: relative;
  display: inline-flex;
  flex: none;

  &:has(> button[hidden]) {
    display: none;
  }

  &:focus-within:not([data-tooltip-hidden]) :is(.script-switch__tooltip, .header-tooltip__text) {
    visibility: visible;
    opacity: 1;
  }

  @media (hover: hover) {
    &:hover:not([data-tooltip-hidden]) :is(.script-switch__tooltip, .header-tooltip__text) {
      visibility: visible;
      opacity: 1;
    }
  }
}

.script-switch__button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

:is(.script-switch__tooltip, .header-tooltip__text) {
  position: absolute;
  z-index: 1;
  inset-block-start: calc(100% + 0.5rem);
  inset-inline-end: 0;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-media);
  background-color: var(--color-surface-elevated);
  color: var(--color-ink);
  box-shadow: var(--shadow-popover);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.popup-close {
  display: none;
}

.is-popup {
  overflow-x: clip;

  & .site-header {
    position: static;
  }

  & .site-header__inner {
    justify-content: flex-end;
  }

  & :is(.site-header__brand, .header-search, .site-header__nav, .site-header__players,
      .site-header__progress, .site-footer, .skip-link, .player-bar,
      .hero-player__crumbs, .hero-player__about) {
    display: none;
  }

  & .popup-close {
    display: inline-grid;
  }

  & .site-header .weather-chip:not([hidden]) {
    display: inline-flex;
    flex: none;
    inline-size: auto;
    max-inline-size: 15rem;
    padding-inline: var(--space-3);
    font-size: 0.75rem;
  }

  & .weather-chip :is(.weather-chip__temp, .weather-chip__city) {
    display: inline;
  }

  & .page {
    max-inline-size: 450px;
    padding-block: var(--space-4);
  }

  & .page > :not(.hero-player, .home-stream) {
    display: none;
  }

  & .hero-player,
  & .hero-player:has(> .song-history:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
    padding-block: 0;
    border: 0;
  }

  & .hero-player__primary,
  & .hero-player__primary .hero-player__body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
  }

  & .hero-player__media {
    max-inline-size: none;
  }

  & .song-history {
    display: none;
  }
}

html.is-popup[data-page] .page > :not(.hero-player, .home-stream) {
  display: none;
}

.site-header__list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  list-style: none;
}

.site-header__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  inline-size: var(--size-target);
  min-block-size: var(--size-target);
  padding-inline: 0;
  color: var(--color-ink-2);
  font-size: var(--fs-nav);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;

  &[aria-current="page"] {
    color: var(--color-ink);
    font-weight: 600;
  }

  @media (min-width: 1280px) {
    inline-size: auto;
    padding-inline: var(--space-2);
  }
}

:is(.site-header__link, .mobile-menu__label) > .icon {
  display: inline-grid;
  place-items: center;
  inline-size: 1rem;
  block-size: 1lh;
  font-size: inherit;
  line-height: inherit;

  &::before {
    font-size: 1rem;
    line-height: 1;
  }
}

.mobile-menu__label > .icon {
  align-self: flex-start;
}

.icon--favorite {
  color: var(--color-favorite);
}

.site-header__label {
  display: none;

  @media (min-width: 1280px) {
    display: inline;
  }
}

/* <768: only the Omiljene icon link (S3.1) */
.site-header__fav {
  display: inline-grid;
  place-items: center;
  inline-size: var(--size-target);
  block-size: var(--size-target);
  border-radius: var(--radius-pill);
  color: var(--color-ink);
  text-decoration: none;

  @media (min-width: 768px) {
    display: none;
  }
}

/* Soft-navigation progress line (S3.1, S4.3) */
.site-header__progress {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: var(--ring-width);
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  pointer-events: none;

  &.is-loading {
    opacity: 1;
    transform: scaleX(0.8);
    transition: transform var(--dur-progress) var(--ease-out);
  }

  &.is-done {
    opacity: 0;
    transform: scaleX(1);
    transition:
      transform var(--dur-fade) var(--ease-out),
      opacity var(--dur-fade) var(--ease-out) var(--dur-fade);
  }
}

/* Weather chip (S3.1, Z6) - rendered hidden, JS unhides */
.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding-inline: var(--space-2);
  color: var(--color-ink-2);
  font-size: var(--fs-subhead);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.weather-chip__temp {
  font-variant-numeric: tabular-nums;
}

.weather-chip__city {
  display: none;

  @media (min-width: 768px) {
    display: inline;
  }
}

/* Theme button + popover menu (S3.1, S4.3, S5.1) */
.theme-toggle {
  position: relative;
  inline-size: 2.125rem;
  block-size: 2.125rem;
  padding: 0.125rem;
  border: 1px solid #ffffff;
  background-color: #ffffff;
  color: var(--color-ink);

  & > .icon,
  & > .theme-toggle__auto {
    position: relative;
    inline-size: 1rem;
    block-size: 1rem;
  }
}

.theme-toggle__auto {
  display: none;
  font-size: 1rem;
  line-height: 1;
}

html[data-theme-mode="auto"] .theme-toggle {
  & > .icon {
    display: none;
  }

  & > .theme-toggle__auto {
    display: block;
  }
}

html[data-theme="dark"] .theme-toggle {
  border-color: #2a2d38;
  background-color: #2a2d38;
}

.theme-menu {
  /* Align with the theme button before the desktop player controls. */
  position: fixed;
  inset: auto;
  inset-block-start: calc(var(--header-h) + var(--space-1));
  inset-inline-end: calc((100% - min(100%, var(--wrap))) / 2 + var(--wrap-pad));

  @media (min-width: 1024px) {
    inset-inline-end: calc((100% - min(100%, var(--wrap))) / 2 + var(--wrap-pad) + 5.5rem);
  }

  margin: 0;
  min-inline-size: 12rem; /* why no token: popover width, unique to this menu */
  padding-block: var(--space-1);
  padding-inline: 0;
  border: var(--line-width) solid var(--color-line);
  border-radius: var(--radius-media);
  background-color: var(--color-surface-elevated);
  color: var(--color-ink);
  box-shadow: var(--shadow-popover);
  transform-origin: top right;
  /* close: reverse along the same path, mirrored easing (§7) */
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity var(--dur-fade) var(--ease-in),
    transform var(--dur-fade) var(--ease-in),
    overlay var(--dur-fade) var(--ease-in) allow-discrete,
    display var(--dur-fade) var(--ease-in) allow-discrete;

  &:popover-open {
    opacity: 1;
    transform: none;
    transition:
      opacity var(--dur-crossfade) var(--ease-out),
      transform var(--dur-crossfade) var(--ease-out),
      overlay var(--dur-crossfade) var(--ease-out) allow-discrete,
      display var(--dur-crossfade) var(--ease-out) allow-discrete;
  }
}

@starting-style {
  .theme-menu:popover-open {
    opacity: 0;
    transform: scale(0.96);
  }
}

.theme-menu__list {
  display: flex;
  flex-direction: column;
  padding: 0;
  list-style: none;
}

.theme-menu__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  inline-size: 100%;
  min-block-size: var(--size-target);
  padding-inline: var(--space-4);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-ink);
  font-size: var(--fs-callout);
  text-align: start;

  &[aria-pressed="true"] {
    font-weight: 600;
  }
}

.theme-menu__check {
  margin-inline-start: auto;
  visibility: hidden;
}

.theme-menu__option[aria-pressed="true"] > .theme-menu__check {
  visibility: visible;
}

@media (hover: hover) and (pointer: fine) {
  .theme-menu__option:hover {
    background-color: var(--color-fill);
  }
}

html:not(.js) :is(.theme-toggle, .theme-menu) {
  display: none;
}

/* Theme switch crossfade (S4.3, View Transitions where supported) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--dur-theme);
}

/* ==========================================================================
   4. Station list block - .station-list (S3.2)
   ========================================================================== */

/* H1 + count on one baseline row (S3.2 "Count") */
.page__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
}

.home-search__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  max-inline-size: 42rem;

  & > .station-search {
    flex: 1 1 14rem;
    max-inline-size: none;
  }
}

.home-links__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;

  @media (min-width: 768px) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.home-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-block-size: 6rem;
  padding: var(--space-6);
  border-radius: var(--radius-sheet);
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: var(--fs-title-3);
  font-weight: 500;
  text-decoration: none;

  & > .icon {
    inline-size: 2rem;
    block-size: 2rem;
    flex: none;
  }
}

.home-stream {
  scroll-margin-block-start: calc(var(--header-h) + var(--space-4));

  & > .hero-player {
    margin: 0;
  }
}

.home-stations {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.station-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.station-list__count {
  color: var(--color-ink-2);
  font-size: var(--fs-footnote);
  line-height: 1.4;
  letter-spacing: 0.006em;
  font-variant-numeric: tabular-nums;
}

.station-list__toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Search - no box: one bottom line, nothing else on its row (S3.2) */
.station-search {
  position: relative;
  margin: 0;

  @media (min-width: 768px) {
    max-inline-size: 22rem; /* why no token: S3.2 search width */
  }
}

.station-search__icon {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 50%;
  transform: translateY(-50%);
  color: var(--color-ink-3);
  pointer-events: none;
}

.station-search__input {
  inline-size: 100%;
  min-block-size: var(--size-target);
  padding-block: 0;
  padding-inline: var(--space-7) var(--size-target);
  border: 0;
  border-block-end: var(--line-width) solid var(--color-line-strong);
  border-radius: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;

  /* 2 px ink line on focus (1 px border + 1 px inset), plus the focus ring */
  &:focus {
    border-block-end-color: var(--color-ink);
    box-shadow: inset 0 calc(-1 * var(--line-width)) 0 var(--color-ink);
  }

  /* hide the WebKit cancel button so all engines look the same (S3.2) */
  &::-webkit-search-cancel-button,
  &::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
  }
}

.station-search__clear {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 0;
  margin-block-start: calc(var(--size-target) / -2);
  color: var(--color-ink-2);
}

/* shown only while the field has text; without JS it cannot clear */
.station-search:has(.station-search__input:placeholder-shown) .station-search__clear,
html:not(.js) .station-search__clear {
  display: none;
}

/* Genre links - plain text links, no counts, no fill, no pill (S3.2) */
.genre-nav {
  min-inline-size: 0;
}

.genre-nav__list {
  --genre-nav-gap: var(--space-3);
  display: flex;
  gap: var(--genre-nav-gap);
  margin: 0;
  /* room for the focus ring inside the scroller, recovered with negative margins */
  margin-block: calc(-1 * var(--space-2));
  margin-inline-start: calc(-1 * var(--space-3));
  padding-block: var(--space-2);
  padding-inline: var(--space-1) var(--space-7);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: calc(var(--size-target) + var(--genre-nav-gap) + var(--space-1)) var(--space-1);
  scrollbar-width: none;
  /* static right-edge fade, 2 rem (black = mask alpha only, not a color) */
  -webkit-mask-image: linear-gradient(to right, black calc(100% - var(--space-7)), transparent);
  mask-image: linear-gradient(to right, black calc(100% - var(--space-7)), transparent);

  &::-webkit-scrollbar {
    display: none;
  }

  & > li {
    flex: none;
    scroll-snap-align: start;
  }

  & > li:first-child {
    position: sticky;
    inset-inline-start: 0;
    z-index: var(--z-raised);
    margin-inline-end: calc(-1 * var(--genre-nav-gap));
    padding-inline-end: var(--genre-nav-gap);
    background: var(--color-bg);
    box-shadow: calc(-1 * var(--space-1)) 0 0 var(--color-bg);
  }

  @media (min-width: 1024px) {
    --genre-nav-gap: var(--space-4);
  }
}

.genre-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: var(--size-target);
  min-inline-size: var(--size-target);
  padding-inline: var(--space-2);
  color: var(--color-ink-2);
  font-size: var(--fs-subhead);
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;

  &:active {
    color: var(--color-ink);
  }

  &[aria-current="page"] {
    color: var(--color-ink);
    font-weight: 500;
    text-decoration: underline var(--line-width);
    text-underline-offset: 0.35em;
  }
}

.genre-nav--favorites {
  & .genre-nav__list {
    flex-wrap: wrap;
    gap: 0 var(--space-4);
    margin: 0;
    padding: 0;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  & .genre-nav__list > li:first-child {
    position: static;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  & .genre-nav__link {
    padding: var(--space-2);
    border: 0;
    border-radius: var(--radius-media);
    background: transparent;

    &[aria-pressed="true"] {
      color: var(--color-ink);
      font-weight: 500;
      text-decoration: underline var(--line-width);
      text-underline-offset: 0.35em;
    }

    &:active {
      background: var(--color-fill);
    }

    &:focus-visible {
      outline: var(--focus-width) solid var(--color-ink);
      outline-offset: var(--focus-offset);
    }
  }
}

@media (hover: hover) and (pointer: fine) {
  .genre-nav__link:hover {
    color: var(--color-ink);
  }
}

.catalog-filters {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0 var(--space-6);
}

.catalog-menu {
  min-inline-size: 0;

  @media (min-width: 768px) {
    position: relative;
  }
}

.catalog-menu__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-block-size: var(--size-target);
  color: var(--color-ink-2);
  font-size: var(--fs-subhead);
  line-height: 1.4;
  list-style: none;
  cursor: pointer;

  &::-webkit-details-marker {
    display: none;
  }

  &[data-selected] {
    color: var(--color-ink);
    font-weight: 500;
    text-decoration: underline var(--line-width);
    text-underline-offset: 0.35em;
  }

  & > .icon {
    flex: none;
    inline-size: var(--space-4);
    block-size: var(--space-4);
  }

  .catalog-menu[open] & > .icon {
    rotate: 180deg;
  }
}

.catalog-menu__list {
  position: absolute;
  z-index: var(--z-raised);
  inset-inline: 0;
  inset-block-start: 100%;
  max-block-size: 50svh;
  margin: 0;
  padding: var(--space-2);
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: var(--color-surface-elevated);
  border-radius: var(--radius-media);
  box-shadow: var(--shadow-popover);

  @media (min-width: 768px) {
    inset-inline-end: auto;
    inline-size: 22rem; /* Matches the existing search field's maximum width. */
  }
}

.catalog-menu__link {
  display: flex;
  align-items: center;
  min-block-size: var(--size-target);
  padding: var(--space-2) var(--space-3);
  color: var(--color-ink-2);
  font-size: var(--fs-subhead);
  line-height: 1.4;
  text-decoration: none;

  &[aria-current="page"] {
    color: var(--color-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.25em;
  }

  &:active {
    background: var(--color-fill);
  }
}

.catalog-index {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--size-target);
  align-items: start;
  gap: var(--space-2);

  & > .station-grid {
    min-inline-size: 0;
    grid-auto-rows: auto;
  }

  & .station-letter {
    scroll-margin-block-start: calc(var(--header-h) + var(--space-4));
  }

  @media (min-width: 768px) {
    gap: var(--space-4);
  }
}

.station-letter {
  grid-column: 1 / -1;
  align-self: end;
  padding-block-start: var(--space-4);

  &:first-child {
    padding-block-start: 0;
  }
}

.station-letter__title {
  margin: 0;
  font-size: calc(var(--fs-title-2) / 2);

  & > a {
    text-decoration: none;
  }
}

.alphabet-index {
  position: sticky;
  inset-block-start: calc(var(--header-h) + var(--space-2));
  min-inline-size: 0;
  max-block-size: min(var(--alphabet-available, 100svh), calc(100svh - var(--header-h) - var(--bar-h) - var(--space-6) - env(safe-area-inset-bottom)));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.alphabet-index__list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
}

.alphabet-index__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-block-size: var(--space-7);
  inline-size: 100%;
  color: var(--color-ink-2);
  font-size: var(--fs-caption);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;

  &:focus-visible {
    outline-offset: calc(-1 * var(--focus-width));
  }

  &[aria-current="location"] {
    color: var(--color-ink);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.25em;
  }
}

.related-stations {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-block-start: var(--space-8);

  @media (min-width: 1024px) {
    margin-block-start: var(--space-10);
  }
}

@media (hover: hover) and (pointer: fine) {
  .catalog-menu__trigger:hover,
  .alphabet-index__link:hover {
    color: var(--color-ink);
  }

  .catalog-menu__link:hover {
    color: var(--color-ink);
    background: var(--color-fill);
  }
}

/* Grid - App Store-style list: every station is one uniform small row, one cell = one row
   track the height of the icon, whatever its placement (sold sizes live in the featured
   band, option C); never `dense`, so visual order = DOM order = focus order (S3.2) */
.station-grid {
  --station-row-gap: var(--space-3);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(var(--size-icon), auto);
  grid-auto-flow: row;
  gap: var(--station-row-gap) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;

  @media (min-width: 768px) {
    --station-row-gap: var(--space-4);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  @media (min-width: 1024px) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  @media (min-width: 1280px) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--space-4);
  }
}

.station-grid--home {
  & > .station-card--large {
    inline-size: 100%;
    row-gap: 0;
    padding: 0;

    & .station-card__name {
      font-size: 17px;
    }
  }

  & .station-card__cover {
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  }

  & .station-card__toggle {
    z-index: 2;
    display: grid;
    grid-column: 1;
    grid-row: 1;
    place-items: center;
    align-self: end;
    justify-self: end;
    inline-size: var(--size-target);
    block-size: var(--size-target);
    margin: var(--space-2);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-on-scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-fade) var(--ease-out);
  }

  & .station-card:is(.is-connecting, .is-playing, .is-reconnecting, .is-error) .station-card__toggle,
  & .station-card__toggle:focus-visible {
    opacity: 1;
    pointer-events: auto;
  }

  & .station-card__toggle .station-card__glyph {
    transform: none;
  }

  @media (hover: hover) and (pointer: fine) {
    & .station-card:hover .station-card__toggle {
      opacity: 1;
      pointer-events: auto;
    }
  }

  @media (hover: none) {
    & .station-card__toggle {
      opacity: 1;
      pointer-events: auto;
    }
  }

  & .station-card__text {
    gap: var(--space-1);
    padding: var(--space-4);
  }

  @media (min-width: 1024px) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Featured band - sold `wide` (4 : 3) and `large` (square) placements, between the H1 row
   and the search (S3.2, option C). PHP outputs it only when something is sold; no animation,
   its sizes never change at runtime. Radius 0: only the card art is rounded (S3.14) */
.featured {
  margin-block-end: calc(var(--space-7) - var(--space-6)); /* --space-7 below; the .page gap gives --space-6 */
}

/* visible label, quiet eyebrow (wording: legal review, S12 Q4) */
.featured__label {
  margin-block-end: var(--space-3);
  color: var(--color-ink-2);
  font-size: var(--fs-nav);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* <1024: one native scroll-snap row, full bleed to the screen edges, the next card peeking;
   ≥1024: wrapping rows, nothing hidden, no scrolling. The 8 px block padding (taken back by
   the margin) keeps the focus ring inside the scroller's clip */
.featured__list {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-block: calc(-1 * var(--space-2));
  margin-inline: calc(-1 * var(--wrap-pad));
  padding-block: var(--space-2);
  padding-inline: var(--wrap-pad);
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--wrap-pad);
  scrollbar-width: none;

  &::-webkit-scrollbar {
    display: none;
  }

  & > .station-card {
    scroll-snap-align: start;
  }

  @media (min-width: 1024px) {
    flex-wrap: wrap;
    gap: var(--space-7) var(--space-6);
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
    scroll-snap-type: none;
  }
}

/* edge cue: a 2 rem fade at the inline end, only while cards continue past it (hidden
   scrollbar); an inactive scroll timeline (nothing overflows) leaves no fade
   (black = mask alpha only, not a color) */
@property --edge-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@keyframes featured-scroll-edge {
  0% {
    --edge-end: var(--space-7);
  }

  92% {
    --edge-end: var(--space-7);
  }

  100% {
    --edge-end: 0px;
  }
}

@supports (animation-timeline: scroll()) {
  .featured__list {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - var(--edge-end)), transparent);
    mask-image: linear-gradient(to right, black calc(100% - var(--edge-end)), transparent);
    animation: featured-scroll-edge linear both;
    animation-timeline: scroll(self inline);

    @media (min-width: 1024px) {
      -webkit-mask-image: none;
      mask-image: none;
      animation: none;
    }
  }
}

/* Empty states (separate containers, toggled with `hidden`) */
.station-list__empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding-block: var(--space-7);
}

.station-list__empty-text {
  font-size: var(--fs-body);
  line-height: 1.55;
  max-inline-size: 38em;
}

.station-list__empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ==========================================================================
   5. Logo well (big player, bar thumb, sheet, TV) and station list item
   ========================================================================== */

.logo-well {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  overflow: clip;
  border-radius: var(--radius-media);
  background-color: var(--color-logo-well);
  color: var(--color-ink);

  /* A subtle inner edge separates artwork from the page in both themes. */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 var(--line-width) var(--color-hairline-media);
    pointer-events: none;
  }

}

/* NAXI artwork: source-cover colors, live type and flat CSS motifs. */
.has-naxi-art > img {
  visibility: hidden;
}

.naxi-art {
  position: absolute;
  inset: 0;
  display: block;
  container-type: inline-size;
  overflow: hidden;
  border-radius: inherit;
  background: var(--naxi-base);
  color: var(--naxi-ink);
  pointer-events: none;
  user-select: none;
}

.naxi-art__type {
  position: absolute;
  inset: 20%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2cqw;
  font-size: min(16cqw, calc(60cqw / var(--naxi-line-width, 4)));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: start;
  white-space: nowrap;
}

.naxi-art__channel {
  max-inline-size: 100%;
}

.naxi-art__motif {
  position: absolute;
  inset: 12% -24% 12% 48%;
  border: 5cqw solid currentColor;
  border-radius: 50%;
  opacity: 0.14;
  transform: rotate(-18deg);
}

/* Cassette reels and their flat shell. */
:is([data-naxi="naxi-70e"], [data-naxi="naxi-80e"], [data-naxi="naxi-millennium"]) .naxi-art__motif {
  inset: 36% -22% 10% 43%;
  border-width: 3cqw;
  border-radius: 5cqw;
  background:
    radial-gradient(circle at 25% 40%, currentColor 0 12%, transparent 12.5%),
    radial-gradient(circle at 75% 40%, currentColor 0 12%, transparent 12.5%);

  &::after {
    content: "";
    position: absolute;
    inset: 64% 16% -1% 16%;
    border: 2cqw solid currentColor;
    clip-path: polygon(15% 0, 85% 0, 100% 100%, 0 100%);
  }
}

/* Headphones: a single arch with two flat ear pads. */
:is([data-naxi="naxi-90e"], [data-naxi="naxi-dance"], [data-naxi="naxi-house"], [data-naxi="naxi-rnb"],
    [data-naxi="naxi-fitness"], [data-naxi="naxi-radio"], [data-naxi="naxi-hype-radio"]) .naxi-art__motif {
  inset: 16% -18% 12% 50%;
  border-block-end-color: transparent;
  border-radius: 50% 50% 25% 25%;

  &::before,
  &::after {
    content: "";
    position: absolute;
    inset-block: 48% 0;
    inline-size: 25%;
    border-radius: 3cqw;
    background: currentColor;
  }

  &::before { inset-inline-start: -10%; }
  &::after { inset-inline-end: -10%; }
}

/* Instrument strings and piano keys. */
:is([data-naxi="naxi-blues-rock"], [data-naxi="naxi-rock"], [data-naxi="naxi-exyurock"],
    [data-naxi="naxi-instrumental"], [data-naxi="naxi-gold"], [data-naxi="naxi-jazz"],
    [data-naxi="naxi-classic"], [data-naxi="naxi-bossa"]) .naxi-art__motif {
  inset: 17% -16% -10% 54%;
  border: 0;
  border-radius: 12cqw;
  background: repeating-linear-gradient(90deg, currentColor 0 2cqw, transparent 2cqw 8cqw);
  transform: rotate(28deg);
}

/* Horizon and sun, taken from the warm and relaxed channels. */
:is([data-naxi="naxi-adore"], [data-naxi="naxi-cafe"], [data-naxi="naxi-chill"],
    [data-naxi="naxi-lounge"], [data-naxi="naxi-love"], [data-naxi="naxi-latino"],
    [data-naxi="naxi-boem"], [data-naxi="naxi-xmas"]) .naxi-art__motif {
  inset: 26% -15% -10% 38%;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 65% 35%, currentColor 0 27%, transparent 27.5%),
    repeating-linear-gradient(0deg, currentColor 0 3cqw, transparent 3cqw 10cqw);
  transform: none;
}

/* Dance-floor lines and the angular motifs of the brighter covers. */
:is([data-naxi="naxi-chillwave"], [data-naxi="naxi-clubbing"], [data-naxi="naxi-disco"],
    [data-naxi="naxi-funk"], [data-naxi="naxi-fresh"], [data-naxi="naxi-exyu"],
    [data-naxi="naxi-mix"], [data-naxi="naxi-slager"], [data-naxi="naxi-evergreen"]) .naxi-art__motif {
  inset: 12% -30% -22% 50%;
  border: 0;
  border-radius: 0;
  background:
    repeating-linear-gradient(90deg, currentColor 0 2cqw, transparent 2cqw 14cqw),
    repeating-linear-gradient(0deg, currentColor 0 2cqw, transparent 2cqw 14cqw);
  transform: rotate(28deg);
}

[data-naxi="naxi-kids"] .naxi-art__motif {
  border: 0;
  border-radius: 0;
  background: currentColor;
  clip-path: polygon(50% 0, 62% 34%, 100% 36%, 70% 58%, 80% 96%, 50% 74%, 20% 96%, 30% 58%, 0 36%, 38% 34%);
}

[data-naxi="naxi-70e"] {
  --naxi-base: #c34b7a;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-80e"] {
  --naxi-base: #c51d44;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-90e"] {
  --naxi-base: #d9e3e9;
  --naxi-ink: #111111;
}
[data-naxi="naxi-adore"] {
  --naxi-base: #ea8d64;
  --naxi-ink: #111111;
}
[data-naxi="naxi-blues-rock"] {
  --naxi-base: #010030;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-boem"] {
  --naxi-base: #ab5c05;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-bossa"] {
  --naxi-base: #a7b312;
  --naxi-ink: #111111;
}
[data-naxi="naxi-cafe"] {
  --naxi-base: #e3640d;
  --naxi-ink: #111111;
}
[data-naxi="naxi-chill"] {
  --naxi-base: #3376c6;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-chillwave"] {
  --naxi-base: #0e104d;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-classic"] {
  --naxi-base: #b89800;
  --naxi-ink: #111111;
}
[data-naxi="naxi-clubbing"] {
  --naxi-base: #0b1b0d;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-dance"] {
  --naxi-base: #254d96;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-disco"] {
  --naxi-base: #0653f1;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-evergreen"] {
  --naxi-base: #007522;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-exyu"] {
  --naxi-base: #7f0e19;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-exyurock"] {
  --naxi-base: #06244c;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-fitness"] {
  --naxi-base: #78818e;
  --naxi-ink: #111111;
}
[data-naxi="naxi-fresh"] {
  --naxi-base: #36b403;
  --naxi-ink: #111111;
}
[data-naxi="naxi-funk"] {
  --naxi-base: #672d95;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-gold"] {
  --naxi-base: #9c4b02;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-house"] {
  --naxi-base: #1b510d;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-hype-radio"] {
  --naxi-base: #020000;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-instrumental"] {
  --naxi-base: #9f1ef6;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-jazz"] {
  --naxi-base: #553517;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-kids"] {
  --naxi-base: #0b9ecf;
  --naxi-ink: #111111;
}
[data-naxi="naxi-latino"] {
  --naxi-base: #ec6e02;
  --naxi-ink: #111111;
}
[data-naxi="naxi-lounge"] {
  --naxi-base: #b24200;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-love"] {
  --naxi-base: #ec438e;
  --naxi-ink: #111111;
}
[data-naxi="naxi-millennium"] {
  --naxi-base: #a235b3;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-mix"] {
  --naxi-base: #e62214;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-rnb"] {
  --naxi-base: #189aa5;
  --naxi-ink: #111111;
}
[data-naxi="naxi-radio"] {
  --naxi-base: #020000;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-rock"] {
  --naxi-base: #1b1b1b;
  --naxi-ink: #ffffff;
}
[data-naxi="naxi-slager"] {
  --naxi-base: #f28153;
  --naxi-ink: #111111;
}
[data-naxi="naxi-xmas"] {
  --naxi-base: #eb9c5c;
  --naxi-ink: #111111;
}

/* S3.11: transparent logo flagged logo_on_light keeps a white well in dark only
   (PHP: modifier class; main.js player slots: .is-light-well) */
:root[data-theme="dark"] :is(.logo-well--light, .station-card__play--light-well, .logo-well.is-light-well) {
  background-color: var(--color-well-light);
}

/* the <img> main.js inserts into player logo slots carries no class */
:is(.logo-well__img, .logo-well > img) {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  user-select: none;          /* CSS#5 */
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Normalized covers already include their logo padding; every player uses the full square. */

/* A missing cover keeps the same framed square and scales its fallback glyph with it. */
.logo-well__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--color-ink-3);

  & .icon {
    inline-size: var(--cover-fallback-scale);
    block-size: var(--cover-fallback-scale);
    aspect-ratio: 1;
  }
}

/* Station row: cover, station link and category. */
.station-card {
  position: relative;
  display: grid;
  grid-template-columns: var(--size-icon) minmax(0, 1fr);
  column-gap: var(--space-3);
  align-items: center;
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-sheet);
  background: var(--color-surface);
  transition: box-shadow var(--dur-fade) var(--ease-out);
  content-visibility: auto;        /* S10: 151 items */
  contain-intrinsic-size: auto var(--size-icon);

  &.is-unfavorited {
    opacity: 0.55;
  }
}

/* Band cards (featured band only, S3.2 option C): wide = 4 : 3 art, half the square's area
   (× √(2/3) = 0.8165 wide); large = square art. Art well on top, one text row with the star
   under it; the ratio alone sets the height. No placeholder size (content-visibility
   visible: few cards, above the list), so no invisible room is needed either */
.station-card--wide,
.station-card--large {
  flex: none;
  inline-size: calc(var(--featured-large) * 0.8165);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  row-gap: var(--space-2);
  align-items: start;
  align-content: start;
  margin: 0;
  padding: var(--space-3);
  content-visibility: visible;
}

.station-card--large {
  inline-size: var(--featured-large);
}

/* Art = play target: <a> (no JS), <button> (JS) or <div> (not linked, JS upgrades) */
.station-card__play,
.station-card__cover {
  position: relative;
  z-index: 1;
  display: block;
  inline-size: var(--size-icon);
  block-size: var(--size-icon);
  padding: 0;
  border: 0;
  overflow: hidden;
  overflow: clip;
  border-radius: var(--radius-media);
  background-color: var(--color-logo-well);
  color: var(--color-ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  /* release from the press: spring back (S4.3 "List item press", art only) */
  transition: transform var(--dur-spring-snappy) var(--ease-spring);

  /* A subtle inner edge separates artwork from the page in both themes. */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 var(--line-width) var(--color-hairline-media);
    pointer-events: none;
  }

  &:active {
    transform: scale(0.95);
    transition: transform var(--dur-press) var(--ease-out);
  }

  :is(.station-card--wide, .station-card--large) > & {
    grid-column: 1 / -1;
    grid-row: 1;
    inline-size: 100%;
    block-size: auto;
    aspect-ratio: 1;

    &:active {
      transform: scale(0.97);
    }
  }

  .station-card--large > & {
    aspect-ratio: 1;
  }
}

/* square icon asset (or, until it exists, the logo) contained - never cropped (S3.2) */
.station-card__img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  user-select: none;          /* CSS#5 */
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Featured placements scale the same square cover used by list rows and players. */
:is(.station-card--wide, .station-card--large) > .station-card__play > .station-card__img {
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}

/* No logo: the well stays (the icon column never breaks) with one quiet glyph */
.station-card__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--color-ink-3);

  & .icon {
    inline-size: var(--cover-fallback-scale);
    block-size: var(--cover-fallback-scale);
    aspect-ratio: 1;
  }
}

/* DIDON uses the same live cover in the catalog and every player. */
:is([data-slug="didon-radio"], [data-logo-for^="didon-radio|"])
  :is(.station-card__fallback, .logo-well__fallback) {
  container-type: inline-size;
  overflow: hidden;
  isolation: isolate;
  border-radius: inherit;
  background: #6428c9;
  color: #ffffff;

  & > .icon {
    display: none;
  }

  &::before {
    content: "";
    position: absolute;
    inset: -25%;
    z-index: -1;
    background: conic-gradient(#6428c9, #c02f82, #ed6845, #1859ab, #6428c9);
    animation: didon-gradient 20s linear infinite;
  }

  &::after {
    content: "♪" / "";
    font-family: Arial, sans-serif;
    font-size: 72cqw;
    font-weight: 700;
    line-height: 1;
  }
}

@keyframes didon-gradient {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  :is([data-slug="didon-radio"], [data-logo-for^="didon-radio|"])
    :is(.station-card__fallback, .logo-well__fallback)::before {
    animation: none;
  }
}

/* Cover controls follow radio's track-cover-play-icon hover and playing states. */
.station-card__scrim {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-color: transparent;
  color: var(--color-on-scrim);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.station-card__glyph {
  inline-size: 28px;
  block-size: 28px;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.5);
  transform: scale(0.94);
  transition: transform 0.18s ease;

  & .icon,
  & .spinner {
    inline-size: 0.95rem;
    block-size: 0.95rem;
    filter: drop-shadow(0 1px 4px rgb(0 0 0 / 0.92));
  }
}

.station-card:is(.is-connecting, .is-playing, .is-reconnecting, .is-error) .station-card__scrim,
.station-card__play:focus-visible .station-card__scrim {
  opacity: 1;

  & .station-card__glyph {
    transform: scale(1);
  }
}

/* Cover artwork dims on hover while its playback control stays legible. */
.station-card__play > :is(.station-card__img, .station-card__fallback, .naxi-art) {
  transition: opacity var(--dur-fade) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .station-card:has(a.station-card__name):hover {
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.12);
  }

  .station-card__play:hover .station-card__scrim {
    opacity: 1;

    & .station-card__glyph {
      transform: scale(1);
    }
  }

  .station-card__play:hover > :is(.station-card__img, .station-card__fallback, .naxi-art) {
    opacity: 0.85;
  }
}

.station-card__sub > .station-card__genre {
  position: relative;
  z-index: 1;
  justify-self: start;
  min-block-size: 24px;
  color: inherit;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Text: name over the secondary line, centered on the icon */
.station-card__text {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;

  :is(.station-card--wide, .station-card--large) > & {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
  }
}

.station-card__name {
  display: block;
  min-block-size: 24px;
  overflow-wrap: anywhere;
  color: var(--color-ink);
  font-size: var(--fs-subhead);
  font-weight: 500;
  line-height: 1.3;
  text-align: start;
  text-decoration: none;

  .station-card--wide & {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
  }

  .station-card--large & {
    font-size: var(--fs-title-3);
    font-weight: 600;
    text-wrap: balance;
  }
}

/* The station link fills the row; the cover remains its own play control. */
a.station-card__name::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sheet);
}

a.station-card__name:focus-visible {
  outline: none;

  &::after {
    outline: var(--focus-width) solid var(--color-focus);
    outline-offset: calc(-1 * var(--focus-width));
  }
}

/* Secondary line: genre at rest, state text while active - two stacked spans in one
   cell, so the line never changes height (S4.3 cross-fade) */
.station-card__sub {
  display: grid;
  color: var(--color-ink-2);
  font-size: var(--fs-footnote);
  line-height: 1.4;

  & > * {
    grid-area: 1 / 1;
    min-inline-size: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;   /* CSS#3 */
    transition:
      opacity var(--dur-crossfade) var(--ease-out),
      visibility var(--dur-crossfade);
  }
}

.station-card__state {
  opacity: 0;
  visibility: hidden;
}

.station-card:is(.is-connecting, .is-playing, .is-reconnecting, .is-error) .station-card__sub {
  & > .station-card__genre {
    opacity: 0;
    visibility: hidden;
  }

  & > .station-card__state {
    opacity: 1;
    visibility: visible;
  }
}

.station-card.is-playing .station-card__state {
  color: var(--color-ink);
}

/* static waveform before "Uživo" while playing (S3.2) */
.station-card__wave {
  display: none;
  inline-size: 1em;
  block-size: 1em;
  margin-inline-end: var(--space-1);
  vertical-align: -0.125em;
}

.station-card.is-playing .station-card__wave {
  display: inline-block;
}

/* ==========================================================================
   6. Favorite toggle - .fav-toggle (S3.2, S3.13, S4.3)
   ========================================================================== */

.fav-toggle {
  color: var(--color-ink-2);

  &[aria-pressed="true"] {
    color: var(--color-favorite);
  }
}

.fav-toggle__icons {
  display: inline-grid;
  place-items: center;

  & > .icon {
    grid-area: 1 / 1;
  }
}

.fav-toggle__on {
  color: var(--color-favorite);
  opacity: 0;
  transform: scale(0.6);
  /* removal: fade 150 ms, then reset the scale without motion */
  transition:
    opacity var(--dur-fade) var(--ease-out),
    transform 0s linear var(--dur-fade);
}

.fav-toggle[aria-pressed="true"] .fav-toggle__on {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-spring-snappy) var(--ease-spring),
    transform var(--dur-spring-snappy) var(--ease-spring);
}

html:not(.js) .fav-toggle {
  display: none;
}

/* ==========================================================================
   7. Station page - breadcrumb, .station-links, .station-text (S3.3)
   ========================================================================== */

.breadcrumb {
  display: flex;
  align-items: center;
  column-gap: calc(var(--space-3) / 2);
  min-inline-size: 0;
  min-block-size: 30px;
  padding-block: 0;
  margin-block-end: var(--space-3);
  border-block-end: var(--line-width) solid var(--color-line);
  color: var(--color-ink-2);
  font-size: var(--fs-caption);
  line-height: 1.4;

  &::before {
    content: "Vi ste ovde:";
    font-weight: 500;
    white-space: nowrap;
  }
}

.breadcrumb__list {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-inline-size: 0;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  list-style: none;
  letter-spacing: 0.006em;
  scrollbar-width: none;
}

.breadcrumb__item {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-inline-size: 0;
  min-block-size: 28px;
  white-space: nowrap;

  & + &::before {
    content: "›";
    content: "›" / "";
    padding-inline: var(--space-1);
    color: var(--color-ink-2);
  }

  &[aria-current="page"] {
    color: var(--color-ink);
    font-weight: 500;
  }
}

.breadcrumb__link {
  display: inline-flex;
  align-items: center;
  min-block-size: 28px;
  color: inherit;
  text-decoration: none;

  &:hover {
    color: var(--color-ink);
    text-decoration: none;
  }

  &:focus-visible {
    outline: var(--focus-width) solid var(--color-focus);
    outline-offset: var(--focus-offset);
    text-decoration: underline;
    text-underline-offset: 0.15em;
  }
}

/* Links - label + one trailing arrow, grow-underline like the footer (S3.3, CSS#8, CSS#9) */
.station-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  padding: 0;
  list-style: none;
}

.station-links__link {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-1);
  min-block-size: var(--size-target);
  padding-block: var(--space-2);
  color: var(--color-ink);
  font-size: var(--fs-callout);
  line-height: 1.4;
  text-decoration: none;

  & .icon {
    inline-size: 1lh;
    block-size: 1lh;
    padding: 0.1875em; /* why no token: glyph inset inside the 1lh box, scales with the text */
    color: var(--color-ink-2);
  }
}

.station-links__label {
  background: linear-gradient(currentColor 0 0) left bottom / 0 var(--line-width) no-repeat;
  transition: background-size var(--dur-underline) var(--ease-underline);
}

@media (hover: hover) and (pointer: fine) {
  .station-links__link:hover .station-links__label {
    background-size: 100% var(--line-width);
  }
}

/* SEO text; the privacy page reuses the same typography (S3.12) */
.station-text,
.legal-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-inline-size: 38em;
  font-size: var(--fs-body);
  line-height: 1.55;
  text-wrap: pretty;
}

.legal-text {
  & h2 {
    margin-block-start: var(--space-4);
  }

  & ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-inline-start: var(--space-6);
  }
}

/* ==========================================================================
   10. Footer - .site-footer (S3.10)
   ========================================================================== */

.site-footer {
  padding-block: var(--space-8);
  color: var(--color-ink-2);
  font-size: var(--fs-footnote);
  line-height: 1.4;
}

.site-footer__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-block-start: var(--space-6);

  /* 1 px hairline across the container: the page ends without a box (S3.10) */
  &::before {
    content: "";
    position: absolute;
    inset-inline: var(--wrap-pad);
    inset-block-start: 0;
    block-size: var(--line-width);
    background-color: var(--color-line);
  }
}

.site-footer__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  padding: 0;
  list-style: none;
}

/* CSS#9 grow-underline on background-size (small inline element, S10 exception) */
.site-footer__link {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--size-target);
  color: var(--color-ink);
  font-size: var(--fs-subhead);
  text-decoration: none;
  background: linear-gradient(currentColor 0 0) left bottom / 0 var(--line-width) no-repeat;
  background-origin: content-box;
  padding-block: var(--space-3);
  transition: background-size var(--dur-underline) var(--ease-underline);

  &:hover,
  &[aria-current="page"] {
    background-size: 100% var(--line-width);
  }

  &[aria-current="page"] {
    font-weight: 600;
  }
}

.site-footer__copy {
  color: var(--color-ink-3);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   11. Keyframes
   ========================================================================== */

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

@keyframes page-in {
  from {
    opacity: 0;
  }
}

@keyframes text-in {
  from {
    opacity: 0;
  }
}

@keyframes hero-shift {
  from {
    transform: translateY(calc(-1 * var(--hero-shift, 0px)));
  }
}

@keyframes hero-logo-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

@keyframes edge-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ==========================================================================
   12. Preferences and fallbacks (S4.3 reduced-motion column, S5.6)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  /* presses: opacity instead of scale */
  :is(.button, .icon-button, .theme-toggle, .fav-toggle, .station-search__clear,
      .theme-menu__option, .player-bar__play, .player-bar__retry,
      .player-sheet__close, .player-sheet__play, .tv-stage__button, .hero-player__play,
      .hero-player__tv, .player-bar__tv, .sleep-timer__button, .sleep-timer__option,
      .station-card__play) {
    transition: opacity var(--dur-press) var(--ease-out);

    &:active:not(:disabled) {
      transform: none;
      opacity: 0.8;
    }
  }

  /* glyph and favorite: opacity only */
  .play-glyph > *,
  .fav-toggle__on,
  .fav-toggle[aria-pressed="true"] .fav-toggle__on {
    transform: none !important;
  }

  /* spinners: static arc, the text carries the state */
  :is(.is-connecting, .is-reconnecting) .spinner,
  .hero-player .hero-player__play::after {
    animation: none !important;
  }

  /* bar: opacity 150 ms, no transform (S4.3) */
  .player-bar {
    transition:
      opacity var(--dur-fade) var(--ease-out),
      visibility 0s linear;
  }

  .player[data-bar="away"] .player-bar {
    transform: none;
    opacity: 0;
    transition:
      opacity var(--dur-fade) var(--ease-in),
      visibility 0s linear var(--dur-fade);
  }

  @starting-style {
    .player-bar {
      opacity: 0;
      transform: none;
    }
  }

  /* popovers: opacity only */
  .theme-menu,
  .theme-menu:popover-open,
  .sleep-timer__menu,
  .sleep-timer__menu:popover-open {
    transform: none;
    transition:
      opacity var(--dur-fade-reduced) var(--ease-out),
      overlay var(--dur-fade-reduced) linear allow-discrete,
      display var(--dur-fade-reduced) linear allow-discrete;
  }

  @starting-style {
    .theme-menu:popover-open,
    .sleep-timer__menu:popover-open {
      opacity: 0;
      transform: none;
    }
  }

  /* TV stage: opacity 200 ms */
  .tv-stage,
  .tv-stage[open]:not(.is-closing) {
    transform: none;
    transition:
      opacity var(--dur-crossfade) var(--ease-out),
      overlay var(--dur-crossfade) linear allow-discrete,
      display var(--dur-crossfade) linear allow-discrete;
  }

  @starting-style {
    .tv-stage[open] {
      opacity: 0;
      transform: none;
    }
  }

  /* soft navigation: instant */
  .page.is-entering {
    animation: none;
  }

  /* big player strip → full: no translate, no scale; the list fades in at its new place,
     the band content fades in with no delay, the band keeps its own edge (S3.13, S4.3) */
  .hero-player.is-expanding {
    border-block-end-color: var(--color-line);

    & :is(.hero-player__media, .hero-player__text, .hero-player__actions > *) {
      animation: text-in var(--dur-crossfade) var(--ease-out) both;
    }
  }

  .hero-player ~ .is-shifting {
    animation: text-in var(--dur-fade) var(--ease-out);
  }

  .hero-player + .is-shifting::before {
    content: none;
  }

  /* progress line: static, opacity only */
  .site-header__progress {
    &.is-loading {
      transform: scaleX(1);
      transition: opacity var(--dur-fade) var(--ease-out);
    }

    &.is-done {
      transform: scaleX(1);
      transition: opacity var(--dur-fade) var(--ease-out);
    }
  }

  /* underlines shown instantly */
  .site-footer__link,
  .station-links__label {
    transition: none;
  }
}

/* No backdrop-filter support (neither prefixed nor unprefixed): chrome and bar at 94 % (S5.6) */
@supports not (backdrop-filter: blur(1px)) {
  @supports not (-webkit-backdrop-filter: blur(1px)) {
    .site-header,
    .player-bar,
    .player-sheet__panel {
      background-color: color-mix(in srgb, var(--color-bg) 94%, transparent);
    }
  }
}

/* Reduced transparency: opaque surfaces, no blur */
@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .player-bar,
  .player-sheet__panel {
    background-color: var(--color-bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Increased contrast: opaque + 1 px strong borders; ink-2 → ink */
@media (prefers-contrast: more) {
  :root,
  :root[data-theme="dark"] {
    --color-ink-2: var(--color-ink);
    --color-hairline-media: var(--color-line-strong);
  }

  .site-header {
    background-color: var(--color-bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-block-end: var(--line-width) solid var(--color-line-strong);
  }

  .player-bar {
    background-color: var(--color-bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-block-start-color: var(--color-line-strong);
  }

  .player-sheet__panel {
    background-color: var(--color-bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: var(--line-width) solid var(--color-line-strong);
  }

  .genre-nav__link[aria-current="page"] {
    text-decoration-thickness: var(--ring-width);
  }
}

/* Forced colors: system colors and selection */
@media (forced-colors: active) {
  .genre-nav__link[aria-current="page"] {
    outline: var(--ring-width) solid Highlight;
  }

  .station-card:is(.is-playing, .is-reconnecting) .station-card__play {
    outline: var(--ring-width) solid Highlight; /* the box-shadow ring is dropped in forced colors */
    outline-offset: calc(-1 * var(--ring-width));
  }

  .logo-well,
  .station-card__play,
  .button,
  .theme-menu,
  .sleep-timer__menu,
  .player-bar,
  .player-sheet__panel {
    border: var(--line-width) solid CanvasText;
  }

  .player-sheet__grabber {
    background-color: CanvasText;
    opacity: 1;
  }
}

/* ==========================================================================
   13. About - /o-nama: sleep dial and inline option buttons
   Page layout lives in about.css; main.js drives the dial and the buttons.
   ========================================================================== */

/* Sleep dial (Pointer Events + Spring in main.js; role="slider") */
.sleep-dial {
  display: grid;
  justify-items: start;
  gap: var(--space-4);
  inline-size: 100%; /* full column, so the dial gets its 280 px */
}

.sleep-dial__surface {
  position: relative;
  display: grid;
  place-items: center;
  container-type: inline-size;
  inline-size: min(100%, 17.5rem); /* why no token: dial diameter, 280 px */
  aspect-ratio: 1;
  border-radius: var(--radius-pill);
  cursor: grab;
  touch-action: none; /* the dial owns the gesture (§2) */
  user-select: none;
  -webkit-user-select: none;

  .sleep-dial.is-dragging & {
    cursor: grabbing;
  }
}

.sleep-dial__arc {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  overflow: visible;
}

/* stroke widths are SVG user units of the 240 × 240 dial, not page spacing */
.sleep-dial__track,
.sleep-dial__fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
}

.sleep-dial__track {
  stroke: var(--color-line);
}

.sleep-dial__fill {
  stroke: var(--color-accent);
  stroke-dasharray: 0 360;
}

.sleep-dial__thumb circle {
  fill: var(--color-accent);
  stroke: var(--color-bg);
  stroke-width: 4;
}

.sleep-dial__readout {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  pointer-events: none;
}

.sleep-dial__value {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;

  /* off state (main.js keeps aria-valuenow on the slider): the longest label */
  .sleep-dial__surface[aria-valuenow="0"] & {
    letter-spacing: -0.01em;
  }

  &.is-updated {
    animation: about-fade var(--dur-fade) var(--ease-out);
  }
}

/* the engine's own countdown (J15 [data-sleep-label]); only while the timer runs */
.sleep-dial__countdown {
  display: none;
  color: var(--color-ink-2);
  font-size: var(--fs-footnote);
  font-variant-numeric: tabular-nums;

  .sleep-dial.is-running & {
    display: block;
  }
}

/* Theme and sleep-timer buttons, inline */
.about-theme {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-6);
}

/* unboxed like .theme-menu__option (S3.14: no new rounded element); chosen = ink + underline,
   one weight for all options so the row never shifts */
.about-theme__option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-block-size: var(--size-target-lg);
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  color: var(--color-ink-2);
  font-size: var(--fs-callout);
  font-weight: 600;
  text-decoration-thickness: var(--ring-width);
  text-underline-offset: 0.4em;
  transition: transform var(--dur-spring-snappy) var(--ease-spring), color var(--dur-fade) var(--ease-out);

  &[aria-pressed="true"] {
    color: var(--color-ink);
    text-decoration-line: underline;
  }

  &:active {
    transform: scale(0.98);
    transition: transform var(--dur-press) var(--ease-out);
  }
}

@media (hover: hover) and (pointer: fine) {
  .about-theme__option:hover {
    color: var(--color-ink);
  }
}

@keyframes about-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ---- Preferences (S4.3 reduced-motion column, S5.6) ---- */

@media (prefers-reduced-motion: reduce) {
  .about-theme__option {
    transition: opacity var(--dur-press) var(--ease-out);

    &:active {
      transform: none;
      opacity: 0.8;
    }
  }
}

@media (forced-colors: active) {
  .about-theme__option[aria-pressed="true"] {
    outline: var(--ring-width) solid Highlight;
  }

  .sleep-dial__fill,
  .sleep-dial__thumb circle {
    stroke: Highlight;
    fill: none;
  }

  .sleep-dial__thumb circle {
    fill: Highlight;
  }
}
