/* MeTube — a YouTube-like layout with clay touches (logo, mascot, buttons that squish). */
:root, [data-theme="dark"] {
  --bg: #0f0f0f; --bg2: #181818; --raise: #212121; --chip: #272727; --chip-hover: #3a3a3a;
  --line: rgba(255,255,255,.12);
  --text: #f1f1f1; --muted: #aaaaaa;
  --clay: #E5533D; --clay-deep: #A8321F; --clay-lip: #7A2414; --on-clay: #ffffff;
  --cream: #F6EAD7;
  --ok: #34d399; --danger: #ff6b6b;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --top: 56px; --side: 240px; --bottom: 0px;
}
[data-theme="light"] {
  --bg: #ffffff; --bg2: #f9f9f9; --raise: #ffffff; --chip: #f2f2f2; --chip-hover: #e5e5e5;
  --line: rgba(0,0,0,.12);
  --text: #0f0f0f; --muted: #555555;
  --clay: #D9432E; --clay-deep: #A8321F; --clay-lip: #8E2A18;
  --shadow: 0 10px 24px rgba(0,0,0,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 "Hanken Grotesk", "Roboto", system-ui, sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
h1 { font: 700 1.6rem/1.2 Fredoka, "Hanken Grotesk", sans-serif; margin: 0; }
h2 { font: 600 1.2rem/1.3 Fredoka, "Hanken Grotesk", sans-serif; margin: 0 0 .8rem; }
.muted { color: var(--muted); margin: .2rem 0 0; }
.small { font-size: .85rem; }

/* ---------- clay buttons: a lip under each, they squish when pressed ---------- */
.clay-btn {
  --lip: rgba(0,0,0,.45);
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: 600 .95rem/1 Fredoka, "Hanken Grotesk", sans-serif; letter-spacing: .2px;
  min-height: 40px; padding: .55rem 1.05rem; border-radius: 999px; cursor: pointer; text-decoration: none;
  color: var(--text); background: var(--chip); border: 1px solid var(--line);
  box-shadow: 0 4px 0 var(--lip), inset 0 1.5px 0 rgba(255,255,255,.14);
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .16s;
  position: relative; top: -2px;
}
[data-theme="light"] .clay-btn { --lip: rgba(0,0,0,.18); }
.clay-btn:hover { transform: translateY(1px); box-shadow: 0 3px 0 var(--lip), inset 0 1.5px 0 rgba(255,255,255,.14); }
.clay-btn:active { transform: translateY(4px) scale(1.03,.96); box-shadow: 0 0 0 var(--lip); }
.clay-btn.primary { --lip: var(--clay-lip); background: radial-gradient(120% 140% at 30% 20%, #ff8a6b 0%, var(--clay) 45%, var(--clay-deep) 100%); color: var(--on-clay); border-color: transparent; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.clay-btn.ghost { background: transparent; box-shadow: none; border-color: transparent; top: 0; }
.clay-btn.danger { color: var(--danger); }
.clay-btn.sm { min-height: 36px; padding: .4rem .85rem; font-size: .85rem; }
.clay-btn.wide { width: 100%; margin-top: 1.1rem; font-size: 1.05rem; min-height: 48px; }
.clay-btn:disabled { opacity: .6; cursor: wait; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; font-size: 1.2rem; display: inline-grid; place-items: center; color: var(--text); }
.icon-btn:hover { background: var(--chip); }
.icon-btn.round { background: var(--chip); width: 52px; height: 52px; }

/* ---------- top bar ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 40; display: flex; align-items: center; gap: 1rem; padding: 0 16px; background: var(--bg); }
.tb-left, .tb-right { display: flex; align-items: center; gap: .4rem; }
.tb-right { margin-left: auto; position: relative; }
.brand { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; font: 700 1.35rem/1 Fredoka, sans-serif; letter-spacing: -.5px; color: var(--text); }
.brand b { font-weight: 700; }
.brand span { position: relative; top: 1px; }
.logo { width: 38px; height: 29px; flex: none; }
.logo.sm { width: 26px; height: 20px; vertical-align: -3px; }
.brand.big { font-size: 2.2rem; justify-content: center; }
.brand.big .logo { width: 64px; height: 48px; }
.searchbar { flex: 0 1 640px; margin: 0 auto; display: flex; height: 42px; }
.searchbar input { flex: 1; min-width: 0; border: 1px solid var(--line); border-right: 0; background: var(--bg2); border-radius: 999px 0 0 999px; padding: 0 1.1rem; font-size: 1rem; outline: none; }
.searchbar input:focus { border-color: #3ea6ff; }
.searchbar .mic { border: 1px solid var(--line); border-right: 0; background: var(--bg2); width: 44px; cursor: pointer; }
.searchbar .go { width: 64px; border: 1px solid var(--line); background: var(--chip); border-radius: 0 999px 999px 0; cursor: pointer; font-size: 1.2rem; }
.create em { font-style: normal; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; font: 700 1rem Fredoka, sans-serif; color: #fff;
  background: radial-gradient(circle at 32% 28%, #9CC6E8, #5E93C2 50%, #36628C); box-shadow: 0 3px 0 #23415E, inset 0 1px 0 rgba(255,255,255,.35); }
.avatar.xl { width: 96px; height: 96px; font-size: 2.6rem; display: grid; place-items: center; box-shadow: 0 6px 0 #23415E, inset 0 2px 0 rgba(255,255,255,.35); }
.menu { position: absolute; right: 0; top: 48px; background: var(--raise); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .4rem 0; min-width: 200px; z-index: 60; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .7rem 1rem; cursor: pointer; }
.menu button:hover { background: var(--chip); }
.sm-only { display: none; }

/* ---------- side nav (desktop) & bottom nav (phone) ---------- */
.sidebar { position: fixed; top: var(--top); left: 0; bottom: 0; width: var(--side); padding: .6rem; overflow-y: auto; background: var(--bg); z-index: 30; }
.sidebar a { display: flex; align-items: center; gap: 1.3rem; padding: .6rem .8rem; border-radius: 10px; text-decoration: none; font-size: .95rem; }
.sidebar a i { font-style: normal; width: 24px; text-align: center; font-size: 1.15rem; }
.sidebar a:hover { background: var(--chip); }
.sidebar a.on { background: var(--chip); font-weight: 600; }
.side-sec { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .6rem; }
.side-sec h3 { font-size: 1rem; margin: .2rem .8rem .4rem; }
body.mini .sidebar { width: 72px; }
body.mini .sidebar a { flex-direction: column; gap: .2rem; font-size: .65rem; padding: .8rem 0; }
body.mini .side-sec { display: none; }
.bottomnav { display: none; }
.main { margin-left: var(--side); padding-top: var(--top); min-height: 100dvh; }
body.mini .main { margin-left: 72px; }

/* ---------- pages ---------- */
.page { display: none; padding: 0 24px 48px; }
.page.on { display: block; }
#shorts.page { padding: 0; }

.chips { display: flex; gap: .6rem; overflow-x: auto; padding: .8rem 0; scrollbar-width: none; position: sticky; top: var(--top); background: var(--bg); z-index: 5; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 0; background: var(--chip); border-radius: 8px; padding: .4rem .8rem; min-height: 34px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.chip:hover { background: var(--chip-hover); }
.chip.on { background: var(--text); color: var(--bg); }

.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0 .8rem; }
.shelf-title { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1.3rem; }
.shelf-head select { background: var(--chip); border: 0; border-radius: 8px; padding: .4rem .6rem; min-height: 36px; }
select option { color: #0b1020; }

/* short cards, like YouTube's Shorts shelf */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px 12px; }
.item { position: relative; cursor: pointer; }
.item .thumb { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; border-radius: 12px; background: var(--chip); transition: border-radius .15s; }
.item:hover .thumb { border-radius: 4px; }
.item .meta { padding: .5rem 1.8rem 0 .1rem; }
.item .t { font-weight: 600; font-size: .95rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .s { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.item .dots { position: absolute; right: -6px; top: calc(100% - 3.4rem); }
.item .pick { display: none; position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; accent-color: var(--clay); z-index: 2; }
.selecting .item .pick { display: block; }
.badge { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 6px; }
.badge.liked { background: var(--clay); }
.len { position: absolute; bottom: calc(100% - (100% - 0px)); }
.tagchip { display: inline-block; font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; background: var(--chip); margin: .25rem .2rem 0 0; }
.bulk { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem; margin: .4rem 0; background: var(--raise); border: 1px solid var(--line); border-radius: 14px; position: sticky; top: calc(var(--top) + 54px); z-index: 6; }
.bulk span { font-weight: 700; margin: 0 .4rem; }
.shelf { display: flex; gap: 12px; overflow-x: auto; padding-bottom: .4rem; }
.shelf .item { flex: 0 0 160px; }

/* ---------- Shorts player ---------- */
.feed-wrap { position: relative; height: calc(100dvh - var(--top) - var(--bottom)); }
.feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; outline: none; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.slide { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; justify-content: center; align-items: center; padding: 16px 0 24px; }
.player { height: 100%; aspect-ratio: 9/16; max-width: 92vw; border-radius: 16px; overflow: hidden; background: #000 center/cover no-repeat; position: relative; }
.player .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 3rem .9rem .9rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.8)); font-size: .9rem; }
.stage { position: absolute; top: 16px; bottom: 24px; left: 50%; transform: translateX(-50%); aspect-ratio: 9/16; max-width: 92vw; border-radius: 16px; overflow: hidden; background: #000; z-index: 3; }
.stage iframe, #ytPlayer { width: 100%; height: 100%; border: 0; display: block; }
.catcher { position: absolute; inset: 0; z-index: 2; cursor: pointer; touch-action: none; }
/* TikTok, Instagram, Facebook, LinkedIn: their own player takes taps; swipe on the strip at the top */
#socialFrame { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border: 0; background: #000; }
.stage.social .catcher { bottom: auto; height: 16%; min-height: 72px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.stage.social .catcher::after { content: "⇅ Swipe here · tap the video to play"; position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  white-space: nowrap; font-size: .78rem; font-weight: 700; color: #fff; background: rgba(0,0,0,.6); padding: .25rem .7rem; border-radius: 999px; }
.actions[data-kind="social"] [data-a="mute"] { display: none; }
@media (max-width: 700px) { .stage.social .catcher { height: 24%; min-height: 170px; } }  /* phone: the chips sit over the top of it */
.stage-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 4rem 1rem 1.1rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); z-index: 3; pointer-events: none; font-size: .92rem; }
.stage-cap b { display: block; font-size: 1rem; margin-bottom: .2rem; }
.stage-cap .why { font-size: .8rem; opacity: .9; margin-top: .3rem; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.25); z-index: 4; }
.progress i { display: block; height: 100%; width: 0; background: var(--clay); }
.sound-pill { position: absolute; top: 14px; left: 14px; z-index: 5; border: 0; border-radius: 999px; padding: .55rem 1rem; font-weight: 700; cursor: pointer; color: #111;
  background: radial-gradient(circle at 30% 25%, #fff, var(--cream)); box-shadow: 0 4px 0 #b9a585; }
.paused-badge { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; color: #fff; font-size: 3rem; pointer-events: none; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.actions { position: absolute; bottom: 40px; z-index: 6; display: flex; flex-direction: column; gap: 14px; left: calc(50% + (100dvh - var(--top) - var(--bottom) - 40px) * 9 / 32 + 14px); }
.act { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer; text-decoration: none; color: var(--text); }
.act b { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.35rem; background: var(--chip);
  box-shadow: 0 4px 0 rgba(0,0,0,.45), inset 0 1.5px 0 rgba(255,255,255,.15); transition: transform .16s cubic-bezier(.34,1.56,.64,1); }
[data-theme="light"] .act b { box-shadow: 0 4px 0 rgba(0,0,0,.15), inset 0 1.5px 0 rgba(255,255,255,.8); }
.act:active b { transform: translateY(4px) scale(1.06,.92); box-shadow: none; }
.act small { font-size: .75rem; font-weight: 600; }
.act.on b { background: radial-gradient(circle at 30% 25%, #ff8a6b, var(--clay) 50%, var(--clay-deep)); color: #fff; box-shadow: 0 4px 0 var(--clay-lip); }
.act.pop b { animation: squish .42s steps(5, end); }
@keyframes squish { 0% { transform: scale(1); } 30% { transform: scale(1.25, .8); } 60% { transform: scale(.9, 1.15); } 100% { transform: scale(1); } }
.nav-arrows { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 14px; z-index: 6; }
.feed-chips { position: absolute; top: 0; left: 0; right: 0; padding: .6rem 16px; background: transparent; z-index: 7; justify-content: flex-start; pointer-events: none; }
.feed-chips .chip { pointer-events: auto; box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* ---------- Find ---------- */
.find-hero { display: flex; align-items: center; gap: 1.2rem; margin: 1.2rem 0; }
.find-hero .mascot { width: 96px; height: 96px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; margin-bottom: 1.1rem; max-width: 1100px; }
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .8rem; }
label input, label select, label textarea, .tags-in { display: block; width: 100%; margin-top: .3rem; font-weight: 400; font-size: .95rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .75rem; min-height: 42px; }
label.big input { font-size: 1.15rem; padding: .75rem .9rem; border-width: 2px; }
label input:focus, label textarea:focus, .tags-in:focus { outline: 2px solid #3ea6ff; outline-offset: -1px; }
.hint { color: var(--muted); font-weight: 400; font-size: .78rem; margin-left: .3rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 .8rem; }
label.check { display: flex; align-items: center; gap: .55rem; font-size: .95rem; cursor: pointer; }
label.check input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--clay); display: inline; }
.more summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin-bottom: .6rem; }
.actions-row { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.section-h { margin-top: 1.6rem; }
.search-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; max-width: 1100px; }
.search-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.search-card .n { font-weight: 700; font-family: Fredoka, sans-serif; font-size: 1.05rem; }
.search-card .w { color: var(--muted); font-size: .85rem; }
.search-card .b { display: flex; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.found { display: flex; gap: .5rem; overflow-x: auto; padding: .4rem 0 .6rem; }
.found img { height: 150px; width: 84px; aspect-ratio: 9/16; object-fit: cover; border-radius: 10px; flex: 0 0 auto; cursor: pointer; background: var(--chip); }
.stat-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.stat { background: var(--chip); border-radius: 12px; padding: .45rem .85rem; }
.stat b { font-size: 1.35rem; display: block; line-height: 1.1; font-family: Fredoka, sans-serif; }
.dropped li { font-size: .85rem; } .dropped span { color: var(--muted); }

/* ---------- You ---------- */
.you-head { display: flex; align-items: center; gap: 1.4rem; margin: 1.6rem 0 1rem; }
.you-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2rem; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 80; display: grid; place-items: center; padding: 16px; }
.sheet { background: var(--raise); border: 1px solid var(--line); width: min(560px, 100%); max-height: 92dvh; overflow: auto; padding: 1.4rem; position: relative; border-radius: 18px; box-shadow: var(--shadow); }
.sheet.wide { width: min(820px, 100%); }
.sheet .close { position: absolute; top: .6rem; right: .6rem; z-index: 3; }
.big-input { display: flex; gap: .5rem; padding: .45rem; border: 2px solid var(--line); border-radius: 999px; background: var(--bg); margin: .4rem 0 .7rem; }
.big-input:focus-within { border-color: #3ea6ff; }
.big-input input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 1.1rem; padding: .5rem .8rem; outline: none; }
.msg { padding: .6rem .8rem; border-radius: 10px; background: var(--chip); margin: .7rem 0; }
.msg.err { color: var(--danger); }
.detail { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.detail .player { height: min(70dvh, 560px); flex: none; }
.detail .player iframe { width: 100%; height: 100%; border: 0; }
.detail .info { flex: 1 1 240px; display: flex; flex-direction: column; gap: .55rem; padding-right: 2.4rem; }
.detail .info .b { display: flex; gap: .5rem; flex-wrap: wrap; }
.help { text-align: center; }
.help h2 { font-size: 1.4rem; margin: .4rem 2.4rem 1rem; }
.help .mascot { width: 110px; height: 110px; }
.steps { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.steps.small { margin-top: 1rem; }
.step { background: var(--chip); border-radius: 16px; padding: .8rem; width: 140px; display: flex; flex-direction: column; gap: .2rem; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.step .ico { font-size: 1.9rem; } .step span { color: var(--muted); font-size: .85rem; }

/* ---------- welcome: glass sheet, clay intro video, one-card-at-a-time carousel ---------- */
.sheet.help { width: min(460px, 100%); background: color-mix(in srgb, var(--raise) 78%, transparent); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); }
.intro-screen { position: fixed; inset: 0; z-index: 1000; background: #b99c80; }  /* sand, so wide screens blend with the clay set */
.intro-screen[hidden] { display: none; }
.intro-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-aspect-ratio: 3/4) { .intro-screen video { object-fit: contain; } }
.intro-btn { position: absolute; z-index: 2; border: 1px solid rgba(255,255,255,.25); cursor: pointer; color: #fff; background: rgba(0,0,0,.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 600 1.05rem/1 Fredoka, sans-serif; }
.intro-btn.mute { left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; font-size: 1.5rem; }
.intro-btn.skip { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); height: 56px; padding: 0 1.4rem; border-radius: 999px; }
.car { position: relative; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; border-radius: 22px; }
.car-track::-webkit-scrollbar { display: none; }
.tcard { flex: 0 0 100%; scroll-snap-align: center; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1.4rem 1rem 1.2rem; }
.tcard .ico { width: 150px; height: 150px; border-radius: 38px; display: grid; place-items: center; margin-bottom: .5rem;
  background: linear-gradient(150deg, rgba(255,255,255,.16), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 10px 24px rgba(0,0,0,.25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tcard .ico img { width: 120px; height: 120px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
[data-theme="light"] .tcard .ico { background: linear-gradient(150deg, rgba(0,0,0,.05), rgba(0,0,0,.02)); border-color: rgba(0,0,0,.1); }
.tcard b { font: 700 1.5rem/1.2 Fredoka, sans-serif; }
.tcard span { color: var(--text); font-size: 1.05rem; opacity: .85; }
.car-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--chip); color: var(--text); font-size: 1.8rem; line-height: 1; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.car-arrow.prev { left: 0; } .car-arrow.next { right: 0; }
.car-arrow:active { transform: translateY(calc(-50% + 3px)); box-shadow: none; }
.car-dots { display: flex; justify-content: center; gap: .2rem; margin-top: .3rem; }
.car-dots button { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 0; }
.car-dots button::after { content: ""; width: 10px; height: 10px; border-radius: 99px; background: var(--muted); opacity: .5; transition: width .25s, opacity .25s; }
.car-dots button.on::after { width: 26px; background: var(--clay); opacity: 1; }
.car.paused + .car-dots button.on::after { background: var(--muted); }
.replay { margin-top: .5rem; width: 100%; min-height: 44px; }
@media (max-width: 700px) { .car-arrow { display: none; } .sheet.help { padding: 1.1rem; } }
.arrow { font-size: 1.4rem; color: var(--clay); }

/* ---------- sign in ---------- */
.login { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: min(380px, 100%); text-align: center; }
.login .mascot { width: 140px; height: 140px; }

/* ---------- mascot & empty states ---------- */
.mascot { width: 120px; height: 120px; display: inline-block; }
.bob { animation: bob 1.25s steps(1, end) infinite; }
@keyframes bob { 0% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-2px) rotate(-1deg); } 50% { transform: translateY(-4px) rotate(0); } 75% { transform: translateY(-2px) rotate(1deg); } }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty p { margin: .6rem 0 1rem; font-size: 1.05rem; }
#shorts .empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; }

.toast { position: fixed; bottom: calc(24px + var(--bottom)); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .65rem 1.2rem; border-radius: 10px; font-weight: 600; z-index: 100; box-shadow: var(--shadow); }

/* ---------- tablet: mini side nav ---------- */
@media (max-width: 1100px) { :root { --side: 72px; } .sidebar a { flex-direction: column; gap: .2rem; font-size: .65rem; padding: .8rem 0; } .side-sec { display: none; } #menuBtn { display: none; } }

/* ---------- phone: bottom nav, full-screen shorts ---------- */
@media (max-width: 700px) {
  :root { --side: 0px; --bottom: calc(60px + env(safe-area-inset-bottom)); --top: 52px; }
  .sidebar { display: none; }
  .main, body.mini .main { margin-left: 0; }
  .page { padding: 0 12px calc(var(--bottom) + 24px); }
  .searchbar { display: none; position: absolute; left: 8px; right: 8px; top: 6px; z-index: 5; }
  body.search-open .searchbar { display: flex; }
  .sm-only { display: inline-grid; }
  .create { display: none; }
  .brand { font-size: 1.15rem; }
  /* bottom tray: one row of matching line icons above the iPhone's home bar */
  .bottomnav { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; box-sizing: border-box;
    height: var(--bottom); padding: 0 6px env(safe-area-inset-bottom); z-index: 40; align-items: center;
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-top: 1px solid var(--line); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 60px; font-size: .7rem; font-weight: 600;
    text-decoration: none; color: var(--muted); -webkit-tap-highlight-color: transparent; }
  .bottomnav a.on { color: var(--text); }
  .bn-ic { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bn-ic .fill { fill: currentColor; stroke: none; }
  .bottomnav a.on .bn-ic { stroke-width: 2.3; }
  .bn-create { justify-self: center; width: 48px; height: 34px; border: 0; border-radius: 12px; padding: 0; cursor: pointer; display: grid; place-items: center;
    background: var(--clay); box-shadow: 0 2px 0 var(--clay-deep); -webkit-tap-highlight-color: transparent; }
  .bn-create svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
  .bn-create:active { transform: translateY(2px); box-shadow: none; }
  /* feed filter chips: a strip you can swipe sideways (it takes the swipe, not the video under it) */
  .feed-chips { pointer-events: auto; touch-action: pan-x; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    padding-right: 16px; scroll-padding: 0 16px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px 8px; }
  .stage { top: 0; bottom: 0; border-radius: 0; max-width: 100vw; width: 100vw; left: 0; transform: none; aspect-ratio: auto; }
  .slide { padding: 0; }
  .player { border-radius: 0; max-width: 100vw; width: 100vw; aspect-ratio: auto; }
  .actions { left: auto; right: 10px; bottom: 90px; }
  .act b { background: rgba(0,0,0,.45); color: #fff; box-shadow: none; backdrop-filter: blur(6px); }
  .act small { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
  .nav-arrows { display: none; }
  .stage-cap { padding-right: 76px; }
  .feed-chips .chip { background: rgba(0,0,0,.62); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); }
  .feed-chips .chip.on { background: #fff; color: #111; }
  .detail .player { height: 60dvh; margin: 0 auto; }
  .find-hero .mascot { width: 72px; height: 72px; }
  .steps:not(.small) { flex-direction: column; } .steps .arrow { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) { .bob, .act.pop b { animation: none !important; } * { transition: none !important; } }

/* caption sits beside the video (never on top of YouTube's own player UI) */
.stage-cap { position: absolute; z-index: 6; bottom: 40px; width: 280px; padding: 0; background: none; color: var(--text); text-align: right; pointer-events: none;
  right: calc(50% + (100dvh - var(--top) - var(--bottom) - 40px) * 9 / 32 + 18px); left: auto; font-size: .9rem; }
.stage-cap b { font-family: Fredoka, sans-serif; font-size: 1.05rem; line-height: 1.3; }
.stage-cap .why { display: inline-block; margin-top: .5rem; padding: .3rem .7rem; border-radius: 999px; background: var(--chip); font-size: .8rem; opacity: 1; }
/* desktop: filter chips stacked on the left */
@media (min-width: 701px) {
  .feed-chips { top: 16px; left: 24px; right: auto; flex-direction: column; align-items: flex-start; overflow: visible; max-height: calc(100% - 32px); }
  .feed-chips .chip { box-shadow: none; }
}
@media (max-width: 1000px) and (min-width: 701px) { .stage-cap { display: none; } }
@media (max-width: 700px) {
  .stage-cap { display: none; }
  .actions { bottom: auto; top: 64px; }
}

/* ================= LEARN ================= */
.learn-hero { display: flex; align-items: center; gap: 1.2rem; margin: 1.2rem 0; }
.learn-hero .mascot { width: 96px; height: 96px; flex: none; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .5rem; }
.flow span { display: inline-flex; align-items: center; gap: .35rem; background: var(--chip); border-radius: 999px; padding: .3rem .75rem; font-weight: 600; font-size: .88rem; }
.flow i { font-style: normal; } .flow em { font-style: normal; color: var(--clay); font-weight: 700; }
.upload { max-width: 1100px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.6rem 1rem; border: 2.5px dashed var(--line); border-radius: 18px;
  cursor: pointer; text-align: center; margin: 0; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--clay); background: color-mix(in srgb, var(--clay) 8%, transparent); }
.drop input { display: none; }
.drop b { font: 600 1.25rem Fredoka, sans-serif; }
.drop .types { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.drop .types i { font-style: normal; font-size: .85rem; background: var(--chip); border-radius: 999px; padding: .2rem .6rem; font-weight: 500; }
.files { display: flex; flex-wrap: wrap; gap: .5rem; margin: .7rem 0 0; }
.files span { display: inline-flex; align-items: center; gap: .4rem; background: var(--chip); border-radius: 10px; padding: .3rem .4rem .3rem .7rem; font-size: .88rem; }
.files button { border: 0; background: none; cursor: pointer; font-size: 1rem; width: 28px; height: 28px; border-radius: 50%; }
.files button:hover { background: var(--chip-hover); }
.learn-input { margin-top: 1rem; align-items: center; }
.learn-input input { font-size: 1.15rem; }
.mic-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--chip); cursor: pointer; font-size: 1.15rem; flex: none; }
.mic-btn.live { background: var(--clay); color: #fff; }
.opts { display: grid; gap: .7rem; margin-top: .6rem; padding: 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.opt { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.opt > span { min-width: 120px; font-weight: 600; font-size: .9rem; }
.opt-focus { margin: 0; }
.seg { display: inline-flex; background: var(--chip); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; border-radius: 8px; padding: .4rem .8rem; min-height: 34px; cursor: pointer; font-weight: 600; font-size: .88rem; }
.seg.big button { padding: .6rem 1.4rem; min-height: 44px; font-size: 1rem; }
.seg button.on { background: var(--text); color: var(--bg); }
.head-tools { display: flex; gap: .5rem; align-items: center; }
.head-tools select { background: var(--chip); border: 0; border-radius: 8px; padding: .4rem .6rem; min-height: 36px; }

.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; max-width: 1400px; }
.course { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; position: relative; }
.course:hover { border-color: var(--clay); }
.course .pic { aspect-ratio: 16/10; background: var(--chip) center/cover no-repeat; position: relative; display: grid; place-items: center; font-size: 2.2rem; }
.course .pic .count { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.75); color: #fff; font-size: .78rem; font-weight: 700; padding: .15rem .5rem; border-radius: 6px; }
.course .body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.course .t { font: 600 1.05rem/1.3 Fredoka, sans-serif; }
.course .st { color: var(--muted); font-size: .85rem; }
.course .st.err { color: var(--danger); }
.course .st.busy::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--clay); margin-right: .4rem; animation: pulse 1s steps(2, end) infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.bar { height: 6px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--clay); width: 0; }
.course .b { display: flex; gap: .5rem; margin-top: auto; padding-top: .4rem; }
.courses.list { grid-template-columns: 1fr; gap: 8px; }
.courses.list .course { flex-direction: row; align-items: center; }
.courses.list .course .pic { width: 120px; flex: none; aspect-ratio: 16/10; font-size: 1.4rem; }
.courses.list .course .body { flex-direction: row; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; padding: .5rem .8rem; }
.courses.list .course .t { flex: 1 1 200px; }
.courses.list .bar { width: 120px; }
.courses.list .course .b { margin: 0; padding: 0; }

/* lesson video + quiz inside the stage */
#lessonVid { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.quiz { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: center; gap: .8rem; padding: 1.4rem;
  background: radial-gradient(120% 80% at 80% 0%, #3a1f1c, #141218 60%); color: #fff; }
.quiz .k { font: 600 .85rem Fredoka, sans-serif; color: #ffb4a3; letter-spacing: .5px; }
.quiz h3 { font: 600 1.45rem/1.3 Fredoka, sans-serif; margin: 0 0 .4rem; }
.quiz .o { text-align: left; border: 2px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); color: #fff; border-radius: 16px; padding: .85rem 1rem;
  font-size: 1.02rem; font-weight: 600; cursor: pointer; min-height: 52px; }
.quiz .o:hover { border-color: #fff; }
.quiz .o.right { background: #1f7a4f; border-color: #34d399; }
.quiz .o.wrong { background: #7a2a1f; border-color: #ff6b6b; }
.quiz .why { background: rgba(255,255,255,.1); border-radius: 12px; padding: .7rem .9rem; font-size: .95rem; }
.quiz .next { align-self: center; margin-top: .4rem; }
.actions [data-for="course"], .actions [data-for="lesson"] { display: none; }
.actions[data-kind="lesson"] [data-for="yt"], .actions[data-kind="quiz"] [data-for="yt"] { display: none; }
.actions[data-kind="lesson"] [data-for="lesson"], .actions[data-incourse="1"] [data-for="course"] { display: flex; }
.actions[data-kind="quiz"] [data-a="mute"] { display: none; }
.stage-cap .lesson-tag { display: inline-block; background: var(--clay); color: #fff; border-radius: 999px; padding: .15rem .6rem; font-size: .75rem; font-weight: 700; margin-bottom: .35rem; }

/* ask + sources */
.answers { display: flex; flex-direction: column; gap: .8rem; margin-top: .6rem; }
.qa { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; }
.qa .q { font-weight: 700; margin-bottom: .3rem; }
.qa .a p { margin: .3rem 0; } .qa .a ul { margin: .3rem 0; padding-left: 1.2rem; }
.qa .tools { display: flex; gap: .4rem; margin-top: .4rem; }
.sources { display: grid; gap: 1rem; }
.src { display: flex; gap: 1rem; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: .8rem; }
.src img { width: min(320px, 100%); border-radius: 10px; background: #fff; }
.src .tx { flex: 1 1 240px; display: flex; flex-direction: column; gap: .4rem; }
.src .tx pre { white-space: pre-wrap; font: .88rem/1.45 "Hanken Grotesk", sans-serif; margin: 0; color: var(--muted); max-height: 220px; overflow: auto; }
.cr-lessons { display: grid; gap: .5rem; margin-top: .8rem; }
.cr-lesson { display: flex; align-items: center; gap: .8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem; cursor: pointer; }
.cr-lesson img { width: 48px; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; background: var(--chip); }
.cr-lesson .t { flex: 1; font-weight: 600; } .cr-lesson .m { color: var(--muted); font-size: .82rem; }
.cr-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
@media (max-width: 700px) {
  .learn-hero .mascot { width: 64px; height: 64px; }
  .learn-input { flex-wrap: wrap; border-radius: 18px; }
  .learn-input input { flex: 1 1 100%; }
  .learn-input .clay-btn { flex: 1; }
  .courses { grid-template-columns: 1fr; }
  .quiz h3 { font-size: 1.25rem; }
}
.cr-lesson .ph { width: 48px; aspect-ratio: 9/16; border-radius: 6px; background: var(--chip); display: grid; place-items: center; font-size: 1rem; }

/* ---------- library counts (Home), AI summary, following ---------- */
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; padding-top: .8rem; }
.count { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; cursor: pointer; text-align: left;
  border: 1px solid var(--line); border-radius: 16px; padding: .7rem .9rem; background: var(--bg2); color: var(--text);
  transition: transform .16s cubic-bezier(.34,1.56,.64,1); }
.count:active { transform: scale(.96); }
.count i { font-style: normal; color: var(--clay); font-size: 1.05rem; }
.count b { font: 700 1.6rem/1.1 Fredoka, sans-serif; }
.count span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.count.on { border-color: var(--clay); box-shadow: inset 0 0 0 1px var(--clay); }
.qa.summary { margin: .6rem 0 .8rem; border-color: var(--clay); }
#followCard { margin-top: 1.2rem; }
#followCard .big-input { margin: .6rem 0; }
@media (max-width: 700px) { .counts { gap: .4rem; } .count { padding: .55rem .6rem; } .count b { font-size: 1.3rem; } .count span { font-size: .75rem; } }
.login-card .apple { margin-top: .6rem; background: #000; color: #fff; border-color: #333; }
[data-theme="light"] .login-card .apple { background: #000; color: #fff; }

/* sound first: a lesson whose video is still being made plays its narration over a live card */
.making { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 1.1rem;
  padding: 4.5rem 1.4rem 6rem; color: #fff6e8; pointer-events: none; overflow: hidden;
  background: radial-gradient(circle at 85% 8%, #3a2226 0 22%, transparent 23%), radial-gradient(circle at 8% 92%, #1e2236 0 24%, transparent 25%), linear-gradient(#18141e, #0c0c10); }
.making::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#2a2630 1.5px, transparent 1.6px); background-size: 28px 28px; opacity: .8; z-index: -1; }
.mk-tag { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #fff6e8; color: #2a211b;
  border-radius: 999px; padding: .4rem .9rem; font-weight: 700; font-size: .85rem; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.mk-tag i { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--clay, #e5533d); margin-right: .35rem; animation: mkPulse 1s infinite alternate; }
@keyframes mkPulse { from { opacity: .3; transform: scale(.8); } to { opacity: 1; transform: scale(1.15); } }
.mk-head { font-family: Fredoka, sans-serif; font-size: clamp(1.6rem, 6.5vw, 2.3rem); line-height: 1.15; margin: 0; }
.mk-items { display: flex; flex-direction: column; gap: .55rem; }
.mk-items span { display: flex; align-items: center; gap: .65rem; background: #fff6e8; color: #2a211b; border-radius: 16px; padding: .6rem .8rem;
  font-weight: 600; font-size: 1.02rem; animation: mkIn .35s ease-out both; }
.mk-items span b { flex: none; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--clay, #e5533d); color: #fff; font-size: .9rem; }
@keyframes mkIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.mk-cap { margin: auto 0 0; text-align: center; font-family: Fredoka, sans-serif; font-weight: 600; font-size: clamp(1.25rem, 5vw, 1.6rem); line-height: 1.3;
  color: #fff; -webkit-text-stroke: 5px #000; paint-order: stroke fill; }
.mk-cap em { font-style: normal; color: #ffd666; }
@media (max-width: 700px) {   /* phone: the course chips sit over the top of the stage */
  .making { padding: 8.2rem 5.2rem 6.5rem 1.2rem; }
  .mk-tag { top: 5.2rem; left: 1.2rem; transform: none; }
}

/* ---------- playlists ---------- */
.pl-head h3 { margin: 1rem 0 .4rem; font-size: 1.05rem; }
.pl-shelf { display: flex; gap: 12px; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: none; }
.pl-shelf::-webkit-scrollbar { display: none; }
.pl-card { flex: 0 0 140px; border: 1px solid var(--line); background: var(--raise); border-radius: 14px; padding: 0; cursor: pointer; text-align: left; color: var(--text); overflow: hidden; }
.pl-card.on { outline: 3px solid var(--clay); }
.pl-card .cv { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: grid; place-items: center; background: var(--chip); font-size: 2rem; }
.pl-card b { display: block; padding: .5rem .6rem 0; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card span { display: block; padding: 0 .6rem .55rem; color: var(--muted); font-size: .8rem; }
.pl-card.new .cv { font-size: 2.4rem; color: var(--clay); }
.pl-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: .2rem 0 1rem; }
.pl-pick { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 .2rem; }
.pl-list { display: grid; gap: .5rem; margin: .4rem 0 1rem; }
.pl-row { display: flex; align-items: center; gap: .8rem; width: 100%; border: 1px solid var(--line); background: var(--bg2); color: var(--text); border-radius: 14px; padding: .55rem .7rem; cursor: pointer; text-align: left; min-height: 60px; font-size: 1rem; }
.pl-row:hover { background: var(--chip); }
.pl-row img, .pl-row .ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--chip); display: grid; place-items: center; flex: 0 0 auto; }
.pl-row b { flex: 1; }
.pl-row .muted { font-size: .85rem; }
.pl-row .ck { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; }
.pl-row.in .ck { background: var(--clay); border-color: var(--clay); color: #fff; }
.item .order { position: absolute; top: 38px; right: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.item .order button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.55); color: #fff; font-size: 1.1rem; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.item .order button:disabled { visibility: hidden; }
