:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #09111d;
  color: #f7f9fc;
  --accent: #ffcc66;
  --panel: #121e2d;
  --muted: #9aabc0;
  --danger: #ff8a85;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100vh; height: 100dvh; overflow: hidden; background: radial-gradient(circle at 50% -20%, #253f5b, #09111d 48%); }
button, input { font: inherit; }
button { touch-action: manipulation; }
.shell { width: min(100%, 620px); height: 100dvh; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: center; }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: 1.4rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.feed-title { margin: 0; font-size: 1.3rem; }
.top-actions { display: flex; gap: 8px; }
.icon-button { width: 52px; height: 52px; border: 1px solid #30445b; border-radius: 16px; background: #172638; color: white; font-size: 1.65rem; }
.icon-button:active, button:active { transform: scale(.97); }
.status { min-height: 20px; color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.error { color: var(--danger); }
.card { flex: 1 1 auto; min-height: 110px; padding: 16px; overflow: hidden; display: flex; flex-direction: column; border: 1px solid #28394e; border-radius: 24px; background: linear-gradient(145deg, rgba(29,47,68,.98), rgba(15,27,42,.98)); box-shadow: 0 18px 50px rgba(0,0,0,.24); }
.card-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; font-weight: 700; }
.badge { padding: 4px 9px; border-radius: 999px; background: #28445c; color: #c7e8ff; }
.card h2 { margin: 12px 0 8px; flex: 0 0 auto; font-size: .9rem; color: var(--accent); }
.news-text-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.card p { margin: 0; min-height: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: clamp(1rem, 3.7vw, 1.28rem); line-height: 1.4; white-space: pre-wrap; }
.card.expanded p { flex: 1; display: block; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; }
.text-actions { flex: 0 0 auto; display: flex; align-items: stretch; gap: 8px; margin-top: 8px; }
.text-action { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; border: 1px solid #40566f; border-radius: 12px; background: #172638; color: var(--accent); font-size: .82rem; font-weight: 750; line-height: 1.2; text-decoration: none; }
.timeline input { width: 100%; accent-color: var(--accent); height: 28px; }
.timeline div { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; }
.transport { display: grid; grid-template-columns: 1fr 1.25fr 1fr; align-items: center; gap: 14px; }
.control { border: 0; color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 74px; border-radius: 24px; }
.control span { font-size: 2rem; line-height: 1; }
.control small { font-size: .75rem; font-weight: 750; }
.control.secondary { background: #1c2c40; border: 1px solid #30455d; }
.control.primary { min-height: 86px; background: var(--accent); color: #18202a; box-shadow: 0 10px 26px rgba(255,204,102,.2); }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wide-button { min-height: 50px; border: 1px solid #30455d; border-radius: 16px; background: #172638; color: #eef5fc; font-weight: 700; }
.voice-button { grid-column: 1 / -1; min-height: 44px; }
.voice-button strong { color: var(--accent); }
.queue { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.queue div { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-radius: 14px; background: rgba(21,35,52,.8); color: var(--muted); font-size: .78rem; }
.queue strong { color: white; font-size: 1.25rem; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 4px solid #f2f6fa; outline-offset: 3px; }
button:disabled { opacity: .45; }
.settings-overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; padding: 14px; background: rgba(3,8,14,.72); backdrop-filter: blur(6px); }
.settings-sheet { width: min(100%, 620px); max-height: min(86dvh, 720px); overflow-y: auto; padding: 20px; border: 1px solid #30455d; border-radius: 26px; background: #101c2a; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.settings-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.settings-header h2 { margin: 0; font-size: 1.35rem; }
.close-button { width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid #40566f; border-radius: 14px; background: #172638; color: white; font-size: 1.7rem; }
.settings-help { margin: 12px 0 16px; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.channel-list { display: grid; gap: 9px; }
.channel-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 10px 12px; border: 1px solid #283d54; border-radius: 16px; background: #152436; }
.channel-toggle { width: 22px; height: 22px; accent-color: var(--accent); }
.channel-copy { min-width: 0; display: grid; gap: 2px; }
.channel-copy strong, .channel-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-copy span { color: var(--muted); font-size: .78rem; }
.remove-channel { min-width: 38px; min-height: 38px; border: 0; border-radius: 12px; background: #26384d; color: #ffaaa6; font-size: 1.25rem; }
.add-channel-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 14px; }
.add-channel-form input { min-width: 0; min-height: 46px; padding: 0 13px; border: 1px solid #40566f; border-radius: 13px; background: #0b1521; color: white; font-size: 1rem; }
.add-channel-form button, .apply-settings { min-height: 46px; padding: 0 16px; border: 0; border-radius: 13px; background: var(--accent); color: #18202a; font-weight: 800; }
.settings-error { min-height: 18px; margin: 7px 2px 0; color: var(--danger); font-size: .8rem; }
.apply-settings { width: 100%; margin-top: 8px; }
@media (max-height: 680px) {
  .shell { gap: 6px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .eyebrow, .queue { display: none; }
  h1, .feed-title { font-size: 1.02rem; }
  .icon-button { width: 42px; height: 42px; border-radius: 13px; font-size: 1.4rem; }
  .status { min-height: 16px; font-size: .75rem; }
  .card { min-height: 80px; padding: 11px 13px; border-radius: 18px; }
  .card h2 { margin: 5px 0; font-size: .78rem; }
  .card p { -webkit-line-clamp: 2; font-size: .94rem; line-height: 1.3; }
  .text-actions { margin-top: 5px; gap: 6px; }
  .text-action { min-height: 30px; padding: 4px 9px; font-size: .76rem; }
  .timeline input { height: 20px; }
  .timeline div { font-size: .72rem; }
  .transport { gap: 8px; }
  .control { min-height: 58px; border-radius: 18px; }
  .control.primary { min-height: 66px; }
  .control span { font-size: 1.65rem; }
  .wide-button { min-height: 40px; border-radius: 13px; font-size: .84rem; }
  .voice-button { min-height: 36px; }
  .settings-sheet { max-height: 94dvh; padding: 15px; border-radius: 20px; }
  .channel-row { min-height: 48px; padding: 7px 10px; }
}
@media (min-height: 820px) { .shell { gap: 14px; padding: max(18px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom)); } .card { min-height: 220px; padding: 22px; } .card p { -webkit-line-clamp: 4; } .control { min-height: 86px; } .control.primary { min-height: 100px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
