/* LearnHub: a direct port of the Deste app's SwiftUI look (Theme.swift, Cards/Shared.swift,
   DeckView.swift, HomeView.swift). Sizes, radii, tracking and colours are the app's own.
   Loaded AFTER styles.css on new pages and the home page only; Support/Privacy never load it. */

:root {
  --bg: #f3f4fb;           /* Theme.bg   */
  --card: #ffffff;         /* Theme.card */
  --ink: #141a33;          /* Theme.ink  */
  --mut: #5d6483;          /* Theme.mut  */
  --line: #e0e4f2;         /* Theme.line */
  --blue: #2540f0; --orange: #e9702b; --purple: #6d3cf0; --green: #1f9a74;
  --pink: #d92d82; --red: #d8423b; --navy: #2b2d4a;
  --indigo: #3730a3;       /* Theme.accent("navy") */
  --lime: #c8f56a; --lime-ink: #16210a;
  --progress: linear-gradient(90deg, #e9702b, #f5a524);
  --ac: var(--blue);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 420' preserveAspectRatio='none'%3E%3Cpath d='M-20 300 C 180 210 380 360 620 270 S 1000 150 1240 240' fill='none' stroke='white' stroke-opacity='.13' stroke-width='84' stroke-linecap='round'/%3E%3Cpath d='M-20 380 C 220 320 420 410 700 340 S 1040 300 1240 350' fill='none' stroke='white' stroke-opacity='.07' stroke-width='60' stroke-linecap='round'/%3E%3C/svg%3E");
  --spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.8 7 17 11.2 24 12 17 12.8 12.8 17 12 24 11.2 17 7 12.8 0 12 7 11.2 11.2 7 12 0Z' fill='%23bff7e0'/%3E%3C/svg%3E");
}
.ac-blue { --ac: #2540f0; } .ac-orange { --ac: #e9702b; } .ac-purple { --ac: #6d3cf0; }
.ac-green { --ac: #1f9a74; } .ac-pink { --ac: #d92d82; } .ac-navy { --ac: #3730a3; }

body.hub { background: var(--bg); color: var(--ink); }
.col { width: min(560px, calc(100% - 32px)); margin: 0 auto; }
.col-wide { width: min(820px, calc(100% - 32px)); margin: 0 auto; }
.hub-main { padding: 14px 0 64px; min-height: 80vh; }
.stack { display: flex; flex-direction: column; gap: 14px; }
button { font-family: inherit; }
.k { font-weight: 800; }

/* ---------- Bilingual labels: "Learn · Öğren" ---------- */
.bi .en { color: var(--ac); } .bi .sep, .bi .tr { color: var(--mut); }

/* ---------- Header row (LearnView.header) ---------- */
.app-head { display: flex; align-items: center; gap: 8px; }
.sq-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px;
  background: var(--card); color: var(--ink); text-decoration: none; border: 0; cursor: pointer;
}
.sq-btn svg { width: 18px; height: 18px; }
.app-head .ttl { flex: 1; min-width: 0; }
.app-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; margin: 0; color: var(--ink); }
.app-head .sub { font-size: 13px; font-weight: 600; color: var(--mut); }
.pill-outlined {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 14px; font-size: 15px; font-weight: 800; color: var(--ink); background: transparent;
}
.pill-outlined svg { width: 16px; height: 16px; color: var(--mut); }
.pill-outlined.hot svg { color: var(--orange); }

.search { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--mut); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink); min-width: 0; }
.search svg { width: 18px; height: 18px; }

/* ---------- Today card ---------- */
.today { background: var(--card); border-radius: 24px; padding: 16px; box-shadow: 0 5px 10px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 14px; }
.today-row { display: flex; align-items: center; gap: 16px; }
.ring { width: 78px; height: 78px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring .bg { stroke: var(--line); } .ring .fg { stroke: var(--orange); transition: stroke-dashoffset .9s cubic-bezier(.3,1.25,.5,1); filter: drop-shadow(0 0 5px rgba(233,112,43,.45)); }
.ring.hit .fg { stroke: var(--green); filter: drop-shadow(0 0 9px rgba(31,154,116,.45)); }
.ring .ico { position: absolute; inset: 0; display: grid; place-items: center; color: var(--orange); font-size: 20px; }
.ring.hit .ico { color: var(--green); }
.today .lab { font-size: 12px; font-weight: 800; letter-spacing: .6px; color: var(--mut); }
.today .num { font-size: 26px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.today .cap { font-size: 13px; font-weight: 600; color: var(--mut); }
.today .cap.hit { color: var(--green); }
.week { margin-left: auto; display: flex; align-items: flex-end; gap: 5px; height: 34px; }
.week i { width: 8px; height: 8px; border-radius: 3px; background: var(--line); transition: height .6s cubic-bezier(.3,1.5,.5,1); }
.week i.some { background: var(--blue); opacity: .75; } .week i.goal { background: var(--green); opacity: .75; } .week i:last-child { opacity: 1; }
.led-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* LEDTile (LEDTiles.swift): near-black base, tone tint .17, 1px tone border .3, 94pt tall */
.led {
  --lit: 111,134,255;
  height: 94px; padding: 8px 10px; border-radius: 14px; display: flex; flex-direction: column; text-align: left; min-width: 0;
  background: linear-gradient(rgba(var(--lit), .17), rgba(var(--lit), .17)), #0b0e1f;
  border: 1px solid rgba(var(--lit), .3);
}
.led.l-blue { --lit: 111,134,255; } .led.l-purple { --lit: 155,123,255; } .led.l-pink { --lit: 255,95,165; }
.led .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; }
.led b { font-size: 34px; line-height: 1.05; font-weight: 800; color: rgb(var(--lit)); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.led svg { width: 17px; height: 17px; margin-top: 4px; flex: none; color: rgba(var(--lit), .9); }
.led .lab { margin-top: auto; font-size: 11px; line-height: 1.25; font-weight: 500; color: #a8b0d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.led .lab span:first-child { display: block; color: #f1f3ff; font-weight: 600; }
.led .nd { margin-top: 3px; font: 500 11px/1.2 ui-monospace, "SF Mono", Menlo, monospace; color: rgb(var(--lit)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.led.zero .nd, .led.zero b { animation: ledblink .65s ease-in-out infinite alternate; }
@keyframes ledblink { from { opacity: 1; } to { opacity: .4; } }

/* ---------- Up next card ---------- */
.upnext {
  display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: 22px; color: #fff;
  background: var(--ac); text-decoration: none; transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.upnext:hover { transform: translateY(-3px); }
.upnext .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.upnext .l { font-size: 12px; font-weight: 800; letter-spacing: .8px; opacity: .85; }
.upnext .n { font-size: 22px; font-weight: 800; line-height: 1.15; }
.upnext .p { font-size: 14px; opacity: .9; }
.upnext .play { width: 38px; height: 38px; flex: none; }

/* ---------- Level groups + topic tiles ---------- */
.group-title { font-size: 13px; font-weight: 800; letter-spacing: .5px; margin: 10px 0 0; color: var(--blue); }
.group-title .tr { color: var(--mut); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  display: flex; flex-direction: column; gap: 6px; min-height: 124px; padding: 14px; border-radius: 20px;
  background: var(--ac); color: #fff; text-decoration: none; box-shadow: 0 5px 10px rgba(0,0,0,.06);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.tile:hover { transform: translateY(-4px); }
.tile .nm { font-size: 17px; font-weight: 800; line-height: 1.15; }
.tile .tr { font-size: 12px; font-weight: 600; opacity: .85; }
.tile .st { margin-top: auto; font-size: 12px; font-weight: 700; }
.tile .bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; }
.tile .bar i { display: block; height: 100%; width: 0; background: #fff; border-radius: inherit; transition: width .5s; }
/* not playable on the web (lives in the Deste app): grayed out, with a lock */
.tile.locked {
  position: relative; background: color-mix(in srgb, var(--mut) 14%, var(--card));
  border: 1.5px dashed var(--line); box-shadow: none; cursor: default;
}
.tile.locked:hover { transform: none; }
.tile.locked .nm, .tile.locked .tr, .tile.locked .st { color: var(--mut); opacity: .85; }
.tile.locked .bar { display: none; }
.tile.locked::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; background: var(--mut); opacity: .7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tile.locked .nm { padding-right: 22px; }
.tile.hide, .lrow.hide, .group.hide { display: none; }

/* ---------- Lesson rows (TopicView) ---------- */
.lrow {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--card);
  text-decoration: none; color: var(--ink); box-shadow: 0 5px 10px rgba(0,0,0,.05); border: 1px solid transparent;
}
.lrow .dot { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--ac); color: #fff; display: grid; place-items: center; font-weight: 800; }
.lrow .tx { flex: 1; min-width: 0; }
.lrow .nm { font-size: 17px; font-weight: 800; line-height: 1.2; }
.lrow .tr { font-size: 13px; font-weight: 600; color: var(--mut); }
.lrow .go { color: var(--mut); font-size: 13px; font-weight: 800; white-space: nowrap; }
.lrow .go b { color: var(--green); }
.lrow.locked { opacity: .78; background: transparent; border: 1px dashed var(--line); box-shadow: none; }
.lrow.locked .dot { background: var(--line); color: var(--mut); }

/* ---------- App band ---------- */
.app-band {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 18px;
  padding: 22px; border-radius: 24px; background: var(--ink); color: #fff;
}
.app-band h2 { font-size: 21px; font-weight: 800; letter-spacing: -.4px; margin: 0; color: #fff; }
.app-band p { margin: 6px 0 0; color: #b9bff0; font-size: 15px; font-weight: 600; max-width: 380px; }
.app-band .go { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 14px; background: var(--lime); color: var(--lime-ink); font-weight: 800; font-size: 17px; text-decoration: none; }

/* ---------- Sheet + components (Cards/Shared.swift) ---------- */
.sheet { background: var(--card); border-radius: 28px; padding: 22px 18px; box-shadow: 0 5px 10px rgba(0,0,0,.06); }
.eyebrow-bi { font-size: 13px; font-weight: 800; letter-spacing: .5px; }
.sheet-title { padding: 4px 0 10px; }
.sheet-title h2 { font-size: 30px; font-weight: 800; letter-spacing: -.6px; line-height: 1.1; margin: 0; color: var(--ink); }
.sheet-title .tr { font-size: 17px; font-weight: 600; color: var(--mut); margin-top: 4px; }
.sheet-body { display: flex; flex-direction: column; gap: 10px; }
.body-txt { font-size: 17px; line-height: 1.45; margin: 0; }
.rich-a { color: var(--ac); font-weight: 800; } .rich-r { color: var(--red); font-weight: 800; } .rich-b { color: var(--blue); font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 44px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: transparent;
  font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left;
}
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.side-lab { font-size: 12px; font-weight: 800; letter-spacing: .8px; margin: 2px 0 8px; }
.panel { border-radius: 20px; padding: 16px; font-size: 17px; font-weight: 700; line-height: 1.4; animation: fadeIn .25s ease both; }
.whybox { border-radius: 14px; padding: 12px 14px; font-size: 16px; line-height: 1.4; animation: fadeIn .25s ease both; }
.outlined { border: 1px solid var(--line); border-radius: 16px; background: transparent; }
.act-btn { min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 17px; font-weight: 700; cursor: pointer; align-self: flex-start; }
.act-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.act-btn.wide { align-self: stretch; }

/* segment (ConceptCard.segment) */
.seg { text-align: left; width: 100%; padding: 12px 14px; cursor: pointer; background: transparent; border: 1px solid var(--line); border-radius: 16px; transition: border-color .2s, background .2s; }
.seg .h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: .8px; }
.seg .tx { font-size: 18px; font-weight: 600; line-height: 1.35; color: var(--ink); margin-top: 4px; }
.seg.open { border-width: 2px; padding: 11px 13px; }
.seg-note { font-size: 15px; font-weight: 600; padding: 6px 6px 0; animation: fadeIn .25s ease both; }

/* options (RapidCard/PickCard/MatchCard) */
.opt {
  display: block; width: 100%; text-align: left; min-height: 50px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 16px;
  background: transparent; font-size: 18px; font-weight: 700; color: var(--ink); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.opt:hover:not(:disabled) { border-color: #c3cae6; }
.opt.ok { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.opt.no { border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.opt:disabled { cursor: default; }
.q { font-size: 21px; font-weight: 700; line-height: 1.3; min-height: 84px; }
.q.compact { font-size: 16px; min-height: 0; }
.segbar { display: flex; gap: 6px; }
.segbar i { flex: 1; height: 6px; border-radius: 99px; background: var(--line); transition: background .25s; }
.segbar i.done { background: var(--ac); } .segbar i.cur { background: color-mix(in srgb, var(--ac) 45%, transparent); }

/* match */
.pairs { display: flex; gap: 10px; align-items: flex-start; }
.pairs .col2 { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.mtile { min-height: 48px; padding: 4px 8px; font-size: 15px; font-weight: 700; text-align: center; border: 2px solid var(--line); border-radius: 16px; background: transparent; color: var(--ink); cursor: pointer; width: 100%; }
.mtile.sel { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 10%, transparent); }
.mtile.m { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); cursor: default; }
.mtile.bad { border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); animation: shake .35s; }
.prompt { font-size: 19px; font-weight: 700; margin: 0; }

/* sort */
.progress-row { display: flex; align-items: center; gap: 8px; }
.progress-row .cap { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-row .cap i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--pink)); transition: width .3s; }
.progress-row b { font-size: 13px; font-weight: 700; color: var(--mut); font-variant-numeric: tabular-nums; }
.sortitem { padding: 18px; min-height: 130px; font-size: 20px; font-weight: 600; border: 1px solid var(--line); border-radius: 18px; animation: slideIn .3s cubic-bezier(.3,1,.5,1) both; }
.sortitem.wrong { border: 2px solid var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); animation: shake .35s; }
.buckets { display: flex; gap: 10px; }
.bucket { flex: 1; min-height: 70px; padding: 8px; border: 0; border-radius: 16px; color: #fff; font-size: 15px; font-weight: 800; white-space: pre-line; cursor: pointer; }
.bucket.b0 { background: var(--blue); } .bucket.b1 { background: var(--orange); }

/* flip */
.fliptile {
  display: block; width: 100%; text-align: left; min-height: 64px; padding: 8px 14px; border-radius: 18px; cursor: pointer;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--ac) 8%, transparent); color: var(--ink);
  transition: transform .45s cubic-bezier(.3,1.35,.5,1), background .2s, border-color .2s;
}
.fliptile.on { transform: rotateX(360deg); background: var(--ac); border-color: var(--ac); color: #fff; }
.fliptile .h { font-size: 12px; font-weight: 600; color: var(--mut); }
.fliptile.on .h { color: rgba(255,255,255,.8); }
.fliptile .m { font-size: 19px; font-weight: 800; margin-top: 4px; }
.fliptile .e { font-size: 15px; font-weight: 500; color: rgba(255,255,255,.92); margin-top: 6px; }
.cap-small { font-size: 13px; font-weight: 700; color: var(--mut); margin-top: 2px; }

/* cheat */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills span { padding: 6px 10px; border-radius: 99px; font-size: 14px; font-weight: 600; background: color-mix(in srgb, var(--ac) 10%, transparent); }

/* rule box under the sheet (DeckView.page) */
.rulebox { background: var(--navy); color: var(--bg); border-radius: 16px; padding: 12px 14px; font-size: 16px; line-height: 1.4; }

/* ---------- Deck chrome (DeckView.top / foot) ---------- */
.deck { display: flex; flex-direction: column; min-height: calc(100dvh - 64px); }
.deck-top { display: flex; align-items: center; gap: 10px; padding: 8px 0 6px; }
.deck-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.deck-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: var(--progress); overflow: hidden; transition: width .4s ease-out; }
.deck-bar i::after { content: ""; position: absolute; top: 0; bottom: 0; width: 50%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: sweep 1.6s linear infinite; }
.deck-n { min-width: 44px; text-align: right; font-size: 13px; font-weight: 700; color: var(--mut); font-variant-numeric: tabular-nums; }
.deck-stage { flex: 1; padding: 4px 0 8px; touch-action: pan-y; }
.page { display: flex; flex-direction: column; gap: 12px; animation: pageIn .32s cubic-bezier(.3,1,.5,1) both; }
.page.back { animation-name: pageInBack; }
.deck-foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 8px 0 12px; background: linear-gradient(180deg, transparent, var(--bg) 28%); }
.nav-btn { flex: 1; min-height: 52px; border: 0; border-radius: 16px; font-size: 17px; font-weight: 800; cursor: pointer; }
.nav-btn.back { background: var(--card); color: var(--ink); }
.nav-btn.next { background: var(--ink); color: var(--bg); }
.nav-btn:disabled { opacity: .35; cursor: default; }

/* score page */
.score-n { font-size: 64px; font-weight: 800; text-align: center; color: var(--ac); line-height: 1.1; }
.party { text-align: center; font-size: 34px; animation: bounce .7s ease both; }
.center { text-align: center; } .mut { color: var(--mut); font-size: 17px; }
.goalok { text-align: center; font-size: 14px; font-weight: 800; color: var(--green); }
.missed-lab { font-size: 13px; font-weight: 800; color: var(--mut); margin-bottom: 6px; }
.missed-chip { display: inline-block; margin: 0 6px 6px 0; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); font-size: 13px; font-weight: 700; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; padding: 16px 18px; border-radius: 18px; background: var(--ink); color: #fff; font-weight: 800; }
.cta small { display: block; font-weight: 600; color: #b9bff0; margin-top: 2px; }
.cta .arrow { color: var(--lime); font-size: 20px; }

/* daily question */
.daily { display: flex; flex-direction: column; gap: 12px; }
.daily .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.daily .streak { display: inline-flex; gap: 5px; align-items: center; padding: 5px 11px; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; font-weight: 800; }
.daily .streak svg { width: 15px; height: 15px; color: var(--mut); } .daily .streak.on svg { color: var(--orange); }
.daily .more { font-weight: 800; color: var(--blue); text-decoration: none; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pageIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes pageInBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@keyframes bounce { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }


/* ---------- Dark theme: follows the browser setting; <html data-theme="light|dark"> (set by the header switch) overrides ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1020; --card: #1a1e38; --ink: #f1f3ff; --mut: #9ea5c9; --line: #2c3153;
    --blue: #6f86ff; --orange: #ff9156; --purple: #9b7bff; --green: #3fc79c; --pink: #ff5fa5; --red: #ff6b62;
    --navy: #b9bff0; --indigo: #6366f1;
    --surface: #0d1020; --muted: #9ea5c9;
    --progress: linear-gradient(90deg, #ff9156, #ffb84d);
    --mint: #1e4a3d; --cream: #3a2f1f; --lavender: #2f2750;
  }
  :root:not([data-theme="light"]) .ac-blue { --ac: #6f86ff; } :root:not([data-theme="light"]) .ac-orange { --ac: #ff9156; } :root:not([data-theme="light"]) .ac-purple { --ac: #9b7bff; }
  :root:not([data-theme="light"]) .ac-green { --ac: #3fc79c; } :root:not([data-theme="light"]) .ac-pink { --ac: #ff5fa5; } :root:not([data-theme="light"]) .ac-navy { --ac: #6366f1; }
  :root:not([data-theme="light"]) .site-header { background: color-mix(in srgb, #0d1020 84%, transparent); }
  /* transparent wordmark: swap to the light-lettered variant on dark */
  :root:not([data-theme="light"]) .logo-l { display: none; }
  :root:not([data-theme="light"]) .logo-d { display: block; }
  :root:not([data-theme="light"]) :is(.sheet, .today, .lrow, .sq-btn, .search) { box-shadow: none; }
  :root:not([data-theme="light"]) .opt:hover:not(:disabled) { border-color: #4a5185; }
  :root:not([data-theme="light"]) :is(.app-band, .cta) { background: #1a1e38; }
  :root:not([data-theme="light"]) :is(.upnext, .tile) { color: #fff; }
}
@media all {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d1020; --card: #1a1e38; --ink: #f1f3ff; --mut: #9ea5c9; --line: #2c3153;
    --blue: #6f86ff; --orange: #ff9156; --purple: #9b7bff; --green: #3fc79c; --pink: #ff5fa5; --red: #ff6b62;
    --navy: #b9bff0; --indigo: #6366f1;
    --surface: #0d1020; --muted: #9ea5c9;
    --progress: linear-gradient(90deg, #ff9156, #ffb84d);
    --mint: #1e4a3d; --cream: #3a2f1f; --lavender: #2f2750;
  }
  :root[data-theme="dark"] .ac-blue { --ac: #6f86ff; } :root[data-theme="dark"] .ac-orange { --ac: #ff9156; } :root[data-theme="dark"] .ac-purple { --ac: #9b7bff; }
  :root[data-theme="dark"] .ac-green { --ac: #3fc79c; } :root[data-theme="dark"] .ac-pink { --ac: #ff5fa5; } :root[data-theme="dark"] .ac-navy { --ac: #6366f1; }
  :root[data-theme="dark"] .site-header { background: color-mix(in srgb, #0d1020 84%, transparent); }
  /* transparent wordmark: swap to the light-lettered variant on dark */
  :root[data-theme="dark"] .logo-l { display: none; }
  :root[data-theme="dark"] .logo-d { display: block; }
  :root[data-theme="dark"] :is(.sheet, .today, .lrow, .sq-btn, .search) { box-shadow: none; }
  :root[data-theme="dark"] .opt:hover:not(:disabled) { border-color: #4a5185; }
  :root[data-theme="dark"] :is(.app-band, .cta) { background: #1a1e38; }
  :root[data-theme="dark"] :is(.upnext, .tile) { color: #fff; }
}

/* ---------- Light/dark switch (theme.js) ---------- */
.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-left: 6px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.theme-toggle:hover { transform: scale(1.06); border-color: var(--blue); }
.theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 520px) { .theme-toggle { width: 28px; height: 28px; margin-left: 2px; } .theme-toggle svg { width: 15px; height: 15px; } }

/* ---------- Marketing "scene" (home hero, store-art look) ---------- */
.scene { position: relative; overflow: hidden; isolation: isolate; color: #fff; background: linear-gradient(155deg, #6a3df0 0%, #4a35de 48%, #2f56d6 100%); }
.scene.blue { background: linear-gradient(155deg, #3b3fe0 0%, #2763d4 55%, #1c85b8 100%); }
.scene::before, .hero.scene::before {
  content: ""; position: absolute; inset: 0; z-index: -1; width: auto; height: auto; border-radius: 0; filter: none; opacity: 1; animation: none;
  background: var(--wave) center / cover no-repeat, radial-gradient(circle at 88% 8%, rgba(255,255,255,.12) 0 24%, transparent 25%);
}
.scene::after, .hero.scene::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; width: auto; height: auto; border-radius: 0; filter: none; opacity: 1;
  background-image: var(--spark), var(--spark), var(--spark), var(--spark); background-size: 22px, 13px, 18px, 11px;
  background-position: 9% 26%, 91% 66%, 66% 12%, 40% 88%; background-repeat: no-repeat; animation: twinkle 4.5s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .55; } }
.scene h1, .scene h2 { color: #fff; font-weight: 800; }
.scene .lead, .scene .section-head p { color: rgba(255,255,255,.88); }
.scene .kicker, .scene .section-head .kicker { color: #a8f0d0; }
.scene .gradient-text { background: none; -webkit-text-fill-color: var(--lime); color: var(--lime); animation: none; }
.scene .btn-primary { background: var(--lime); color: var(--lime-ink); box-shadow: 0 12px 24px -12px rgba(0,0,0,.45); }
.scene .btn-ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.4); }
.scene .eyebrow { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); box-shadow: none; }
.scene .chip-f, .scene .chip { color: var(--ink); }
.try-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.crumbs-hub { display: none; }

@media (max-width: 820px) { .try-grid { grid-template-columns: 1fr; gap: 28px; } }
@media (max-width: 520px) {
  .site-header .wrap { gap: 6px; width: calc(100% - 24px); }
  .brand img { height: 22px; }
  .nav { gap: 0; }
  .nav a { padding: 6px 4px; font-size: .74rem; }
}
}
@media (prefers-reduced-motion: reduce) {
  .deck-bar i::after, .scene::after { animation: none; }
  .page, .sortitem, .panel, .whybox { animation: none; }
}
.upnext .play { color: var(--ac); }

/* the original hero's blurred blobs must not tint the scene */
.hero.scene::before, .hero.scene::after { background-color: transparent; }
.hero.scene p.lead { color: rgba(255,255,255,.9); }
.hero.scene .chip { background: #fff; color: #141a33; border-color: #e3e6f3; }
.hero.scene .chip small { color: #5b6285; }
.hero.scene .chip .bar { background: #e3e6f3; }
.brand .logo-d { display: none; }
/* white pill on the gradient stays readable in dark: the dark theme turns --ink light */
.contact a.btn-light { color: #141a33; }


/* ---------- Stickers (store-art look) ---------- */
.sticker {
  display: inline-block; font-weight: 900; letter-spacing: -.01em; background: var(--lime); color: var(--lime-ink);
  padding: 6px 14px; border-radius: 14px; transform: rotate(-6deg); box-shadow: 0 10px 20px -10px rgba(0,0,0,.45); white-space: nowrap;
}
.sticker.pop { animation: pop .38s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes pop { from { transform: rotate(-14deg) scale(.3); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }

/* ---------- Deste page hero ---------- */
.dhero { padding: 40px 0 48px; }
.dhero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.dhero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); letter-spacing: -.04em; line-height: 1.04; margin: 14px 0 14px; color: #fff; }
.dhero .lead { color: rgba(255,255,255,.9); font-size: 1.12rem; max-width: 520px; margin: 0 0 24px; }
.dhero .led-row { max-width: 460px; margin-top: 26px; }
.dhero .led { height: 88px; }
.demo-wrap { position: relative; display: grid; place-items: center; padding: 8px 0 12px; }
.demo-wrap .float-a { position: absolute; top: 6%; right: 2%; z-index: 3; animation: float 6s ease-in-out infinite; }
.demo-wrap .float-b { position: absolute; bottom: 12%; left: 0; z-index: 3; animation: float 7s ease-in-out -3s infinite; }
.pillfloat { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 16px; background: var(--card); color: var(--ink); font-weight: 800; box-shadow: 0 16px 30px -14px rgba(0,0,0,.5); }
.pillfloat svg { width: 16px; height: 16px; color: var(--orange); }
@keyframes float { 50% { transform: translateY(-10px); } }

/* phone + demo (scaled-down app components) */
.phone { width: 292px; padding: 10px; border-radius: 46px; background: #0b0e1f; box-shadow: 0 50px 80px -34px rgba(0,0,0,.65), inset 0 0 0 2px #2a2f55; transform: rotate(2.5deg); }
.phone-in { position: relative; height: 580px; border-radius: 37px; background: var(--bg); overflow: hidden; padding: 40px 12px 10px; display: flex; flex-direction: column; color: var(--ink); }
.phone-in::before { content: ""; position: absolute; top: 9px; left: 50%; width: 84px; height: 22px; margin-left: -42px; border-radius: 99px; background: #05060f; z-index: 4; }
.d-top { display: flex; align-items: center; gap: 8px; padding: 2px 0 8px; }
.d-home { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--card); }
.d-home svg { width: 14px; height: 14px; }
.d-bar { flex: 1; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.d-bar i { display: block; height: 100%; width: 7%; border-radius: inherit; background: var(--progress); transition: width .6s ease-out; }
.d-n { font-size: 11px; font-weight: 700; color: var(--mut); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.d-stage { flex: 1; overflow: hidden; }
.d-page { display: flex; flex-direction: column; gap: 9px; animation: pageIn .45s cubic-bezier(.3,1,.5,1) both; }
.d-sheet { background: var(--card); border-radius: 22px; padding: 16px 14px; box-shadow: 0 4px 8px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 8px; }
.d-sheet .eb { font-size: 10.5px; font-weight: 800; letter-spacing: .4px; } .d-sheet .eb .en { color: var(--blue); } .d-sheet .eb .tr { color: var(--mut); }
.d-sheet h4 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; color: var(--ink); }
.d-sheet .trs { font-size: 13px; font-weight: 600; color: var(--mut); margin-top: -4px; }
.d-sheet .lab { font-size: 10px; font-weight: 800; letter-spacing: .7px; } .d-sheet .lab.b { color: var(--blue); }
.d-sheet .chips { display: flex; flex-wrap: wrap; gap: 5px; }
.d-sheet .c { min-height: 34px; padding: 0 9px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; font-size: 12px; font-weight: 700; transition: background .2s, color .2s; }
.d-sheet .c.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.d-sheet .panel { padding: 12px; border-radius: 16px; font-size: 13.5px; font-weight: 700; line-height: 1.4; background: color-mix(in srgb, var(--blue) 10%, transparent); }
.d-sheet em, .d-sheet .q em { font-style: normal; color: var(--blue); }
.d-rule { background: var(--navy); color: var(--bg); border-radius: 13px; padding: 10px 12px; font-size: 12.5px; line-height: 1.4; }
.d-sheet .segbar { display: flex; gap: 5px; } .d-sheet .segbar i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.d-sheet .segbar i.done { background: var(--blue); } .d-sheet .segbar i.cur { background: color-mix(in srgb, var(--blue) 45%, transparent); }
.d-sheet .q { font-size: 16px; font-weight: 700; line-height: 1.3; min-height: 62px; }
.d-sheet .blank { display: inline-block; min-width: 2.8ch; border-bottom: 3px solid var(--blue); color: transparent; }
.d-sheet .o { position: relative; min-height: 40px; padding: 0 12px; display: flex; align-items: center; border: 2px solid var(--line); border-radius: 13px; font-size: 14.5px; font-weight: 700; transition: background .2s, border-color .2s; }
.d-sheet .o.ok { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.d-sheet .o .sticker { position: absolute; right: 8px; top: 50%; margin-top: -15px; font-size: 12.5px; padding: 5px 11px; }
.d-sheet .why, .d-today .why { padding: 9px 11px; border-radius: 12px; font-size: 12.5px; line-height: 1.35; background: color-mix(in srgb, var(--green) 10%, transparent); animation: fadeIn .3s ease both; }
.d-sheet .pairs { display: flex; gap: 8px; } .d-sheet .pairs > div { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.d-sheet .m { min-height: 42px; display: grid; place-items: center; text-align: center; padding: 3px 6px; border: 2px solid var(--line); border-radius: 13px; font-size: 12px; font-weight: 700; transition: all .2s; }
.d-sheet .m.sel { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.d-sheet .m.done { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.d-foot { display: flex; gap: 8px; padding-top: 8px; }
.d-btn { flex: 1; text-align: center; padding: 11px 4px; border-radius: 13px; font-size: 12.5px; font-weight: 800; }
.d-btn.b { background: var(--card); } .d-btn.n { background: var(--ink); color: var(--bg); }
.d-cursor { position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: rgba(37,64,240,.28); border: 2px solid var(--blue); opacity: 0; z-index: 5; pointer-events: none; transition: transform .6s cubic-bezier(.4,0,.2,1), opacity .25s; }
.d-cursor.tap { background: rgba(37,64,240,.6); }
.d-today { background: var(--card); border-radius: 22px; padding: 14px; box-shadow: 0 4px 8px rgba(0,0,0,.06); }
.d-trow { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.d-ring { width: 64px; height: 64px; flex: none; } .d-ring svg { width: 100%; height: 100%; }
.d-today .lab { font-size: 10px; font-weight: 800; letter-spacing: .6px; color: var(--mut); }
.d-today .big { font-size: 23px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.d-today .cap { font-size: 11px; font-weight: 600; color: var(--mut); }
.d-flame { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 12px; font-weight: 800; font-size: 13px; }
.d-flame svg { width: 14px; height: 14px; color: var(--orange); }
.d-flame.pop { animation: flamepop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes flamepop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.demo-wrap .led { height: 78px; padding: 6px 8px; }
.demo-wrap .led b, .d-today .led b { font-size: 24px; }
.d-today .led-row { gap: 6px; }
.d-today .led .lab { font-size: 10px; } .d-today .led .top svg { display: none; }

.deste-feats .cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (max-width: 820px) {
  .dhero-grid { grid-template-columns: 1fr; gap: 28px; }
  .phone { transform: none; }
  .dhero { padding: 28px 0 32px; }
}
@media (prefers-reduced-motion: reduce) { .demo-wrap .float-a, .demo-wrap .float-b, .d-flame.pop { animation: none; } }
.deck-stage { overflow-x: clip; }
body.hub { overflow-x: clip; }

/* ---------- Document pages (Support, Privacy): the app's white-sheet look ---------- */
main.doc {
  width: min(760px, calc(100% - 32px)); max-width: none; margin: 22px auto 56px; padding: 26px 28px 36px;
  background: var(--card); border-radius: 28px; box-shadow: 0 5px 10px rgba(0,0,0,.06);
}
main.doc h1 { font-size: clamp(1.7rem, 4.5vw, 1.9rem); font-weight: 800; letter-spacing: -.6px; line-height: 1.1; margin: 16px 0 6px; color: var(--ink); }
main.doc h2 { font-size: 1.08rem; font-weight: 800; letter-spacing: -.2px; margin: 1.8rem 0 .3rem; color: var(--ink); }
main.doc p, main.doc li { color: var(--mut); font-size: 1.02rem; line-height: 1.6; }
main.doc a { color: var(--blue); font-weight: 700; }
main.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }
main.doc .crumbs { margin: 0; }
main.doc .crumbs a {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 800; font-size: .95rem;
}
main.doc .lang-switch { margin-top: 16px; padding: 4px; background: transparent; border: 1px solid var(--line); border-radius: 14px; }
main.doc .lang-switch button { border-radius: 10px; font-weight: 700; color: var(--mut); padding: 7px 16px; }
main.doc .lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
@media (max-width: 520px) { main.doc { padding: 20px 18px 28px; border-radius: 24px; } }
.js main.doc hr { display: none; }

/* ---------- Lesson summary, breadcrumbs, SEO copy, FAQ (static, crawlable text) ---------- */
.crumbs-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; font-weight: 700; color: var(--mut); margin: 0 2px 12px; }
.crumbs-trail a { color: var(--mut); text-decoration: none; }
.crumbs-trail a:hover { color: var(--ac, var(--blue)); text-decoration: underline; }
.crumbs-trail [aria-current] { color: var(--ink); }
.stack > .crumbs-trail { margin-bottom: 0; }

.notes { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.notes h2 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2; margin: 0; color: var(--ink); }
.notes .lede { margin: 0; color: var(--mut); font-size: 15px; font-weight: 600; line-height: 1.5; }
.notes .note { border-top: 1px solid var(--line); padding-top: 14px; }
.notes .note h3 { font-size: 16px; font-weight: 800; margin: 0 0 6px; color: var(--ink); }
.notes .note p { margin: 0 0 6px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.notes .note .rule { font-weight: 700; }
.notes ul { margin: 6px 0 0; padding-left: 18px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.notes li + li { margin-top: 4px; }
.notes strong { color: var(--ac, var(--blue)); }
.notes .pat { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; color: var(--ac, var(--blue)); }
.notes .more-app { margin: 0; font-size: 15px; font-weight: 600; color: var(--mut); }
.notes .more-app a, .seo-note a { color: var(--blue); font-weight: 700; }
.notes .others-h { font-size: 13px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--mut); margin: 6px 0 0; border: 0; padding: 0; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.chip-link:hover { border-color: var(--ac, var(--blue)); color: var(--ac, var(--blue)); }

.seo-note { margin: 4px 2px 0; color: var(--mut); font-size: 14px; font-weight: 600; line-height: 1.55; }
.seo-note h2 { font-size: 15px; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.seo-note p { margin: 0; }

.topic-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 4px; }
.topic-links a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 18px; background: var(--card);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .15s ease, border-color .15s ease; }
.topic-links a:hover { transform: translateY(-2px); border-color: var(--ac, var(--blue)); }
.topic-links b { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.topic-links span { font-size: 14px; font-weight: 600; color: var(--mut); }

.faq { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 18px; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 0; font-size: 17px; font-weight: 800; letter-spacing: -.2px; color: var(--ink);
  display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; font-weight: 600; color: var(--mut); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--mut); font-size: 16px; line-height: 1.55; font-weight: 500; }

.tiles.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tiles.two .tile { min-height: 150px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 0; }

/* tighter vertical rhythm than the original 88px (styles.css is frozen, so overridden here) */
section.block { padding: 72px 0; }
@media (max-width: 720px) { section.block { padding: 52px 0; } }
.topic-links a { border-left: 5px solid var(--ac, var(--blue)); }
