/* Chamku sign-in sheet + story report */
.ca-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(3,5,14,.82); display: grid; place-items: end center; padding: 12px; }
@media (min-width: 600px) { .ca-wrap { place-items: center; } }
.ca-card { width: 100%; max-width: 440px; background: #121936; border: 1px solid var(--line); border-radius: 22px; padding: 20px 18px 14px; text-align: center; }
.ca-card h2 { margin: 6px 0 4px; font-size: 22px; }
.ca-card > p { color: var(--muted); margin: 4px 0 12px; }
.ca-img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.ca-google { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ca-gl { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 800; font-family: Arial, sans-serif; }
.ca-or { color: var(--muted); margin: 10px 0; font-size: 14px; }
.ca-card input { display: block; width: 100%; margin: 0 0 8px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 16px; }
.ca-card .small { margin: 8px 0 0; }
.ca-card a { color: inherit; }
.ca-who { margin: 6px 0 0; }
.ca-who .link { padding: 0; font-size: inherit; }
.ca-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.ca-table th, .ca-table td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: left; white-space: nowrap; }
.ca-table td:first-child { white-space: normal; min-width: 140px; }
.ca-gbtn { display: flex; justify-content: center; min-height: 44px; margin: 4px 0; }

/* hamburger menu */
.menu-btn { font-size: 20px; }
.bar-r, .bar-l { display: inline-flex; align-items: center; gap: 6px; }
header.top > .menu-btn { flex: 0 0 auto; }
header.top > .brand { margin-right: auto; }
.cm-wrap { position: fixed; inset: 0; z-index: 55; background: rgba(3,5,14,.7); display: flex; justify-content: flex-start; }
.cm-panel { width: min(320px, 86vw); height: 100%; overflow-y: auto; background: #121936; border-right: 1px solid var(--line); padding: 14px 14px 30px; box-sizing: border-box; }
.cm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cm-head b { font-size: 20px; }
.cm-acct { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; word-break: break-all; }
.cm-panel h4 { margin: 16px 0 6px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.cm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 8px; border-radius: 10px; color: inherit; text-decoration: none; background: none; border: 0; font: inherit; text-align: left; }
.cm-item:hover, .cm-item:active { background: var(--card); }
.cm-item span { width: 24px; text-align: center; }

/* ---------- watch / listen-only switch ---------- */
.mode-tabs { display: flex; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 4px; margin: 4px 0 10px; }
.mode-tabs button { flex: 1; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 8px 6px; border-radius: 99px; }
.mode-tabs button.on { background: var(--amber); color: #2a1a00; }
.listen { background: linear-gradient(160deg, #1b2450, #0f1532); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 12px; text-align: center; }
.lp-art { width: 112px; height: 112px; margin: 0 auto 12px; border-radius: 28px; display: grid; place-items: center; font-size: 58px;
  background: radial-gradient(circle, rgba(244,185,90,.28), rgba(244,185,90,.05) 70%); box-shadow: 0 0 36px rgba(244,185,90,.25); }
.lp-row { display: flex; justify-content: center; align-items: center; gap: 18px; margin-bottom: 10px; }
.lp-btn { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: #252c4f; color: var(--text); font-size: 20px; display: grid; place-items: center; }
.lp-btn.lp-play { width: 68px; height: 68px; background: var(--amber); color: #2a1a00; font-size: 26px; border: 0; }
.lp-seek { width: 100%; accent-color: var(--amber); }
.lp-time { display: flex; justify-content: space-between; }
/* small bar at the bottom while a story plays in the background */
.lp-mini { position: fixed; left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: 8px;
  background: #1b2450; border: 1px solid rgba(244,185,90,.35); border-radius: 16px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.lp-mini .lp-mi { font-size: 24px; text-decoration: none; }
.lp-mini .lp-mt { flex: 1; min-width: 0; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-mini button { border: 0; background: #252c4f; color: var(--text); width: 38px; height: 38px; border-radius: 50%; font-size: 15px; flex: none; }
.lp-mini button[data-lp="mplay"] { background: var(--amber); color: #2a1a00; }
body.has-mini #app { padding-bottom: 70px; }
/* more stories row under a story */
.more-row .card { flex: 0 0 64%; max-width: 260px; }

.cm-langs { display: flex; gap: 8px; }
.cm-langs button { flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 600; padding: 9px 6px; border-radius: 12px; }
.cm-langs button.on { background: var(--amber); color: #2a1a00; border-color: var(--amber); }

.ca-inapp { background: rgba(244,185,90,.12); border: 1px solid rgba(244,185,90,.4); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.ca-inapp .pill { margin-top: 8px; justify-content: center; text-decoration: none; }
.ca-gbtn { min-height: 44px; display: flex; align-items: center; justify-content: center; }
.home-btn { white-space: nowrap; }

/* ---------- calmer top bar ---------- */
header.top .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
header.top .brand a { color: inherit; text-decoration: none; }
header.top .brand h1 { margin: 0; font-size: 26px; line-height: 1.1; }
.kid-line { display: block; border: 0; background: none; padding: 1px 0 0; font: inherit; font-size: 13px; color: var(--amber); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
/* ---------- category circles: gold ring, name on its own little label ---------- */
.home-cats { gap: 4px; padding: 14px 2px 10px; margin: 2px 0 6px; }
.home-cats .circle { width: 78px; gap: 8px; }
.home-cats .circle .disc { width: 62px; height: 62px; border: 2px solid rgba(244,185,90,.85);
  box-shadow: 0 0 0 4px rgba(244,185,90,.10), 0 0 16px rgba(244,185,90,.28); }
.home-cats .circle b { box-sizing: border-box; width: 100%; height: 3.1em; padding: 0 4px; font-size: 11.5px; font-weight: 600; line-height: 1.25;
  color: #f4ecdc; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden;
  background: rgba(244,185,90,.10); border: 1px solid rgba(244,185,90,.25); border-radius: 10px; -webkit-line-clamp: unset; }
.home-cats + .searchbar { margin-top: 8px; margin-bottom: 14px; }
.cm-edit { margin-left: auto; color: var(--muted); font-size: 12px; text-decoration: underline; }

/* top bar: menu left, Chamku centred, language right */
header.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
header.top > .menu-btn { justify-self: start; }
header.top > .brand { justify-self: center; margin: 0; display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
header.top > .brand .avatar { width: 40px; height: 40px; }
header.top > .brand h1 { margin: 0; font-size: 24px; line-height: 1.1; }
header.top > .top-r { justify-self: end; }

/* top bar: equal gaps between ☰, Chamku's picture, the name and the language button */
header.top { display: flex; justify-content: space-between; align-items: center; gap: 0; }
header.top > .brand { display: flex; align-items: center; gap: 8px; margin: 0; }   /* picture + name = one unit */
header.top > .brand h1 { margin: 0; }

/* ---------- science behind each story ---------- */
.sci-box { background: linear-gradient(180deg, #121a3d, #0f1532); border: 1px solid rgba(244,185,90,.28); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.sci-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.sci-badge { font-weight: 700; color: var(--amber); font-size: 16px; }
.sci-skill { font-size: 12.5px; padding: 3px 9px; border-radius: 99px; background: rgba(244,185,90,.12); border: 1px solid rgba(244,185,90,.3); color: #f4ecdc; }
.sci-headline { font-size: 17px; font-weight: 600; line-height: 1.45; margin: 6px 0 10px; }
.sci-box h4 { margin: 14px 0 6px; font-size: 14px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.sci-list { margin: 0; padding-left: 20px; } .sci-list li { margin: 0 0 9px; line-height: 1.5; }
.sci-ref { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; margin-left: 2px; text-align: center; font-size: 11px; font-weight: 700;
  border-radius: 9px; background: rgba(244,185,90,.18); color: var(--amber); text-decoration: none; vertical-align: 2px; padding: 0 4px; }
.sci-card { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.sci-card p { margin: 4px 0 0; } .sci-try { border-color: rgba(244,185,90,.35); } .sci-doc { border-color: rgba(120,190,255,.35); }
.sci-src summary { cursor: pointer; font-weight: 600; margin-top: 10px; }
.sci-src ol, .lib-src { padding-left: 22px; font-size: 13.5px; line-height: 1.5; color: #d9d2c3; }
.sci-src li, .lib-src li { margin-bottom: 8px; border-radius: 6px; transition: background .4s; }
.sci-src a, .lib-src a { color: var(--amber); }
.sci-type, .sci-used { font-size: 11.5px; color: var(--muted); }
.sci-flash { background: rgba(244,185,90,.22); }
.sci-note { margin-top: 10px; } .sci-note a { color: var(--amber); }
.sci-intro { font-size: 16px; line-height: 1.55; }
.lib-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 6px; }
.lib-stats div { background: var(--card); border: 1px solid rgba(244,185,90,.3); border-radius: 14px; padding: 10px 6px; text-align: center; }
.lib-stats b { display: block; font-size: 26px; color: var(--amber); line-height: 1.1; } .lib-stats span { font-size: 12.5px; color: var(--muted); }
.lib-stories { display: grid; gap: 8px; }
.lib-story { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: inherit; text-decoration: none; }
.lib-story b { display: block; } .lib-story span { display: block; font-size: 12.5px; color: var(--amber); margin: 2px 0; } .lib-story i { font-style: normal; font-size: 13.5px; color: #d9d2c3; }
.badge.seen { background: rgba(255,255,255,.08); color: var(--muted); border: 1px solid var(--line); }
