/* ---- Buttons ---- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:11px 18px;border-radius:999px;font-weight:600;font-size:14px;
  background:var(--surface);border:1px solid var(--line);color:var(--text);
  transition:background .15s,border-color .15s,opacity .15s;
}
.btn:hover{background:var(--elevated)}
.btn:disabled{opacity:.5;cursor:default}
.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-primary:hover{filter:brightness(1.07)}
.btn-ghost{background:transparent;border-color:transparent;color:var(--text-2)}
.btn-ghost:hover{background:var(--surface);color:var(--text)}
.btn-block{display:flex;width:100%}
.btn-sm{padding:7px 12px;font-size:13px}

/* ---- Fields ---- */
.field{margin-bottom:var(--space-md)}
.field label{display:block;font-size:13px;color:var(--text-2);margin-bottom:6px}
.input{
  width:100%;padding:12px 14px;border-radius:var(--radius-md);
  background:var(--surface);border:1px solid var(--line);color:var(--text);
  outline:none;transition:border-color .15s;
}
.input:focus{border-color:var(--accent)}
.input::placeholder{color:var(--text-3)}

/* ---- Login ---- */
.login{min-height:calc(100dvh - var(--topbar-h));display:grid;place-items:center;padding:var(--space-lg)}
.login-card{width:100%;max-width:360px;text-align:center}
.login-card .logo{width:76px;height:76px;border-radius:18px;margin:0 auto var(--space-md);box-shadow:0 12px 40px var(--accent-soft)}
.login-card h1{font-size:24px;letter-spacing:-.02em;margin-bottom:6px}
.login-card p.sub{color:var(--text-2);margin-bottom:var(--space-lg);font-size:14px}
.login-card .input{text-align:center;margin-bottom:var(--space-sm)}
.login-card .err{color:var(--red);font-size:13px;min-height:18px;margin:4px 0}
.login-card .hint{color:var(--text-3);font-size:12px;margin-top:var(--space-md)}
.login-card .notice.ok{background:var(--accent-soft);border:1px solid var(--accent);color:var(--text);border-radius:12px;padding:11px 13px;font-size:13px;line-height:1.45;margin-bottom:var(--space-md);text-align:left}
.code-input{letter-spacing:.4em;font-size:20px;font-weight:600}

/* ---- Segmented home selector (pills) ---- */
.homes{display:flex;gap:8px;overflow-x:auto;padding:var(--space-sm) 0 var(--space-md);scrollbar-width:none}
.homes::-webkit-scrollbar{display:none}
.pill{
  flex:0 0 auto;padding:8px 14px;border-radius:999px;font-size:13px;font-weight:600;
  background:var(--surface);border:1px solid var(--line);color:var(--text-2);white-space:nowrap;
}
.pill[aria-selected="true"]{background:var(--accent);border-color:var(--accent);color:#fff}
.pill .dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;vertical-align:middle}
.pill .count{display:inline-block;min-width:18px;text-align:center;margin-left:6px;padding:0 6px;border-radius:999px;background:color-mix(in srgb,var(--text) 16%,transparent);color:var(--text);font-size:11px;font-weight:700;vertical-align:middle}
.pill[aria-selected="true"] .count{background:rgba(255,255,255,.28);color:#fff}

/* ---- Artwork ---- */
.art{background:var(--surface);border-radius:var(--radius-md);object-fit:cover;flex:0 0 auto}
.art.lg{width:120px;height:120px;border-radius:var(--radius-lg)}

/* ---- Episode row ---- */
.ep{display:flex;gap:var(--space-md);padding:var(--space-md) 0;border-bottom:1px solid var(--line);align-items:flex-start}
.ep:last-child{border-bottom:none}
.ep .art{width:56px;height:56px}
.ep .body{flex:1;min-width:0}
.ep .pod{font-size:12px;color:var(--text-3);margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ep .title{font-size:14px;font-weight:600;line-height:1.35;margin-bottom:4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ep .meta{font-size:12px;color:var(--text-2);display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.ep .meta .tag{padding:1px 7px;border-radius:6px;background:var(--surface);border:1px solid var(--line);font-size:11px;color:var(--text-2)}
.ep .play{width:40px;height:40px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;flex:0 0 auto}
.ep .play:hover{background:var(--accent);color:#fff}
.ep.playing .title{color:var(--accent)}

/* progress bar under an in-progress episode */
.ep .prog{height:3px;border-radius:2px;background:var(--line);margin-top:8px;overflow:hidden}
.ep .prog>i{display:block;height:100%;background:var(--accent)}

/* ---- Podcast grid (library / search) ---- */
.pods{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:var(--space-md)}
.pod-card{text-align:left}
.pod-card .art{width:100%;aspect-ratio:1;height:auto}
.pod-card .nm{font-size:12px;font-weight:600;margin-top:6px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ---- Mini-player (persistent, docked) ---- */
.miniplayer{
  position:fixed;left:0;right:0;bottom:0;z-index:40;
  height:var(--miniplayer-h);
  display:flex;align-items:center;gap:var(--space-sm);
  padding:0 var(--space-md);
  background:color-mix(in srgb,var(--elevated) 94%,transparent);
  backdrop-filter:saturate(160%) blur(18px);-webkit-backdrop-filter:saturate(160%) blur(18px);
  border-top:1px solid var(--line);
  transform:translateY(100%);transition:transform .25s ease;
}
.miniplayer.show{transform:translateY(0)}
.miniplayer .art{width:44px;height:44px}
.miniplayer .info{flex:1;min-width:0}
.miniplayer .t{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.miniplayer .s{font-size:12px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.miniplayer .ctrl{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:var(--text)}
.miniplayer .ctrl:hover{background:var(--surface)}
.miniplayer .ctrl.primary{color:var(--accent)}
/* thin scrub line on top of the mini-player */
.miniplayer .scrub{position:absolute;top:0;left:0;right:0;height:2px;background:var(--accent);width:0}

.icon{width:20px;height:20px;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.icon.fill{fill:currentColor;stroke:none}

/* dim a played episode row */
.ep.played .title,.ep.played .pod{opacity:.55}

/* row action: add-to-queue / remove */
.ep .qbtn{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;color:var(--text-3);flex:0 0 auto;align-self:center}
.ep .qbtn:hover{background:var(--surface);color:var(--text)}
.ep .qbtn.on{color:var(--green)}
.ep .play{align-self:center}

/* mini-player: artwork+info is one tap target that opens the full player */
.miniplayer .open{display:flex;flex:1;min-width:0;align-items:center;gap:var(--space-sm);text-align:left;padding:0}

/* ---- Now playing sheet ---- */
.nowplaying{
  position:fixed;inset:0;z-index:60;display:none;flex-direction:column;
  background:var(--bg);overflow-y:auto;
  padding:max(env(safe-area-inset-top),12px) var(--space-lg) calc(env(safe-area-inset-bottom) + 24px);
}
.nowplaying.show{display:flex;animation:np-in .22s ease}
@keyframes np-in{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}
.np-head{display:flex;align-items:center;gap:var(--space-sm);width:100%;max-width:560px;margin:0 auto}
.np-head .iconbtn{width:40px;height:40px;border-radius:var(--radius-md);display:grid;place-items:center;color:var(--text-2);flex:0 0 auto}
.np-head .iconbtn:hover{background:var(--surface);color:var(--text)}
.np-pod{flex:1;min-width:0;text-align:center;font-size:13px;font-weight:600;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.np-pod:hover{color:var(--accent)}
.np-artwrap{display:grid;place-items:center;padding:var(--space-lg) 0}
.np-art{width:min(62vw,300px);aspect-ratio:1;border-radius:var(--radius-lg);box-shadow:var(--shadow);object-fit:cover}
.np-title{font-size:18px;font-weight:700;text-align:center;max-width:560px;margin:0 auto var(--space-md);line-height:1.35}
.np-scrub{width:100%;max-width:560px;margin:0 auto}
.np-range{
  -webkit-appearance:none;appearance:none;width:100%;height:24px;background:transparent;cursor:pointer;
  --fill:0%;
}
.np-range::-webkit-slider-runnable-track{height:5px;border-radius:3px;background:linear-gradient(to right,var(--accent) var(--fill),var(--line) var(--fill))}
.np-range::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:var(--text);margin-top:-5.5px;box-shadow:0 1px 4px rgba(0,0,0,.3)}
.np-range::-moz-range-track{height:5px;border-radius:3px;background:var(--line)}
.np-range::-moz-range-progress{height:5px;border-radius:3px;background:var(--accent)}
.np-range::-moz-range-thumb{width:16px;height:16px;border:none;border-radius:50%;background:var(--text)}
.np-clocks{display:flex;justify-content:space-between;margin-top:2px}
.np-clock{font-size:12px;color:var(--text-3);font-variant-numeric:tabular-nums}
.np-transport{display:flex;align-items:center;justify-content:center;gap:var(--space-md);margin:var(--space-md) auto;width:100%;max-width:560px}
.np-play{width:72px;height:72px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;flex:0 0 auto}
.np-play:hover{filter:brightness(1.07)}
.np-play .icon{width:30px;height:30px}
.np-skip{position:relative;width:56px;height:56px;border-radius:50%;display:grid;place-items:center;color:var(--text)}
.np-skip:hover{background:var(--surface)}
.np-skip .icon{width:26px;height:26px}
.np-skip i{position:absolute;font-size:9px;font-weight:700;font-style:normal;bottom:10px;left:50%;transform:translateX(-50%);color:var(--text-2)}
.np-sidewrap{width:44px;display:grid;place-items:center}
.np-side{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;color:var(--text-2)}
.np-side:hover{background:var(--surface);color:var(--text)}
.np-side.on{color:var(--accent)}
.np-row2{display:flex;align-items:center;justify-content:space-between;width:100%;max-width:300px;margin:0 auto}
.np-rate-val{font-size:14px;font-weight:700;color:var(--text-2);font-variant-numeric:tabular-nums}
.np-sleepwrap{position:relative}
.np-menu{
  position:absolute;bottom:52px;right:0;display:none;flex-direction:column;min-width:180px;
  background:var(--elevated);border:1px solid var(--line);border-radius:var(--radius-md);
  box-shadow:var(--shadow);overflow:hidden;z-index:5;
}
.np-menu.show{display:flex}
.np-menu-item{padding:11px 16px;text-align:left;font-size:14px}
.np-menu-item:hover{background:var(--surface)}
.np-menu-item.off{color:var(--text-2);border-top:1px solid var(--line)}
.np-chapters{width:100%;max-width:560px;margin:var(--space-md) auto 0}
.np-chapter{display:flex;gap:12px;width:100%;padding:10px 12px;border-radius:var(--radius-md);text-align:left;align-items:baseline}
.np-chapter:hover{background:var(--surface)}
.np-chapter.on{background:var(--accent-soft)}
.np-chapter.on .np-ch-title{color:var(--accent)}
.np-ch-time{font-size:12px;color:var(--text-3);font-variant-numeric:tabular-nums;flex:0 0 44px}
.np-ch-title{font-size:14px;min-width:0}
body.np-open{overflow:hidden}

/* ---- Search ---- */
.searchbar{margin-bottom:var(--space-md)}
.srow{display:flex;gap:var(--space-md);padding:var(--space-sm) 0;border-bottom:1px solid var(--line);align-items:center;cursor:pointer}
.srow:last-child{border-bottom:none}
.srow .art{width:56px;height:56px}
.srow .body{flex:1;min-width:0}
.srow .title{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.srow .sub{font-size:12px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---- Podcast / episode detail ---- */
.pd-head{display:flex;gap:var(--space-md);align-items:flex-start;margin:var(--space-sm) 0 var(--space-md)}
.pd-info{flex:1;min-width:0}
.pd-title{font-size:20px;letter-spacing:-.01em;line-height:1.25;margin-bottom:4px}
.pd-actions{margin-top:10px}
.pd-desc{font-size:14px;color:var(--text-2);margin-bottom:var(--space-md);cursor:pointer}
.pd-desc.clamp{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.ed-head{display:flex;gap:var(--space-md);align-items:flex-start;margin:var(--space-sm) 0 var(--space-md)}
.ed-info{flex:1;min-width:0}
.ed-info .np-pod{text-align:left;display:block;margin-bottom:4px}
.ed-title{font-size:19px;line-height:1.3;letter-spacing:-.01em;margin-bottom:6px}
.ed-actions{display:flex;gap:var(--space-sm);margin:var(--space-md) 0}
.notes{font-size:14.5px;color:var(--text);line-height:1.65;max-width:680px}
.notes p{margin:0 0 .9em}
.notes a{word-break:break-word}
.notes img{border-radius:var(--radius-md);margin:.5em 0}
.notes ul,.notes ol{padding-left:1.4em;margin:0 0 .9em}
.notes h1,.notes h2,.notes h3,.notes h4{font-size:15px;margin:1.1em 0 .4em}
.notes blockquote{border-left:3px solid var(--line);padding-left:12px;color:var(--text-2);margin:0 0 .9em}

/* ---- Episode AI ---- */
.ai-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:var(--space-md);margin:var(--space-md) 0;max-width:680px}
.ai-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm);margin-bottom:10px}
.ai-head .section{margin:0}
.ai-chip{font-size:11px;font-weight:700;color:var(--accent);background:var(--accent-soft);padding:3px 8px;border-radius:999px;white-space:nowrap}
.ai-card>.btn{margin-top:10px}
.ai-status{display:flex;align-items:center;gap:8px;color:var(--text-2);font-size:13px}
.ai-prog{height:4px;border-radius:2px;background:var(--line);margin-top:12px;overflow:hidden}
.ai-prog>i{display:block;height:100%;background:var(--accent);border-radius:2px;transition:width .6s ease}
.ai-section{padding-top:12px;margin-top:12px;border-top:1px solid var(--line)}
.ai-section h3{font-size:13px;color:var(--text-3);text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px}
.ai-summary{font-size:14.5px;line-height:1.6;color:var(--text)}
.ai-list{display:flex;flex-direction:column;gap:4px}
.ai-time{display:grid;grid-template-columns:58px 1fr auto;gap:10px;align-items:baseline;width:100%;padding:8px 10px;border-radius:var(--radius-md);text-align:left}
.ai-time:hover{background:var(--elevated)}
.ai-time.ad{color:var(--red)}
.ai-timecode{font-size:12px;color:var(--text-3);font-variant-numeric:tabular-nums}
.ai-time-title{font-size:14px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}
.ai-time.ad .ai-time-title{color:var(--red)}
.ai-time-dur{font-size:12px;color:var(--text-3);font-variant-numeric:tabular-nums}
.ai-links{display:flex;gap:8px;flex-wrap:wrap}
.ai-links a{font-size:13px;font-weight:600;background:var(--elevated);border:1px solid var(--line);border-radius:999px;padding:6px 10px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-transcript{font-size:13px;color:var(--text-2);line-height:1.55;display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden}

/* ---- Lists ---- */
.pagehead{display:flex;align-items:center;justify-content:space-between;gap:var(--space-md)}
.pagehead .page{margin-bottom:0}
.pagehead+.section{margin-top:var(--space-md)}
.lrow{display:flex;gap:var(--space-md);align-items:center;width:100%;padding:var(--space-md) 0;border-bottom:1px solid var(--line);text-align:left}
.lrow:last-child{border-bottom:none}
.lrow .dot.lg{width:14px;height:14px;border-radius:50%;flex:0 0 auto}
.lrow .body{flex:1;min-width:0;display:flex;flex-direction:column}
.lrow .title{font-size:15px;font-weight:600}
.lrow .sub{font-size:12px;color:var(--text-2)}
.lrow .chev{color:var(--text-3)}
.members{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:var(--radius-md);overflow:hidden}
.mrow{display:flex;gap:12px;align-items:center;padding:10px 12px;text-align:left;border-bottom:1px solid var(--line)}
.mrow:last-child{border-bottom:none}
.mrow:hover{background:var(--surface)}
.mrow .art{width:36px;height:36px;border-radius:8px}
.mrow .title{flex:1;min-width:0;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mrow .mark{color:transparent}
.mrow.on .mark{color:var(--accent)}
.inline-fields{display:flex;gap:var(--space-md);flex-wrap:wrap;margin-bottom:var(--space-sm)}
.field.inline{flex:1;min-width:130px}
.input.sm{padding:9px 12px}
.btn.danger{color:var(--red);border-color:color-mix(in srgb,var(--red) 40%,transparent)}
.err{color:var(--red);font-size:13px;min-height:18px;margin:4px 0}
.small{font-size:13px}

/* ---- Chips / colour dots / steppers (settings, list editor) ---- */
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{padding:8px 14px;border-radius:999px;font-size:13px;font-weight:600;background:var(--surface);border:1px solid var(--line);color:var(--text-2)}
.chip.sm{padding:6px 11px;font-size:12px}
.chip.on{background:var(--accent);border-color:var(--accent);color:#fff}
.dots{display:flex;gap:10px;flex-wrap:wrap}
.cdot{width:30px;height:30px;border-radius:50%;border:2px solid transparent;position:relative}
.cdot.on{border-color:var(--text);box-shadow:0 0 0 2px var(--bg) inset}
.setrow{display:flex;align-items:center;justify-content:space-between;gap:var(--space-md);padding:10px 0;flex-wrap:wrap}
.setrow>label{font-size:14px;color:var(--text);flex:0 0 auto}
.stepper{display:flex;align-items:center;gap:4px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:3px}
.stepper .step{width:34px;height:34px;border-radius:50%;font-size:18px;display:grid;place-items:center;color:var(--text-2)}
.stepper .step:hover{background:var(--elevated);color:var(--text)}
.stepper-val{min-width:48px;text-align:center;font-weight:700;font-size:14px;font-variant-numeric:tabular-nums}

/* ---- Home pills extras ---- */
.pill.edit{padding:8px 11px;display:grid;place-items:center}
.pill.edit .icon{width:15px;height:15px}

/* ---- Upsell ---- */
.upsell .ultra{color:var(--accent)}
.upsell .perks{list-style:none;text-align:left;margin:0 auto var(--space-md);max-width:300px;display:flex;flex-direction:column;gap:10px}
.upsell .perks li{display:flex;gap:10px;font-size:14px;align-items:baseline}
.upsell .pcheck{color:var(--green);font-weight:700}
.upsell .price{font-size:22px;font-weight:800;letter-spacing:-.01em;margin-bottom:var(--space-md)}

/* ---- Articles (read-to-me) ---- */
.art-form{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:var(--space-md)}
.input.ta{resize:vertical;min-height:120px;margin-top:8px;font-size:14px}
.arow{display:flex;gap:var(--space-md);align-items:center;padding:var(--space-md) 0;border-bottom:1px solid var(--line)}
.arow:last-child{border-bottom:none}
.arow .body{flex:1;min-width:0}
.arow .title{font-size:14px;font-weight:600;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.arow .sub{font-size:12px;color:var(--text-2);display:flex;align-items:center;gap:6px}
.arow.bad .sub{color:var(--red)}
.arow .play{width:40px;height:40px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;flex:0 0 auto}
.arow .play:hover{background:var(--accent);color:#fff}
.arow .qbtn{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;color:var(--text-3);flex:0 0 auto}
.arow .qbtn:hover{background:var(--surface);color:var(--red)}
.spinner.sm{width:13px;height:13px;border-width:2px}

/* conversion progress bar (blue, fills with the TTS chunk fraction) */
.arow .prog{height:4px;border-radius:2px;background:var(--line);margin-top:7px;overflow:hidden}
.arow .prog>i{display:block;height:100%;background:var(--accent);border-radius:2px;transition:width .6s ease}

/* ---- Ultra card (settings) ---- */
.ultracard{
  --ultra:#8B5CF6;
  background:var(--surface);border:1px solid color-mix(in srgb,var(--ultra) 38%,transparent);
  border-radius:var(--radius-lg);padding:var(--space-md);margin-bottom:var(--space-md);
}
.ultracard .uc-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.ultracard .uc-head strong{font-size:16px;letter-spacing:-.01em}
.ultracard .uc-head::before{content:"⚡";font-size:18px}
.ultracard .uc-chip{margin-left:auto;font-size:10px;font-weight:800;color:var(--ultra);background:color-mix(in srgb,var(--ultra) 15%,transparent);padding:2px 8px;border-radius:999px}
.ultracard .uc-perks{list-style:none;display:flex;flex-direction:column;gap:8px;margin:0;padding:0}
.ultracard .uc-perks li{display:flex;gap:8px;font-size:14px;color:var(--text-2);align-items:baseline}
.ultracard .uc-check{color:var(--ultra);font-weight:700}

/* audio language picker in the articles composer */
.langrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px}
.langlabel{font-size:12px;color:var(--text-3);flex:0 0 auto}
