/* firsthand: telefono = giornata guidata, computer = scaletta. Stessa identità: blu cuffie, hype arancione. */
:root {
  color-scheme: light;
  --bg: #f3f5fa; --fg: #0f1a33; --muted: #52607e; --card: #ffffff; --line: #dde3f0; --line-2: #c3cbdd;
  --accent: #2b5fd9; --accent-2: #1f4dbd; --accent-fg: #ffffff; --accent-wash: #e8eefc;
  --navy: #0f1a33; --navy-fg: #ffffff; --navy-muted: #c4cee6; --navy-fill: #8fb0ff;
  --hot: #9a3412; --hot-wash: #ffe9d6; --hot-bar: #e8590c;
  --danger: #b3261e; --ok: #1e7b4f; --warn: #a15c00; --free: #ebeff8; --seg-a: #1f4dbd; --seg-b: #2b5fd9;
  --k-video: #e8eefc; --k-video-fg: #1f4dbd; --k-pod: #efe7fb; --k-pod-fg: #5b2ea6; --k-web: #e6f1ec; --k-web-fg: #1e6b47;
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabbar-h: 72px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1222; --fg: #e9eefb; --muted: #9fb0d2; --card: #131c33; --line: #25314f; --line-2: #3a4a72;
    --accent: #7ba0ff; --accent-2: #9db8ff; --accent-fg: #0b1222; --accent-wash: #1a2742;
    --navy: #1a2a52; --navy-fg: #ffffff; --navy-muted: #c4cee6; --navy-fill: #8fb0ff;
    --hot: #ffb88a; --hot-wash: #3a2314; --hot-bar: #ff8a4c;
    --danger: #ff8a80; --ok: #6fd39a; --warn: #f0b45a; --free: #17213b;
    --seg-a: #1f4dbd; --seg-b: #2b5fd9;
    --k-video: #1a2742; --k-video-fg: #a9c1ff; --k-pod: #2a1f45; --k-pod-fg: #cdb6ff; --k-web: #16322a; --k-web-fg: #8fdcb4;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1222; --fg: #e9eefb; --muted: #9fb0d2; --card: #131c33; --line: #25314f; --line-2: #3a4a72;
  --accent: #7ba0ff; --accent-2: #9db8ff; --accent-fg: #0b1222; --accent-wash: #1a2742;
  --navy: #1a2a52; --navy-fg: #ffffff; --navy-muted: #c4cee6; --navy-fill: #8fb0ff;
  --hot: #ffb88a; --hot-wash: #3a2314; --hot-bar: #ff8a4c;
  --danger: #ff8a80; --ok: #6fd39a; --warn: #f0b45a; --free: #17213b;
  --seg-a: #1f4dbd; --seg-b: #2b5fd9;
  --k-video: #1a2742; --k-video-fg: #a9c1ff; --k-pod: #2a1f45; --k-pod-fg: #cdb6ff; --k-web: #16322a; --k-web-fg: #8fdcb4;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.45 var(--sans);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.7rem; line-height: 1.1; margin: 8px 0 14px; font-weight: 700; }
h2 { font-size: 1.15rem; margin: 20px 0 8px; font-weight: 700; }
h3 { font-size: 1rem; margin: 6px 0; font-weight: 700; }
a { color: var(--accent-2); }
.num, .mins, .idx, .chip, .seg-t { font-variant-numeric: tabular-nums; }

/* ---- intestazione e navigazione ---- */
header.top { display: flex; align-items: center; gap: 12px 28px; padding: 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700;
  font-size: 1.25rem; text-decoration: none; color: var(--fg); margin-right: auto; }
.brand img { border-radius: 7px; }
.main-nav { display: none; gap: 4px; margin-right: auto; }
.main-nav a, .gear { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-weight: 600; }
.gear { width: 44px; padding: 0; justify-content: center; }
.main-nav a:hover, .gear:hover { color: var(--fg); }
.main-nav a.on, .gear.on { background: var(--accent-wash); color: var(--accent-2); }
.login-title { display: flex; align-items: center; gap: 12px; }
.login-title img { border-radius: 9px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding: 6px 8px calc(10px + env(safe-area-inset-bottom, 0px)); }
.tabbar a { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: .75rem; font-weight: 600; text-decoration: none; color: var(--muted); }
.tabbar a.on { color: var(--accent); }
body:has(.login-page) .tabbar { display: none; }

main { max-width: 900px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left, 0px)); }
main.narrow { max-width: 380px; margin-top: 12vh; }

/* ---- blocchi comuni ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 12px 0; }
.card.off { opacity: .55; }
.card h2:first-child { margin-top: 0; }
.hint { border-left: 4px solid var(--accent); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid .card { margin: 0; }
.big { font-size: 2.2rem; font-weight: 700; margin: 4px 0 8px; font-family: var(--display); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.err { color: var(--danger); }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.flash { background: var(--accent-wash); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.flash.err { border-color: var(--danger); color: var(--danger); }
label { display: block; margin: 8px 0; font-size: .9rem; color: var(--muted); }
input, textarea, select { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; }
input[type=checkbox] { display: inline; width: 18px; height: 18px; margin: 0 8px 0 0; vertical-align: -3px; accent-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.checks label { color: var(--fg); }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.row > * { flex: 1 1 180px; }
.row button { flex: 0 0 auto; }
.actions { display: flex; gap: 8px; }
button, .button { display: inline-block; min-height: 44px; padding: 0 18px; font: 600 1rem var(--sans); cursor: pointer;
  color: var(--accent-fg); background: var(--accent); border: 0; border-radius: 12px; text-decoration: none; line-height: 44px; }
button.secondary, .button.secondary { background: transparent; color: var(--accent-2); border: 1.5px solid var(--accent); line-height: 41px; }
button.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); line-height: 41px; }
button.small { min-height: 34px; padding: 0 12px; font-size: .85rem; line-height: 31px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
form.inline { display: inline; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9rem; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; text-decoration: none;
  color: var(--muted); border: 1px solid var(--line-2); font-weight: 600; font-size: .9rem; }
.tabs a.on { background: var(--navy); color: var(--navy-fg); border-color: var(--navy); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .75rem; border: 1px solid var(--line-2); color: var(--muted); }
.badge.ready, .badge.done { color: var(--ok); border-color: var(--ok); }
.badge.failed, .badge.error { color: var(--danger); border-color: var(--danger); }
.badge.running, .badge.generating, .badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.hot { color: var(--hot); border-color: var(--hot); font-weight: 600; background: var(--hot-wash); }
.cand .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.cand p { margin: 4px 0 8px; }
.decide { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.decide input { flex: 1 1 220px; margin-top: 0; }
details { margin: 8px 0; }
summary { cursor: pointer; color: var(--accent-2); font-weight: 600; min-height: 32px; }
pre.text { white-space: pre-wrap; word-wrap: break-word; font: inherit; font-size: .9rem; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 360px; overflow: auto; }
pre.text.full { max-height: none; }
audio { width: 100%; margin: 8px 0; }
tr.off td { opacity: .55; }
.nowrap { white-space: nowrap; }
.hint form.inline { display: block; margin-top: 10px; }
.link { font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

/* ---- chip ---- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--bg); color: var(--muted); white-space: nowrap; }
.chip.kind { background: var(--accent-wash); color: var(--accent-2); text-transform: uppercase; letter-spacing: .04em; }
.chip.hype.hot { background: var(--hot-wash); color: var(--hot); }
.chip.warn { background: var(--hot-wash); color: var(--hot); }

/* ---- barra della durata ---- */
.durata { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 12px 0; }
.durata-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.durata .num { font-family: var(--display); font-size: 1.4rem; }
.durata .lbl { display: none; }
.durata .miss { color: var(--hot); font-weight: 600; font-size: .9rem; }
.durata .ok { color: var(--ok); font-weight: 600; font-size: .9rem; }
.segs { display: flex; gap: 3px; height: 14px; }
.seg { background: var(--seg-a); border-radius: 4px; overflow: hidden; min-width: 4px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 10px; color: #fff; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.seg.alt { background: var(--seg-b); }
.seg:first-child { border-radius: 999px 4px 4px 999px; }
.seg-l, .seg-t { display: none; }
.seg-l { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.seg-t { margin-left: 8px; flex: none; }
.seg.free { flex: 1; background: repeating-linear-gradient(135deg, var(--bg) 0 6px, var(--free) 6px 12px); border: 1px dashed var(--line-2);
  border-radius: 999px; color: var(--muted); justify-content: center; font-weight: 500; }
.seg.free span { display: none; }
.seg:last-child { border-radius: 4px 999px 999px 4px; }
.seg.free:last-child { border-radius: 999px; }
.seg:only-child { border-radius: 999px; }

/* ---- TELEFONO: giornata guidata ---- */
.view-plan { display: none; }
.greet { font-size: 1.9rem; margin: 6px 0 16px; }
.hero { background: var(--navy); color: var(--navy-fg); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.hero .eyebrow { color: #9db4f5; }
.hero h2 { margin: 0; font-size: 1.4rem; color: var(--navy-fg); }
.hero p { margin: 0; color: var(--navy-muted); }
.hero .durata { background: transparent; border: 0; padding: 0; margin: 0; }
.hero .durata .num, .hero .durata-top { color: var(--navy-fg); }
.hero .durata .muted { color: var(--navy-muted); }
.hero .durata .miss { color: #ffc9a3; }
.hero .durata .ok { color: #8be0b4; }
.hero .seg { background: var(--navy-fill); }
.hero .seg.alt { background: #b5caff; }
.hero .seg.free { background: rgba(255,255,255,.14); border: 0; }
.cta, .hero button.cta { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; border-radius: 14px;
  background: #fff; color: #1f4dbd; font: 600 1.05rem var(--sans); border: 0; text-decoration: none; line-height: 1.2; }
.steps { list-style: none; margin: 14px 0 0; padding: 0; }
.steps li { display: flex; gap: 14px; padding: 10px 0; align-items: flex-start; }
.steps .dot { width: 28px; height: 28px; flex: none; border-radius: 999px; border: 2px solid var(--line-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; }
.steps li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.now .dot { border-color: var(--accent); color: var(--accent); }
.note-auto { background: var(--accent-wash); border-radius: 14px; padding: 4px 14px; margin: 8px 0 14px; }
.note-auto label { color: var(--fg); font-size: .9rem; min-height: 44px; display: flex; align-items: center; margin: 0; }

/* ---- scelta a carte ---- */
.choose { max-width: 460px; margin: 0 auto; }
.choose-head { display: flex; align-items: center; gap: 4px; }
.back { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--fg); }
.stack { position: relative; margin-top: 16px; padding-top: 8px; }
.stack::before, .stack::after { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 40px; border-radius: 22px; background: var(--line); z-index: 0; }
.stack::after { left: 7px; right: 7px; top: 4px; background: var(--line-2); opacity: .6; }
.swipe { position: relative; z-index: 1; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px;
  box-shadow: 0 10px 30px rgba(15, 26, 51, .12); display: flex; flex-direction: column; gap: 12px; touch-action: pan-y; }
.swipe h2 { margin: 0; font-size: 1.4rem; line-height: 1.15; }
.swipe h2 a { color: var(--fg); text-decoration: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.swipe p { margin: 0; }
.plus { color: var(--fg); }
.meter { background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.meter-top { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.bar { position: relative; height: 8px; border-radius: 999px; background: var(--line); }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--hot-bar); }
.bar i { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--fg); }
.meter-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: 6px; }
.choose-actions { display: flex; gap: 12px; margin-top: 18px; }
.big-btn { flex: 1.3; min-height: 56px; border-radius: 16px; font-size: 1.05rem; line-height: 1.2; }
.big-btn.outline { flex: 1; background: var(--card); color: var(--fg); border: 2px solid var(--line-2); }

/* ---- COMPUTER: scaletta ---- */
.plan-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.plan-head h1 { font-size: 2.1rem; margin: 4px 0 0; }
.plan-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.plan-actions label.auto { display: flex; align-items: center; margin: 0; color: var(--fg); min-height: 44px; }
.plan-cols { display: flex; gap: 24px; align-items: stretch; }
.plan-cols > .card { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.slot { flex: 1; min-height: 120px; margin-top: 12px; border: 2px dashed var(--line-2); border-radius: 14px;
  background: repeating-linear-gradient(135deg, var(--bg) 0 8px, var(--free) 8px 16px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 16px; color: var(--muted); }
.slot strong { color: var(--fg); font-family: var(--display); font-size: 1.1rem; }
.plan-cols > .card:first-child { flex: 1.15; }
.plan-cols > .card:last-child { flex: 1; }
.rowitem { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-height: 56px; }
.rowitem a { color: var(--fg); text-decoration: none; }
.rowitem a:hover { text-decoration: underline; }
.idx { width: 22px; font-weight: 600; color: var(--muted); }
.mins { font-weight: 600; min-width: 44px; text-align: right; }
.icon { width: 44px; padding: 0; background: transparent; color: var(--muted); }
.add { background: var(--card); color: var(--accent-2); border: 1.5px solid var(--accent); padding: 0 12px; line-height: 41px; font-variant-numeric: tabular-nums; }
.wide { width: 100%; margin-bottom: 8px; background: var(--accent-wash); color: var(--accent-2); border: 2px solid var(--accent); min-height: 52px; line-height: 48px; }

.statusline { display: none; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.dot-ok { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.card-head .sub { font-family: var(--sans); font-size: .9rem; font-weight: 500; color: var(--muted); }
.grip { color: var(--line-2); cursor: grab; display: inline-flex; }
.rowitem[draggable=true]:active { cursor: grabbing; }
.rowitem.dragging { opacity: .45; background: var(--accent-wash); }
.rowitem[hidden] { display: none; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.fchip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card);
  color: var(--fg); font: 600 .85rem var(--sans); line-height: 34px; }
.fchip.on { background: var(--navy); color: var(--navy-fg); border-color: var(--navy); }
button.primary-lg { min-height: 48px; padding: 0 24px; border-radius: 14px; font-size: 1rem; line-height: 48px; }
button:disabled { opacity: .6; cursor: default; }
.player { position: sticky; bottom: 16px; margin-top: 20px; background: var(--navy); color: var(--navy-fg); border-radius: 18px;
  height: 72px; padding: 0 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 10px 30px rgba(15, 26, 51, .25); }
.p-cover { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.p-title { min-width: 220px; }
.p-sub { font-size: .75rem; color: var(--navy-muted); }
.p-btn { width: 44px; height: 44px; padding: 0; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-size: .75rem; line-height: 44px; }
.p-play { width: 48px; height: 48px; padding: 0; border-radius: 999px; background: #fff; color: #1f4dbd; display: flex; align-items: center; justify-content: center; }
.p-prog { flex: 1; display: flex; align-items: center; gap: 12px; font-size: .75rem; color: var(--navy-muted); font-variant-numeric: tabular-nums; }
.p-track { flex: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,.16); cursor: pointer; }
.p-track div { height: 100%; border-radius: 999px; background: var(--navy-fill); }
.only-guided { display: block; }
.lastep { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lastep audio { flex: 2 1 260px; margin: 0; }
.jobs summary { color: var(--muted); }

@media (min-width: 900px) {
  :root { --tabbar-h: 0px; }
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .main-nav { display: flex; }
  .brand { margin-right: 0; }
  header.top { padding: 0 32px; height: 64px; }
  header.top .gear { margin-left: 0; }
  main { max-width: 1280px; padding: 28px 32px 40px; }
  main.narrow { max-width: 380px; }
  .view-guided { display: none; }
  .only-guided { display: none; }
  header.top .statusline { display: flex; margin-left: auto; }
  .view-plan { display: block; }
  .seg-l, .seg-t { display: inline; }
  .seg.free span { display: inline; }
  .segs { height: 48px; }
  .seg { border-radius: 12px 4px 4px 12px; }
  .seg.free { border-radius: 12px; }
  .seg:last-child { border-radius: 4px 12px 12px 4px; }
  .seg:first-child { border-radius: 12px 4px 4px 12px; }
  .seg:only-child { border-radius: 12px; }
  .durata .num { font-size: 1.6rem; }
  /* pagine di contenuto più strette di Oggi */
  body.sec-episodi main, body.sec-impostazioni main { max-width: 900px; }
  body.sec-oggi main:has(.choose), body.sec-oggi main:has(.cand) { max-width: 900px; }

  /* ---- Oggi: misure del mockup B (1280 px) ---- */
  body { font-size: 15px; }
  .statusline { font-size: 13px; }
  .view-plan { display: flex; flex-direction: column; gap: 22px; }
  .view-plan .plan-head h1 { font-size: 34px; margin: 4px 0 0; }
  .view-plan .durata { border-radius: 18px; padding: 18px 20px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
  .view-plan .durata-top { margin: 0; }
  .durata .lbl { display: inline; font-weight: 600; }
  .durata .num { font-size: 22px; }
  .durata .miss, .durata .ok { font-size: 15px; }
  .seg { font-size: 13px; }
  .seg.free { border: 2px dashed #aebad3; border-radius: 12px;
    background: repeating-linear-gradient(135deg, var(--bg) 0 8px, var(--free) 8px 16px); }
  .view-plan .plan-cols { margin: 0; }
  .view-plan .plan-cols > .card { border-radius: 18px; padding: 20px; gap: 6px; }
  .view-plan .plan-cols > .card:last-child { gap: 10px; }
  .view-plan .card-head { margin-bottom: 6px; }
  .view-plan .card-head h2 { font-size: 20px; }
  .view-plan .card-head .small { font-size: 13px; }
  #rundown .rowitem { gap: 14px; padding: 10px 0; min-height: 56px; }
  #rundown .rowitem .small { font-size: 13px; }
  #rundown .mins { width: 44px; min-width: 44px; }
  #proposals .rowitem { padding: 8px 10px; margin: 0; min-height: 52px; }
  #proposals .rowitem strong { font-size: 14px; }
  #proposals .rowitem .small { font-size: 12px; }
  #proposals .add { font-size: 13px; }
  .view-plan .filters { margin: 0; }
  .view-plan .wide { margin: 0; border-radius: 14px; font-size: 15px; }
  .view-plan .plan-cols .link { margin-top: auto; font-size: 14px; }
  .view-plan .player { margin: 0; }
  .p-track { height: 6px; }
  .meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; min-width: 0; }
  .meta .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kind { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; }
  .k-youtube { background: var(--k-video); color: var(--k-video-fg); }
  .k-podcast { background: var(--k-pod); color: var(--k-pod-fg); }
  .k-web { background: var(--k-web); color: var(--k-web-fg); }
  .view-plan .rowitem { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 12px; border-top: 0;
    border-bottom: 1px solid var(--line); transition: background .12s; }
  .view-plan .rowitem:hover { background: var(--bg); }
  .view-plan .rowitem.hot { box-shadow: inset 3px 0 0 var(--hot-bar); }
  .view-plan .rowitem:last-child { border-bottom: 0; }
  .view-plan .grip { color: var(--muted); opacity: .55; }
  .view-plan .rowitem:hover .grip { opacity: 1; }
  .view-plan .slot { height: auto; min-height: 0; margin-top: 10px; border-width: 1.5px; background: transparent; flex-direction: row; gap: 10px; padding: 12px 16px; justify-content: center; }
  .view-plan .slot strong { font-size: 1rem; }
  .view-plan .seg.free { background: transparent; border: 1.5px dashed var(--line-2); }
  .view-plan .durata { box-shadow: 0 1px 0 rgba(15,26,51,.04); }
  .view-plan .durata .miss { background: var(--hot-wash); padding: 4px 12px; border-radius: 999px; }
  .view-plan .durata .ok { background: var(--k-web); color: var(--k-web-fg); padding: 4px 12px; border-radius: 999px; }
  .view-plan .plan-head h1 { font-size: 36px; }
  /* Molte proposte: la lista scorre dentro la card, la pagina resta a misura di schermo */
  .view-plan .slot { flex: none; }
  .view-plan .plan-cols { align-items: flex-start; }
  .view-plan .plan-cols > .card:first-child { align-self: stretch; }
  .view-plan .player { position: static; margin-top: 4px; }
}
@media (max-width: 899px) {
  .plan-cols { flex-direction: column; }
  table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Fonti: righe compatte con interruttore ---- */
.count { font-family: var(--sans); font-size: .85rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.srclist { list-style: none; margin: 10px 0 0; padding: 0; }
.srcrow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); min-height: 52px; }
.srcrow.off { opacity: .7; }
.avatar { width: 34px; height: 34px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font: 700 .95rem var(--display); }
.avatar.k-youtube { background: var(--k-video); color: var(--k-video-fg); }
.avatar.k-podcast { background: var(--k-pod); color: var(--k-pod-fg); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.switch { width: 46px; min-height: 28px; height: 28px; padding: 0; border-radius: 999px; background: var(--line-2); position: relative; line-height: 1; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; transition: left .15s; }
.switch.on { background: var(--accent); }
.switch.on i { left: 21px; }
.srcoff { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.srcoff summary { color: var(--muted); }
.card h2 + p.muted { max-width: 65ch; }
@media (min-width: 900px) {
}

.more-rows summary { min-height: 44px; display: flex; align-items: center; }
.empty-note { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 0; }
.empty-note p { margin: 0; }
.empty-note form { margin-top: 6px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ep { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: 18px; }
.ep.new { border-color: var(--accent); }
.ep-top { display: flex; align-items: center; gap: 14px; }
.ep h2 { margin: 0; font-size: 1.15rem; }
.ep audio { margin: 0; }
.chip.ok { background: var(--k-web); color: var(--k-web-fg); }
.ep-more { margin: 0; border-top: 1px solid var(--line); padding-top: 6px; }
.ep-more h3 { margin: 14px 0 6px; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-family: var(--sans); }
.ep-src { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ep-src li { display: flex; align-items: center; gap: 10px; min-height: 36px; border-bottom: 1px solid var(--line); }
.ep-src a { color: var(--fg); text-decoration: none; min-width: 0; }
.ep-src a:hover { text-decoration: underline; }
.kind { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; }
.k-youtube { background: var(--k-video); color: var(--k-video-fg); }
.k-podcast { background: var(--k-pod); color: var(--k-pod-fg); }
.k-web { background: var(--k-web); color: var(--k-web-fg); }
.ep-more form.inline { display: block; margin-top: 14px; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.clean-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--hot-wash);
  color: var(--hot); border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; font-size: .9rem; }
.clean-note strong { font-weight: 600; }
.seg.free { min-width: 104px; }
.seg.free span { white-space: nowrap; }

/* ---- Fonti: due colonne, liste con scorrimento interno ---- */
.hint-slim { padding: 10px 16px; }
.hint-slim summary { min-height: 36px; display: flex; align-items: center; }
.src-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; margin: 12px 0; }
.src-grid > .card { margin: 0; }
.addbox { margin: 8px 0 0; }
.addbox summary { color: var(--accent-2); font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.addbox form.row { margin-top: 4px; }
.card.slim form.row { align-items: stretch; }
@media (min-width: 900px) {
  .src-grid { grid-template-columns: 1fr 1fr; }
}

.ep-player { background: var(--navy); color: var(--navy-fg); border-radius: 16px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 68px; }
.ep-player .p-prog { min-width: 0; }
.ep-fill { height: 100%; border-radius: 999px; background: var(--navy-fill); }
.ep-track { position: relative; }
@media (max-width: 560px) { .ep-player { flex-wrap: wrap; } .ep-player .p-prog { flex-basis: 100%; order: 5; } }

/* ---- Oggi: barra di ascolto sempre in vista ---- */
@media (min-width: 900px) {
  body.sec-oggi .view-plan { padding-bottom: 96px; }
  body.sec-oggi .view-plan .player { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 8;
    width: min(1216px, calc(100% - 64px)); margin: 0; }
}

/* ---- Argomenti ---- */
.lead { font-size: 1.05rem; max-width: 65ch; color: var(--muted); margin: 0 0 14px; }
.quickadd { padding: 14px 16px; }
.quickrow { display: flex; gap: 10px; align-items: stretch; }
.quickrow input { margin: 0; flex: 1; min-height: 48px; }
.quickrow button { min-height: 48px; }
.adv { margin: 10px 0 0; }
.list-title { margin-top: 22px; }
.topic-grid { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: start; }
.topic { margin: 0; padding: 0; }
.topic > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px; color: var(--fg); font-weight: 400; }
.topic > summary::-webkit-details-marker { display: none; }
.topic > summary strong { display: block; font-family: var(--display); font-size: 1.05rem; }
.topic-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.topic .edit { color: var(--accent-2); font-weight: 600; font-size: .9rem; margin-left: 6px; }
.topic[open] > summary { border-bottom: 1px solid var(--line); }
.topic > form { padding: 6px 16px 16px; }
@media (min-width: 900px) { .topic-grid { grid-template-columns: 1fr 1fr; } body.sec-fonti main { max-width: 1280px; } }
@media (max-width: 560px) { .quickrow { flex-direction: column; } }

/* ---- operazioni in corso ---- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slide { 0% { left: -40%; } 100% { left: 100%; } }
.spinner { width: 22px; height: 22px; border-radius: 999px; border: 3px solid var(--line-2); border-top-color: var(--accent);
  animation: spin .9s linear infinite; flex: none; display: inline-block; }
.spinner.sm { width: 16px; height: 16px; border-width: 2.5px; margin-right: 8px; vertical-align: -3px; border-color: rgba(255,255,255,.35); border-top-color: currentColor; }
.jobbar { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; background: var(--accent-wash);
  border: 1px solid var(--accent); border-radius: 14px; padding: 12px 16px 16px; margin: 0 0 14px; }
.jobtrack { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--line); }
.jobtrack i { position: absolute; top: 0; bottom: 0; width: 40%; background: var(--accent); border-radius: 999px; animation: slide 1.4s ease-in-out infinite; }
.elapsed { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s !important; }
  .jobtrack i { animation: none; left: 0; width: 100%; opacity: .5; }
}

/* ---- nessuna barra di scorrimento visibile (si scorre comunque con rotella, dito e tastiera) ---- */
html, * { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ---- interruttore chiaro/scuro ---- */
.theme { width: 44px; height: 44px; padding: 0; border-radius: 12px; background: transparent; color: var(--muted); display: inline-flex;
  align-items: center; justify-content: center; line-height: 1; }
.theme:hover { color: var(--fg); }
.theme .i-sun { display: none; }
:root[data-theme="dark"] .theme .i-sun { display: inline; }
:root[data-theme="dark"] .theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .i-sun { display: inline; }
  :root:not([data-theme="light"]) .theme .i-moon { display: none; }
}
