.theme-category-nav { position:relative; display:grid; gap:8px; min-width:0; border-bottom:1px solid var(--rule); padding:0 0 10px; margin-top:calc(var(--s4) - var(--s6)); font-family:var(--sans); }
.theme-navigation-heading { position:relative; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:16px; min-width:0; }
.theme-focus-label { color:var(--heading); font-size:.68rem; font-weight:700; line-height:1.3; letter-spacing:.08em; text-transform:uppercase; }
.theme-navigation-actions { grid-column:3; grid-row:1; display:flex; align-items:center; gap:14px; }
.theme-category-link { display:flex; align-items:center; justify-content:flex-start; min-width:0; height:44px; padding:5px 9px; border:1px solid var(--rule); border-radius:var(--radius); background:var(--paper-alt); color:var(--kind-theme); font-family:var(--sans); font-size:.75rem; font-weight:600; line-height:1.35; letter-spacing:normal; text-transform:none; text-decoration:none; -webkit-tap-highlight-color:transparent; }
.theme-category-title { font-family:var(--serif); font-weight:700; letter-spacing:.012em; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; min-width:0; overflow:hidden; white-space:normal; overflow-wrap:anywhere; }
.theme-category-link.active { background:color-mix(in srgb,var(--kind-theme) 10%,var(--surface-paper, var(--paper))); border-color:var(--kind-theme); color:var(--kind-theme); }
/* The themes as subtle pills, each as long as its title, in up to two rows;
   on a computer the navigation script hides the ones that would start a
   third (the height limit covers a page without it), and a title too long
   for a row ends in an ellipsis. */
.theme-category-scroller { position:relative; min-width:0; }
.theme-category-strip { min-width:0; max-height:calc(2 * (1.35em + 8px) + 6px); overflow:hidden; font-size:.92rem; }
.theme-category-rows { display:flex; flex-wrap:wrap; gap:6px 8px; min-width:0; }
.theme-category-strip .theme-category-link { flex:0 1 auto; max-width:100%; height:auto; padding:3px 11px; border:1px solid color-mix(in srgb,var(--kind-theme) 28%,var(--rule)); border-radius:999px; background:color-mix(in srgb,var(--kind-theme) 6.5%,transparent); font-size:inherit; line-height:1.35; }
/* The page's a:hover turns links red; a tap leaves a phone hovering, which
   flashed the theme red before the next one loaded. */
.theme-category-link:hover { color:var(--kind-theme); }
.theme-all-link:hover { color:var(--heading); }
/* A theme is pressed, never dragged or selected (navigation.js opens it). */
.theme-category-link, .theme-browse-link { -webkit-user-select:none; user-select:none; -webkit-user-drag:none; }
.theme-category-strip .theme-category-title { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.theme-category-strip .theme-category-link[hidden] { display:none; }
.theme-category-strip .theme-category-link.active { border-color:color-mix(in srgb,var(--kind-theme) 55%,var(--rule)); background:color-mix(in srgb,var(--kind-theme) 12%,transparent); }
/* On the dark page a strip of rose titles reads as a wall of pink; there the
   themes stay neutral until hovered or chosen. */
:root[data-theme="dark"] .theme-category-strip .theme-category-link:not(.active):not(:hover) { border-color:color-mix(in srgb,var(--rule-strong) 35%,var(--rule)); background:color-mix(in srgb,var(--ink) 4%,transparent); color:var(--ink-soft); }
.theme-strip-arrow { display:none; }
.theme-all-link { color:var(--heading); height:auto; min-height:32px; padding:4px 0; border:0; background:none; font-size:.74rem; font-weight:500; }
.theme-all-link.active { background:none; color:var(--ink); text-decoration:underline; text-underline-offset:4px; }
.theme-browser { flex:0 0 auto; }
.theme-more { display:flex; align-items:center; gap:5px; min-height:32px; padding:4px 0; border:0; background:none; color:var(--ink-soft); font-family:var(--sans); font-size:.74rem; font-weight:500; line-height:1.35; cursor:pointer; white-space:nowrap; list-style:none; }
.theme-more::-webkit-details-marker { display:none; }
.theme-more:hover, .theme-browser[open] .theme-more { color:var(--ink); }
.theme-more svg { width:10px; height:10px; }
.theme-browser[open] .theme-more svg { transform:rotate(180deg); }
.theme-browse-panel { position:absolute; z-index:19; top:calc(100% - 1px); right:0; width:min(440px,100%); padding:12px; border:1px solid var(--rule-strong); border-radius:var(--radius); background:var(--surface-paper, var(--paper)); box-shadow:0 8px 20px rgba(18,18,18,.12); }
.theme-browse-label { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.theme-browse-search { display:block; width:100%; min-height:44px; padding:10px 12px; border:1px solid var(--rule); border-radius:var(--radius); background:var(--paper-alt); color:var(--ink); font-family:var(--sans); font-size:1rem; }
.theme-browse-list { max-height:min(360px,50dvh); margin:8px 0 0; padding:0; overflow-y:auto; overscroll-behavior:contain; list-style:none; }
.theme-browse-link { font-family:var(--serif); font-weight:600; display:block; padding:11px 10px; border-bottom:1px solid var(--rule); color:var(--kind-theme); font-size:.85rem; line-height:1.4; overflow-wrap:anywhere; text-decoration:none; }
.theme-browse-link:hover, .theme-browse-link[aria-current="page"] { background:var(--paper-alt); color:var(--kind-theme); }
.theme-browse-link[aria-current="page"] { font-weight:700; }
.theme-browse-status { margin:12px 10px 4px; color:var(--muted); font-size:.85rem; line-height:1.5; }
.theme-browse-retry { margin:8px 10px 4px; padding:8px 12px; border:1px solid var(--rule); border-radius:var(--radius); background:var(--paper-alt); color:var(--ink); font:inherit; cursor:pointer; }
.theme-browse-status[hidden], .theme-browse-retry[hidden], .theme-browse-list li[hidden] { display:none; }
.theme-category-link:focus-visible, .theme-more:focus-visible, .theme-browse-link:focus-visible, .theme-browse-search:focus-visible, .theme-browse-retry:focus-visible, .theme-ticker:focus-visible, .theme-ticker-item:focus-visible { outline:2px solid var(--heading); outline-offset:-2px; }
.theme-ticker { grid-column:2; grid-row:1; min-width:0; overflow-x:auto; scrollbar-width:none; font-size:.76rem; line-height:1.4; cursor:grab; touch-action:pan-x pan-y; -webkit-tap-highlight-color:transparent; }
.theme-ticker[hidden], .theme-ticker [hidden] { display:none; }
/* The feed loads after the page; its row is reserved so the navigation does not shift. */
.theme-ticker { min-height:32px; transition:opacity .16s ease-out; }
.theme-ticker.is-loading { opacity:0; visibility:hidden; pointer-events:none; }
.theme-ticker::-webkit-scrollbar { display:none; }
.theme-ticker.is-dragging { cursor:grabbing; }
.theme-ticker-track, .theme-ticker-group { display:flex; align-items:center; width:max-content; }
.theme-ticker-item { display:flex; flex:0 0 auto; align-items:center; gap:5px; min-height:32px; color:var(--ink-soft); text-decoration:none; white-space:nowrap; user-select:none; -webkit-user-select:none; }
.theme-ticker-title { font-family:var(--serif); font-weight:600; color:var(--ticker-color); }
.theme-ticker-item::after { content:'·'; margin:0 18px; color:var(--muted); }
.theme-ticker-item[data-kind="event"] { --ticker-color:var(--kind-event); }
.theme-ticker-item[data-kind="theme"] { --ticker-color:var(--kind-theme); }
/* Both kinds share one label style: the plain label in the kind colour, the
   emphasised one ("Händer nu:", "Aktuell händelse:", "Aktuellt tema:") bold. */
.theme-ticker-label { font-family:var(--sans); color:var(--ticker-color); font-weight:400; }
.theme-ticker-emphasis { font-weight:700; }
@media(hover:hover) and (pointer:fine) {
  .theme-category-link:hover { background:color-mix(in srgb,var(--kind-theme) 8%,var(--surface-paper, var(--paper))); border-color:var(--kind-theme); color:var(--kind-theme); }
  .theme-category-strip .theme-category-link:hover { border-color:color-mix(in srgb,var(--kind-theme) 45%,var(--rule)); background:color-mix(in srgb,var(--kind-theme) 9%,transparent); }
  .theme-all-link:hover { background:none; color:var(--ink); text-decoration:underline; text-underline-offset:4px; }
  .theme-ticker-item:hover { color:var(--ink); }
  .theme-ticker-item:hover .theme-ticker-title { text-decoration:underline; text-underline-offset:3px; }
}
@media(max-width:720px) {
  .theme-navigation-heading { grid-template-columns:minmax(0,1fr) auto; column-gap:12px; row-gap:0; }
  .theme-navigation-actions { grid-column:2; }
  .theme-ticker { grid-column:1 / -1; grid-row:2; }
  /* Little room above and under the ticker's line. */
  .theme-ticker, .theme-ticker-item { min-height:26px; }
  .theme-ticker { margin-top:-5.5px; }
  /* The same two rows, scrolled sideways together (the navigation script
     sets the rows' width so the themes wrap into two); an arrow shows at
     each end with more to see and scrolls on a tap. */
  .theme-category-strip { max-height:none; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; overscroll-behavior-x:contain; font-size:.86rem; }
  .theme-category-strip::-webkit-scrollbar { display:none; }
  .theme-category-rows { width:max-content; }
  .theme-category-strip .theme-category-link { flex:0 0 auto; max-width:none; }
  .theme-strip-arrow { position:absolute; z-index:1; top:0; bottom:0; display:grid; place-items:center; width:40px; padding:0; border:0; background:linear-gradient(to right, var(--surface-paper, var(--paper)) 45%, transparent); color:var(--heading); cursor:pointer; -webkit-tap-highlight-color:transparent; }
  /* Horizontal moves reach the script, which scrolls the row with them. */
  .theme-strip-arrow { touch-action:pan-y; }
  .theme-strip-arrow[hidden] { display:none; }
  .theme-strip-prev { left:0; justify-items:start; }
  .theme-strip-next { right:0; background:linear-gradient(to left, var(--surface-paper, var(--paper)) 45%, transparent); justify-items:end; }
  .theme-strip-arrow svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
  .theme-all-link, .theme-more { min-height:44px; }
}
