/* Ayah v20: every screen except the lesson (Learn, Review, Surahs, a surah's lessons, Settings, Preparing, Complete).
   Colours come only from the tokens style.css sets on :root, light and dark. Load this after style.css.
   2026-10-26, gold round: a calmer, lighter pass. Cards have a hairline edge instead of a shadow, header buttons are ghost icons,
   the header and tab bar are slimmer, and a lesson row's main action is a gold pill with a word. */
@font-face{font-family:surah-names;src:url(/mushaf/fonts/sura_names.woff2) format("woff2");font-display:block}
/* Derived from the tokens: accent text that keeps 4.5:1 in light mode, and a soft accent wash. */
#app{--accent-text:color-mix(in srgb,var(--accent,#A87B1A) 66%,var(--ink,#171511));--accent-tint:color-mix(in srgb,var(--accent,#A87B1A) 14%,transparent)}
.screen:has(>.view){min-height:100dvh;display:flex;flex-direction:column;background:var(--bg,#F7F5F0);color:var(--ink,#171511);font-family:Inter,-apple-system,Roboto,"Segoe UI",sans-serif;line-height:1.4}
:where(.top,.view,.tabs),:where(.top,.view,.tabs) *{box-sizing:border-box}
:where(.top,.view,.tabs) :where(h1,h2,h3,p){margin:0}
:where(.top,.view,.tabs) :where(button,input){font:inherit;color:inherit}
:where(.top,.view,.tabs) button{background:none;border:0;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
:where(.top,.view,.tabs) svg{width:22px;height:22px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
:where(.top,.view,.tabs) :focus-visible{outline:3px solid var(--accent,#A87B1A);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* Header: the wordmark and a settings gear, or a back chevron and the page's title. Both buttons are ghost icons (no fill, no
   shadow) in a 44 px tap target, pulled into the gutter so the icon itself lines up with the content's 16 px edge. */
.top{display:flex;align-items:center;gap:4px;min-height:56px;padding:6px 16px 2px}
.top .brand{margin-right:auto;font-size:25px;font-weight:700;letter-spacing:-1.2px;line-height:1}
.top .brand span{color:var(--accent)}
.top .round{width:44px;height:44px;flex-shrink:0;border-radius:50%;display:grid;place-items:center;background:none;box-shadow:none;color:var(--ink);transition:background-color .15s}
.top .round:first-child{margin-left:-12px}
.top .round:last-child{margin-right:-10px}
.top .round svg{width:24px;height:24px;stroke-width:1.9}
.top .round:active{background:var(--card)}
.top .top-title{flex:1;min-width:0;font-size:19px;font-weight:700;letter-spacing:-.3px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.view{flex:1;display:flex;flex-direction:column;gap:14px;padding:4px 16px 24px}
.view .title{font-size:28px;font-weight:700;letter-spacing:-.6px;line-height:1.15;margin-top:2px}
.view .label{font-size:13px;font-weight:650;line-height:1.3;letter-spacing:0;color:var(--muted);margin:4px 4px -6px}
/* Cards: a hairline edge and 18 px corners, no drop shadow. */
.view :is(.card,.list,.hero){background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:none}
.view :is(.card,.list){overflow:hidden}
.view .sname{font-family:surah-names,serif;font-weight:400;line-height:1;direction:rtl;white-space:nowrap;color:var(--ink)}
.view .sname.xl{font-size:78px;line-height:1.15}
.view .sname.sm{flex-shrink:0;font-size:30px}

/* Learn: the next lesson as a hero card with one big round gold button, the one strong thing on the screen. */
/* It fills a tall screen: the name and button centred, the progress at its foot. */
.view .hero{flex:1 0 auto;display:flex;flex-direction:column;align-items:center;text-align:center;padding:16px 20px 18px;background:radial-gradient(120% 60% at 50% 0%,var(--accent-tint),transparent 72%),var(--surface)}
.view .hero>:first-child{margin-top:auto}
.view .hero .chip+.sname{margin-top:6px}
.view .hero-name{font-size:22px;font-weight:700;letter-spacing:-.4px;line-height:1.2}
.view .hero-range{margin-top:4px;font-size:15px;color:var(--muted)}
.view .go{display:flex;flex-direction:column;align-items:center;gap:10px;margin:20px 0 18px;font-size:16px;font-weight:650}
/* A soft gold halo instead of the wide glow (it read heavy in dark). */
.view .hero .fab{width:84px;height:84px;box-shadow:0 0 0 8px var(--accent-tint),0 10px 24px -10px var(--glow);transition:transform .15s}
.view .hero .fab svg{width:34px;height:34px;margin-left:4px}
.view .go:active:not(:disabled){transform:none}
.view .go:active .fab{transform:scale(.94)}
.view .segs{align-self:stretch;display:flex;align-items:center;gap:10px}
.view .hero .segs{margin-top:auto}
.view .segs-bar{flex:1;display:flex;gap:3px}
.view .segs-bar i{flex:1;height:6px;border-radius:999px;background:var(--line)}
.view .segs-bar i.on{background:var(--accent)}
.view .segs-bar i.next{background:var(--accent-tint);box-shadow:inset 0 0 0 1.5px var(--accent)}
.view .segs-n{font-size:13px;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}

/* First open: one short question at a time, in a quiet card; its two answers look the same. */
.view .ask{display:flex;flex-direction:column;gap:12px;padding:14px 14px 14px 16px;border-radius:18px;background:var(--surface);border:1px solid var(--line)}
.view .ask-head{display:flex;align-items:center;gap:12px}
.view .ask .item-ic{width:36px;height:36px}
.view .ask-q{flex:1;font-size:16px;font-weight:600;line-height:1.35}
.view .ask-sub{display:block;margin-top:3px;font-size:14px;font-weight:400;line-height:1.4;color:var(--muted)}
.view .ask-skip{min-height:44px;padding:0 8px;margin:-10px -6px -10px 0;font-size:15px;font-weight:600;color:var(--accent-text)}
.view .ask-row{display:flex;gap:8px}
.view .ask-row>*{flex:1}
.view .ask-row>.btn:only-of-type{flex:none}
.view .ask .field{height:44px}

/* Buttons and fields. */
.view .btn{min-height:44px;padding:0 18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--ink);color:var(--bg);font-size:15px;font-weight:650;white-space:nowrap}
.view .btn.soft{background:var(--card);color:var(--ink);box-shadow:none}
.view .btn.gold{background:var(--accent-grad);color:var(--accent-ink)}
/* Red text on a dark card needs a lighter red to reach 4.5:1 (--miss-text, 2026-10-25: Delete was 3.96:1). */
.view .btn.danger{background:none;color:var(--miss-text,var(--miss,#D92D20));box-shadow:inset 0 0 0 1.5px currentColor}
/* style.css shrinks every pressed button. Rows light up instead, and the pill a whole lesson row presses must keep its size
   mid-tap: shrunk (a transform), it stops covering the row and the tap lands beside it and is lost. */
.view :is(.srow,.item,.group-head,.lrow>.play,.mini,.set):active:not(:disabled),.tabs .tab:active:not(:disabled){transform:none}
.view :is(.srow,.item,.group-head,button.set,a.set):active,.view .lrow:has(>.play:active){background:var(--card)}
.view .btn:active:not(:disabled){opacity:.8}
.view .field{width:100%;min-width:0;height:48px;margin:0;padding:0 14px;border-radius:12px;border:1px solid var(--line);background:var(--bg);color:var(--ink);font-size:16px}
.view .field::placeholder{color:var(--muted);opacity:1}
.view .field:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-tint)}
.view .link{min-height:44px;padding:0 14px;font-size:15px;font-weight:600;color:var(--accent-text)}

/* Compact rows to another screen. */
.view .item{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:8px 14px;text-align:left}
.view .item+.item{border-top:1px solid var(--line)}
.view .item-ic{width:36px;height:36px;flex-shrink:0;border-radius:50%;display:grid;place-items:center;background:var(--accent-tint);color:var(--accent-text)}
.view .item-ic svg{width:20px;height:20px}
.view .item-t{flex:1;min-width:0;font-size:16px;font-weight:600}
.view .item-v{font-size:14px;color:var(--muted);white-space:nowrap}
.view .item>svg{width:18px;height:18px;color:var(--muted)}

/* Tab bar, held at the bottom of the app column: slim, a hairline on top, the page showing faintly through. Labels kept. */
.tabs{position:sticky;bottom:0;z-index:5;margin-top:auto;display:flex;gap:4px;padding:4px 8px max(6px,env(safe-area-inset-bottom));background:color-mix(in srgb,var(--surface) 95%,transparent);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-top:1px solid var(--line)}
.tabs .tab{flex:1;min-height:52px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:13px;font-weight:600;color:var(--muted)}
.tabs .tab-ic{width:52px;height:28px;border-radius:999px;display:grid;place-items:center;transition:background-color .2s}
.tabs .tab.on{color:var(--ink);font-weight:700}
.tabs .tab.on .tab-ic{background:var(--accent-tint);color:var(--accent-text)}
@media(min-width:760px){#app:has(.tabs){overflow:clip}}   /* hidden would stop the tab bar sticking */

/* Surahs: search, then one compact row each with its progress. */
.view .find{position:relative;display:flex;align-items:center}
.view .find svg{position:absolute;left:16px;width:20px;height:20px;color:var(--muted);pointer-events:none}
.view .find .field{height:48px;padding-left:46px;border-radius:999px;border-color:var(--line);background:var(--surface);-webkit-appearance:none;appearance:none}
.view .find .field:focus{border-color:var(--accent)}
.view .srow{display:flex;align-items:center;gap:12px;width:100%;min-height:64px;padding:10px 14px 10px 10px;text-align:left}
.view .srow+.srow{border-top:1px solid var(--line)}
.view .snum{position:relative;width:44px;height:44px;flex-shrink:0;display:grid;place-items:center;font-size:13px;font-weight:650;font-variant-numeric:tabular-nums}
.view .snum::before,.view .snum::after{content:'';position:absolute;inset:9px;border:1.5px solid color-mix(in srgb,var(--muted) 45%,transparent);border-radius:5px}
.view .snum::after{transform:rotate(45deg)}
.view .srow-t{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.view .srow-t strong{font-size:16px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.view .srow-m{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.view .mbar{width:52px;height:4px;flex-shrink:0;border-radius:999px;background:var(--line);overflow:hidden}
.view .mbar i{display:block;height:100%;border-radius:inherit;background:var(--accent)}
.view .find .field::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;width:28px;height:28px;margin-right:2px;border-radius:50%;background:var(--muted);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6 6 18' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center/16px no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6 6 18' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center/16px no-repeat;cursor:pointer}
.view .search-empty{padding:28px 16px;text-align:center;font-size:15px;color:var(--muted)}

/* Review: finished lessons grouped by surah. */
.view .group-head{display:flex;align-items:center;gap:10px;width:100%;min-height:58px;padding:8px 14px 8px 16px;text-align:left}
.view .group-t{flex:1;min-width:0;font-size:17px;font-weight:700}
.view .group-head>svg{width:18px;height:18px;color:var(--muted)}
.view .none{display:flex;flex-direction:column;align-items:center;gap:12px;padding:28px 20px;text-align:center}
.view .none>svg{width:30px;height:30px;color:var(--accent-text)}
.view .none p{font-size:15px;color:var(--muted)}

/* A surah's lessons (and the Review list): one compact row each. The name and its status chip on the left; on the right, always
   in the same place, the other action as a small text button and the main action as a gold pill with its word. The whole row
   presses the pill (its ::after covers the row); the text button sits above that and stays its own. */
.view .surah-top{display:flex;flex-direction:column;align-items:center;gap:6px;padding:0 4px}
.view .surah-top .sname.xl{font-size:70px}
.view .lrow{position:relative;display:flex;align-items:center;gap:2px;min-height:60px;padding:8px 12px 8px 16px}
.view :is(.lrow+.lrow,.group-head+.lrow){border-top:1px solid var(--line)}
.view .lrow-t{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:5px;margin-right:4px}
.view .lrow-t strong{font-size:16px;font-weight:600;line-height:1.25}
.view .chips{display:flex;flex-wrap:wrap;gap:6px}
.view .chip{display:inline-flex;align-items:center;min-height:22px;padding:0 9px;border-radius:999px;border:1px solid var(--line);font-size:12.5px;font-weight:600;line-height:1;color:var(--muted);white-space:nowrap}
.view .chip.done{border-color:transparent;background:var(--accent-tint);color:var(--accent-text)}
.view .chip.next{border-color:var(--accent);background:none;color:var(--accent-text)}
.view .chip.going{border-color:transparent;background:var(--card);color:var(--ink)}
.view .lrow>.play{flex-shrink:0;min-width:74px;height:34px;padding:0 16px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:var(--accent-tint);color:var(--accent-text);font-size:14px;font-weight:650;line-height:1;letter-spacing:-.1px;white-space:nowrap}
/* Only the next or stopped lesson is full gold, so a long list has one clear place to start (2026-10-26); the rest are light. */
.view .lrow>.play.prime{background:var(--accent-grad);color:var(--accent-ink);box-shadow:0 0 0 3px var(--accent-tint)}
.view .lrow>.play::after{content:'';position:absolute;inset:0}
.view .lrow>.mini{position:relative;z-index:1;flex-shrink:0;min-height:44px;padding:0 10px;border-radius:999px;display:inline-flex;align-items:center;font-size:14px;font-weight:600;line-height:1;color:var(--accent-text);white-space:nowrap}
.view .lrow>.mini:active{background:var(--card)}

/* Settings: grouped cards, one helper line at most per row. */
.view .sec{display:flex;flex-direction:column;gap:8px}
.view .sec .label{margin:2px 4px 0}
.view .set{display:flex;align-items:center;gap:14px;width:100%;min-height:56px;padding:12px 14px;color:inherit;text-decoration:none;text-align:left}
.view .set+.set{border-top:1px solid var(--line)}
.view .set.wrap{flex-wrap:wrap;row-gap:10px}
.view .set>svg:first-child{color:var(--muted)}
.view .set>svg:last-child:not(:first-child){width:18px;height:18px;color:var(--muted)}
.view .set-t{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.view .set-t strong{font-size:16px;font-weight:600}
.view .set-t small{font-size:13px;line-height:1.4;color:var(--muted)}
.view :is(label,button,a).set{cursor:pointer}
.view .set>.field{flex:1.4}
.view .seg,.view .set.wrap>.note{flex-basis:100%;margin-left:36px}
.view .field-row{flex:1;min-width:0;display:flex;gap:8px}
.view .note{font-size:13px;line-height:1.4}
.view #restore-note{color:var(--miss-text,var(--miss,#D92D20))}
.view :is(#restore-note,#voice-note):empty{display:none}
.view .my-code{font-size:22px;font-weight:700;letter-spacing:1.5px;font-variant-numeric:tabular-nums;user-select:all;margin:2px 0}
.view .card-foot{padding:12px 14px;border-top:1px solid var(--line);font-size:13px;color:var(--muted)}
.view .seg{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;padding:4px;border-radius:999px;background:var(--card)}
.view .seg.three{grid-template-columns:repeat(3,1fr)}    /* the theme: Auto, Light, Dark (2026-10-25) */
.view .seg.qari span{font-size:14px;letter-spacing:-.1px}    /* Minshawi, Husary, Mishary, No Qari in one row (2026-11-04) */
@media (max-width:400px){.view .seg.qari span{font-size:13px}}
.view .seg label{position:relative;cursor:pointer}
.view .seg input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.view .seg span{display:grid;place-items:center;min-height:44px;border-radius:999px;font-size:15px;font-weight:600;font-variant-numeric:tabular-nums}
.view .seg input:checked+span{background:var(--ink);color:var(--bg)}
.view .seg input:focus-visible+span{outline:3px solid var(--accent);outline-offset:2px}

/* Preparing. */
.view.prep{align-items:center;justify-content:center;gap:10px;text-align:center;padding-bottom:96px}
.view .prep-name{font-size:20px;font-weight:700}
.view .spin{width:40px;height:40px;margin:14px 0 2px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(1turn)}}
.view .prep-note{font-size:15px;color:var(--muted)}

/* Complete: a big check, the time, the words to work on, the next lesson. */
.view.done-page{align-items:center;text-align:center}
.view.done-page>.mark{margin-top:auto;width:96px;height:96px;border-radius:50%;display:grid;place-items:center;background:var(--accent-tint);color:var(--accent-text)}
.view.done-page>.mark svg{width:48px;height:48px;stroke-width:2.4}
.view .done-t{font-size:28px;font-weight:700;letter-spacing:-.6px;line-height:1.15}
.view .done-s{font-size:15px;color:var(--muted)}
.view .done-t+.done-s{margin-top:-10px}
.view .done-q{font-size:17px;font-weight:600;margin-bottom:6px}
.view .stat{display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border-radius:999px;background:var(--surface);border:1px solid var(--line);font-size:15px;font-weight:600;font-variant-numeric:tabular-nums}
.view .stat svg{width:18px;height:18px;color:var(--muted)}
.view .work{align-self:stretch;display:flex;flex-direction:column;align-items:center;gap:12px}
.view .work .label{margin:0}
.view .work-w{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;font-family:AmiriQuran,"Amiri Quran",serif;font-size:28px;line-height:1.9}
.view .work-w span{padding:10px 14px 6px;line-height:1.9;border-radius:14px;background:var(--surface);border:1px solid var(--line)}
.view .done-actions{margin-top:auto;align-self:stretch;display:flex;flex-direction:column;align-items:center;gap:10px;padding-top:12px}
.view .done-actions .secondary{background:var(--surface);border:1px solid var(--line);box-shadow:none}

/* The error line after a lesson could not open sits above the tab bar. */
.screen:has(>.view)>.notice{order:1;position:sticky;bottom:calc(70px + env(safe-area-inset-bottom));z-index:6;margin:0 16px 12px;padding:12px 16px;border-radius:14px;background:var(--surface);border:1px solid var(--line);box-shadow:inset 4px 0 var(--miss);font-size:14px;color:var(--ink)}
.screen:has(>.view)>.tabs{order:2}

@media(min-height:820px){.view .hero .sname.xl{font-size:104px}.view .hero-name{font-size:26px}.view .hero-range{font-size:16px}.view .hero .fab{width:96px;height:96px}.view .hero .fab svg{width:38px;height:38px}.view .go{margin:30px 0 28px;font-size:17px}}
@media(max-height:760px){.view .sname.xl,.view .surah-top .sname.xl{font-size:66px}.view .hero .fab{width:76px;height:76px}.view .go{margin:14px 0 14px}}
/* A first-open question over the lesson card: the card takes the short screen's sizes, so question, lesson and list fit on the
   screen with no scroll (2026-10-26: the voice question made a 360 x 780 Learn 8 px taller than the screen, 390 x 844 14 px). */
@media(max-height:879px){.view:has(>.ask) .hero .sname.xl{font-size:66px}.view:has(>.ask) .hero .fab{width:76px;height:76px}.view:has(>.ask) .hero .fab svg{width:34px;height:34px}.view:has(>.ask) .hero .go{margin:14px 0 14px}}
@media(prefers-reduced-motion:reduce){.view .hero .fab,.tabs .tab-ic,.top .round{transition:none}}
/* v53: "Worked on", the ayat the practice after the test went over. */
.view .work-k{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:0}
.view .work-k span{padding:6px 12px;border-radius:999px;background:var(--surface);border:1px solid var(--line);font-size:15px;font-weight:600;font-variant-numeric:tabular-nums}

/* Settings (L-749): the sheets that open from the short page, set over it as the delete question is, and the version line at its foot */
.sheet-scrim.set-sc{position:fixed}
.sheet.set-sheet{position:fixed;left:50%;right:auto;width:min(100%,440px);translate:-50% 0;max-height:82%}
.set-sheet .sheet-row{width:100%;text-align:start;background:none;border-inline:0;border-bottom:0;color:inherit;font-family:inherit}
.set-sheet button.sheet-row,.set-sheet a.sheet-row{text-decoration:none}
.set-sheet .sheet-row.on>svg{color:var(--gold,var(--accent))}
.set-sheet .sheet-row.bad strong,.set-sheet .sheet-row.bad>span{color:var(--miss-text,var(--miss))}
.set-sheet .sheet-row .field{flex:1.4;min-width:0;height:44px;padding:0 14px;border:0;border-radius:12px;background:var(--card);color:var(--ink);font:inherit;font-size:16px}
.set-sheet .sheet-row .btn.danger{flex:none;min-height:40px;padding:0 16px;border:0;border-radius:999px;background:none;color:var(--miss-text,var(--miss));font:inherit;font-weight:650;box-shadow:inset 0 0 0 1.5px currentColor}
.set-sheet .set-foot{margin:6px 0 4px;font-size:13px;line-height:1.45;color:var(--muted)}
.view .set-ver{margin:6px 0 0;text-align:center;font-size:12px;color:var(--muted)}
.view .seg.qari span{text-align:center;line-height:1.15;padding:0 2px}
