/* The Daily Short — clean, bold, mobile-first (Squarespace-like restraint) */
:root{
  --bg:#0f0f10; --surface:#17181a; --surface2:#1f2023; --text:#f5f3ee; --muted:#a7a49c;
  --accent:#e4572e; --accent2:#f2a03d; --border:#2a2b2e; --ok:#3cb371; --danger:#e5484d;
  --header-h:56px; --chips-h:46px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}
a{color:var(--accent2)}
button{font:inherit;cursor:pointer}
.hidden{display:none!important}

/* Header */
header{height:var(--header-h);display:flex;align-items:center;gap:12px;padding:0 16px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--bg);z-index:30}
.logo{font-weight:800;font-size:20px;letter-spacing:-.5px;white-space:nowrap;margin:0}
.logo span{color:var(--accent)}
.mode-badge{font-size:11px;padding:3px 8px;border:1px solid var(--border);border-radius:999px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mode-badge.live{color:var(--ok);border-color:var(--ok)}
.search-wrap{margin-left:auto;flex:0 1 260px}
.search-wrap input{width:100%;background:var(--surface2);border:1px solid var(--border);color:var(--text);border-radius:999px;padding:8px 14px;font-size:14px;outline:none}
.search-wrap input:focus{border-color:var(--accent)}

/* Top banner ad */
#top-banner{max-width:760px;margin:10px auto 0;padding:0 12px}
.ad-banner{display:block;background:var(--surface2);border:1px dashed var(--accent2);border-radius:10px;padding:12px;text-decoration:none;color:var(--text)}
.ad-banner small{color:var(--accent2);text-transform:uppercase;letter-spacing:1px;font-size:10px}
.ad-banner strong{display:block;font-size:16px;margin-top:2px}

/* Category chips */
.chips{height:var(--chips-h);display:flex;gap:8px;align-items:center;padding:0 12px;overflow-x:auto;scrollbar-width:none;position:sticky;top:var(--header-h);background:var(--bg);z-index:20}
.chips::-webkit-scrollbar{display:none}
.chip{flex:0 0 auto;background:var(--surface2);color:var(--muted);border:1px solid var(--border);padding:6px 14px;border-radius:999px;font-size:13px;font-weight:600}
.chip.active{background:var(--text);color:#111;border-color:var(--text)}

/* Feed: vertical snap scroll */
.feed{height:calc(100dvh - var(--header-h) - var(--chips-h));overflow-y:auto;scroll-snap-type:y mandatory;max-width:760px;margin:0 auto}
.card{scroll-snap-align:start;min-height:100%;display:flex;flex-direction:column;padding:14px 14px 20px;border-bottom:1px solid var(--border)}
.card-img{width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:12px;background:var(--surface2)}
.card-media{position:relative}
.card-mark{position:absolute;right:10px;bottom:10px;background:rgba(15,15,16,.78);border-radius:8px;padding:6px 9px;display:flex;align-items:center;pointer-events:none}
.card-mark img{height:16px;width:auto;display:block}
.card-img.placeholder img.ph-mark{height:44px;width:auto}
.card-img.placeholder{display:flex;align-items:center;justify-content:center;font-size:44px;font-weight:800;color:var(--surface);background:linear-gradient(135deg,var(--accent),var(--accent2))}
.card h2{font-size:22px;line-height:1.25;letter-spacing:-.3px;margin:14px 0 8px}
.card .summary{font-size:15.5px;line-height:1.55;color:#ddd9d0}
.card .meta{margin-top:10px;font-size:12.5px;color:var(--muted);display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.badge{background:var(--accent);color:#fff;font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:999px;text-transform:uppercase;letter-spacing:.5px}
.badge.cat{background:var(--surface2);color:var(--accent2);border:1px solid var(--border)}
.badge.read{background:var(--surface2);color:var(--muted);border:1px solid var(--border)}
.card.is-read{opacity:.78}
.card.is-read h2{color:#cfccc4}
.read-divider{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;padding:16px 14px 2px}
.read-divider::before,.read-divider::after{content:'';flex:1;height:1px;background:var(--border)}
.badge.lang{background:var(--surface2);color:#b78cff;border:1px solid var(--border);text-transform:none;letter-spacing:0}
.badge.region{background:var(--surface2);color:#4cc38a;border:1px solid var(--border)}
.feed-banner{max-width:760px;margin:10px auto 0;padding:8px 14px;background:#3a2b00;color:#ffd166;border:1px solid #6b5312;border-radius:10px;font-size:13px}
.feed-banner .btn{margin-left:8px;padding:2px 10px;font-size:12px}
.offline-panel{max-width:760px;margin:16px auto;padding:18px 16px;background:var(--surface2);border:1px solid var(--border);border-radius:12px;text-align:center}
.offline-panel h2{margin:0 0 6px;font-size:18px}
.offline-panel p{color:var(--muted);margin:0 0 12px}
.offline-panel .row{justify-content:center}
.actions{margin-top:auto;padding-top:16px;display:flex;gap:10px;flex-wrap:wrap}
.btn{background:var(--surface2);color:var(--text);border:1px solid var(--border);border-radius:999px;padding:9px 16px;font-size:13.5px;font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:6px}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn.on{border-color:var(--accent2);color:var(--accent2)}
.btn.danger{border-color:var(--danger);color:var(--danger);background:transparent}
.btn:disabled{opacity:.5;cursor:default}

/* In-feed ad card */
.ad-card{scroll-snap-align:start;min-height:60%;display:flex;flex-direction:column;justify-content:center;padding:20px 14px;border-bottom:1px solid var(--border)}
.ad-inner{border:1px dashed var(--accent2);border-radius:14px;padding:22px;text-align:center;background:var(--surface)}
.ad-inner small{color:var(--accent2);text-transform:uppercase;letter-spacing:1.5px;font-size:10.5px}
.ad-inner h3{font-size:20px;margin:8px 0}
.ad-inner p{color:var(--muted);font-size:14px;margin-bottom:14px}
.ad-inner img{max-width:100%;border-radius:10px;margin-bottom:12px}

/* Panels (Saved / Studio / Ads / pages) */
.panel{max-width:760px;margin:0 auto;padding:18px 14px 90px;overflow-y:auto;height:calc(100dvh - var(--header-h))}
.panel h1{font-size:26px;letter-spacing:-.5px;margin-bottom:6px}
.panel h2{font-size:18px;margin:22px 0 10px}
.panel p.lead{color:var(--muted);font-size:14.5px;line-height:1.55;margin-bottom:14px}
.saved-item,.own-item,.ad-item{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:12px 14px;margin-bottom:10px}
.saved-item h3,.own-item h3,.ad-item h3{font-size:15.5px;line-height:1.35;margin-bottom:4px}
.saved-item p,.own-item p,.ad-item p{font-size:12.5px;color:var(--muted)}
.row{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px;align-items:center}
.stats{display:flex;gap:16px;font-size:13px;color:var(--muted);margin-top:6px;flex-wrap:wrap}
.stats b{color:var(--text)}

/* Forms */
label{display:block;font-size:13px;font-weight:600;margin:14px 0 6px}
input[type=text],input[type=url],input[type=email],input[type=password],select,textarea{width:100%;background:var(--surface2);border:1px solid var(--border);color:var(--text);border-radius:10px;padding:10px 12px;font-size:14.5px;outline:none}
input:focus,select:focus,textarea:focus{border-color:var(--accent)}
textarea{min-height:96px;resize:vertical}
.hint{font-size:12px;color:var(--muted);margin-top:4px}
.notice{background:var(--surface2);border:1px solid var(--border);border-left:3px solid var(--accent2);border-radius:8px;padding:12px 14px;font-size:13.5px;line-height:1.5;color:#ddd9d0;margin:12px 0}
.empty{color:var(--muted);text-align:center;padding:40px 10px;font-size:14.5px}
.switch{display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:600}

/* Static pages */
.page{max-width:720px;margin:0 auto;padding:28px 18px 90px;line-height:1.7;font-size:15.5px}
.page h1{font-size:30px;letter-spacing:-.5px;margin-bottom:14px}
.page h2{font-size:19px;margin:24px 0 8px}
.page p,.page li{color:#ddd9d0;margin-bottom:10px}
.page ul{padding-left:20px}
.back{font-size:13.5px;font-weight:700}
.orig-cat{margin:18px 0 0}
.orig-label{font-size:12px;font-weight:700;color:var(--accent2);text-transform:uppercase;letter-spacing:.5px}
.orig-byline{font-size:13px;color:var(--muted);margin-bottom:18px}
.orig-sources{font-size:13.5px}
.orig-sources a{color:var(--muted);word-break:break-all}
.orig-note{font-size:13.5px;color:var(--muted);margin-top:22px}
.orig-item{display:block;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:12px 14px;margin-bottom:10px;text-decoration:none}
.orig-item-title{display:block;font-size:16px;font-weight:700;color:var(--text);line-height:1.35;margin-bottom:4px}
.orig-item-dek{display:block;font-size:13.5px;color:var(--muted);line-height:1.5;margin-bottom:6px}
.orig-item-meta{display:block;font-size:12px;color:var(--accent2);font-weight:600}

footer.links{max-width:760px;margin:0 auto;padding:10px 14px 32px;display:flex;gap:16px;font-size:12.5px}
footer.links a{color:var(--muted);text-decoration:none}

@media (max-width:480px){ .mode-badge{max-width:86px} .search-wrap{flex-basis:104px} .logo{font-size:18px} }
@media (min-width:768px){ .card h2{font-size:26px} .feed{border-left:1px solid var(--border);border-right:1px solid var(--border)} }

/* Personalisation: For You chip, Follow topics sheet */
.chip.foryou{color:var(--accent2);border-color:var(--accent2)}
.chip.foryou.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.chip.follow-btn{color:var(--text);border-style:dashed}
#follow-sheet{max-width:760px;margin:8px auto 0;padding:12px 14px;background:var(--surface);border:1px solid var(--border);border-radius:12px}
#follow-sheet h3{font-size:15px;margin-bottom:4px}
#follow-sheet p{font-size:12.5px;color:var(--muted);line-height:1.5;margin-bottom:10px}
.follow-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 2px;border-top:1px solid var(--border);font-size:14px;font-weight:600}
.follow-row:first-of-type{border-top:none}
.follow-row .btn{padding:6px 14px;font-size:12.5px}

/* Mobile: Follow topics opens as a bottom sheet over the page. Before this
   it was an inline panel: opening it made the page taller than the screen,
   the sticky header scrolled away and the sticky chips bar floated over the
   sheet's rows, slicing them (seen on Arya's phone 2026-11-15). As a fixed
   sheet the page behind never moves and the chips can't overlap it.
   Desktop keeps the inline panel (unchanged, already verified there). */
@media (max-width:1023px){
  #sheet-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.62);z-index:50}
  #follow-sheet{position:fixed;left:0;right:0;bottom:0;max-width:760px;margin:0 auto;max-height:82dvh;overflow-y:auto;overscroll-behavior:contain;z-index:60;border-radius:16px 16px 0 0;border-bottom:none;box-shadow:0 -10px 32px rgba(0,0,0,.55);padding:0 14px calc(18px + env(safe-area-inset-bottom))}
  #follow-sheet .sheet-grip{width:42px;height:4px;border-radius:999px;background:var(--border);margin:10px auto}
  #follow-sheet .sheet-head{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--surface);padding:6px 0 8px;z-index:1}
  #follow-sheet .sheet-head h3{margin:0}
  #follow-sheet .sheet-head .btn{padding:6px 12px}
  body.sheet-open{overflow:hidden}
}

/* Hamburger menu + side drawer (mobile app experience). The old sticky
   bottom nav looked like a browser toolbar, so its items moved here and
   the bottom bar is gone. Desktop keeps the top nav; the hamburger is
   hidden there. */
.menu-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;flex:0 0 auto;border:1px solid var(--border);border-radius:10px;background:var(--surface2);color:var(--text);font-size:18px;line-height:1}
#drawer-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.62);z-index:65}
#drawer{position:fixed;top:0;bottom:0;left:0;width:min(300px,84vw);background:var(--surface);border-right:1px solid var(--border);z-index:70;transform:translateX(-105%);visibility:hidden;transition:transform .25s ease,visibility .25s;display:flex;flex-direction:column;padding:calc(10px + env(safe-area-inset-top)) 0 calc(16px + env(safe-area-inset-bottom));overflow-y:auto}
#drawer.open{transform:none;visibility:visible}
.drawer-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 16px 12px;border-bottom:1px solid var(--border)}
.drawer-head .logo{font-size:18px}
.drawer-head .btn{padding:6px 12px}
.drawer-nav{display:flex;flex-direction:column;padding:10px 8px}
.drawer-nav button,.drawer-nav a{display:flex;align-items:center;gap:12px;width:100%;background:none;border:none;color:var(--text);font-size:15px;font-weight:600;text-align:left;padding:12px 10px;border-radius:10px;text-decoration:none}
.drawer-nav button:hover,.drawer-nav a:hover{background:var(--surface2)}
.drawer-nav button.active{color:var(--accent2);background:var(--surface2)}
.drawer-nav .ic{font-size:19px;width:24px;text-align:center;flex:0 0 auto}
.drawer-sep{height:1px;background:var(--border);margin:6px 16px}
.drawer-links{display:flex;flex-direction:column;padding:6px 8px}
.drawer-links a{color:var(--muted);font-size:13.5px;padding:9px 10px;text-decoration:none;border-radius:8px}
.drawer-links a:hover{color:var(--text);background:var(--surface2)}
body.drawer-open{overflow:hidden}
@media (min-width:1024px){.menu-btn{display:none}}

/* Insights bars (owner analytics) */
.bar-row{margin:8px 0;font-size:13px}
.bar-row .bar-label{display:flex;justify-content:space-between;color:var(--muted);margin-bottom:3px}
.bar-row .bar-label b{color:var(--text)}
.bar-row .bar-track{height:8px;background:var(--surface2);border-radius:999px;overflow:hidden}
.bar-row .bar-fill{height:100%;background:var(--accent);border-radius:999px}

/* Desktop layout (1024px+): a proper website, not a stretched phone app.
   Mobile is untouched — every rule below only applies at desktop widths. */
.topnav{display:none}
@media (min-width:1024px){
  /* Root cause of the overlap: html,body{height:100%} makes body exactly
     viewport-tall, so a sticky header has no room to stick and scrolls away
     while the sticky chips bar stays at top:64px — floating over the cards.
     height:auto lets body grow with content, so the header sticks again. */
  html,body{height:auto;min-height:100%}
  :root{--header-h:64px}
  header{max-width:1180px;margin:0 auto;border-left:1px solid var(--border);border-right:1px solid var(--border);padding:0 20px}
  .topnav{display:flex;gap:4px;align-items:center;margin-left:8px}
  .topnav button,.topnav a{background:none;border:none;color:var(--muted);font-size:14px;font-weight:700;padding:8px 12px;border-radius:999px;text-decoration:none}
  .topnav button:hover,.topnav a:hover{color:var(--text);background:var(--surface2)}
  .topnav button.active{color:var(--text);background:var(--surface2)}
  .search-wrap{flex:0 1 320px}
  #feed-wrap{max-width:1180px;margin:0 auto}
  .chips{max-width:1180px;margin:0 auto;flex-wrap:wrap;height:auto;overflow:visible;padding:10px 16px}
  #top-banner,.feed-banner,.offline-panel,#follow-sheet{max-width:100%}
  .hint{max-width:1180px!important}
  .feed{height:auto;overflow:visible;scroll-snap-type:none;max-width:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:16px;border:none}
  .card{scroll-snap-align:none;min-height:0;border:1px solid var(--border);border-radius:14px;background:var(--surface);padding:16px}
  .card:hover{border-color:#3a3b3f}
  .card h2{font-size:20px;margin:12px 0 8px}
  .card .summary{font-size:14.5px}
  .actions{margin-top:14px;padding-top:0}
  .ad-card{scroll-snap-align:none;min-height:0;border:1px solid var(--border);border-radius:14px;background:var(--surface);padding:16px}
  .panel{max-width:900px;height:auto;overflow:visible;padding:24px 20px 48px}
  .page{max-width:780px}
  .page.hub{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px;padding-bottom:48px}
  .page.hub h1,.page.hub h2,.page.hub p,.page.hub .back{grid-column:1/-1}
  .page.hub h2{margin-top:26px}
  footer.links{max-width:1180px;padding:10px 16px 32px}
}
@media (min-width:1400px){
  header,#feed-wrap,.chips{max-width:1320px}
  .feed{grid-template-columns:repeat(3,minmax(0,1fr))}
  .page.hub{grid-template-columns:repeat(3,minmax(0,1fr))}
}
