/* Mind Space, version 1.1: design by Ibrahim.
   Midnight navy, ivory white, muted violet. Art fades into the top of each screen; type does the rest. */
@font-face { font-family: 'EB Garamond'; src: url('../fonts/eb-garamond-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'EB Garamond'; src: url('../fonts/eb-garamond-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'EB Garamond'; src: url('../fonts/eb-garamond-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'EB Garamond'; src: url('../fonts/eb-garamond-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --navy: #0E1634;
  --ivory: #F7F6F9;
  --paper: #FDFCFA;
  --violet: #7A5C9A;
  --violet-deep: #5E4682;
  --slate: #3F4872;
  --stone: #D8D7DC;
  --brass: #A68C6B;
  --ink: #0E1634;
  --muted: #5D6178;
  --hair: rgba(14, 22, 52, .09);
  --green: #4FA84C;
  --amber: #E79B36;
  --red: #D9454B;
  --grey: #CBCAD2;
  --serif: 'EB Garamond', 'Book Antiqua', Garamond, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --btn: linear-gradient(180deg, #8A6CA8 0%, #5E4682 100%);
  --btn-blue: linear-gradient(180deg, #8696D6 0%, #5A6CB2 100%);
  --fill: linear-gradient(90deg, #6B5BB0 0%, #8A62B8 100%);
  --fill-blue: linear-gradient(90deg, #5B6BB1 0%, #7F90D4 100%);
  --lift: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 14px 34px rgba(14, 22, 52, .08), 0 2px 6px rgba(14, 22, 52, .04);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--serif); font-size: 17px; line-height: 1.5; }
body { min-height: 100vh; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-family: var(--sans); font-size: 15px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.ic { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }
.center { text-align: center; }
.faint { opacity: .4; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.screen { position: relative; max-width: 480px; margin: 0 auto; padding: 20px 20px 124px; display: flex; flex-direction: column; gap: 16px; min-height: 100vh; overflow-x: hidden; isolation: isolate; }
.screen > :not(.hero) { position: relative; }

/* ---------- hero art: Ibrahim's backgrounds in full colour, melting into the page ---------- */
.hero { position: absolute; left: 0; right: 0; top: 0; height: 250px; pointer-events: none; z-index: -1; overflow: hidden; background: var(--navy); }
.hero::before, .hero::after { content: ''; position: absolute; inset: 0; }
.hero::before { background-position: center; background-size: cover; background-repeat: no-repeat; }
.hero::after { background: linear-gradient(180deg, rgba(14, 22, 52, .38) 0%, rgba(14, 22, 52, .12) 42%, rgba(14, 22, 52, 0) 64%, rgba(247, 246, 249, .55) 84%, var(--ivory) 100%); }
.hero-home { height: 350px; }
.hero-home::before { background-image: url('../assets/bg-skyline.jpg'); background-position: 60% 30%; }
.hero-home::after { background: linear-gradient(180deg, rgba(14, 22, 52, .45) 0%, rgba(14, 22, 52, .1) 40%, rgba(14, 22, 52, .05) 70%, rgba(247, 246, 249, .6) 88%, var(--ivory) 100%); }
.hero-study { height: 215px; }
.hero-study::before { background-image: url('../assets/bg-window.jpg'); background-position: center 42%; }
.hero-review::before { background-image: url('../assets/bg-armillary.jpg'); }
.hero-dusk::before { background-image: url('../assets/bg-chart.jpg'); }
.hero-library::before { background-image: url('../assets/bg-library.jpg'); background-position: 62% 40%; }
.hero-galaxy::before { background-image: url('../assets/bg-galaxy.jpg'); }
.hero .sky, .hero .motif { display: none; }

/* text sitting on the art turns ivory */
.hero ~ .screen-title, .hero ~ .greet h1, .hero ~ .greet .ask, .hero + .orn + .screen-title { color: var(--ivory); text-shadow: 0 2px 18px rgba(14, 22, 52, .55), 0 1px 2px rgba(14, 22, 52, .4); }
.hero ~ .screen-title + .subline { color: rgba(247, 246, 249, .92); text-shadow: 0 1px 10px rgba(14, 22, 52, .6); }
.hero ~ .orn { background: var(--ivory); -webkit-mask: url('../assets/divider.png') center / contain no-repeat; mask: url('../assets/divider.png') center / contain no-repeat; opacity: .85; }
.hero ~ .back { color: var(--ivory); }
.home .mood:not(.on) { background: rgba(253, 252, 250, .16); color: var(--ivory); box-shadow: inset 0 0 0 1px rgba(247, 246, 249, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.screen-title { text-align: center; font-size: 46px; line-height: 1.05; letter-spacing: .005em; margin-top: 74px; }
.screen-title.study-title { margin-top: 58px; font-size: 44px; }
.orn { height: 16px; width: 64%; margin: 0 auto; background: url('../assets/divider.png') center / contain no-repeat; opacity: .8; }
.orn.top { margin-top: 44px; margin-bottom: -6px; }
.orn.bottom { margin-top: -6px; }
.orn.ornate { background-image: url('../assets/divider-ornate.png'); height: 22px; width: 76%; }
.subline { text-align: center; color: var(--muted); font-size: 16.5px; margin-top: -8px; }
.form-title { text-align: center; font-size: 34px; margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 16px; align-self: flex-start; margin-bottom: -60px; z-index: 2; }
.back .ic { width: 18px; height: 18px; }

/* ---------- surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--hair); border-radius: 22px; padding: 20px; box-shadow: var(--lift); display: flex; flex-direction: column; gap: 14px; }
.card.quiet { background: transparent; box-shadow: none; border: 0; padding: 4px 2px; }
.card-head { display: flex; gap: 14px; align-items: center; }
.card-head > .ic { width: 34px; height: 34px; stroke-width: 1.3; color: var(--navy); }
.card-head h2 { font-size: 27px; line-height: 1.1; }
.card-head p { color: var(--muted); font-size: 15.5px; margin-top: 2px; }
.h2 { font-size: 23px; line-height: 1.15; }
.parchment { position: relative; background: url('../assets/tex-parchment.jpg') center / cover; border: 24px solid transparent; border-image: url('../assets/frame-corners.png') 90 / 24px stretch; border-radius: 16px; background-clip: border-box; background-origin: border-box; padding: 6px 8px; box-shadow: 0 16px 34px rgba(80, 60, 30, .14), 0 2px 6px rgba(14, 22, 52, .06); }
.parchment::before { content: ''; position: absolute; inset: -24px; border-radius: 16px; background: rgba(253, 250, 244, .35); pointer-events: none; }
.parchment > * { position: relative; }
.rule { height: 1px; background: var(--hair); margin: 2px 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 16px; border: 0; background: var(--btn); color: #FBFAFD; font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .01em; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .08), 0 8px 18px rgba(94, 70, 130, .28); transition: transform .12s ease, filter .12s ease; text-align: center; }
.btn:active { transform: translateY(1px) scale(.99); filter: brightness(.96); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { min-height: 60px; font-size: 22px; border-radius: 20px; }
.btn.wide { width: 100%; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 16px; border-radius: 13px; }
.btn-outline { background: var(--paper); color: var(--navy); box-shadow: inset 0 0 0 1px rgba(14, 22, 52, .22), 0 2px 6px rgba(14, 22, 52, .05); }
.btn-ivory { background: var(--ivory); color: var(--navy); box-shadow: 0 8px 22px rgba(0, 0, 0, .28); }
.btn-ghost-light { background: transparent; color: var(--ivory); box-shadow: inset 0 0 0 1px rgba(247, 246, 249, .45); }
.btn-text { background: none; border: 0; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; justify-content: center; padding: 10px; cursor: pointer; font-size: 16px; }
.btn-text .ic { width: 16px; height: 16px; }
.btn[disabled] { opacity: .45; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 4px; cursor: pointer; }
.icon-btn .ic { width: 16px; height: 16px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.center-row { justify-content: center; }
.list-btns { display: grid; gap: 8px; }
.list-btns .btn { justify-content: flex-start; }
.link-line { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 21px; padding: 6px 0; }
.link-line .ic { width: 22px; height: 22px; }
.link-line::before, .link-line::after { content: ''; width: 46px; height: 12px; background: url('../assets/divider.png') center / cover no-repeat; opacity: .45; }

/* ---------- pills, tags, chips, tabs ---------- */
.pill { display: inline-flex; align-items: center; padding: 3px 13px; border-radius: 999px; color: #fff; font-size: 14.5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 6px rgba(14, 22, 52, .12); white-space: nowrap; }
.pill-maths { background: var(--btn); }
.pill-physics { background: var(--btn-blue); }
.pill-mixed { background: var(--slate); }
.tag { display: inline-flex; align-items: center; gap: 9px; padding: 8px 18px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px rgba(14, 22, 52, .35), 0 3px 8px rgba(14, 22, 52, .06); font-size: 18px; cursor: pointer; border: 0; }
.tag.on { box-shadow: inset 0 0 0 2px var(--violet), 0 3px 10px rgba(94, 70, 130, .18); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-green { background: var(--green); } .dot-amber { background: var(--amber); } .dot-red { background: var(--red); } .dot-grey { background: var(--grey); }
.state { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; padding: 2px 12px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px rgba(14, 22, 52, .28); }
.state .ic { width: 14px; height: 14px; }
.state-done { color: var(--violet-deep); box-shadow: inset 0 0 0 1px var(--violet); }
.state-skipped { opacity: .6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; background: var(--paper); color: var(--navy); border-radius: 12px; padding: 7px 15px; font-size: 16px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(14, 22, 52, .2); }
.chip.on { background: var(--btn); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.chips.small .chip { padding: 5px 14px; font-size: 15px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; border: 0; background: var(--paper); border-radius: 15px; padding: 11px 6px; font-size: 17.5px; cursor: pointer; color: var(--navy); white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(14, 22, 52, .14), 0 3px 8px rgba(14, 22, 52, .05); }
.seg button.on { background: var(--btn); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 14px rgba(94, 70, 130, .25); }
.seg.four button { font-size: 16px; padding: 10px 4px; }

/* ---------- checkboxes, toggles, bars ---------- */
.box, .cbox { width: 26px; height: 26px; border-radius: 6px; border: 1.6px solid rgba(14, 22, 52, .75); background: var(--paper); flex: none; padding: 0; cursor: pointer; position: relative; display: inline-block; }
.box.ticked, input:checked + .cbox { background: var(--btn); border-color: transparent; }
.box.ticked::after, input:checked + .cbox::after { content: ''; position: absolute; left: 8.5px; top: 3.5px; width: 7px; height: 13px; border: solid #fff; border-width: 0 2.4px 2.4px 0; transform: rotate(45deg); }
.box.skipped { background: var(--btn); border-color: transparent; opacity: .55; }
.box.skipped::after { content: ''; position: absolute; left: 6px; right: 6px; top: 11px; height: 2.4px; background: #fff; border-radius: 2px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.toggle-row input { display: none; }
.toggle { width: 58px; height: 32px; border-radius: 999px; background: var(--stone); position: relative; flex: none; transition: background .2s; box-shadow: inset 0 1px 3px rgba(14, 22, 52, .15); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .22); transition: left .2s; }
.toggle-row input:checked + .toggle { background: var(--btn); }
.toggle-row input:checked + .toggle::after { left: 29px; }
.bar { height: 12px; border-radius: 999px; background: #E9E7EC; overflow: hidden; box-shadow: inset 0 1px 2px rgba(14, 22, 52, .08); }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--fill); transition: width .6s ease; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.bar.bar-blue i { background: var(--fill-blue); }
.bar-thin { height: 7px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 16px; color: var(--muted); }
.field input, .field select, .field textarea, .two input { width: 100%; border: 0; border-radius: 13px; padding: 12px 14px; background: var(--paper); outline: none; box-shadow: inset 0 0 0 1px rgba(14, 22, 52, .18); }
.field input:focus, .field select:focus, .field textarea:focus, .two input:focus { box-shadow: inset 0 0 0 2px var(--violet); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.err { color: #F0A9AD; font-size: 15px; min-height: 20px; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; background: rgba(253, 252, 250, .97); border-top: 1px solid var(--hair); padding: 9px 4px calc(9px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(14, 22, 52, .06); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; color: rgba(14, 22, 52, .72); min-width: 60px; }
.tab .ic { width: 27px; height: 27px; stroke-width: 1.4; }
.tab.on { color: var(--violet-deep); }
.tab.on .ic { fill: rgba(122, 92, 154, .22); stroke-width: 1.7; }
.timer-pill { position: fixed; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 21; display: flex; align-items: center; gap: 8px; background: var(--navy); color: var(--ivory); padding: 9px 16px; border-radius: 999px; box-shadow: 0 10px 26px rgba(14, 22, 52, .32); font-size: 15px; max-width: calc(100% - 28px); }
.timer-pill .ic { width: 16px; height: 16px; }
.timer-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.timer-pill b { font-size: 19px; font-weight: 500; }

/* ---------- home ---------- */
.greet { text-align: center; padding-top: 58px; }
.greet h1 { font-size: 44px; line-height: 1.06; }
.ask { font-size: 20px; margin-top: 14px; }
.moods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.mood { border: 0; background: rgba(253, 252, 250, .85); border-radius: 14px; padding: 10px 4px; font-size: 18px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(14, 22, 52, .14), 0 4px 10px rgba(14, 22, 52, .06); backdrop-filter: blur(4px); }
.mood.on { background: var(--btn); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 16px rgba(94, 70, 130, .3); }
.sys { background: var(--navy); color: var(--ivory); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 14px 30px rgba(14, 22, 52, .24); position: relative; overflow: hidden; }
.sys::before { content: ''; position: absolute; inset: 0; background: url('../assets/sub-navy-chart.jpg') center / cover; opacity: .35; pointer-events: none; }
.sys::after { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(247, 246, 249, .2); border-radius: 13px; pointer-events: none; }
.sys > * { position: relative; z-index: 1; }
.sys p { font-size: 18.5px; line-height: 1.4; }
.sys-label { font-family: var(--serif) !important; font-size: 15px !important; font-variant: small-caps; letter-spacing: .14em; color: rgba(247, 246, 249, .7); display: flex; align-items: center; gap: 6px; }
.sys-label::before { content: '\2726'; font-variant: normal; font-size: 11px; color: var(--brass); }
.sys-label.ink { color: var(--violet-deep); justify-content: center; }
.sys-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sys-note { opacity: .85; font-style: italic; }
.plan-card { padding: 24px 22px 22px; }
.checklist, .quests { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checklist li, .quests li { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--hair); }
.checklist li:first-child, .quests li:first-child { border-top: 0; padding-top: 4px; }
.checklist span, .quests span:not(.box) { flex: 1; font-size: 18.5px; line-height: 1.3; }
.checklist small { display: block; font-size: 15px; color: var(--muted); font-style: italic; margin-top: 2px; }
.checklist em { font-style: normal; font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.checklist li.done span, .quests li.done span:not(.box) { color: var(--muted); }
.quests b { font-size: 15px; color: var(--muted); font-weight: 400; }
.quests .box { cursor: default; width: 22px; height: 22px; }
.quests .box.ticked::after { left: 7px; top: 3px; width: 6px; height: 11px; }
.done-note { text-align: center; font-size: 19px; font-style: italic; color: var(--violet-deep); display: flex; gap: 6px; justify-content: center; align-items: center; }
.status { display: flex; align-items: center; gap: 16px; }
.status .letter { font-size: 58px; line-height: .9; width: 56px; text-align: center; }
.status .st-body { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.status .st-line { display: flex; justify-content: space-between; font-size: 16px; }
.status .st-line i { color: var(--violet-deep); }
.status .st-xp { font-size: 13.5px; color: var(--muted); font-family: var(--sans); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--hair); padding-top: 14px; text-align: center; }
.stats > div { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.stats .ic { width: 19px; height: 19px; color: var(--violet); stroke-width: 1.5; }
.stats b { font-size: 26px; font-weight: 500; line-height: 1.1; }
.stats span { font-size: 14px; color: var(--muted); }
.due-card { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.due-card h2 { font-size: 22px; }
.due-card p { font-size: 15.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.quote { text-align: center; padding: 8px 14px 0; }
.quote .q { font-size: 21px; line-height: 1.42; margin-top: 12px; font-style: italic; }
.quote .qa { font-size: 15px; color: var(--muted); margin-top: 8px; }

/* ---------- study ---------- */
.blocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.blk { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--hair); }
.blk:first-child { border-top: 0; padding-top: 2px; }
.blk-time { font-size: 16px; width: 62px; flex: none; color: var(--muted); padding-top: 3px; }
.blk-main { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.blk-top { display: flex; justify-content: space-between; align-items: center; }
.blk h3 { font-size: 20px; line-height: 1.25; }
.blk p { font-size: 15.5px; color: var(--muted); font-style: italic; }
.blk.done h3, .blk.skipped h3 { color: var(--muted); }
.blk-btns { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.week-topic { display: flex; gap: 12px; align-items: flex-start; }
.week-topic p { font-size: 18px; line-height: 1.3; }
.timer-screen { align-items: center; text-align: center; gap: 12px; }
.t-subject { font-size: 24px; margin-top: 4px; }
.t-pages { background: none; border: 0; font-size: 20px; cursor: pointer; padding: 0 10px; margin-top: -8px; }
.t-pages u { font-size: 14px; color: var(--violet); margin-left: 6px; text-underline-offset: 3px; }
.dial { position: relative; width: 300px; height: 300px; margin: 6px auto 2px; }
.dial::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(circle, rgba(253, 252, 250, .95) 55%, rgba(253, 252, 250, 0) 72%); }
.dial-face { position: absolute; inset: 0; background: url('../assets/clock.png') center / contain no-repeat; opacity: .32; }
.dial-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.dial-ring .track { fill: none; stroke: rgba(14, 22, 52, .06); stroke-width: 3; }
.dial-ring .fill { fill: none; stroke: var(--violet); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.dial-time { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 76px; letter-spacing: .01em; font-variant-numeric: lining-nums; }
.is-break .dial-ring .fill { stroke: var(--slate); }
.controls { display: flex; align-items: center; justify-content: center; gap: 34px; margin: 2px 0 4px; }
.ctl { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--paper); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--navy); box-shadow: inset 0 0 0 1px rgba(14, 22, 52, .1), 0 6px 16px rgba(14, 22, 52, .1); }
.ctl.big { width: 92px; height: 92px; background: var(--btn); color: #fff; box-shadow: 0 0 0 7px rgba(253, 252, 250, .9), 0 0 0 8px rgba(14, 22, 52, .08), 0 14px 30px rgba(94, 70, 130, .38), inset 0 1px 0 rgba(255, 255, 255, .3); }
.ctl.big .ic { width: 40px; height: 40px; }
.ctl.on { background: var(--navy); color: var(--ivory); }
.t-block { font-size: 21px; }
.dots { display: flex; gap: 14px; justify-content: center; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1.5px rgba(14, 22, 52, .3); }
.dots i.on { background: var(--btn); box-shadow: 0 2px 6px rgba(94, 70, 130, .35); }
.dots i.done { background: var(--stone); box-shadow: none; }
.end-sheet { text-align: center; }
.end-sheet h2 { font-size: 27px; }
.feel { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.counter { display: flex; align-items: center; gap: 12px; justify-content: space-between; border-top: 1px solid var(--hair); padding-top: 12px; }
.counter span { flex: 1; text-align: left; font-size: 18px; }
.counter button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--paper); font-size: 22px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(14, 22, 52, .2); }
.counter b { font-size: 30px; min-width: 38px; font-weight: 500; }

/* ---------- review ---------- */
.mlist, .plist, .titles, .rewards, .mastery-list, .roadmap { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mlist a { display: flex; flex-direction: column; gap: 6px; background: var(--paper); border: 1px solid var(--hair); border-radius: 20px; padding: 16px 18px; box-shadow: var(--lift); }
.m-top { display: flex; justify-content: space-between; align-items: center; }
.stage { font-size: 14.5px; color: var(--muted); }
.mlist h3 { font-size: 20px; line-height: 1.25; }
.mlist p { font-size: 16px; color: var(--muted); }
.m-due { color: var(--violet-deep) !important; display: flex; gap: 4px; align-items: center; font-style: italic; }
.m-due .ic { width: 15px; height: 15px; }
.empty { text-align: center; color: var(--muted); padding: 14px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; font-style: italic; font-size: 17.5px; }
.empty-art { width: 120px; height: 120px; opacity: .3; background: center / contain no-repeat; }
.empty-art.orbit { background-image: url('../assets/orbit.png'); }
.empty-art.clock { background-image: url('../assets/clock.png'); }
.redo { text-align: center; }
.redo h2 { font-size: 27px; }
.note { background: #F5F2F8; border-radius: 14px; padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.note p { font-size: 18px; }
.m-photo { width: 100%; border-radius: 10px; }
.soon { text-align: center; color: var(--muted); font-style: italic; font-size: 16px; padding: 6px 20px; }

/* ---------- progress ---------- */
.grade-card { text-align: center; }
.grade-card .g-title { font-size: 26px; }
.grade-row { display: grid; grid-template-columns: 1fr 1fr; margin-top: 2px; }
.grade-half { display: flex; flex-direction: column; align-items: center; }
.grade-half + .grade-half { border-left: 1px solid rgba(80, 60, 30, .18); }
.g-label { font-size: 16px; color: #6A5A48; font-style: italic; }
.g-letter { font-size: 76px; line-height: 1.02; }
.g-letter.faint { color: rgba(14, 22, 52, .2); }
.g-pct { font-size: 18px; }
.g-used { font-size: 14px; color: #6A5A48; }
.subj { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.subj-line { display: flex; justify-content: space-between; font-size: 22px; }
.subj-line b { font-weight: 400; }
.countdown { display: flex; align-items: center; gap: 16px; }
.countdown > .ic { width: 40px; height: 40px; stroke-width: 1.3; }
.countdown div { flex: 1; }
.countdown h2 { font-size: 24px; }
.countdown p { font-size: 19px; }
.countdown .muted { font-size: 17px; color: #5D5446; }
.stats-card { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 8px; }
.stats-card > div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stats-card b { font-size: 28px; font-weight: 500; line-height: 1.1; }
.stats-card span { font-size: 14.5px; color: var(--muted); }
.plist li { display: flex; justify-content: space-between; align-items: center; background: var(--paper); border: 1px solid var(--hair); border-radius: 18px; padding: 14px 16px; box-shadow: var(--lift); }
.plist h3 { font-size: 19px; }
.plist p { font-size: 15px; }
.p-score { text-align: right; display: flex; flex-direction: column; }
.p-score b { font-size: 22px; font-weight: 500; }
.p-score span { font-size: 14.5px; color: var(--muted); }
.roadmap .phase { font-size: 22px; margin-top: 12px; color: var(--violet-deep); font-style: italic; }
.wk { background: var(--paper); border: 1px solid var(--hair); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 6px 16px rgba(14, 22, 52, .05); }
.wk.now { box-shadow: inset 0 0 0 2px var(--violet), var(--lift); }
.wk-head { display: flex; gap: 10px; align-items: baseline; font-size: 15.5px; color: var(--muted); }
.wk-head b { font-size: 20px; color: var(--ink); font-weight: 500; }
.wk-head em { margin-left: auto; color: var(--violet-deep); }
.wk-row { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.wk-row input { display: none; }
.wk-row span { font-size: 18px; line-height: 1.3; }
.wk-row small { display: block; font-size: 14.5px; color: var(--muted); font-style: italic; }
.wk-row input:checked ~ span { color: var(--muted); }
.branch-head { display: flex; justify-content: space-between; align-items: baseline; }
.branch-head span { color: var(--muted); font-size: 15px; }
.nodes { display: flex; flex-wrap: wrap; position: relative; }
.node { display: flex; flex-direction: column; align-items: center; width: 25%; gap: 5px; padding: 6px 2px; position: relative; }
.node i { width: 20px; height: 20px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1.6px var(--stone); position: relative; z-index: 1; }
.node::before { content: ''; position: absolute; top: 16px; left: -50%; width: 100%; height: 1.5px; background: var(--stone); }
.node:nth-child(4n + 1)::before { display: none; }
.node span { font-size: 13px; text-align: center; color: var(--muted); line-height: 1.2; }
.node-green i { background: var(--btn); box-shadow: 0 0 0 4px rgba(122, 92, 154, .18); }
.node-amber i { box-shadow: inset 0 0 0 2px var(--amber); }
.node-red i { box-shadow: inset 0 0 0 2px var(--red); }
.branch-title { font-size: 15.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.branch-title i { font-size: 18px; color: var(--ink); }
.branch-title .ic { width: 16px; height: 16px; color: var(--brass); }
.branch.complete { box-shadow: inset 0 0 0 1.5px var(--brass), var(--lift); }

/* ---------- mastery (follows Ibrahim's mockup) ---------- */
.mastery-list { gap: 0; }
.mastery-list li a { display: flex; flex-direction: column; gap: 12px; padding: 18px 2px; }
.ml-top { display: flex; align-items: center; gap: 10px; }
.ml-top .ml-name { flex: 1; display: flex; gap: 10px; align-items: center; font-size: 23px; line-height: 1.15; }
.ml-top .ml-name .dot { width: 9px; height: 9px; }
.ml-top b { font-weight: 400; font-size: 22px; }
.ml-top b.not-yet { font-size: 16px; color: var(--muted); font-style: italic; }
.ml-top .ic { width: 24px; height: 24px; color: var(--navy); margin-left: 8px; }
.mastery-list .bar { margin-right: 34px; }
.legend { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; border-top: 1px solid var(--hair); padding-top: 14px; }
.legend .dot { width: 9px; height: 9px; margin-left: 8px; }
.topic-card { text-align: center; }
.topic-card .g-letter { font-size: 60px; }

/* ---------- me ---------- */
.profile { text-align: center; }
.profile .big-letter { font-size: 112px; line-height: .95; }
.profile .p-name { font-size: 28px; }
.profile .p-title { font-size: 20px; color: var(--violet-deep); font-style: italic; }
.profile .bar { margin-top: 8px; }
.profile .g-used { margin-top: 6px; }
.rank-ladder { display: flex; align-items: center; justify-content: center; gap: 6px; }
.rank-ladder span { font-size: 30px; color: var(--stone); width: 34px; text-align: center; }
.rank-ladder span.on { color: var(--ink); font-size: 40px; }
.rank-ladder i .ic { width: 14px; height: 14px; color: var(--stone); }
.titles li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--hair); }
.titles li:first-child { border-top: 0; }
.titles .t-name { font-size: 20px; font-style: italic; }
.titles li:not(.has) .t-name { color: var(--muted); }
.titles .muted.small { font-size: 15px; }
.rewards li { display: flex; align-items: center; gap: 10px; }
.rewards span { flex: 1; font-size: 18.5px; }
.rewards b { display: inline-flex; align-items: center; gap: 3px; font-weight: 400; font-size: 17px; }
.rewards b .ic { width: 16px; height: 16px; color: var(--brass); }

/* ---------- dark screens: welcome, lock ---------- */
.dark { background: var(--navy); color: var(--ivory); align-items: center; justify-content: center; text-align: center; padding-bottom: 44px; max-width: none; }
.dark::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 300px; background: url('../assets/bg-galaxy.jpg') center / cover no-repeat; opacity: .75; pointer-events: none; z-index: -1; -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); }
.dark::after { display: none; }
.dark > * { max-width: 420px; width: 100%; }
.dark h2 { font-size: 34px; }
.dark .field { text-align: left; }
.dark .field > span { color: rgba(247, 246, 249, .72); }
.dark .field input { background: rgba(247, 246, 249, .07); box-shadow: inset 0 0 0 1px rgba(247, 246, 249, .3); color: var(--ivory); font-size: 18px; letter-spacing: .08em; }
.dark .chip { background: transparent; color: var(--ivory); box-shadow: inset 0 0 0 1px rgba(247, 246, 249, .38); }
.dark .chip.on { background: var(--btn); box-shadow: none; }
.muted-light { color: rgba(247, 246, 249, .72); font-size: 17px; font-style: italic; }
.arch { width: 236px !important; height: 300px; margin: 0 auto; border-radius: 118px 118px 12px 12px; background: url('../assets/arch-window.jpg') 50% 42% / auto 112% no-repeat; box-shadow: 0 0 0 1.5px rgba(166, 140, 107, .85), 0 0 0 7px rgba(14, 22, 52, .9), 0 0 0 8px rgba(166, 140, 107, .35), 0 28px 60px rgba(0, 0, 0, .55); position: relative; }
.arch::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(14, 22, 52, 0) 60%, rgba(14, 22, 52, .55)); }
.mark { width: 64px !important; height: 64px; margin: 0 auto; background: var(--ivory); -webkit-mask: url('../assets/compass.png') center / contain no-repeat; mask: url('../assets/compass.png') center / contain no-repeat; }
.setup.step-0 .mark { margin-top: -38px; position: relative; z-index: 2; width: 76px !important; height: 76px; background: #E9DFCB; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
.mark.spin { animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand { font-size: 46px; letter-spacing: .14em; font-weight: 500; margin-top: 6px; }
.brand.small { font-size: 36px; }
.brand-sub { font-size: 19px; letter-spacing: .06em; opacity: .85; }
.splash-line { font-size: 22px; font-style: italic; opacity: .9; margin: 6px 0 4px; }
.setup .btn, .lock .btn { width: 100%; }
.setup-list { list-style: none; margin: 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 14px; font-size: 20px; }
.setup-list li { display: flex; gap: 10px; align-items: flex-start; }
.setup-list .ic { color: #C9B4E2; margin-top: 4px; }
.awaken { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.awaken-letter { font-size: 140px; line-height: 1; text-shadow: 0 0 44px rgba(166, 140, 107, .55); }
.awaken-line { font-size: 23px; line-height: 1.4; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(14, 22, 52, .5); display: flex; align-items: center; justify-content: center; padding: 22px; opacity: 0; transition: opacity .25s; backdrop-filter: blur(3px); }
.overlay.show { opacity: 1; }
.overlay-box { width: 100%; max-width: 400px; transform: translateY(12px) scale(.98); transition: transform .3s ease; filter: drop-shadow(0 22px 44px rgba(0, 0, 0, .4)); }
.overlay.show .overlay-box { transform: none; }
.sys-window { --c: 14px; position: relative; background: var(--navy) url('../assets/sub-navy-chart.jpg') center / cover; color: var(--ivory); padding: 28px 22px 22px; text-align: center; display: flex; flex-direction: column; gap: 12px; clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c)); }
.sys-window::before { content: ''; position: absolute; inset: 0; background: rgba(14, 22, 52, .62); }
.sys-window::after { content: ''; position: absolute; inset: 7px; border: 1px solid rgba(247, 246, 249, .3); pointer-events: none; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }
.sys-window > * { position: relative; z-index: 1; }
.sys-window .sys-label { justify-content: center; }
.sys-window p:not(.sys-label) { font-size: 20px; line-height: 1.4; }
.sys-window .sys-actions { justify-content: center; }
.divider-light { height: 14px; width: 70%; margin: 0 auto; background: var(--ivory); -webkit-mask: url('../assets/divider.png') center / contain no-repeat; mask: url('../assets/divider.png') center / contain no-repeat; opacity: .75; }
.dlg-input { width: 100%; border: 0; box-shadow: inset 0 0 0 1px rgba(247, 246, 249, .35); background: rgba(247, 246, 249, .08); color: var(--ivory); border-radius: 12px; padding: 12px 14px; font-size: 16px; outline: none; }
.overlay.full { background: var(--navy); backdrop-filter: none; }
.overlay.full::before { content: ''; position: absolute; inset: 0; background: url('../assets/bg-window.jpg') center top / auto 46% no-repeat; opacity: .8; }
.overlay.full::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 22, 52, .2) 0, rgba(14, 22, 52, .8) 32%, var(--navy) 50%); }
.overlay.full .overlay-box { position: relative; z-index: 1; filter: none; }
.rankup { color: var(--ivory); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ru-small { font-size: 24px; font-style: italic; }
.ru-letter { font-size: 160px; line-height: 1; text-shadow: 0 0 54px rgba(166, 140, 107, .6); animation: rise .9s ease both; }
.ru-title { font-size: 40px; font-style: italic; animation: rise .9s ease both; }
.ru-line { font-size: 20px; line-height: 1.45; opacity: .9; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.92); } to { opacity: 1; transform: none; } }
.xp-pop { position: fixed; left: 50%; bottom: 104px; z-index: 60; transform: translate(-50%, 10px); background: var(--btn); color: #fff; padding: 8px 20px; border-radius: 999px; font-size: 22px; opacity: 0; pointer-events: none; box-shadow: 0 12px 26px rgba(94, 70, 130, .38); }
.xp-pop.go { animation: pop 1.8s ease forwards; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 14px); } 15% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px); } }
.toast { position: fixed; top: 14px; left: 50%; z-index: 60; transform: translate(-50%, -20px); width: calc(100% - 28px); max-width: 440px; background: var(--navy); color: var(--ivory); padding: 12px 18px; border-radius: 16px; font-size: 18px; line-height: 1.35; opacity: 0; transition: all .35s ease; box-shadow: 0 14px 32px rgba(14, 22, 52, .35); display: flex; flex-direction: column; gap: 2px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.screen-title.study-title { margin-top: 0; }
.screen > .back { position: absolute; top: 18px; left: 18px; margin: 0; z-index: 3; }
.form-title { margin-top: 36px; }
button.parchment { text-align: left; cursor: pointer; color: inherit; font: inherit; width: 100%; }
.countdown > .ic:last-child { width: 26px; height: 26px; }
.status-card { gap: 14px; }
.home .card.status-card { padding: 16px 20px; }
.blk-btns .btn { min-height: 36px; padding: 0 12px; font-size: 15.5px; border-radius: 12px; }
.end-sheet h2 { font-size: 25px; }
.logo { width: 96px !important; height: 96px; margin: 0 auto 4px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45)); }
/* colour hero tuning */
.hero { height: 268px; }
.hero-home { height: 430px; }
.hero-home::after { background: linear-gradient(180deg, rgba(14, 22, 52, .45) 0%, rgba(14, 22, 52, .14) 38%, rgba(14, 22, 52, .18) 66%, rgba(247, 246, 249, .5) 84%, var(--ivory) 100%); }
.hero-study { height: 220px; }
.hero-study ~ .t-subject, .hero-study ~ p.center { margin-top: 34px; }
