    /* Kartan korkeus mukautuu ikkunaan: ei ylitä matalaa näkymää, mutta käyttää tilan isolla näytöllä.
       Ensimmäinen height on varalla selaimille, jotka eivät tunne clamp()/dvh. */
    #map { height: 500px; height: clamp(420px, 72dvh, 720px); width: 100%; z-index: 1; border-radius: var(--r-md); }
    .map-frame { height: 500px; height: clamp(420px, 72dvh, 720px); width: 100%; border: 0; border-radius: var(--r-md); }
    /* iPhonen kotipalkki ei peitä alanavigaatiota */
    nav.fixed { padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); }
    @media (prefers-reduced-motion: reduce) {
      .animate-ping, .animate-pulse { animation: none !important; }
    }
    /* ---------- Tyyliarvot: värit, pyöristykset ja varjot yhdessä paikassa. Tumma tila vaihtaa vain arvot. ---------- */
    :root {
      --bg: #f8fafc; --surface: #fff; --surface-2: #f8fafc; --surface-3: #f1f5f9; --surface-4: #e2e8f0;
      --border: #e2e8f0; --border-soft: #f1f5f9; --border-ctl: #e2e8f0; --border-strong: #cbd5e1;
      --text: #0f172a; --text-2: #334155; --text-3: #475569; --muted: #64748b; --faint: #94a3b8;
      --accent: #2563eb; --accent-ink: #2563eb; --accent-soft: #eff6ff; --accent-line: #93c5fd; --ring: rgba(59,130,246,.45);
      --dis: #ea580c; --warn: #f59e0b; --danger: #dc2626; --ok: #059669;
      --r-sm: .5rem; --r-md: .75rem; --r-lg: 1rem; --r-full: 9999px;
      --shadow-sm: 0 1px 3px rgba(15,23,42,.15); --shadow-pop: 0 12px 32px rgba(0,0,0,.2);
    }
    html.dark {
      --bg: #020617; --surface: #0f172a; --surface-2: #111c33; --surface-3: #1e293b; --surface-4: #334155;
      --border: #1e293b; --border-soft: #1e293b; --border-ctl: #334155; --border-strong: #334155;
      --text: #f1f5f9; --text-2: #cbd5e1; --text-3: #cbd5e1; --muted: #94a3b8; --faint: #64748b;
      --accent-ink: #60a5fa; --accent-soft: rgba(37,99,235,.2); --accent-line: rgba(96,165,250,.5); --ring: rgba(96,165,250,.5);
      --shadow-pop: 0 12px 32px rgba(0,0,0,.5);
    }
    /* ---------- Yhteiset komponentit: painike, siru, segmenttivalitsin, kortti, valikko ja kenttä ---------- */
    .btn { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .75rem; border: 1px solid var(--border-ctl); border-radius: var(--r-md);
      background: var(--surface); color: var(--text-2); font-size: .75rem; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
    .btn:hover { background: var(--surface-3); color: var(--text); }
    .btn.is-on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
    .chip { flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border: 1px solid var(--border-ctl); border-radius: var(--r-full);
      background: var(--surface); color: var(--text-3); font-size: .75rem; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
    .chip:hover { background: var(--surface-3); color: var(--text); }
    .chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
    .seg { display: inline-flex; gap: .25rem; padding: .25rem; background: var(--surface-3); border: 1px solid var(--border-ctl); border-radius: var(--r-lg); }
    .seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .4rem .8rem; border-radius: var(--r-md);
      color: var(--muted); font-size: .8rem; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s; }
    .seg-btn:hover { color: var(--text); }
    .seg-btn.is-on, .seg-btn.is-active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
    .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
    .menu { padding: .8rem; background: var(--surface); border: 1px solid var(--border-ctl); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
    .menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border-radius: var(--r-md); text-align: left;
      font-size: .82rem; font-weight: 600; color: var(--text); }
    .menu-item:hover { background: var(--surface-3); }
    .menu-item.is-active { background: var(--accent); color: #fff; }
    .field { padding: .45rem .7rem; border: 1px solid var(--border-ctl); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-size: .8rem; }
    .btn:focus-visible, .chip:focus-visible, .seg-btn:focus-visible, .menu-item:focus-visible, .field:focus { outline: none; box-shadow: 0 0 0 3px var(--ring); }
    /* ---------- Näkymien yhteinen rakenne: otsikkorivi, tilaviestit ja tekstiasteikko ---------- */
    :root { --fs-xs: .7rem; --fs-sm: .8rem; --fs-md: .9rem; --fs-lg: 1.2rem; }
    .view-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem; }
    .view-head-tight { margin-bottom: 0; }
    .view-head-main { min-width: 0; flex: 1 1 14rem; }
    .view-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .45rem; font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; line-height: 1.25; color: var(--text); }
    .view-desc { margin-top: .15rem; font-size: var(--fs-sm); color: var(--muted); }
    .view-meta { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
    .view-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
    .wx-actions { flex: 1 1 22rem; justify-content: flex-end; }
    .wx-actions .wx-search-wrap { flex: 1 1 14rem; max-width: 26rem; }
    @media (max-width: 640px) {
      .view-desc { display: none; }
      .view-head { margin-bottom: .75rem; }
      .view-head-tight { margin-bottom: 0; }
      .view-title { font-size: 1.05rem; }
    }
    .state { padding: 2rem 1rem; text-align: center; font-size: var(--fs-sm); color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
    .state-loading::before { content: ""; display: block; width: 1.5rem; height: 1.5rem; margin: 0 auto .6rem; border-radius: var(--r-full);
      border: 3px solid var(--surface-4); border-top-color: var(--accent); animation: state-spin .8s linear infinite; }
    @keyframes state-spin { to { transform: rotate(360deg); } }
    @media (prefers-reduced-motion: reduce) { .state-loading::before { animation: none; } }
    /* ---------- Tumma tila (html.dark) ---------- */
    html.dark { color-scheme: dark; }
    html.dark body { background: #020617; color: #e2e8f0; }
    html.dark .bg-white { background-color: #0f172a; }
    html.dark .bg-slate-50 { background-color: #0b1424; }
    html.dark .bg-slate-100 { background-color: #1e293b; }
    html.dark .hover\:bg-slate-50:hover { background-color: #1e293b; }
    html.dark .hover\:bg-slate-100:hover { background-color: #273449; }
    html.dark .hover\:bg-slate-200:hover { background-color: #334155; }
    html.dark .bg-slate-200 { background-color: #334155; }
    html.dark .text-slate-900, html.dark .text-slate-800 { color: #f1f5f9; }
    html.dark .text-slate-700 { color: #e2e8f0; }
    html.dark .text-slate-600 { color: #cbd5e1; }
    html.dark .text-slate-500, html.dark .text-slate-400 { color: #94a3b8; }
    html.dark .hover\:text-slate-900:hover { color: #f8fafc; }
    html.dark .border-slate-100 { border-color: #1e293b; }
    html.dark .border-slate-200, html.dark .border-slate-200\/80, html.dark .border-slate-300 { border-color: #334155; }
    html.dark .border-blue-100\/60 { border-color: #1e3a8a; }
    html.dark .group:hover .group-hover\:text-blue-600, html.dark .text-blue-600 { color: #60a5fa; }
    html.dark .bg-blue-600.text-white, html.dark .bg-blue-600 { color: #fff; }
    html.dark .bg-blue-50 { background-color: rgba(59,130,246,.15); }
    html.dark .hover\:bg-blue-100:hover { background-color: rgba(59,130,246,.28); }
    html.dark .text-blue-700 { color: #93c5fd; }
    html.dark .border-blue-200 { border-color: rgba(59,130,246,.35); }
    html.dark .bg-emerald-50, html.dark .bg-emerald-100 { background-color: rgba(16,185,129,.15); }
    html.dark .hover\:bg-emerald-100:hover { background-color: rgba(16,185,129,.28); }
    html.dark .text-emerald-700, html.dark .text-emerald-800 { color: #6ee7b7; }
    html.dark .border-emerald-200, html.dark .border-emerald-300 { border-color: rgba(16,185,129,.35); }
    html.dark .bg-amber-50 { background-color: rgba(245,158,11,.12); }
    /* Uusi uutinen: oma luokka (is-new), jotta korostus ei riipu Tailwindin utility-luokkien järjestyksestä */
    .news-item.is-new { background-color: #fffbeb; border-color: #fcd34d; }
    html.dark .news-item.is-new { background-color: rgba(245,158,11,.10); border-color: rgba(245,158,11,.5); }
    /* Luettu uutinen himmennetään; vie hiiri päälle niin se näkyy taas täysin */
    .news-item.is-read { opacity: .6; }
    .news-item.is-read:hover, .news-item.is-read:focus-within { opacity: 1; }
    .news-item.is-read h2 { font-weight: 600; }
    #share-menu.hidden { display: none; }
    /* Hakusanan korostus ja näppäimistöllä valittu kortti */
    mark.search-hit { background-color: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px; }
    html.dark mark.search-hit { background-color: rgba(245,158,11,.35); }
    .news-item.kb-active { box-shadow: 0 0 0 3px #3b82f6; }
    #main-search::-webkit-search-cancel-button { display: none; }
    html.dark #share-menu { background-color: #0f172a; border-color: #334155; }
    html.dark #share-menu [data-share] { color: #e2e8f0; }
    html.dark #share-menu [data-share]:hover { background-color: #1e293b; }
    /* Kopioitu-tila (kopiointipainike): sama periaate, !important voittaa painikkeen omat utility-luokat */
    .is-copied { background-color: #d1fae5 !important; color: #065f46 !important; border-color: #6ee7b7 !important; }
    html.dark .is-copied { background-color: rgba(16,185,129,.28) !important; color: #6ee7b7 !important; border-color: rgba(16,185,129,.35) !important; }
    html.dark #weather-result { background: linear-gradient(135deg, rgba(30,58,138,.28), rgba(49,46,129,.28)); border-color: #1e3a8a; }
    html.dark .leaflet-popup-content-wrapper, html.dark .leaflet-popup-tip { background: #0f172a; color: #e2e8f0; }
    html.dark .leaflet-container a.leaflet-popup-close-button { color: #94a3b8; }
    html.dark img { opacity: .92; }
    .no-scrollbar::-webkit-scrollbar { display: none; }
    .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
    /* Kuvan paikkamerkki: lähteen väri (Tailwind-luokka) + valoliuku, jotta tyhjä kuva-alue näyttää tarkoitukselliselta */
    .card-ph::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(0,0,0,.35)); }
    .card-ph > * { position: relative; }
    /* Tilarivi tummassa tilassa */
    html.dark .text-amber-600 { color: #fbbf24; }
    html.dark .info-bar .text-slate-800 { color: #f1f5f9; }
    /* Kategoriarivin nuolet (vain hiirelle, puhelimessa rivi vieritetään sormella) */
    .chips-arrow.is-visible { display: none; }
    @media (hover: hover) and (min-width: 768px) {
      .chips-arrow.is-visible { display: flex; }
      .chips-arrow-prev { background: linear-gradient(to right, #f8fafc 55%, rgba(248,250,252,0)); }
      .chips-arrow-next { background: linear-gradient(to left, #f8fafc 55%, rgba(248,250,252,0)); }
      html.dark .chips-arrow-prev { background: linear-gradient(to right, #020617 55%, rgba(2,6,23,0)); }
      html.dark .chips-arrow-next { background: linear-gradient(to left, #020617 55%, rgba(2,6,23,0)); }
    }
    html.dark .hover\:text-blue-600:hover { color: #60a5fa; }
    /* Inter omalta palvelimelta (muuttuva paksuus 100–900) */
    @font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(fonts/inter-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
    @font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(fonts/inter-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
    /* Päiväotsikot korttien välissä (app.js: updateGridLayout) */
    .day-sep { grid-column: 1 / -1; display: flex; align-items: center; gap: .75rem; margin-top: .75rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
    .day-sep:first-child { margin-top: 0; }
    .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--surface-4); }
    html.dark .day-sep { color: #94a3b8; }
    html.dark .day-sep::after { background: #1e293b; }
    /* Tuorein uutinen isona: puhelimessa pystykortti isolla kuvalla, isommalla näytöllä kahden sarakkeen levyinen, kuva vasemmalla */
    .news-item.is-featured h2 { font-size: 1.2rem; line-height: 1.3; }
    @media (max-width: 639px) {
      .news-item.is-featured { flex-direction: column; }
      .news-item.is-featured .card-media { width: auto; height: auto; aspect-ratio: 16 / 9; margin: 0; border-radius: 0; }
    }
    @media (min-width: 768px) {
      .news-item.is-featured { grid-column: span 2; flex-direction: row; }
      .news-item.is-featured .card-media { width: 50%; height: auto; min-height: 280px; aspect-ratio: auto; }
      .news-item.is-featured > div { justify-content: center; padding: 1.5rem; }
      .news-item.is-featured > div > div > div:first-child { flex-wrap: wrap; row-gap: .5rem; }
      .news-item.is-featured h2 { font-size: 1.35rem; line-height: 1.3; margin-bottom: .6rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
      .news-item.is-featured h2 + p { font-size: .9rem; -webkit-line-clamp: 4; }
      .news-item.is-featured .card-ph > span:first-child { font-size: 4.5rem; }
    }
    html.dark .border-amber-200 { border-color: rgba(245,158,11,.35); }
    html.dark .hover\:bg-rose-50:hover { background-color: rgba(244,63,94,.15); }
    html.dark .text-rose-600 { color: #fb7185; }
    /* Uutiskuvan pehmeä esiin tulo (app.js lisää html.img-fade ja kuvalle is-loaded); alla näkyy lähteen värinen paikkamerkki */
    .img-fade .card-media img { opacity: 0; transition: opacity .45s ease, transform .5s; }
    .img-fade .card-media img.is-loaded { opacity: 1; }
    html.dark.img-fade .card-media img.is-loaded { opacity: .92; }
    @media (prefers-reduced-motion: reduce) { .img-fade .card-media img { transition: none; } }
    /* Tietoa ja ohjeet -ikkuna */
    .info-sec { padding: .75rem 0; border-top: 1px solid var(--border-soft); }
    .info-sec h3 { font-weight: 700; color: var(--text); margin-bottom: .35rem; font-size: .95rem; }
    .info-sec p + p { margin-top: .4rem; }
    .info-sec b, .info-disclaimer strong { color: var(--text); font-weight: 600; }
    .info-sec kbd { font-family: ui-monospace, monospace; font-size: .75rem; border: 1px solid var(--border-strong); border-radius: .25rem; padding: 0 .3rem; background: var(--surface-2); }
    html.dark .info-sec { border-color: #1e293b; }
    html.dark .info-sec kbd { border-color: #334155; background: #1e293b; }
    /* Tumma kartta: värit käännetään ja himmennetään, jotta kategorioiden väriset merkit erottuvat */
    #map .leaflet-tile-pane { filter: saturate(.75); }
    html.dark #map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(.55) brightness(.8) contrast(.95); }
    /* Uutiskartta: kartta ja uutislista rinnakkain (puhelimessa lista kartan alla) */
    .map-layout { display: grid; gap: .5rem; }
    @media (min-width: 1024px) { .map-layout { grid-template-columns: minmax(0, 1fr) 360px; } }
    .map-list { display: flex; flex-direction: column; min-height: 0; }
    .map-list-items { overflow-y: auto; max-height: 60vh; }
    @media (min-width: 1024px) { .map-list-items { max-height: none; height: 0; flex: 1; } .map-list { height: 500px; height: clamp(420px, 72dvh, 720px); } }
    .map-list-item { display: flex; gap: .6rem; width: 100%; text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border-soft); }
    .map-list-item:hover, .map-list-item:focus-visible { background: var(--surface-2); outline: none; }
    .map-list-dot { flex: none; width: .6rem; height: .6rem; margin-top: .35rem; border-radius: var(--r-full); background: var(--c); }
    .map-list-dot.is-fresh { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
    .map-list-title { display: block; font-size: .82rem; font-weight: 600; line-height: 1.3; color: var(--text); }
    .map-list-meta { display: block; margin-top: .15rem; font-size: .7rem; color: var(--muted); }
    html.dark .map-list-item:hover, html.dark .map-list-item:focus-visible { background: #1e293b; }
    /* Kartan merkit: kategorian värinen pallo ja kuvake; ryhmä yleisimmän kategorian värillä */
    .nm-wrap { background: none; border: 0; }
    .nm-pin { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--r-full);
      background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); font-size: 14px; line-height: 1; transition: transform .15s; }
    .nm-pin.is-country { opacity: .7; border-style: dashed; }
    .nm-pin.is-hover, .nm-cluster.is-hover, .is-hover > .nm-cluster { transform: scale(1.25); z-index: 1000; box-shadow: 0 0 0 4px rgba(59,130,246,.5); }
    .nm-cluster { display: flex; align-items: center; justify-content: center; border-radius: var(--r-full); background: var(--c); color: #fff;
      font-weight: 800; font-size: 13px; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 1px 6px rgba(0,0,0,.35); transition: transform .15s; }
    .nm-pin.is-fresh, .nm-cluster.is-fresh { animation: nm-pulse 2s ease-out infinite; }
    @keyframes nm-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
    @media (prefers-reduced-motion: reduce) { .nm-pin.is-fresh, .nm-cluster.is-fresh { animation: none; } }
    html.dark .nm-pin, html.dark .nm-cluster { border-color: #0f172a; }
    .leaflet-popup-content { margin: 10px 12px; }
    /* Kategoriapainikkeen uudet uutiset (+N) ja seurattu kategoria (★) */
    .chip-count { margin-left: .15rem; padding: 0 .4rem; border-radius: var(--r-full); background: #f59e0b; color: #1f1300; font-size: 10px; font-weight: 800; line-height: 1.35rem; }
    .chip-follow { color: #f59e0b; font-size: 11px; }
    [aria-pressed="true"] > .chip-follow { color: #fde68a; }
    #follow-cat-btn.is-following { background: #f59e0b; color: #1f1300; border-color: #f59e0b; }
    html.dark #follow-cat-btn:not(.is-following) { background: rgba(245,158,11,.12); color: #fbbf24; border-color: rgba(245,158,11,.4); }
    /* Seuratun kategorian uusi uutinen: kategorian värinen reunus vasemmalla */
    .news-item.is-followed-new { box-shadow: inset 4px 0 0 var(--fc); }
    .news-item.is-followed-new.kb-active { box-shadow: inset 4px 0 0 var(--fc), 0 0 0 3px #3b82f6; }
    /* Erotinviiva: uudet edellisen käynnin jälkeen */
    .day-sep.visit-sep { color: #d97706; }
    .day-sep.visit-sep::after { background: rgba(245,158,11,.45); }
    html.dark .day-sep.visit-sep { color: #fbbf24; }
    /* Kartan työkalut: aikaväli, toisto, lämpökartta, omat painikkeet ja ponnahdusikkunan selaus */
    .map-ctl a { font-size: 16px; line-height: 30px; color: #0f172a; }
    html.dark .leaflet-bar a { background: #1e293b; color: #e2e8f0; border-color: #334155; }
    html.dark .leaflet-bar a:hover { background: #334155; }
    .popup-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .5rem; padding-top: .4rem; border-top: 1px solid var(--border-ctl); font-size: 11px; color: var(--muted); }
    .popup-nav button { width: 28px; height: 28px; border-radius: var(--r-full); border: 1px solid var(--border-strong); font-size: 16px; line-height: 1; color: var(--text); }
    .popup-nav button:hover { background: var(--surface-3); }
    html.dark .popup-nav button { border-color: #334155; color: #e2e8f0; }
    /* Kartta koko näytölle */
    #map-tab-leaflet.is-fullscreen { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; padding: .5rem; background: #f8fafc; }
    html.dark #map-tab-leaflet.is-fullscreen { background: #020617; }
    #map-tab-leaflet.is-fullscreen .map-layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
    #map-tab-leaflet.is-fullscreen .map-main, #map-tab-leaflet.is-fullscreen #map { height: 100%; }
    @media (min-width: 1024px) { #map-tab-leaflet.is-fullscreen .map-list { height: 100%; } }
    /* Tuoreusreuna: alle tunnin vanhan uutisen yläreunan viiva himmenee (app.js: updateRelativeTimes asettaa --fresh) */
    .news-item.is-fresh::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 5; pointer-events: none;
      background: linear-gradient(90deg, #f59e0b, #ef4444); opacity: var(--fresh, 1); }
    /* Toisto: kartalle ilmestyvän uutisen laajeneva aalto ja uusimman otsikon korostus */
    .nm-ripple { position: absolute; inset: 0; border-radius: var(--r-full); border: 3px solid var(--c); background: color-mix(in srgb, var(--c) 25%, transparent);
      animation: nm-ripple 1.5s ease-out forwards; pointer-events: none; }
    @keyframes nm-ripple { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
    #map-play-feed.feed-flash { animation: feed-flash 1.2s ease-out; }
    @keyframes feed-flash { 0% { color: #f59e0b; } 100% { color: inherit; } }
    @media (prefers-reduced-motion: reduce) { .nm-ripple, #map-play-feed.feed-flash { animation: none; } }
    /* Häiriöt-kerros: oranssireunaiset merkit tyypin kuvakkeella */
    .nm-dis { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--r-sm); background: #fff;
      border: 2px solid #ea580c; box-shadow: 0 1px 4px rgba(0,0,0,.35); font-size: 14px; transform: rotate(0); transition: transform .15s; }
    .nm-dis-weather { border-color: #dc2626; }
    .is-hover .nm-dis, .nm-dis.is-hover { transform: scale(1.25); box-shadow: 0 0 0 4px rgba(234,88,12,.45); }
    html.dark .nm-dis { background: #1e293b; }
    /* Paikannuskysely kartan päällä */
    .map-ask { position: absolute; z-index: 30; left: 50%; top: 1rem; transform: translateX(-50%); width: min(92%, 340px);
      padding: .85rem 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: .875rem; color: var(--text); }
    /* ---------- Karttasivu: tasot, Aika-valikko, suodatinrivi, välilehdellinen lista ja puhelimen alapaneeli ---------- */
    .map-tools { display: flex; flex-direction: column; gap: .5rem; padding: .25rem .25rem .5rem; font-size: .75rem; font-weight: 600; }
    .map-layer-btn { transition: background .15s, color .15s; }
    .map-layer-btn.is-news.is-on { background: var(--accent); color: #fff; }
    .map-layer-btn.is-dis.is-on { background: var(--dis); color: #fff; }
    .map-layer-count { min-width: 1.4rem; padding: 0 .4rem; border-radius: var(--r-full); background: rgba(255,255,255,.25); font-size: .7rem; text-align: center; font-variant-numeric: tabular-nums; }
    .map-layer-count:empty { display: none; }
    .map-pop { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 700; width: 17.5rem; max-width: calc(100vw - 2rem); }
    .map-pop-h { margin-bottom: .4rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
    .map-pop-field { display: flex; flex-direction: column; gap: .25rem; font-size: .7rem; color: var(--muted); }
    .map-pop-field select { padding: .35rem .5rem; font-size: .75rem; cursor: pointer; }
    .map-main { position: relative; min-width: 0; }
    .map-ctl a.is-on { background: #f97316; color: #fff; }
    /* Toiston aika ja uusin uutinen kartan yläreunassa */
    .map-play-overlay { position: absolute; z-index: 450; left: 50%; top: .6rem; transform: translateX(-50%); max-width: calc(100% - 7rem);
      display: flex; flex-direction: column; align-items: center; gap: .2rem; pointer-events: none; }
    .map-play-overlay > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .3rem .75rem; border-radius: var(--r-full);
      background: rgba(15,23,42,.86); color: #f1f5f9; font-size: .75rem; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
    .map-play-overlay > #map-play-time { color: #93c5fd; font-size: .85rem; }
    /* Sivulistan välilehdet */
    .map-list-tabs { display: flex; margin: .5rem .5rem .35rem; }
    .map-list-tab { flex: 1; padding: .4rem .5rem; }
    .map-list-tab-count { min-width: 1.4rem; padding: 0 .4rem; border-radius: var(--r-full); background: var(--surface-4); color: var(--text-3); font-size: .7rem; text-align: center; font-variant-numeric: tabular-nums; }
    #map-list-tab-dis.is-active .map-list-tab-count { background: rgba(255,255,255,.25); color: #fff; }
    #map-list-tab-news.is-active .map-list-tab-count { background: rgba(255,255,255,.25); color: #fff; }
    #map-list-tab-dis.is-active { background: var(--dis); }
    .map-sheet-handle { display: none; }
    /* Puhelin ja tabletti: kartta isona, lista alhaalta nousevana paneelina */
    @media (max-width: 1023px) {
      .map-layout { position: relative; display: block; --sheet-peek: 6.4rem; }
      #map { height: clamp(440px, calc(100dvh - 190px), 780px); }
      #map .leaflet-bottom { bottom: var(--sheet-peek); }
      .map-list { position: absolute; z-index: 500; left: 0; right: 0; bottom: 0; height: var(--sheet-peek); overflow: hidden;
        border-radius: var(--r-lg) var(--r-lg) var(--r-md) var(--r-md); box-shadow: 0 -6px 22px rgba(0,0,0,.22); transition: height .25s ease; }
      .map-list.is-open { height: 72%; }
      .map-list-items { max-height: none; flex: 1; height: 0; }
      .map-sheet-handle { display: flex; justify-content: center; width: 100%; padding: .45rem 0 .1rem; cursor: pointer; }
      .map-sheet-handle span { width: 2.6rem; height: 4px; border-radius: var(--r-full); background: #cbd5e1; }
      .map-list-tabs { margin-top: .2rem; }
    }
    @media (prefers-reduced-motion: reduce) { .map-list { transition: none; } }
    html.dark .map-list-sub { border-color: #1e293b; }
    html.dark .map-sheet-handle span { background: #475569; }
    /* Tasovalikot: Uutiset ja Häiriöt avaavat valikon, jossa tason kytkin ja alakategoriat */
    .map-layer-wrap { position: relative; }
    .map-layer-btn.is-open { box-shadow: 0 0 0 2px rgba(59,130,246,.45); }
    .map-layer-sum { font-size: .72rem; font-weight: 600; opacity: .85; }
    .map-layer-sum:empty { display: none; }
    .map-caret { font-size: 10px; opacity: .75; }
    .map-layer-menu { left: 0; right: auto; width: 16.5rem; }
    .map-switch { position: relative; display: flex; align-items: center; gap: .6rem; padding: .3rem .25rem; font-size: .85rem; font-weight: 700; color: var(--text); cursor: pointer; }
    .map-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
    .map-switch-ui { position: relative; flex: none; width: 2.2rem; height: 1.25rem; border-radius: var(--r-full); background: #cbd5e1; transition: background .15s; }
    .map-switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.25rem - 4px); height: calc(1.25rem - 4px); border-radius: var(--r-full);
      background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
    .map-switch input:checked + .map-switch-ui { background: #2563eb; }
    .map-switch.is-dis input:checked + .map-switch-ui { background: #ea580c; }
    .map-switch input:checked + .map-switch-ui::after { transform: translateX(.95rem); }
    .map-switch input:focus-visible + .map-switch-ui { box-shadow: 0 0 0 3px rgba(59,130,246,.5); }
    .map-check-list { display: flex; flex-direction: column; max-height: min(50vh, 22rem); overflow-y: auto; margin: 0 -.3rem; }
    .map-check { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem; border-radius: var(--r-md); font-size: .8rem; font-weight: 600; color: var(--faint); cursor: pointer; }
    .map-check:hover { background: var(--surface-3); }
    .map-check.is-on { color: var(--text); }
    .map-check input { flex: none; width: 1rem; height: 1rem; accent-color: #2563eb; cursor: pointer; }
    #map-dis-types .map-check input { accent-color: #ea580c; }
    .map-check-dot { flex: none; width: .6rem; height: .6rem; border-radius: var(--r-full); background: var(--c, #94a3b8); }
    .map-check-dot.is-dis { background: #ea580c; }
    .map-check-count { margin-left: auto; font-size: .7rem; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
    .is-layer-off .map-check-list { opacity: .55; }
    .map-pop-actions { display: flex; justify-content: space-between; gap: .5rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border-ctl); }
    .map-pop-actions button { padding: .25rem .4rem; border-radius: var(--r-sm); font-size: .75rem; font-weight: 700; color: var(--accent-ink); }
    .map-pop-actions button:hover { background: var(--accent-soft); }
    /* Kapealla näytöllä valikot avautuvat koko ohjainrivin levyisinä */
    @media (max-width: 640px) {
      .map-tools { position: relative; }
      .map-layer-wrap { position: static; }
      .map-layer-menu { left: 0; right: 0; width: auto; max-width: none; }
    }
    html.dark .map-switch-ui { background: #475569; }
    html.dark .map-check.is-on { color: #e2e8f0; }
    html.dark .map-pop-actions button:hover { background: rgba(37,99,235,.18); }
    /* ---------- Yläpalkki: tilatiedot otsikon vieressä ja Kartat-valikko ---------- */
    .header-status { display: flex; align-items: center; gap: .4rem; min-width: 0; font-size: .72rem; color: #cbd5e1; }
    .hs-chip { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; padding: .2rem .6rem; border-radius: var(--r-full);
      background: rgba(30,41,59,.85); border: 1px solid #334155; }
    .hs-chip.hidden { display: none; }
    .hs-price { font-weight: 700; color: #fbbf24; }
    .hs-time { font-weight: 700; color: #f1f5f9; font-variant-numeric: tabular-nums; }
    .hs-label { display: none; color: #94a3b8; }
    @media (min-width: 1280px) { .hs-label { display: inline; } }
    /* Puhelin: tilatiedot pienenä rivinä otsikon alla (ilman taustoja) */
    @media (max-width: 767px) {
      .header-row { flex-wrap: wrap; row-gap: .1rem; }
      .header-status { order: 3; flex-basis: 100%; padding-left: 2.625rem; margin-top: -.15rem; gap: .2rem; font-size: .68rem; }
      .hs-chip { padding: 0; background: none; border: 0; gap: .2rem; }
      .hs-chip + .hs-chip::before { content: "·"; margin-right: .35rem; color: #64748b; }
    }
    .maps-sub { color: inherit; opacity: .9; }
    .maps-caret { font-size: 9px; opacity: .7; }
    .maps-menu { position: absolute; left: 0; top: calc(100% + .5rem); z-index: 60; min-width: 13.5rem; padding: .35rem;
      background: #0f172a; border: 1px solid #334155; border-radius: var(--r-lg); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
    .maps-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border-radius: var(--r-md); text-align: left;
      font-size: .82rem; font-weight: 600; color: #e2e8f0; }
    .maps-item:hover, .maps-item:focus-visible { background: #1e293b; outline: none; }
    .maps-item.is-active { background: #2563eb; color: #fff; }
    .maps-ext { margin-left: auto; color: #64748b; }
    /* Puhelimen karttavalikko alanavigaation yläpuolella */
    .maps-sheet { position: fixed; z-index: 55; left: .75rem; right: .75rem; bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px)); padding: .5rem;
      background: #0f172a; border: 1px solid #334155; border-radius: var(--r-lg); box-shadow: 0 -8px 32px rgba(0,0,0,.45); }
    .maps-sheet-h { padding: .3rem .7rem .4rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; }
    .nav-map-caret { display: none; font-size: 9px; }
    #nav-map.text-blue-400 .nav-map-caret { display: inline; }
    /* Kartta omana kerroksenaan: alapaneelin ja valikoiden z-index vaikuttaa vain kartan sisällä, joten alanavigaatio
       (z-50) pysyy aina niiden päällä. Puhelimen koko näytön tila jättää alanavigaation näkyviin (--nav-h: app.js fitMobileMap). */
    #map-tab-leaflet { isolation: isolate; }
    @media (max-width: 767px) {
      #map-tab-leaflet.is-fullscreen { bottom: var(--nav-h, 0px); z-index: 45; }
    }
    /* ---------- Etusivun kategoriavalikot (samat tyylit kuin kartan tasovalikoissa) ---------- */
    .cat-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .75rem; font-weight: 600; }
    .cat-bar .map-layer-menu { width: 19rem; }
    .cat-row { display: flex; align-items: center; gap: .15rem; }
    .cat-row .map-check { flex: 1; min-width: 0; }
    .cat-new { flex: none; padding: 0 .4rem; border-radius: var(--r-full); background: #f59e0b; color: #fff; font-size: .68rem; font-weight: 700; font-variant-numeric: tabular-nums; }
    .cat-new.hidden { display: none; }
    .cat-follow { flex: none; width: 1.9rem; height: 1.9rem; border-radius: var(--r-sm); color: var(--faint); font-size: .95rem; line-height: 1; }
    .cat-follow:hover { background: var(--surface-3); color: #f59e0b; }
    .cat-follow.is-following { color: #f59e0b; }
    .cat-fav.is-on { border-color: #f59e0b; background: #f59e0b; color: #1f1300; }
    .cat-unread { color: #047857; border-color: #a7f3d0; }
    .cat-unread.is-on { border-color: #059669; background: #059669; color: #fff; }
    html.dark .cat-fav.is-on { background: #f59e0b; border-color: #f59e0b; color: #1f1300; }
    html.dark .cat-unread:not(.is-on) { color: #6ee7b7; border-color: rgba(16,185,129,.4); }
    html.dark .cat-unread.is-on { background: #059669; border-color: #059669; color: #fff; }
    @media (max-width: 640px) { .cat-bar .map-layer-menu { width: auto; } }
    /* ---------- Tilannekuva: kartta vasemmalla (puhelimessa ylhäällä), paneelit oikealla ja tilarivi alla ---------- */
    body.is-dash main { padding-top: 1rem; } /* leveys sama kuin muilla sivuilla (max-w-7xl) */
    .dash-menu { left: auto; right: 0; width: 17.5rem; }
    .dash-menu .menu-item { flex-direction: column; align-items: flex-start; gap: .1rem; }
    .dash-menu-desc { font-size: .68rem; font-weight: 500; opacity: .75; }
    .dash-grid { display: grid; gap: .75rem; }
    .dash-map { padding: .4rem; min-width: 0; }
    .dash-map #map-tab-leaflet { display: flex; flex-direction: column; height: 100%; }
    .dash-map .map-layout { flex: 1; min-height: 0; display: block; position: relative; }
    .dash-map .map-main { height: 100%; }
    .dash-map #map { height: 100%; }
    .dash-map .map-list { display: none; }
    .dash-map #map .leaflet-bottom { bottom: 0; }
    @media (min-width: 1024px) {
      .dash-grid { grid-template-columns: minmax(0, 1fr) 410px; height: calc(100dvh - 14rem); min-height: 500px; }
      .dash-panels { overflow-y: auto; padding-right: .2rem; }
    }
    /* Paneelit aina yhdessä sarakkeessa; leveällä näytöllä sarake vähän leveämpi */
    @media (min-width: 1600px) {
      .dash-grid { grid-template-columns: minmax(0, 1fr) 460px; }
    }
    @media (max-width: 1023px) {
      .dash-map { height: 58dvh; min-height: 340px; }
    }
    .dash-panel { break-inside: avoid; margin-bottom: .75rem; overflow: hidden; }
    .dash-panel-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .5rem .5rem .75rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
    .dash-panel-title { display: flex; align-items: center; gap: .35rem; min-width: 0; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
    .dash-panel-count { font-size: .7rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .dash-panel-tools { margin-left: auto; display: flex; gap: .1rem; }
    .dash-panel-tools button { width: 1.6rem; height: 1.6rem; border-radius: var(--r-sm); color: var(--faint); font-size: .8rem; line-height: 1; }
    .dash-panel-tools button:hover:not(:disabled) { background: var(--surface-4); color: var(--text); }
    .dash-panel-tools button:disabled { opacity: .3; cursor: default; }
    .dash-panel-body { padding: .15rem 0; }
    .dash-item { display: flex; gap: .6rem; width: 100%; padding: .45rem .75rem; border-bottom: 1px solid var(--border-soft); text-align: left; }
    .dash-item:last-child { border-bottom: 0; }
    button.dash-item:hover { background: var(--surface-2); }
    .dash-item-time { flex: none; width: 2.9rem; padding-top: .1rem; font-size: .7rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
    .dash-item-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .82rem; font-weight: 600; line-height: 1.3; color: var(--text); }
    a.dash-item-title:hover { color: var(--accent-ink); text-decoration: underline; }
    .dash-item-meta { display: flex; align-items: center; gap: .35rem; min-width: 0; margin-top: .15rem; font-size: .68rem; color: var(--muted); }
    .dash-dot { flex: none; width: .45rem; height: .45rem; border-radius: var(--r-full); }
    .dash-pin { margin-left: auto; padding: 0 .2rem; font-size: .75rem; opacity: .65; }
    .dash-pin:hover { opacity: 1; }
    .dash-item.is-new { animation: dash-new 3s ease-out; }
    @keyframes dash-new { 0% { background: rgba(245,158,11,.35); } 100% { background: transparent; } }
    .dash-more { display: block; width: 100%; padding: .45rem .75rem; text-align: left; font-size: .75rem; font-weight: 700; color: var(--accent-ink); }
    .dash-more:hover { text-decoration: underline; }
    .dash-bar { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 2.2rem; align-items: center; gap: .5rem; width: 100%; padding: .3rem .75rem; font-size: .75rem; }
    .dash-bar:hover { background: var(--surface-2); }
    .dash-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-weight: 600; color: var(--text-2); }
    .dash-bar-track { height: .5rem; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
    .dash-bar-fill { display: block; height: 100%; border-radius: var(--r-full); }
    .dash-bar-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
    .dash-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; padding: .5rem .75rem; }
    .dash-tile { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: .45rem .55rem; border: 1px solid #fed7aa; border-radius: var(--r-md); background: #fff7ed; text-align: left; }
    .dash-tile:hover, .dash-tile.is-on { border-color: #ea580c; box-shadow: 0 0 0 1px #ea580c; }
    .dash-tile-n { font-size: 1.15rem; font-weight: 800; line-height: 1.1; color: #9a3412; font-variant-numeric: tabular-nums; }
    .dash-tile-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; font-weight: 600; color: #9a3412; }
    .dash-dis .dash-item-time { width: 1.4rem; }
    .dash-stream-select { display: block; margin: .45rem .75rem; padding: .3rem .5rem; font-size: .75rem; }
    .dash-stream { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
    .dash-empty { padding: .75rem; font-size: .8rem; color: var(--muted); }
    .dash-status { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .6rem; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
    .dash-status-sep { color: #cbd5e1; }
    .dash-status-warn { color: #b45309; }
    @media (prefers-reduced-motion: reduce) { .dash-item.is-new { animation: none; } }
    html.dark .dash-panel-tools button:hover:not(:disabled) { background: #1e293b; color: #f1f5f9; }
    html.dark button.dash-item:hover, html.dark .dash-bar:hover { background: #1e293b; }
    html.dark a.dash-item-title:hover { color: #93c5fd; }
    html.dark .dash-tile { background: rgba(234,88,12,.12); border-color: rgba(234,88,12,.4); }
    html.dark .dash-tile-n, html.dark .dash-tile-l { color: #fdba74; }
    html.dark .dash-status-sep { color: #334155; }
    html.dark .dash-status-warn { color: #fbbf24; }
    /* ---------- Striimit: soitin ja kanavalista, monitori 2×2 / 3×3 ja pohjoismaiset linkit ---------- */
    .st-groups { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: .75rem; padding-bottom: .15rem; }
    .st-group-n { font-size: .68rem; font-weight: 600; opacity: .7; }
    .st-single { display: grid; gap: .75rem; }
    @media (min-width: 1024px) { .st-single { grid-template-columns: minmax(0, 1fr) 340px; } }
    .st-player { min-width: 0; }
    .st-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--r-lg); background: #000; }
    .st-now { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-top: .5rem; }
    .st-now-name { font-size: .95rem; font-weight: 800; color: var(--text); }
    .st-now-title { flex-basis: 100%; font-size: .8rem; color: var(--text-3); }
    .st-live { flex: none; padding: .05rem .4rem; border-radius: var(--r-sm); background: #dc2626; color: #fff; font-size: .6rem; font-weight: 800; letter-spacing: .06em; }
    .st-list { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
    @media (min-width: 1024px) { .st-list { max-height: calc((100vw - 2rem - 340px - .75rem) * 9 / 16 + 3rem); max-height: min(78dvh, 720px); overflow-y: auto; padding-right: .2rem; } }
    .st-card { display: flex; gap: .6rem; width: 100%; padding: .55rem .6rem; border-radius: var(--r-md); text-align: left; }
    .st-card:hover { background: var(--surface-2); }
    .st-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
    .st-avatar { flex: none; display: flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: var(--r-md);
      background: hsl(var(--h) 55% 42%); color: #fff; font-size: .72rem; font-weight: 800; }
    .st-card-body { min-width: 0; flex: 1; }
    .st-card-top { display: flex; align-items: center; gap: .4rem; }
    .st-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 700; color: var(--text); }
    .st-card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: .1rem; font-size: .72rem; line-height: 1.3; color: var(--muted); }
    .st-note { display: inline-block; margin-top: .2rem; padding: 0 .35rem; border-radius: var(--r-sm); background: #fef3c7; color: #92400e; font-size: .62rem; font-weight: 700; }
    .st-offline { margin-top: .25rem; font-size: .72rem; color: var(--muted); }
    .st-offline summary { cursor: pointer; padding: .3rem .2rem; font-weight: 700; }
    .st-offline p { padding: 0 .2rem .3rem; }
    .st-grid { display: grid; gap: .5rem; }
    .st-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-grid9 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    @media (min-width: 768px) { .st-grid9 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
    @media (max-width: 520px) { .st-grid4, .st-grid9 { grid-template-columns: minmax(0, 1fr); } }
    .st-tile { position: relative; overflow: hidden; border-radius: var(--r-md); background: #000; }
    .st-tile-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
    .st-tile-bar { display: flex; align-items: center; gap: .3rem; padding: .3rem .4rem; background: #0f172a; }
    .st-tile-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; font-weight: 700; color: #fff; }
    .st-tile-bar button { width: 1.8rem; height: 1.8rem; border-radius: var(--r-sm); background: rgba(15,23,42,.75); color: #fff; font-size: .85rem; }
    .st-tile-bar button:hover { background: #2563eb; }
    .st-links { margin-top: 1.25rem; }
    .st-links-h { margin-bottom: .5rem; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
    .st-links-row { display: flex; flex-wrap: wrap; gap: .5rem; }
    .st-link { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border-radius: var(--r-md); font-size: .8rem; font-weight: 700; color: var(--text); }
    .st-link:hover { border-color: var(--accent); color: var(--accent-ink); }
    .st-link-ext { color: var(--faint); }
    .st-links-note { margin-top: .4rem; font-size: .7rem; color: var(--faint); }
    html.dark .st-card:hover { background: #1e293b; }
    html.dark .st-now-title, html.dark .st-card-title { color: #94a3b8; }
    html.dark .st-note { background: rgba(245,158,11,.18); color: #fcd34d; }
    /* Tilannekuvan paneelipino: kiinni olevasta paneelista näkyy otsikkorivi; avoimen sisältö näkyy kartalla */
    .dash-panel-head { padding: 0 .5rem 0 0; }
    .dash-panel-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; padding: .6rem .5rem .6rem .75rem; text-align: left; }
    .dash-panel-toggle:hover .dash-panel-title { color: var(--accent-ink); }
    .dash-caret { flex: none; font-size: .7rem; color: var(--faint); transition: transform .15s; }
    .dash-panel.is-open .dash-caret { transform: rotate(90deg); color: var(--accent-ink); }
    .dash-panel:not(.is-open) .dash-panel-body { display: none; }
    .dash-panel:not(.is-open) .dash-panel-head { border-bottom: 0; }
    .dash-panel.is-open { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
    .dash-onmap { margin-left: auto; font-size: .8rem; }
    .dash-onmap.hidden { display: none; }
    .dash-panel { margin-bottom: .5rem; }
    .dash-map { position: relative; }
    .dash-focus { position: absolute; z-index: 600; left: 50%; bottom: .9rem; transform: translateX(-50%); max-width: calc(100% - 2rem);
      display: flex; align-items: center; gap: .4rem; padding: .3rem .35rem .3rem .8rem; border-radius: var(--r-full); background: rgba(15,23,42,.9);
      color: #f1f5f9; font-size: .75rem; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
    .dash-focus-l { color: #93c5fd; font-weight: 700; white-space: nowrap; }
    .dash-focus-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
    .dash-focus-x { flex: none; width: 1.6rem; height: 1.6rem; border-radius: var(--r-full); background: rgba(255,255,255,.12); color: #fff; }
    .dash-focus-x:hover { background: #dc2626; }
    html.dark .dash-panel-toggle:hover .dash-panel-title { color: #93c5fd; }
    /* 📌 Kiinnitetyt paneelit: sarakkeen yläosassa, pysyvät näkyvissä kun pinoa vieritetään (enintään puolet korkeudesta) */
    .dash-pin-btn { filter: grayscale(1); opacity: .55; }
    .dash-pin-btn:hover, .dash-pin-btn.is-on { filter: none; opacity: 1; }
    .dash-pin-btn.is-on { background: #dbeafe; }
    .dash-panel.is-pinned .dash-caret { visibility: hidden; }
    .dash-panel.is-pinned .dash-panel-toggle { cursor: default; }
    .dash-panel.is-pinned { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
    .dash-pinned { padding-bottom: .1rem; }
    @media (min-width: 1024px) {
      .dash-pinned { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 2px solid var(--accent); padding-bottom: .4rem; margin-bottom: .6rem; box-shadow: 0 8px 12px -10px rgba(15,23,42,.45); }
      /* Kiinnitetyt vievät yhteensä enintään noin puolet sarakkeesta; kunkin sisältö vierittää omassa laatikossaan */
      .dash-pinned .dash-panel-body { max-height: calc((100dvh - 15rem) * .5 / var(--pin-n, 1)); overflow-y: auto; }
    }
    .dash-stream-now { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; padding: .45rem .75rem .55rem; }
    .dash-stream-name { font-size: .8rem; font-weight: 700; color: #0f172a; }
    .dash-stream-title { flex-basis: 100%; font-size: .72rem; color: #64748b; }
    .st-unknown { flex: none; width: 1rem; height: 1rem; border-radius: var(--r-full); background: var(--surface-4); color: var(--muted); font-size: .6rem; font-weight: 800; text-align: center; line-height: 1rem; }
    html.dark .dash-pin-btn.is-on { background: rgba(37,99,235,.3); }
    html.dark .dash-stream-name { color: #f1f5f9; }
    html.dark .dash-stream-title { color: #94a3b8; }
    html.dark .st-unknown { background: #334155; color: #cbd5e1; }
    .dash-pinned-h { position: sticky; top: 0; z-index: 1; padding: .2rem .25rem .35rem; background: inherit; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); }
    html.dark .dash-pinned-h { color: #93c5fd; }
    .dash-pinned .dash-panel[data-panel="stream"] .dash-panel-body { max-height: none; overflow: visible; }
    .dash-map { isolation: isolate; } /* Kartalla-merkintä ja kartta eivät nouse alanavigaation päälle */
    /* ---------- Sää: haku, oma sääkartta ja paikkakortti ---------- */
    html.dark #wx-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(.55) brightness(.8) contrast(.95); }
    #wx-map .leaflet-tile-pane { filter: saturate(.75); }
    .wx-search-wrap { position: relative; flex: 1 1 240px; min-width: 0; }
    .wx-search { width: 100%; padding: .6rem .9rem; font-size: .85rem; }
    .wx-results { left: 0; right: 0; width: auto; max-width: none; padding: .3rem; }
    .wx-result { display: flex; align-items: baseline; gap: .5rem; width: 100%; padding: .5rem .6rem; border-radius: var(--r-md); text-align: left; }
    .wx-result:hover, .wx-result:focus-visible { background: var(--surface-3); outline: none; }
    .wx-result-name { font-size: .85rem; font-weight: 700; color: var(--text); }
    .wx-result-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; color: var(--muted); }
    .wx-grid { display: grid; gap: .75rem; }
    @media (min-width: 1024px) { .wx-grid { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; } }
    .wx-map-box { min-width: 0; padding: .4rem; }
    .wx-layers { display: flex; flex-wrap: wrap; gap: .35rem; padding: .2rem .2rem .45rem; }
    .wx-layer-n { margin-left: .15rem; padding: 0 .35rem; border-radius: var(--r-full); background: rgba(0,0,0,.12); font-size: .65rem; }
    .wx-map-wrap { position: relative; isolation: isolate; }
    #wx-map { height: clamp(420px, calc(100dvh - 15rem), 760px); width: 100%; border-radius: var(--r-md); z-index: 1; }
    @media (max-width: 1023px) { #wx-map { height: 55dvh; min-height: 320px; } .wx-card { order: -1; } }
    .wx-radar-bar { position: absolute; z-index: 500; left: .6rem; right: .6rem; bottom: 1.6rem; display: flex; align-items: center; gap: .5rem;
      max-width: 420px; padding: .35rem .6rem; border-radius: var(--r-full); background: rgba(15,23,42,.85); color: #f1f5f9; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
    .wx-radar-bar.hidden { display: none; }
    .wx-radar-btn { flex: none; width: 1.9rem; height: 1.9rem; border-radius: var(--r-full); background: #2563eb; color: #fff; font-size: .8rem; }
    .wx-radar-bar input { flex: 1; min-width: 0; accent-color: #60a5fa; }
    .wx-radar-time { flex: none; font-size: .72rem; font-weight: 700; white-space: nowrap; }
    .wx-temp-pin { display: inline-flex; align-items: center; justify-content: center; gap: .15rem; width: 58px; height: 24px; border-radius: var(--r-full);
      background: var(--tc); color: #fff; font-size: .72rem; font-weight: 800; box-shadow: 0 1px 4px rgba(0,0,0,.4); border: 1.5px solid rgba(255,255,255,.85); }
    .wx-bolt { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; font-size: 16px; filter: drop-shadow(0 0 4px #facc15); animation: wx-bolt 1.2s ease-in-out infinite; }
    @keyframes wx-bolt { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .55; } }
    @media (prefers-reduced-motion: reduce) { .wx-bolt { animation: none; } }
    .wx-card { min-width: 0; padding: .9rem; transition: opacity .2s; }
    .wx-card.is-loading { opacity: .55; }
    .wx-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
    .wx-place { font-size: 1.15rem; font-weight: 800; color: var(--text); }
    .wx-place-sub { font-size: .72rem; color: var(--muted); }
    .wx-star { flex: none; width: 2.2rem; height: 2.2rem; border-radius: var(--r-md); border: 1px solid var(--border-ctl); font-size: 1.1rem; color: var(--faint); }
    .wx-star.is-on { color: #f59e0b; border-color: #fcd34d; background: #fffbeb; }
    .wx-now { display: flex; align-items: center; gap: 1rem; margin: .7rem 0; padding: .8rem 1rem; border-radius: var(--r-lg);
      background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 22%, transparent), color-mix(in srgb, var(--tc) 6%, transparent)); }
    .wx-now-main { display: flex; align-items: center; gap: .4rem; }
    .wx-now-icon { font-size: 2.6rem; line-height: 1; }
    .wx-now-temp { font-size: 2.8rem; font-weight: 800; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
    .wx-now-cond { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
    .wx-now-text { font-size: .9rem; font-weight: 700; color: var(--text); }
    .wx-now-feels { font-size: .75rem; color: var(--text-3); }
    .wx-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
    .wx-stat { display: flex; flex-direction: column; gap: .1rem; padding: .45rem .6rem; border-radius: var(--r-md); background: var(--surface-2); }
    .wx-stat-l { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
    .wx-stat-v { font-size: .85rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
    .wx-wind-arrow { display: inline-block; color: var(--accent-ink); transition: transform .3s; }
    .wx-chart-box { margin-top: .8rem; }
    .wx-chart { display: block; width: 100%; height: auto; }
    .wx-chart-line { fill: none; stroke: #f97316; stroke-width: 2.2; stroke-linejoin: round; }
    .wx-chart-area { fill: rgba(249,115,22,.12); }
    .wx-chart-rain { fill: #3b82f6; }
    .wx-chart-zero { stroke: #94a3b8; stroke-dasharray: 3 3; stroke-width: 1; }
    .wx-chart-day { stroke: #cbd5e1; stroke-width: 1; }
    .wx-chart-x { font-size: 10px; fill: #64748b; }
    .wx-chart-t { font-size: 10px; font-weight: 700; fill: #0f172a; }
    .wx-chart-icon { font-size: 12px; }
    .wx-days { margin-top: .8rem; }
    .wx-day { display: grid; grid-template-columns: 5.2rem 1.6rem 2rem minmax(0, 1fr) 2rem; align-items: center; gap: .4rem; padding: .35rem 0; border-bottom: 1px solid var(--border-soft); font-size: .8rem; }
    .wx-day-name { font-weight: 700; color: var(--text-2); text-transform: capitalize; }
    .wx-day-icon { font-size: 1.05rem; text-align: center; }
    .wx-day-min { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
    .wx-day-max { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
    .wx-day-bar { position: relative; height: .4rem; border-radius: var(--r-full); background: var(--surface-3); }
    .wx-day-fill { position: absolute; top: 0; bottom: 0; border-radius: var(--r-full); }
    .wx-day-rain { grid-column: 2 / -1; font-size: .68rem; color: var(--accent-ink); }
    .wx-day-rain:empty { display: none; }
    .wx-external { margin-top: .25rem; }
    .wx-ext-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
    .wx-ext-title { font-size: .9rem; font-weight: 800; color: var(--text); }
    .wx-ext-frame { display: block; width: 100%; height: clamp(420px, calc(100dvh - 13rem), 820px); border: 0; border-radius: var(--r-lg); background: #0f172a; }
    .hs-weather { cursor: pointer; }
    .hs-weather:hover { border-color: #60a5fa; }
    /* Tilannekuvan Sää-paneeli */
    .dash-wx-now { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .75rem; text-align: left; }
    .dash-wx-now:hover { background: var(--surface-2); }
    .dash-wx-icon { font-size: 1.8rem; line-height: 1; }
    .dash-wx-temp { font-size: 1.7rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
    .dash-wx-place { display: block; font-size: .82rem; font-weight: 700; color: var(--text); }
    .dash-wx-cond { display: block; font-size: .72rem; color: var(--muted); }
    .dash-wx-hours { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .15rem; padding: 0 .5rem .4rem; }
    .dash-wx-hour { display: flex; flex-direction: column; align-items: center; gap: .05rem; font-size: .9rem; }
    .dash-wx-h { font-size: .62rem; color: var(--muted); }
    .dash-wx-ht { font-size: .7rem; font-weight: 700; color: var(--text); }
    html.dark .wx-star.is-on { background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.5); }
    html.dark .wx-chart-t { fill: #f1f5f9; }
    html.dark .wx-chart-day { stroke: #334155; }
    html.dark .dash-wx-now:hover { background: #1e293b; }
    .wx-layer-btn.is-on .wx-layer-n { background: rgba(255,255,255,.25); }
    /* ---------- Tapahtumaryhmä kortissa: sama uutinen muista lähteistä (index.php: render_news_card) ---------- */
    .cluster { margin-top: .6rem; font-size: .75rem; }
    .cluster > summary { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: var(--r-full); cursor: pointer; list-style: none;
      background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
    .cluster > summary::-webkit-details-marker { display: none; }
    .cluster > summary::after { content: "▾"; font-size: .65rem; opacity: .75; }
    .cluster[open] > summary::after { content: "▴"; }
    .cluster > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
    .cluster-n { font-variant-numeric: tabular-nums; }
    .cluster-list { display: flex; flex-direction: column; gap: .1rem; margin-top: .45rem; padding-left: .65rem; border-left: 2px solid var(--accent-line); }
    .cluster-link { display: block; padding: .2rem 0; line-height: 1.3; }
    .cluster-src { font-weight: 700; color: var(--text); }
    .cluster-time { margin-left: .2rem; font-size: .68rem; color: var(--muted); }
    .cluster-title { display: block; color: var(--text-2); }
    .cluster-link:hover .cluster-title { color: var(--accent-ink); text-decoration: underline; }
    /* ---------- 🔥 Nousussa-rivi etusivulla (app.js: renderTrending) ---------- */
    .trend-bar { display: flex; align-items: center; gap: .6rem; min-width: 0; }
    .trend-bar.hidden { display: none; }
    .trend-h { flex: none; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--dis); cursor: help; }
    .trend-row { display: flex; gap: .4rem; min-width: 0; overflow-x: auto; padding: .1rem; }
    .trend-chip { max-width: 22rem; padding-left: .35rem; }
    .trend-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
    .trend-n { flex: none; min-width: 1.35rem; padding: 0 .35rem; border-radius: var(--r-full); background: var(--dis); color: #fff; font-size: .68rem; font-weight: 800; line-height: 1.35rem; text-align: center; font-variant-numeric: tabular-nums; }
    .news-item.trend-flash { box-shadow: 0 0 0 3px var(--dis); transition: box-shadow .3s; }

/* ---------- 🔔 Hakuvahdit ---------- */
.cat-watch { color: #7c3aed; border-color: #ddd6fe; }
.cat-watch.is-on { border-color: #7c3aed; background: #7c3aed; color: #fff; }
html.dark .cat-watch:not(.is-on) { color: #c4b5fd; border-color: rgba(139,92,246,.45); }
.watch-menu { width: 19rem; }
.watch-form { display: flex; gap: .35rem; margin-bottom: .4rem; }
.watch-input { flex: 1; min-width: 0; padding: .4rem .6rem; font-size: var(--fs-sm); }
.watch-add { flex: none; padding: .4rem .7rem; font-size: var(--fs-sm); }
.watch-msg { margin: -.1rem 0 .35rem; font-size: var(--fs-xs); color: var(--danger); }
.watch-list { display: flex; flex-direction: column; max-height: min(40vh, 18rem); overflow-y: auto; margin: 0 -.3rem .35rem; }
.watch-empty { padding: .35rem .3rem; font-size: var(--fs-sm); color: var(--muted); }
.watch-word { flex: 1; min-width: 0; display: flex; align-items: center; gap: .4rem; padding: .4rem .45rem; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); text-align: left; }
.watch-word:hover { background: var(--surface-3); }
.watch-word.is-on { background: #ede9fe; color: #5b21b6; }
html.dark .watch-word.is-on { background: rgba(139,92,246,.22); color: #ddd6fe; }
.watch-word .map-check-count { margin-left: auto; }
.watch-del:hover { color: var(--danger); }
.watch-all { margin: 0 -.3rem; }
.watch-hint { margin-top: .35rem; font-size: var(--fs-xs); line-height: 1.4; color: var(--muted); }
.news-item.is-watch { box-shadow: inset 4px 0 0 #8b5cf6; }
.news-item.is-watch.kb-active { box-shadow: inset 4px 0 0 #8b5cf6, 0 0 0 3px #3b82f6; }
.watch-badge { flex: none; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .2rem .4rem; border-radius: var(--r-sm); background: #ede9fe; color: #5b21b6; font-size: 10px; font-weight: 700; line-height: 1; }
html.dark .watch-badge { background: rgba(139,92,246,.25); color: #ddd6fe; }
.notify-watch { margin-bottom: .75rem; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.notify-watch-label { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); cursor: pointer; }
.notify-watch-hint { margin-top: .3rem; font-size: var(--fs-xs); color: var(--muted); }
.cat-bar .watch-menu { left: auto; right: 0; }
@media (max-width: 640px) { .cat-bar .watch-menu { width: auto; left: 0; right: 0; } }

/* ---------- 🔗 Tapahtuma: kuka uutisoi ja milloin ---------- */
.story-box { width: 100%; max-width: 40rem; max-height: 88vh; overflow-y: auto; padding: 1.1rem 1.25rem 1.25rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
.story-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-bottom: .5rem; margin-bottom: .6rem; border-bottom: 1px solid var(--border-soft); }
.story-eyebrow { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.story-x { flex: none; width: 2rem; height: 2rem; border-radius: var(--r-sm); font-size: 1.5rem; line-height: 1; color: var(--faint); }
.story-x:hover { background: var(--surface-3); color: var(--text); }
.story-headline { font-size: var(--fs-lg); font-weight: 800; line-height: 1.3; letter-spacing: -.01em; color: var(--text); }
.story-sum { margin-top: .3rem; font-size: var(--fs-sm); color: var(--text-3); }
.story-tl { margin-top: 1rem; }
.story-track { position: relative; height: 1.6rem; margin: .5rem .55rem 0; }
.story-track::before { content: ""; position: absolute; left: -.55rem; right: -.55rem; top: 50%; height: 2px; transform: translateY(-50%); border-radius: 2px; background: var(--surface-4); }
.story-dot { position: absolute; top: 50%; width: .8rem; height: .8rem; transform: translate(-50%, -50%); border: 2px solid var(--surface); border-radius: var(--r-full); cursor: default; }
.story-dot.is-first { width: 1.15rem; height: 1.15rem; box-shadow: 0 0 0 3px var(--accent-line); z-index: 1; }
.story-axis { display: flex; justify-content: space-between; margin-top: .2rem; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.story-dists { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.25rem; margin-top: 1rem; }
@media (max-width: 540px) { .story-dists { grid-template-columns: 1fr; } }
.story-bar { display: flex; height: .55rem; margin-top: .45rem; overflow: hidden; border-radius: var(--r-full); background: var(--surface-3); }
.story-seg { height: 100%; }
.story-legend { display: flex; flex-wrap: wrap; gap: .2rem .75rem; margin-top: .4rem; font-size: var(--fs-xs); color: var(--text-3); }
.story-lg { display: inline-flex; align-items: center; gap: .3rem; }
.story-sw { width: .55rem; height: .55rem; border-radius: 2px; }
.is-dom.story-dot, .story-seg.is-dom, .story-sw.is-dom { background: #2563eb; }
.is-for.story-dot, .story-seg.is-for, .story-sw.is-for { background: #f59e0b; }
.is-unk.story-dot, .story-seg.is-unk, .story-sw.is-unk { background: #94a3b8; }
.story-seg.is-fi, .story-sw.is-fi { background: #0ea5e9; }
.story-seg.is-sv, .story-sw.is-sv { background: #eab308; }
.story-seg.is-en, .story-sw.is-en { background: #8b5cf6; }
.story-list-h { margin-top: 1.1rem; }
.story-list { margin-top: .35rem; border-top: 1px solid var(--border-soft); }
.story-row { display: flex; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border-soft); }
.story-rank { flex: none; width: 4.6rem; padding-top: .1rem; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.story-row.is-first .story-rank { color: #b45309; }
html.dark .story-row.is-first .story-rank { color: #fbbf24; }
.story-meta { display: flex; align-items: center; gap: .4rem; min-width: 0; font-size: var(--fs-xs); color: var(--muted); }
.story-src { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); }
.story-time { flex: none; font-variant-numeric: tabular-nums; }
.story-lang { flex: none; padding: .05rem .3rem; border-radius: var(--r-sm); background: var(--surface-3); font-size: 10px; font-weight: 700; }
.story-link { display: block; margin-top: .15rem; font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; color: var(--text); }
.story-link:hover { color: var(--accent-ink); text-decoration: underline; }
.story-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-top: .9rem; }
.story-note { font-size: var(--fs-xs); line-height: 1.4; color: var(--muted); }
.story-copy { flex: none; padding: .45rem .8rem; font-size: var(--fs-sm); }
@media (max-width: 540px) { .story-box { padding: 1rem; } .story-foot { flex-direction: column; align-items: stretch; } .story-rank { width: 3.9rem; } }

/* ---------- ☀️🌙 Päivän kooste ---------- */
.digest { margin: .75rem 0 .25rem; padding: .85rem 1rem 1rem; border-color: #fcd34d; background: linear-gradient(180deg, #fffbeb, var(--surface) 5rem); }
html.dark .digest { border-color: rgba(245,158,11,.4); background: linear-gradient(180deg, rgba(245,158,11,.1), var(--surface) 5rem); }
.digest.is-collapsed { padding-bottom: .85rem; }
/* Puhelimella pienennetty kooste on yksi matala rivi */
@media (max-width: 640px) {
  .digest.is-collapsed { padding: .5rem .75rem; margin-top: .5rem; }
  .digest.is-collapsed .digest-h { font-size: var(--fs-md); }
  .digest.is-collapsed .digest-toggle { align-items: center; }
}

/* Uutiset-näkymän suodatinrivi heti yläpalkin alle: näkymätön otsikko ei tuo väliä (Tailwind space-y-3),
   puhelimella myös sisällön yläreunus pienempi */
#source-filter.hidden + #category-chips { margin-top: 0; }
@media (max-width: 767px) { main.py-6 { padding-top: .625rem; } } /* .py-6 ohittaisi pelkän main-valitsimen */

/* ✨ Uudet uutiset yläpalkissa säätiedon vieressä hetken hehkuvana tekstinä (app.js showNewSinceVisitToast) */
.hs-news { display: none; align-items: center; white-space: nowrap; font-weight: 700; color: #fcd34d; opacity: 1; transition: opacity .6s;
  animation: hs-news-glow 1.6s ease-in-out infinite; }
.hs-news.is-on { display: inline-flex; }
.hs-news.is-out { opacity: 0; }
@keyframes hs-news-glow {
  0%, 100% { text-shadow: 0 0 2px rgba(251,191,36,.35); color: #fcd34d; }
  50% { text-shadow: 0 0 10px rgba(251,191,36,.95), 0 0 18px rgba(245,158,11,.6); color: #fef3c7; }
}
@media (prefers-reduced-motion: reduce) { .hs-news { animation: none; } }

/* Uudet uutiset: yläpalkin hehkuva painike (app.js showNewNewsBar), sama tyyli kuin .hs-news */
.hs-news-btn { cursor: pointer; border-radius: var(--r-sm); padding: 0 .2rem; }
.hs-news-btn:hover, .hs-news-btn:focus-visible { text-decoration: underline; outline: none; }

/* Sivujen otsikot pois kaikilla leveyksillä: sivun nimi näkyy yläpalkissa (app.js updateBrandPage) */
.brand-page, .brand-clock { display: none; }
body.has-page-name .brand-news { display: none; }
body.has-page-name .brand-page { display: inline; }
body.is-dash .brand-clock { display: inline; margin-left: .35rem; font-size: .75rem; font-weight: 600; color: #94a3b8; font-variant-numeric: tabular-nums; }
.view-head > .view-head-main { display: none; }
#map-container > .view-head { display: none; }
@media (max-width: 767px) {
  #dash-container > .view-head, #map-container > .view-head { display: none; }
  #streams-container > .view-head .view-head-main, #weather-container > .view-head .view-head-main { display: none; }
  /* Striimit: asettelun ⚟ aluerivin oikeaan reunaan */
  #streams-container { position: relative; }
  #streams-container > .view-head { margin: 0; }
  #streams-container .st-actions { position: absolute; right: 0; top: 0; z-index: 6; }
  #streams-container .st-groups { padding-right: 3rem; }
  /* Tilannekuva: Näkymä ja Oma näkymä kartan ⚟-paneelissa (placeDashActions) */
  .dash-map .map-extra.is-open { flex-direction: column; align-items: stretch; width: min(20rem, calc(100vw - 2rem)); max-height: 70dvh; overflow-y: auto; }
  .dash-map .map-extra.is-open > * { width: 100%; }
  .dash-map .map-extra.is-open > .relative > .btn, .dash-map .map-extra.is-open > .btn { width: 100%; justify-content: flex-start; gap: .4rem; }
  .dash-map .map-extra.is-open > .relative > .btn .map-caret { margin-left: auto; }
  .dash-map .map-extra .dash-menu, .dash-map .map-extra #map-time-menu { position: static; width: auto; margin-top: .4rem; box-shadow: none; }
}

/* 🛰️ Tilannekuva puhelimella samaan tapaan kuin pääsivu (app.js toggleDashActions, toggleMapExtra, toggleDashMenu 'edit'):
   otsikkorivillä ⚟ (Näkymä + Muokkaa), kartan säätimet yhdellä rivillä ja ⚟ (Aika + Toista), kartta 40 % näytöstä,
   paneelien 📌 ↑ ↓ ✕ vain Muokkaa-tilassa. Tietokoneella ennallaan. */
.dash-more-btn, .map-more-btn { display: none; }
.dash-actions-pop { display: contents; } /* tietokoneella napit suoraan otsikkorivillä */
@media (max-width: 767px) {
  body.is-dash main { padding-top: .625rem; }
  #dash-container .view-head { flex-wrap: nowrap; margin-bottom: .5rem; }
  .dash-actions { position: relative; flex: none; }
  .dash-more-btn { display: inline-flex; padding-left: .6rem; padding-right: .6rem; }
  .dash-more-btn.is-open { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
  /* ⚟-paneeli: tausta, reunus ja varjo; Näkymä ja Muokkaa allekkain, niiden valikot avautuvat paneelin sisään */
  .dash-actions-pop { display: none; }
  .dash-actions.is-open .dash-actions-pop { display: flex; flex-direction: column; gap: .5rem; position: absolute; right: 0; top: calc(100% + .4rem);
    z-index: 1100; width: min(20rem, calc(100vw - 2rem)); max-height: calc(100dvh - 10rem); overflow-y: auto; padding: .6rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: 0 14px 36px rgba(2,6,23,.5); }
  .dash-actions-pop > .relative > .btn { width: 100%; justify-content: flex-start; gap: .4rem; }
  .dash-actions-pop > .relative > .btn .map-caret { margin-left: auto; }
  .dash-actions-pop .dash-menu { position: static; width: auto; margin-top: .4rem; box-shadow: none; }
  #dash-container.is-editing #dash-edit-btn { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }

  .dash-map #map-tools > div { flex-wrap: nowrap; }
  .dash-map #map-tools .map-layers { flex: 1 1 0; min-width: 0; }
  .dash-map #map-tools .map-layers .map-layer-wrap { flex: 1 1 0; min-width: 0; }
  .dash-map #map-tools .map-layers .map-layer-btn { width: 100%; min-width: 0; overflow: hidden; white-space: nowrap; justify-content: center; }
  .dash-map .map-more-btn { display: inline-flex; flex: none; padding-left: .6rem; padding-right: .6rem; }
  .dash-map .map-more-btn.is-open { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
  .dash-map #map-tools { position: relative; }
  .dash-map .map-extra { display: none !important; }
  .dash-map .map-extra.is-open { display: flex !important; position: absolute; right: .25rem; top: calc(100% - .1rem); z-index: 1100; /* Leafletin säätimien (1000) yläpuolelle */ padding: .5rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: 0 10px 28px rgba(2,6,23,.4); }
  .dash-map { height: 40dvh; min-height: 260px; }

  /* Avoin ⚟-paneeli himmennyksen (#menu-backdrop, z 35) yläpuolelle */
  .dash-actions.is-open { z-index: 36; }
  .dash-map.has-pop { position: relative; z-index: 36; }
  .dash-map.has-pop #map, .dash-map.has-pop .map-layers { filter: brightness(.45); transition: filter .18s; } /* kartta himmenee kuten muu sivu */
  .dash-panel-tools { display: none; }
  #dash-container.is-editing .dash-panel-tools { display: flex; }

  /* Välilehdet kartan alla: yksi paneeli kerrallaan (app.js renderDashboard, selectDashTab).
     Oma näkymä -tilassa näytetään kaikki paneelit järjestyksen muokkausta varten. */
  .dash-grid { grid-template-columns: minmax(0, 1fr); } /* välilehtirivi ei saa leventää sivua */
  .dash-map { position: relative; z-index: 5; } /* kartan Uutiset/Häiriöt-valikot välilehtien ja paneelien päälle */
  .dash-map:has(.map-pop:not(.hidden)) .dash-focus { display: none; } /* "Kartalla: …" ei peitä avointa valikkoa */
  .dash-panels { min-width: 0; }
  .dash-tabs { display: flex; gap: .4rem; overflow-x: auto; padding: .1rem .1rem .55rem; max-width: 100%; }
  .dash-tab { flex: none; white-space: nowrap; }
  /* Nuolet rivin päissä (app.js renderDashboard): häivytys + ‹ › kun riviä voi vierittää siihen suuntaan */
  .dash-tabs-wrap { position: relative; }
  .dash-tabs-arrow { position: absolute; top: 0; bottom: .55rem; z-index: 2; width: 2.2rem; display: none; align-items: center;
    font-size: 1.5rem; font-weight: 700; line-height: 1; color: var(--text); }
  .dash-tabs-arrow.is-on { display: flex; }
  .dash-tabs-arrow.is-prev { left: 0; justify-content: flex-start; padding-left: .15rem; background: linear-gradient(90deg, var(--bg) 45%, transparent); }
  .dash-tabs-arrow.is-next { right: 0; justify-content: flex-end; padding-right: .15rem; background: linear-gradient(270deg, var(--bg) 45%, transparent); }
  .dash-tab-n { font-size: .68rem; font-weight: 600; opacity: .75; }
  .dash-tab-n:empty { display: none; }
  #dash-container.has-tabs .dash-panel { display: none; }
  #dash-container.has-tabs .dash-panel.is-tab-active { display: block; }
  #dash-container.has-tabs .dash-panel.is-tab-active .dash-panel-head { display: none; }
  #dash-container.has-tabs .dash-pinned-h { display: none; }
  #dash-container.is-editing .dash-tabs { display: none; }
  #dash-container.is-editing.has-tabs .dash-panel { display: block; }
  #dash-container.is-editing.has-tabs .dash-panel .dash-panel-head { display: flex; }
  /* Uutislistat enintään 5 + "Kaikki uutiset ›" */
  #dash-container.has-tabs .dash-panel[data-panel="latest"] .dash-panel-body:not(.is-scroll) > .dash-item:nth-of-type(n+4),
  #dash-container.has-tabs .dash-panel[data-panel="trending"] .dash-panel-body:not(.is-scroll) > .dash-item:nth-of-type(n+4),
  #dash-container.has-tabs .dash-panel[data-panel^="cat:"] .dash-panel-body:not(.is-scroll) > .dash-item:nth-of-type(n+4) { display: none; }
  /* Näytä lisää: kolmen uutisen korkuinen vieritettävä lista, alapalkki pysyy näkyvissä (app.js dashListFit) */
  #dash-container.has-tabs .dash-panel-body.is-scroll { overflow-y: auto; overscroll-behavior: contain; }
  #dash-container.has-tabs .dash-panel-body > .dash-more { display: none; }
  .dash-list-foot { display: flex; position: sticky; bottom: 0; z-index: 1; background: var(--surface); border-top: 1px solid var(--border-soft); }
  .dash-list-foot > * { flex: 1 1 0; }
  .dash-list-foot .dash-more-link { border-top: 0; }
  .dash-show-more { padding: .6rem .75rem; text-align: center; font-size: .8rem; font-weight: 700; color: var(--text); border-right: 1px solid var(--border-soft); }
  .dash-show-more:hover { background: var(--surface-3); }
  .dash-more-link { display: block; width: 100%; padding: .6rem .75rem; text-align: center; font-size: .8rem; font-weight: 700; color: var(--accent-ink);
    border-top: 1px solid var(--border-soft); }
  .dash-more-link:hover { background: var(--surface-3); }
}

/* Monitorin ruudun kanavavalinta (app.js stTile, setGridChannel) */
.st-tile-pick { flex: 1; min-width: 0; height: 1.8rem; padding: 0 1.4rem 0 .45rem; border-radius: var(--r-sm); border: 1px solid #334155;
  background: #1e293b; color: #fff; font-size: .72rem; font-weight: 700; text-overflow: ellipsis; cursor: pointer; }
.st-tile-pick:focus-visible { outline: 2px solid #60a5fa; outline-offset: 1px; }

/* 📺 Striimit: aluevalikko (puhelin) ja 🔴 Live nyt (app.js renderStreams, toggleStGroupMenu, toggleStLive, toggleStActions).
   Asettelun ⚟ käyttää Tilannekuvan .dash-actions-tyylejä. */
.st-gmenu-wrap { display: none; position: relative; }
.st-gmenu { position: absolute; left: 0; top: calc(100% + .4rem); z-index: 1100; width: min(15rem, calc(100vw - 2rem)); }
.st-gopt { display: flex; justify-content: space-between; align-items: center; gap: .75rem; width: 100%; }
.st-gopt:disabled { opacity: .4; cursor: default; }
.st-live-btn { flex: none; }
.st-live-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: var(--r-full); background: #ef4444; }
.st-live-btn.is-on { border-color: #ef4444; background: rgba(239,68,68,.15); color: #fca5a5; }
.st-live-btn.is-on .st-live-dot { box-shadow: 0 0 0 3px rgba(239,68,68,.35); }
@media (max-width: 767px) {
  #streams-container .view-head { flex-wrap: nowrap; margin-bottom: .5rem; }
  .st-actions .dash-actions-pop .seg { width: 100%; }
  .st-actions .dash-actions-pop .seg-btn { flex: 1; justify-content: center; }
  .st-groups { overflow: visible; flex-wrap: nowrap; align-items: center; }
  .st-groups .st-group { display: none; }
  .st-gmenu-wrap { display: block; }
  .st-gmenu-wrap.is-open { z-index: 36; } /* vain oman valikon ollessa auki himmennyksen yläpuolella */
}

/* Puhelimen ☰-valikko sivun päällä (ei työnnä sisältöä alas), sivu himmennetään alla (app.js setMobileMenu).
   Yläpalkki (z-40) ja valikko jäävät himmennyksen (z-35) yläpuolelle. */
@media (max-width: 767px) {
  #mobile-menu { position: absolute; left: 0; right: 0; top: 100%; z-index: 41; border-radius: 0 0 1.1rem 1.1rem;
    box-shadow: 0 18px 40px rgba(2,6,23,.55); max-height: calc(100vh - 8rem); overflow-y: auto; animation: search-bar-in .16s ease-out; }
}
.menu-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(2,6,23,.55); opacity: 0; pointer-events: none; transition: opacity .18s; }
.menu-backdrop.is-on { opacity: 1; pointer-events: auto; }
@media (min-width: 768px) { .menu-backdrop { display: none; } }
@media (prefers-reduced-motion: reduce) { #mobile-menu { animation: none; } .menu-backdrop { transition: none; } }

/* 🔥 Nousussa nauhana (app.js startTrendMarquee). Ilman .is-marquee rivi on tavallinen vieritettävä rivi. */
.trend-track { display: flex; gap: .4rem; flex: none; }
.trend-row.is-marquee { overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.25rem, #000 calc(100% - 2rem), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 1.25rem, #000 calc(100% - 2rem), transparent); }
.trend-row.is-marquee .trend-track { animation: trend-scroll var(--trend-dur, 30s) linear infinite; will-change: transform; }
.trend-row.is-marquee:hover .trend-track, .trend-row.is-marquee:focus-within .trend-track,
.trend-row.is-marquee.is-paused .trend-track { animation-play-state: paused; }
@keyframes trend-scroll { from { transform: translateX(0); } to { transform: translateX(var(--trend-shift, -50%)); } }
@media (prefers-reduced-motion: reduce) { .trend-row.is-marquee .trend-track { animation: none; } .trend-row.is-marquee { overflow-x: auto; } }

/* ⚙ Lisäsuodattimet (app.js renderCategoryChips, toggleMoreFilters, renderActivePills).
   Tietokoneella ★ ● 🔔 🌐 ovat suoraan rivillä; puhelimella ne ovat ⚙-napin alle avautuvassa pudotusvalikossa. */
.cat-more-wrap, .cat-extra { display: contents; }
.cat-more-btn, .cat-extra-head, .cat-pills { display: none; }
@media (max-width: 767px) { /* sama raja kuin alanavigaatiolla (md:hidden) */
  .cat-more-wrap { display: block; flex: none; position: relative; }
  .cat-more-btn { display: inline-flex; padding-left: .6rem; padding-right: .6rem; }
  .cat-more-btn .map-caret { display: none; }
  /* Uutiset ja Häiriöt kapenevat, jotta ⚙ mahtuu samalle riville */
  .cat-bar > .map-layers { flex: 1 1 0; min-width: 0; }
  .cat-bar > .map-layers .map-layer-wrap { flex: 1 1 0; min-width: 0; }
  .cat-bar > .map-layers .map-layer-btn { width: 100%; min-width: 0; overflow: hidden; white-space: nowrap; justify-content: center; }
  .cat-more-btn.is-on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
  .cat-more-count { min-width: 1.15rem; padding: 0 .3rem; border-radius: var(--r-full); background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700; text-align: center; }
  .cat-more-count.hidden { display: none; }
  .cat-extra { display: none; }
  .cat-more-wrap.is-open .cat-extra { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; position: absolute; z-index: 56; top: calc(100% + .4rem); right: 0;
    width: min(20rem, calc(100vw - 2rem)); padding: .75rem .85rem .85rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); box-shadow: 0 12px 32px rgba(15,23,42,.28); animation: search-bar-in .18s ease-out; }
  .cat-extra-head { display: flex; flex-basis: 100%; align-items: center; justify-content: space-between; }
  .cat-extra-head .map-pop-h { margin: 0; }
  .cat-extra-done { padding: .3rem .7rem; border-radius: var(--r-sm); font-weight: 700; color: var(--accent-ink); }
  .cat-extra-done:hover { background: var(--surface-3); }
  /* Vahtien ja kielen valikot pudotusvalikon alle sen levyisinä */
  .cat-extra .map-layer-wrap { position: static; }
  .cat-bar .cat-extra .map-layer-menu { top: calc(100% + .4rem); bottom: auto; left: 0; right: 0; width: auto; max-width: none; max-height: 60vh; overflow: auto; }
  .cat-pills { display: flex; flex-wrap: wrap; gap: .35rem; flex-basis: 100%; }
  .cat-pills.hidden { display: none; }
  .cat-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .4rem .25rem .6rem; border-radius: var(--r-full); border: 1px solid var(--accent-line);
    background: var(--accent-soft); color: var(--accent-ink); font-size: .72rem; font-weight: 600; }
  .cat-pill-x { font-size: .95rem; line-height: 1; opacity: .7; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) { .cat-more-wrap.is-open .cat-extra { animation: none; } }

/* 🌐 Uutisten kieli suodatinrivillä (app.js buildLangMenu) */
.map-layer-menu.lang-menu { width: 12rem; min-width: 0; max-width: calc(100vw - 2rem); }
.lang-opt { display: block; width: 100%; text-align: left; padding: .45rem .6rem; border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text); }
.lang-opt:hover { background: var(--surface-3); }
.lang-opt.is-on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }

/* 🔍 Haku yläpalkissa (index.php #search-btn, #search-bar) */
.search-btn { position: relative; flex: none; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .75rem;
  background: #1e293b; border: 1px solid #334155; color: #cbd5e1; transition: background-color .15s, color .15s; }
.search-btn:hover, .search-btn.is-open { background: #334155; color: #fff; }
.search-btn:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.search-dot { position: absolute; top: .35rem; right: .35rem; width: .5rem; height: .5rem; border-radius: 9999px; background: #f59e0b; box-shadow: 0 0 0 2px #1e293b; }
.search-dot.hidden { display: none; }
.search-bar { animation: search-bar-in .18s ease-out; }
@keyframes search-bar-in { from { opacity: 0; transform: translateY(-.35rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .search-bar { animation: none; } }

/* "Sivusto on päivittynyt": kelluva ilmoitus, ei vie tilaa uutisilta (app.js initFirstVisit sulkee 10 s kuluttua) */
.update-toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); width: min(calc(100vw - 2rem), 34rem);
  bottom: calc(4.8rem + env(safe-area-inset-bottom, 0px)); margin: 0; box-shadow: 0 10px 30px rgba(15,23,42,.3); animation: update-toast-in .35s ease-out; }
@media (min-width: 768px) { .update-toast { bottom: 1.5rem; } }
@keyframes update-toast-in { from { opacity: 0; transform: translate(-50%, .75rem); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .update-toast { animation: none; } }
.digest-head { display: flex; align-items: flex-start; gap: .5rem; }
.digest-toggle { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; text-align: left; }
.digest-h { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.digest-when { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.digest-caret { font-size: var(--fs-xs); color: var(--faint); }
.digest-x { flex: none; width: 1.9rem; height: 1.9rem; border-radius: var(--r-sm); font-size: 1.35rem; line-height: 1; color: var(--faint); }
.digest-x:hover { background: var(--surface-3); color: var(--text); }
.digest-intro { margin-top: .55rem; font-size: var(--fs-md); line-height: 1.5; color: var(--text-2); }
.digest-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1.5rem; margin-top: .6rem; }
@media (max-width: 760px) { .digest-list { grid-template-columns: 1fr; } }
.digest-item { display: flex; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--border-soft); }
.digest-num { flex: none; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border-radius: var(--r-full); background: #f59e0b; color: #1f1300; font-size: var(--fs-xs); font-weight: 800; }
.digest-title { display: block; text-align: left; font-size: var(--fs-md); font-weight: 700; line-height: 1.35; color: var(--text); }
.digest-title:hover { color: var(--accent-ink); text-decoration: underline; }
.digest-meta { margin-top: .15rem; font-size: var(--fs-xs); color: var(--muted); }
.digest-sum { margin-top: .3rem; font-size: var(--fs-sm); line-height: 1.45; color: var(--text-2); }
.digest-srcs { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; }
.digest-src { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .1rem .4rem; border: 1px solid var(--border); border-radius: var(--r-full); font-size: 10px; font-weight: 700; color: var(--text-3); }
.digest-src:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.digest-note { margin-top: .6rem; font-size: var(--fs-xs); color: var(--muted); }
.digest-mini { margin: .6rem 0 .1rem; }
.digest-reopen { font-weight: 700; border-color: #fcd34d; }
.dash-digest-h { padding: .1rem .75rem .35rem; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.dash-digest-intro { padding: 0 .75rem .5rem; font-size: var(--fs-sm); line-height: 1.45; color: var(--text-2); }

/* Puhelin vaakatasossa: pyyntö kääntää pystyyn (asettelu on tehty pystynäytölle). Kotinäytön sovellus on lukittu pystyyn (manifest.json). */
.rotate-note { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (hover: none) and (pointer: coarse) {
  .rotate-note { display: flex; position: fixed; inset: 0; z-index: 20000; flex-direction: column; align-items: center; justify-content: center; gap: .75rem;
    background: var(--bg); color: var(--text); font-size: var(--fs-lg); font-weight: 700; text-align: center; padding: 1rem; }
  .rotate-note-icon { font-size: 2.5rem; display: inline-block; transform: rotate(90deg); }
  body:has(.rotate-note) { overflow: hidden; }
}

/* Tietokone: tiiviimpi väli yläpalkin alla kaikissa näkymissä. Tilannekuvan otsikkorivi pois, koska
   Näkymä ja Oma näkymä ovat kartan säädinrivillä (app.js placeDashActions). */
#dash-container > .view-head { display: none; }
@media (min-width: 768px) {
  body main[class], body.is-dash main[class] { padding-top: .75rem; } /* [class] ohittaa Tailwindin md:py-8 */
  .view-head { margin-bottom: .75rem; }
  .dash-map .map-extra .dash-menu { right: 0; left: auto; }
}

/* Tietokone: Striimien asettelu ja Sään haku + napit suodatinrivin oikeaan reunaan (ei omaa riviä).
   Sirurivi kapenee napiston leveyden verran (vierittyy sivusuunnassa, jos ei mahdu). Puhelin ennallaan. */
@media (min-width: 768px) {
  #streams-container, #weather-container { position: relative; --head-w: 0px; }
  #streams-container > .view-head, #weather-container > .view-head { position: absolute; top: 0; right: 0; z-index: 6; margin: 0; flex-wrap: nowrap; }
  #streams-container { --head-w: 15.5rem; }
  #weather-container { --head-w: min(40rem, 60vw); }
  #weather-container > .view-head { width: var(--head-w); }
  #weather-container .wx-actions { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
  #weather-container .wx-actions .wx-search-wrap { flex: 1 1 auto; min-width: 8rem; max-width: none; }
  #st-groups, #wx-places { max-width: calc(100% - var(--head-w) - .75rem); min-height: 2.6rem; } /* vieritys ei mene napiston alle */
}

/* 🔥 Nousussa puhelimella: vieritettävä rivi nuolilla ‹ › (app.js trendArrowWrap, .dash-tabs-arrow-tyylit) */
@media (max-width: 767px) {
  .trend-wrap { flex: 1 1 auto; min-width: 0; }
  .trend-wrap .trend-row { scroll-behavior: smooth; }
  .trend-wrap .dash-tabs-arrow { bottom: 0; }
}

/* Häiriöt nyt: valittujen tyyppien lista vieritettävässä laatikossa */
.dash-dis-list.is-filtered { max-height: 24rem; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 767px) { .dash-dis-list.is-filtered { max-height: 18rem; } }
a.dash-item.dash-dis { color: inherit; text-decoration: none; }

/* Tilannekuva: yksi Kategoriat-valikko kartan yläpuolella (app.js placeDashCatMenu) ja Valitut-lista (renderDashFeed) */
.map-lbl-dash { display: none; }
#map-tools.is-dash .map-lbl-map { display: none; }
#map-tools.is-dash .map-lbl-dash { display: inline; }
#map-tools.is-dash #map-dis-wrap { display: none; }
#map-tools.is-dash .map-switch { display: none; }
#map-tools.is-dash #map-news-menu { max-height: min(70vh, 36rem); overflow-y: auto; overscroll-behavior: contain; }
#map-tools.is-dash .is-layer-off .map-check-list { opacity: 1; }
#map-tools.is-dash #map-news-menu > .map-pop-h:first-of-type { margin-top: 0; }
.dash-feed { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.dash-feed-head { display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.dash-feed-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dash-feed-body .dash-empty { padding: .75rem; }
@media (min-width: 768px) {
  .dash-panels { display: flex; flex-direction: column; gap: .6rem; overflow-y: auto; min-height: 0; padding-right: .2rem; }
  .dash-panels > .dash-live { flex: 0 0 auto; }
  .dash-panels > .dash-stack, .dash-panels > .dash-pinned { flex: 0 0 auto; margin-bottom: 0; }
  .dash-feed { flex: 1 0 0; min-height: 20rem; }
  .dash-feed-body { flex: 1 1 auto; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) 320px; height: calc(100dvh - 9.5rem); min-height: 460px; }
  .dash-map { height: auto; min-height: 0; }
}
@media (max-width: 767px) {
  .dash-feed { margin-top: .6rem; }
  .dash-feed-body { max-height: 65dvh; }
}

/* Tilannekuva: lohkot ilman siirto- ja piilotusnappeja; kooste/Nousussa-valinnat vain Tilannekuvan Kategoriat-valikossa */
#dash-container .dash-panel-tools { display: none; }
#map-tools:not(.is-dash) #dash-extra-section { display: none; }
#dash-extra-section { margin-bottom: .6rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.dash-live .dash-panel-head { padding: .45rem .5rem .45rem .75rem; }
.dash-live .dash-panel-title { flex: 1; }
.dash-live-close { width: 1.8rem; height: 1.8rem; border-radius: var(--r-md); color: var(--muted); }
.dash-live-close:hover { background: var(--surface-2); color: var(--text); }
#dash-live-btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 767px) { #dash-panels > .dash-live, #dash-panels > .dash-stack { margin-top: .6rem; } }

/* Kartan merkintätavat Nastat/Pisteet/Laput, käyttäjä valitsee (app.js mkStyle, setMkStyle, renderMkSwitch) */
.mk-switch { position: absolute; top: 10px; right: 10px; z-index: 1000; display: flex; gap: 2px; padding: 3px; border-radius: var(--r-md); background: rgba(15,23,42,.85); border: 1px solid rgba(148,163,184,.35); }
.mk-switch-btn { min-width: 2rem; padding: .25rem .55rem; border-radius: var(--r-sm); font-size: .72rem; font-weight: 700; color: #cbd5e1; }
.mk-switch-btn.is-on { background: var(--accent); color: #fff; }
/* A: pisaranasta ikonilla, ryhmä värikiekkona */
.nm-a { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-top: 2px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,.45); transition: transform .15s; }
.nm-a > span { transform: rotate(45deg); font-size: 14px; line-height: 1; }
.nm-a.is-country { opacity: .7; border-style: dashed; }
.nm-a.is-hover { transform: rotate(-45deg) scale(1.25); box-shadow: 0 0 0 4px rgba(59,130,246,.5); }
.nm-a.is-fresh { animation: nm-pulse 2s ease-out infinite; }
html.dark .nm-a { border-color: #0f172a; }
.nm-donut { display: flex; align-items: center; justify-content: center; border-radius: 50%; box-shadow: 0 1px 6px rgba(0,0,0,.45); transition: transform .15s; }
.nm-donut > span { display: flex; align-items: center; justify-content: center; width: 64%; height: 64%; border-radius: 50%; background: #fff; color: #0f172a; font-weight: 800; font-size: 12px; }
html.dark .nm-donut > span { background: #0f172a; color: #f1f5f9; }
.nm-donut.is-fresh { animation: nm-pulse 2s ease-out infinite; }
.is-hover > .nm-donut { transform: scale(1.2); }
/* B: pienet pisteet, neutraali ryhmä ja selite */
.nm-b { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.nm-b.is-hover { transform: scale(1.5); }
.nm-b.is-fresh { animation: nm-pulse 2s ease-out infinite; }
html.dark .nm-b { border-color: #0f172a; }
.nm-bc { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #334155; color: #fff; font-weight: 700; font-size: 11px; border: 2px solid rgba(255,255,255,.8); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.mk-b .nm-dis { width: 20px !important; height: 20px !important; font-size: 11px; }
.mk-legend { position: absolute; left: 10px; bottom: 24px; z-index: 1000; min-width: 9rem; max-width: 13rem; padding: .4rem .55rem; border-radius: var(--r-md); background: rgba(15,23,42,.85); border: 1px solid rgba(148,163,184,.35); color: #e2e8f0; font-size: .7rem; }
.mk-legend-row { display: flex; align-items: center; gap: .4rem; padding: .08rem 0; }
.mk-legend-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.mk-legend-dot.is-dis { border-radius: 2px; background: #f97316; }
.mk-legend-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-legend-n { font-variant-numeric: tabular-nums; color: #94a3b8; }
/* C: vanhat (yli 6 h) haaleina, lähennettynä otsikkolaput */
.nm-pin.is-old { opacity: .45; filter: saturate(.6); }
.leaflet-tooltip.mk-label { padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: 600; background: rgba(15,23,42,.88); color: #f1f5f9; border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.35); white-space: nowrap; }
.leaflet-tooltip.mk-label::before { display: none; }
@media (max-width: 767px) { .mk-legend { left: auto; right: 8px; bottom: 22px; font-size: .64rem; min-width: 7.5rem; padding: .3rem .45rem; } .mk-legend-row:nth-child(n+6) { display: none; } }

/* Puhelin: Tilannekuvan kartta täyttää näytön niin, että Valitut-listan kaksi ensimmäistä riviä näkyvät (app.js fitDashMobileMap) */
.dash-more-hint { display: none; }
@media (max-width: 767px) {
  .dash-more-hint.is-on { display: flex; justify-content: center; align-items: flex-end; position: fixed; left: 0; right: 0; bottom: var(--nav-h, 60px); z-index: 45; height: 44px; padding-bottom: 6px;
    pointer-events: none; background: linear-gradient(to bottom, transparent, var(--bg) 55%); }
  .dash-more-pill { pointer-events: auto; height: 30px; padding: 0 .85rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,.35); white-space: nowrap; }
}

/* Sää: Lisää karttoja -monivalinta, valitut kartat pääkartan alla (app.js renderWxExtList) */
.wx-ext-list { display: flex; flex-direction: column; gap: .75rem; margin-top: .75rem; }
.wx-ext-list:empty { display: none; }
.wx-ext-card { padding: .5rem; }
.wx-ext-card .wx-ext-head { margin-bottom: .4rem; gap: .4rem; }
.wx-ext-card .wx-ext-title { flex: 1; min-width: 0; margin: 0 0 0 .25rem; }
.wx-ext-card .wx-ext-frame { height: clamp(360px, 70dvh, 720px); }
.wx-ext-open, .wx-ext-close { min-width: 2.2rem; justify-content: center; text-decoration: none; }
.wx-ext-check { align-items: flex-start; }
.wx-ext-check-t { display: flex; flex-direction: column; min-width: 0; }
#wx-more-menu { width: min(20rem, calc(100vw - 2rem)); }
#wx-more-n:empty { display: none; }
@media (max-width: 767px) { .wx-ext-card .wx-ext-frame { height: 60dvh; } }

/* ---------- Sää-sivun asettelu C (app.js applyWxLayout): kartta ensin, kelluvat säätimet ---------- */
.wx-ov-top, .wx-tools { display: none; }
#weather-container.wxl-c > .view-head { display: none; }
#weather-container.wxl-c #wx-places { display: none; }
#wx-saved-menu { right: 0; left: auto; width: min(16rem, calc(100vw - 2rem)); }
.wxl-c .wx-grid { grid-template-columns: minmax(0, 1fr) !important; }
.wxl-c .wx-ov-top { display: flex; position: absolute; z-index: 1000; top: .5rem; left: 3.25rem; right: .5rem; gap: .4rem; align-items: flex-start; }
.wxl-c .wx-ov-top #wx-search-wrap { flex: 1 1 auto; min-width: 0; max-width: 24rem; }
.wxl-c .wx-ov-top .field { background: var(--surface); box-shadow: var(--shadow-pop); }
.wxl-c .wx-ov-top .btn, .wxl-c .wx-tools-btn { background: var(--surface); box-shadow: var(--shadow-pop); }
.wxl-c .wx-tools { display: block; position: absolute; z-index: 1000; right: .5rem; bottom: 4.25rem; }
.wx-tools-btn { font-size: 1.1rem; padding: .4rem .65rem; }
.wx-tools-panel { position: absolute; right: 0; bottom: calc(100% + .4rem); width: min(20rem, calc(100vw - 3rem)); max-height: 55vh; overflow-y: auto;
  padding: .6rem; background: var(--surface); border: 1px solid var(--border-ctl); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.wx-tools-panel.hidden { display: none; }
.wx-tools-panel #wx-layers { padding: 0 0 .5rem; border-bottom: 1px solid var(--border-soft); margin-bottom: .5rem; }
.wx-tools-panel #wx-more-menu { display: block; position: static; width: auto; max-width: none; padding: 0; border: 0; box-shadow: none; background: none; }
@media (min-width: 1024px) { .wx-tools-panel { max-height: calc(clamp(420px, calc(100dvh - 15rem), 760px) - 8rem); } }
@media (max-width: 1023px) { .wxl-c .wx-card { order: 0; } .wx-tools-panel { max-height: calc(55dvh - 8rem); } }

/* OSINT 2026-11-06: luotettavuuspiste uutiskortissa (app.js markConfidence) ja 📡 Signaalit-lohko (renderSignalsPanel) */
.conf-dot { display: inline-block; flex: none; width: .5rem; height: .5rem; border-radius: var(--r-full); margin-right: .1rem; vertical-align: middle; cursor: help; }
.conf-dot.is-confirmed { background: #10b981; }
.conf-dot.is-single { background: #f59e0b; opacity: .75; }
.conf-dot.is-official { background: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.25); }
.osint-seg { display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem .75rem .35rem; }
.osint-chip { font-size: .72rem; padding: .2rem .55rem; }
.osint-row.is-unverified .dash-item-title { color: var(--text-2); }
.osint-note { padding: .5rem .75rem .75rem; font-size: .7rem; line-height: 1.45; color: var(--muted); }
.osint-pop { font-size: .8rem; line-height: 1.4; }
.osint-pop-src { font-size: .7rem; font-weight: 700; color: var(--muted); margin-bottom: .2rem; }
.osint-pop-title { display: block; font-weight: 700; color: var(--text); }
.osint-pop-time { margin-top: .2rem; font-size: .7rem; color: var(--muted); }

/* ⚠️ Varmistamaton lähde (feeds.json trust, app.js markConfidence/toggleUntrusted): oranssi kehys ja merkintä */
.news-item.is-untrusted { border-color: #f97316 !important; box-shadow: 0 0 0 1px #f97316, 0 1px 2px rgba(0,0,0,.05); }
.trust-badge { display: inline-block; margin-bottom: .35rem; padding: .1rem .45rem; border-radius: var(--r-sm); background: rgba(249,115,22,.14); color: #ea580c; font-size: .68rem; font-weight: 800; letter-spacing: .01em; }
.conf-dot.is-untrusted { background: #f97316; }
.cat-untrusted.is-on { border-color: #f97316; background: rgba(249,115,22,.14); color: #ea580c; }

/* 2026-11-07 (luonnos 2.5–2.7) */
/* 2.5 Sijaintikysely pienenä lappuna kartan alareunassa (ei peitä karttaa), selite piilossa */
.map-ask { top: auto; bottom: 1.9rem; width: auto; max-width: calc(100% - 1.5rem); display: flex; align-items: center; gap: .6rem; padding: .35rem .4rem .35rem .8rem; border-radius: var(--r-full); font-size: .8rem; box-shadow: 0 6px 18px rgba(2,6,23,.35); }
.map-ask.hidden { display: none; }
.map-ask > p.text-xs { display: none; }
.map-ask > div { margin-top: 0 !important; flex: none; }
/* 2.6 Sään kartan säätimet puhelimella 44 px kosketusalueiksi */
@media (max-width: 767px) {
  #wx-map .leaflet-bar a, #wx-map .leaflet-control button { width: 44px; height: 44px; line-height: 44px; font-size: 1.15rem; }
  #wx-map .leaflet-control-layers-toggle { width: 44px; height: 44px; }
}
/* 2.7 Uusien uutisten ilmoitus: puhelimella lyhyt muoto (✨ 12 uutta) */
.hs-short { display: none; }
@media (max-width: 767px) { .hs-long { display: none; } .hs-short { display: inline; } }
.map-ask > p:first-child { white-space: nowrap; }
@media (max-width: 400px) { .map-ask { font-size: .74rem; gap: .4rem; } .map-ask button { padding-left: .55rem; padding-right: .55rem; } }
