@font-face{font-family:DM Sans;src:url('./fonts/dmsans.woff2') format('woff2');font-weight:400 750;font-display:swap}
@font-face{font-family:Fraunces;src:url('./fonts/fraunces.woff2') format('woff2');font-weight:400 600;font-display:swap}
@font-face{font-family:Noto Naskh;src:url('./fonts/naskh.woff2') format('woff2');font-weight:400 600;font-display:swap}
:root{
  color-scheme:light;
  --body:#f8f7f2;
  --white:#fffefa;
  --sidebar:#fdfcf7;
  --ink:#172821;
  --muted:#585f55;
  --green:#1d4b36;
  --green-dark:#123527;
  --green-pale:#e7efe4;
  --border:#e3e4da;
  --sand:#f5eddb;
  --brown:#77521e;
  --radius:18px;
  --sans:'DM Sans',system-ui,sans-serif;
  --serif:Fraunces,Georgia,serif;
  --side:240px;
}
*{box-sizing:border-box}
html{scroll-padding-top:1rem}
body{margin:0;background:var(--body);color:var(--ink);font:400 1rem/1.55 var(--sans)}
button,input,select,textarea{font:inherit}
button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.55}
button{color:inherit}
a{color:var(--green)}
h1,h2,h3,h4,p{margin:0}
h1,h2{font-family:var(--serif);font-weight:460;line-height:1.1;letter-spacing:-.033em}
h1{font-size:clamp(2.75rem,5.1vw,4.45rem)}
h2{font-size:1.75rem}
h3{font-size:1.06rem;font-weight:700}
svg{flex:none;vertical-align:middle}
::selection{color:var(--green-dark);background:#dbe9d6}
:focus-visible{outline:3px solid #587d54;outline-offset:4px}
#main:focus{outline:none}
#dialog-title:focus{outline:none}
.skip-link{position:fixed;top:.75rem;left:.75rem;z-index:12;background:var(--white);padding:.7rem 1rem;transform:translateY(-180%)}
.skip-link:focus{transform:translateY(0)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.arabic{font-family:'Noto Naskh','Geeza Pro',serif;font-weight:500;text-align:right}
.muted{color:var(--muted)}
.small{font-size:.9rem}
.padded{padding:1rem 1.2rem}
.sidebar{
  position:fixed;inset:0 auto 0 0;width:var(--side);z-index:3;display:flex;flex-direction:column;
  padding:2rem 1.15rem 1.35rem;background:var(--sidebar);border-right:1px solid var(--border)
}
.brand{
  display:inline-flex;align-items:center;gap:.7rem;color:var(--ink);text-decoration:none;font-size:.89rem;
  font-weight:620;line-height:1.2;width:max-content;max-width:100%;padding:.1rem .35rem
}
.brand strong{font-family:var(--serif);display:inline-block;font-size:1.35rem;font-weight:550;margin-top:.08rem}
.brand-mark{
  height:44px;width:44px;display:grid;place-items:center;background:var(--green-dark);color:#f1dba9;border-radius:13px;
  border:1px solid #234c39;box-shadow:0 2px 3px #14291d19;flex:none
}
.nav-list{display:grid;gap:.38rem;margin-top:3.15rem}
.nav-list a,.mobile-nav a{
  display:flex;gap:.7rem;align-items:center;text-decoration:none;color:#484f45;font-weight:610;font-size:.93rem;
  padding:.79rem .75rem;border-radius:11px;min-height:45px
}
.nav-list a:hover,.mobile-nav a:hover{color:var(--green);background:#f1f4eb}
.nav-list a[aria-current],.mobile-nav a[aria-current]{background:var(--green-pale);color:#1a412e;font-weight:720}
.profile{
  margin-top:auto;display:flex;gap:.65rem;align-items:center;text-decoration:none;color:var(--ink);
  border-top:1px solid var(--border);padding:.95rem .12rem .1rem;min-width:0
}
.profile>span:last-child{min-width:0}
.profile strong,.profile small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile strong{font-size:.89rem}
.profile small{font-size:.78rem;color:var(--muted)}
.avatar{width:35px;height:35px;background:#e8eee2;color:var(--green);border-radius:50%;display:grid;place-items:center;flex:none;font-weight:720}
.site-body{margin-left:var(--side);min-height:100dvh;display:flex;flex-direction:column}
.mobile-header,.mobile-nav{display:none}
#main,#footer{width:min(100%,74rem);margin-inline:auto;padding-inline:clamp(1.75rem,4.35vw,4.5rem)}
#main{flex:1;padding-top:3.0rem;padding-bottom:2.2rem}
#footer{display:flex;justify-content:flex-end;align-items:center;padding-block:.6rem 1.25rem;color:var(--muted);font-size:.85rem}
.page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:1.4rem;margin:0 0 1.85rem}
.page-head h1{margin:0 0 .55rem}
.page-head p{color:var(--muted);font-size:1.03rem}
.page-head .date-label{display:flex;align-items:center;gap:.48rem;font-weight:650;font-size:.85rem;color:var(--green);margin-bottom:.65rem}
.hero{
  position:relative;display:flex;align-items:center;min-height:315px;overflow:hidden;border-radius:22px;
  background:#143227;color:#fffdf1;isolation:isolate;
  box-shadow:0 11px 25px #19342817
}
.hero::before,.hero::after{position:absolute;inset:0;content:"";z-index:-1}
.hero::before{background:url('./hero-open.webp') right 53% / 80% auto no-repeat}
.hero::after{background:linear-gradient(90deg,#122e24 0%,#122e24 17%,#132f24f5 28%,#112d22c7 44%,#10282040 66%,#0d241c15 100%)}
.hero-content{width:min(70%,32rem);padding:2rem 2.25rem}
.hero-eyebrow{color:#f4dda5;display:flex;align-items:center;gap:.5rem;font-size:.77rem;font-weight:740;letter-spacing:.12em}
.hero h2{font-size:clamp(2.35rem,4.2vw,3.95rem);line-height:1.02;margin:.68rem 0 .7rem;text-wrap:balance;color:#fff8e9}
.hero h2:first-child{margin-top:0}
.hero-meta{color:#fff7e3;max-width:25rem;font-size:1rem;line-height:1.5}
.hero-actions{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap;margin-top:1.3rem}
.button{
  min-height:42px;display:inline-flex;justify-content:center;align-items:center;gap:.46rem;text-decoration:none;
  padding:.58rem .9rem;border-radius:10px;border:1px solid transparent;font-weight:700;font-size:.91rem;line-height:1.3;text-align:center
}
.button.primary{color:#fffcf2;background:var(--green);border-color:var(--green)}
.button.primary:hover{background:var(--green-dark)}
.button.secondary{background:var(--white);color:var(--green);border-color:#d6ddd1}
.button.secondary:hover,.icon-btn:hover{background:#edf2e8}
.button.light{background:#fbf2da;color:#233d2d;border-color:#fbf2da}
.button.light:hover{background:#fffaf0}
.button.ghost{color:#fffdf0;background:#16352790;border-color:#ffffff65}
.button.ghost:hover{background:#163527d9}
.button.quiet{color:var(--green);background:transparent}
.button.quiet:hover{background:var(--green-pale)}
.button.danger{color:white;background:#943e31;border-color:#943e31}
.button.danger:hover{background:#753025}
.text-button,.text-link{background:none;border:none;padding:.15rem 0;color:var(--green);font-weight:700;text-decoration:underline;text-underline-offset:.2em}
.text-button{font-size:inherit}
.icon-btn{
  width:42px;height:42px;border:1px solid transparent;flex:none;display:grid;place-items:center;background:transparent;
  border-radius:10px;color:var(--green)
}
.dashboard{display:grid;grid-template-columns:minmax(0,1.85fr) minmax(280px,1fr);gap:1.6rem;align-items:start;margin-top:1.8rem}
.dashboard-main,.dashboard-side{display:grid;gap:1.4rem;min-width:0}
.section-head{display:flex;justify-content:space-between;align-items:center;gap:.65rem;margin-bottom:.72rem}
.section-head h2{font-size:clamp(1.4rem,2.25vw,1.85rem)}
.panel{
  border:1px solid var(--border);background:var(--white);border-radius:var(--radius);
  box-shadow:0 1px 3px #36422b07;min-width:0
}
.empty-panel{display:flex;align-items:center;gap:.8rem;min-height:105px;padding:1.05rem 1.15rem}
.empty-panel strong{font-weight:730}
.empty-panel p{color:var(--muted);font-size:.91rem;margin-top:.12rem}
.empty-panel .button{margin-left:auto}
.sq-icon{
  display:grid;place-items:center;flex:none;width:45px;height:45px;border-radius:12px;color:var(--green);
  background:var(--green-pale)
}
.sq-icon.amber{color:var(--brown);background:var(--sand)}
.task-row{display:flex;align-items:center;gap:.7rem;padding:.65rem .85rem;min-height:66px}
.task-row+.task-row,.plan-part+.plan-part{border-top:1px solid #ecece2}
.task-row:hover{background:#f9faf5}
.task-row:first-child{border-radius:var(--radius) var(--radius) 0 0}
.task-row:last-child{border-radius:0 0 var(--radius) var(--radius)}
.task-copy{
  flex:1;min-width:0;border:0;color:inherit;background:none;display:grid;text-align:left;gap:.08rem;padding:.35rem .12rem
}
.task-copy strong{font-size:.95rem;font-weight:720}
.task-copy small,.plan-part small{color:var(--muted);font-size:.85rem}
.task-check{
  appearance:none;position:relative;display:grid;place-items:center;width:42px;height:42px;flex:none;
  background:transparent;border:0;border-radius:10px;color:white
}
.task-check::before{
  content:"";width:23px;height:23px;border-radius:7px;border:1.5px solid #97aa94;background:#fffefa;
  position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)
}
.task-check.is-done::before{background:var(--green);border-color:var(--green)}
.task-check svg{z-index:1}
.task-check:hover{background:var(--green-pale)}
.tag{
  background:#edf1e7;color:#374939;border-radius:999px;display:inline-flex;align-items:center;
  gap:.3rem;padding:.24rem .59rem;font-size:.8rem;font-weight:700;line-height:1.28;max-width:100%;
}
.tag.plain{background:#eeefe8;color:#50584b}
.tag.known{background:#e4efe1;color:#2a5033}
.tag.forgotten{background:#f8eadb;color:#784722}
.tag.goal{background:#edf0de;color:#4a521b}
.tag.learning{background:#e6eef2;color:#33536a}
.progress-card{padding:1.05rem 1rem}
.progress-top{display:flex;gap:.7rem;align-items:center}
.progress-top strong{line-height:1.1;font-family:var(--serif);font-size:1.92rem;font-weight:520}
.progress-top strong span{font:600 .94rem var(--sans);color:var(--muted)}
.progress-top p,.progress-label{color:var(--muted);font-size:.85rem}
progress{display:block;width:100%;height:8px;margin:.9rem 0 .35rem;border:0;border-radius:10px;overflow:hidden;background:#e6e9e0}
progress::-webkit-progress-bar{background:#e6e9e0}
progress::-webkit-progress-value{background:#4f7956;border-radius:10px}
progress::-moz-progress-bar{background:#4f7956;border-radius:10px}
.intention{border-inline-start:3px solid #8ea481;padding:.12rem 0 .15rem .9rem}
.intention h2{font-size:1.3rem;margin-bottom:.33rem}
.intention p{color:var(--muted);overflow-wrap:anywhere;white-space:pre-line}
.under-actions{display:flex;gap:.65rem;align-items:center;flex-wrap:wrap}
.inline-notice{background:#f5ebd8;color:#5a3c18;padding:.8rem 1rem;border-radius:10px;margin-bottom:1rem}

.library-tools{display:flex;gap:1rem;align-items:center;flex-wrap:wrap}
.library-filter-mobile{display:none}
.search{
  display:flex;gap:.55rem;align-items:center;min-width:min(100%,18rem);max-width:100%;border-radius:11px;
  border:1px solid #d8ddd0;background:var(--white);padding:0 .7rem;color:var(--green)
}
.search:focus-within{outline:2px solid #54805a;outline-offset:1px}
.search input{width:100%;min-width:0;padding:.65rem .1rem;border:0;background:transparent;color:var(--ink);outline:0}
.search input:focus-visible{outline:0}
.search.compact{margin-bottom:.6rem}
.segmented{display:flex;align-items:center;flex-wrap:wrap;gap:.3rem}
.segmented button{
  background:transparent;border:1px solid #d9ddd0;padding:.35rem .67rem;min-height:37px;
  border-radius:8px;font-weight:650;font-size:.86rem;color:#4e594d
}
.segmented button:hover{background:#edf2e8}
.segmented button[aria-pressed=true]{background:var(--green-pale);border-color:#a3b89e;color:var(--green-dark)}
.results-label{color:var(--muted);font-size:.9rem;margin:1rem 0 .6rem}
.surah-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}
.surah-card{display:flex;flex-direction:column;padding:.7rem}
.surah-open{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:.49rem;align-items:center;
  text-align:left;width:100%;border:0;border-radius:8px;background:none;padding:.3rem;color:var(--ink)
}
.surah-open:hover{background:#f0f4eb}
.surah-number{width:31px;height:31px;display:grid;place-items:center;background:#edf1e8;color:#3d5540;border-radius:8px;font-size:.78rem;font-weight:700}
.surah-info{line-height:1.23}
.surah-info strong,.surah-info small{display:block;overflow-wrap:anywhere}
.surah-info small{font-size:.8rem;color:var(--muted);margin-top:.13rem}
.surah-ar{font-size:1.16rem;color:var(--green);max-width:4.5rem;overflow-wrap:anywhere}
.surah-controls{display:flex;justify-content:space-between;align-items:center;gap:.35rem;margin-top:.32rem}
.tag-button{padding:.43rem .22rem;border:0;background:none;border-radius:10px;text-align:left;min-height:42px}
.tag-button:hover .tag{filter:brightness(.95)}

.plan-tabs{margin-bottom:1.05rem}
.annual-filters{margin-bottom:.85rem}
.week-picker{max-width:38rem;padding:.66rem 1rem .8rem}
.week-nav{display:flex;justify-content:space-between;align-items:center;margin:0 0 .3rem;gap:.5rem}
.annual-tools{display:flex;align-items:center;justify-content:space-between;gap:.8rem;margin:.2rem 0 .9rem}
.annual-tools p{color:var(--muted)}
.plan-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:.85rem;margin-bottom:1rem}
.plan-summary>div{padding:.3rem .7rem}
.plan-summary>div+div{border-left:1px solid var(--border)}
.plan-summary span,.plan-summary strong{display:block}
.plan-summary span{color:var(--muted);font-size:.86rem}
.plan-summary strong{font:500 1.5rem var(--serif);margin-top:.28rem}
.month-title{font:520 1.45rem var(--serif);margin:1.35rem 0 .6rem}
.course-item{margin-bottom:.6rem}
.course-header{display:flex;align-items:center;gap:.65rem;padding:.65rem .85rem}
.date-square{width:44px;height:47px;background:#ecf0e5;border-radius:10px;display:grid;place-content:center;text-align:center;line-height:1.1;flex:none}
.date-square span{font-size:.73rem;color:var(--muted)}
.date-square strong{font-size:1.12rem;color:var(--green)}
.course-title{flex:1;min-width:0}
.course-title h4{font-size:1rem}
.course-title p{font-size:.86rem;color:var(--muted)}
.plan-part{display:flex;justify-content:space-between;gap:.5rem;align-items:center;padding:.66rem 1rem}
.course-header+.plan-part{border-top:1px solid #ecece2}
.plan-part strong,.plan-part small{display:block}
.part-actions,.catch-up-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:.4rem}
.catch-up{display:flex;align-items:center;gap:.7rem;padding:.8rem .95rem;margin-top:.9rem}
.catch-up-copy{flex:1;min-width:0}
.catch-up-copy h2{font-family:var(--sans);font-size:.92rem;font-weight:740;letter-spacing:0}
.catch-up-copy p{margin-top:.15rem;color:var(--muted);font-size:.9rem}
.catch-up-copy strong{color:var(--ink)}
.catch-up-unavailable{display:grid;gap:.18rem;color:var(--muted);font-size:.85rem}

.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.form-panel{padding:1.05rem 1.15rem}
.form-panel h2{margin-bottom:.7rem}
.form-panel p{margin:.56rem 0 .68rem;color:var(--muted)}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.25rem .85rem;align-items:start}
.field{display:grid;gap:.24rem;margin:.24rem 0 .75rem;color:var(--ink);min-width:0;align-content:start}
.field-grid>.field{margin:0 0 .58rem}
@supports(grid-template-rows:subgrid){
  .field-grid>.field{grid-row:span 3;grid-template-rows:subgrid;align-items:start}
  .field-grid>.field>span{grid-row:1}
  .field-grid>.field>input,.field-grid>.field>select{grid-row:2}
  .field-grid>.field>small{grid-row:3}
}
.field>span{font-size:.9rem;font-weight:690}
.field input,.field select,.field textarea{
  color:var(--ink);background:#fbfbf6;border:1px solid #d8ddcf;border-radius:8px;
  padding:.48rem .6rem;min-width:0;width:100%;min-height:41px;max-width:100%
}
.field input,.field select{height:46px;min-height:46px;line-height:1.2}
.field input::-webkit-date-and-time-value{text-align:left;min-height:1.2em}
.field textarea{resize:vertical}
.field select{
  appearance:none;background-image:url('./chevron.png');background-repeat:no-repeat;
  background-position:right .67rem center;background-size:11px;padding-right:1.65rem
}
.field small{font-size:.8rem;color:var(--muted)}
.settings-actions{grid-column:1/-1}
.backup{margin-top:1rem}
.form-error{color:#843524;font-size:.9rem;margin:.3rem 0}
.form-error:empty{display:none}

dialog{
  border:1px solid #dce2d4;border-radius:19px;color:var(--ink);background:var(--white);padding:1.25rem;
  width:min(36rem,calc(100% - 1.5rem));max-height:calc(100dvh - 2rem);box-shadow:0 22px 80px #08211638;overflow:auto
}
dialog.wide{width:min(49rem,calc(100% - 1.5rem))}
body:has(dialog[open]){overflow:hidden}
dialog::backdrop{background:#152c24a0}
.modal-head{display:flex;align-items:flex-start;gap:.5rem;justify-content:space-between;margin-bottom:.9rem}
.modal-head h2{font-size:clamp(1.6rem,3.3vw,2.15rem);margin:.15rem 0 .25rem}
.modal-head p{color:var(--muted);margin-top:.35rem}
.modal-head .icon-btn{margin:-.33rem -.35rem 0 0}
.dialog-actions{display:flex;justify-content:flex-end;align-items:center;gap:.55rem;margin-top:1rem}
.dialog-actions.wrap{flex-wrap:wrap}
.step-label{font-size:.84rem;color:var(--green);font-weight:700;margin-bottom:.35rem}
.step-track{display:flex;gap:.25rem;margin:0 0 .72rem;width:min(100%,9.5rem)}
.step-track span{background:#e2e8dd;flex:1;height:3px;border-radius:999px}
.step-track .reached{background:var(--green)}
.picker-count{font-size:.85rem;color:var(--muted);margin:.4rem 0 .28rem}
.trial-results{margin-top:.4rem}
.trial-pick svg{color:var(--green)}
.setup-extra summary{cursor:pointer;min-height:44px;line-height:1.4;padding:.65rem 0;font-size:.9rem;font-weight:650;color:var(--green)}
.picker{max-height:min(37vh,19rem);overflow:auto;display:grid;gap:.35rem;padding:.16rem .35rem .25rem .16rem;overscroll-behavior:contain}
.pick{
  position:relative;display:flex;align-items:center;gap:.52rem;width:100%;min-height:46px;text-align:left;
  border:1px solid #e2e5da;border-radius:8px;padding:.33rem .55rem;background:var(--white);font-weight:670
}
.pick>span:first-child{flex:1;min-width:0;overflow-wrap:anywhere}
.pick small{display:block;font-size:.75rem;color:var(--muted);font-weight:500}
.pick .arabic{color:var(--green);font-size:1.15rem}
.pick:hover,.pick.picked{background:#e9f0e5;border-color:#cadaC5}
.pick-check{
  display:grid;place-items:center;width:22px;height:22px;flex:none;
  border:1px solid #9aaa93;border-radius:6px;color:white
}
.picked .pick-check{background:var(--green);border-color:var(--green)}
.status-options{display:grid;gap:.35rem}
.status-option{
  display:flex;justify-content:space-between;align-items:center;gap:.5rem;text-align:left;background:#fafbf7;color:var(--ink);
  border:1px solid #dce1d5;border-radius:9px;padding:.55rem .68rem
}
.status-option strong,.status-option small{display:block}
.status-option small{font-size:.84rem;color:var(--muted)}
.status-option:hover,.status-option[aria-pressed=true]{background:#e9f0e5;border-color:#acc1a5}
.course-field{margin:.5rem 0 .9rem;border:1px solid var(--border);border-radius:10px;padding:.45rem .65rem .4rem;min-width:0}
.course-field legend{color:var(--green);font-size:.85rem;font-weight:650;padding:0 .3rem}
.course-fields{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr) auto;gap:.55rem;align-items:center}
.course-fields .field{margin:.15rem 0}
.reader-controls{display:flex;gap:.48rem;align-items:center;flex-wrap:wrap}
.guide-hint{margin:-.12rem 0 .6rem;color:var(--green);font-size:.9rem;font-weight:650}
.reader-meta{min-width:0;display:flex;justify-content:space-between;align-items:center;gap:.65rem;margin:.5rem 0}
.field.mini{display:flex;align-items:center;gap:.4rem;margin:0 0 0 auto}
.field.mini select{width:auto;min-width:65px}
.audio-status{font-size:.86rem;color:var(--muted)}
.reader-text{
  overflow:auto;max-height:min(47dvh,25rem);min-height:7rem;border:1px solid var(--border);
  border-radius:10px;background:#faf9f1;overscroll-behavior:contain
}
.verse-opening{
  padding:.55rem .65rem .65rem;
  border-bottom:1px solid #e8e6d8;background:#f4f2e7;text-align:center
}
.verse-opening .arabic{font-size:clamp(1.36rem,4.5vw,1.9rem);line-height:1.8;text-align:center}
.verse-row{display:grid;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:.4rem;padding:.35rem .65rem .35rem .35rem;min-height:67px}
.verse-row+.verse-row{border-top:1px solid #e8e6d8}
.verse-row.playing{background:#e6eee0}
.verse-row .arabic{font-size:clamp(1.55rem,4vw,2.15rem);line-height:1.95;padding:.11rem .25rem;overflow-wrap:anywhere}
.verse-play{width:44px;height:48px;display:flex;flex-direction:column;justify-content:center;gap:.06rem}
.verse-number{font-size:.8rem;font-weight:700;color:#426044}
.recite-panel{display:grid;place-content:center;justify-items:center;text-align:center;gap:.48rem;padding:1rem;min-height:100%}
.source-list{padding-left:1.3rem}
.source-list li{margin:0 0 .55rem}
.notice{
  position:fixed;z-index:10;right:1rem;bottom:1.1rem;max-width:min(29rem,calc(100vw - 2rem));
  background:var(--green-dark);color:#fffdf0;font-weight:650;font-size:.92rem;padding:.7rem .9rem;
  border-radius:10px;box-shadow:0 5px 18px #162d2460;pointer-events:none
}
.notice:empty{background:transparent;padding:0;box-shadow:none;pointer-events:none}

@media(max-width:1160px){
  :root{--side:218px}
  #main,#footer{padding-inline:clamp(1.35rem,3.4vw,3.4rem)}
  .surah-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
  :root{--side:180px}
  .sidebar{padding:1.55rem .7rem .9rem}
  #main,#footer{padding-inline:1.3rem}
  .dashboard{gap:1rem;grid-template-columns:minmax(0,1.25fr) minmax(235px,1fr)}
  .hero{min-height:288px}
  .hero-content{width:min(75%,30rem);padding:1.9rem 1.5rem}
}
@media(max-width:733px){
  html{scroll-padding-bottom:calc(68px + env(safe-area-inset-bottom,0px))}
  .sidebar{display:none}
  .site-body{margin-left:0;padding-bottom:calc(65px + env(safe-area-inset-bottom,0px))}
  .mobile-header{
    display:flex;align-items:center;padding:calc(.48rem + env(safe-area-inset-top,0px))
      max(1rem,env(safe-area-inset-right,0px)) .48rem max(1rem,env(safe-area-inset-left,0px));
    background:var(--sidebar);border-bottom:1px solid var(--border)
  }
  .brand{margin:0;padding:.1rem 0;font-size:.78rem}
  .brand strong{font-size:1.12rem}
  .brand-mark{width:36px;height:36px;border-radius:10px}
  .mobile-nav{
    position:fixed;z-index:6;bottom:0;left:0;right:0;
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr));background:var(--sidebar);
    padding:.25rem max(.45rem,env(safe-area-inset-right,0px)) calc(.25rem + env(safe-area-inset-bottom,0px))
      max(.45rem,env(safe-area-inset-left,0px));gap:.28rem;border-top:1px solid var(--border)
  }
  .mobile-nav a{flex-direction:column;gap:.14rem;justify-content:center;padding:.3rem .1rem;font-size:.78rem;text-align:center;min-height:49px}
  #main,#footer{padding-left:max(1rem,env(safe-area-inset-left,0px));padding-right:max(1rem,env(safe-area-inset-right,0px))}
  #main{padding-top:1.15rem}
  .page-head{margin-bottom:1rem;align-items:flex-start;flex-direction:column;gap:.55rem}
  .page-head h1{margin-bottom:0}
  .page-head p{font-size:.95rem}
  .page-head .date-label{margin-bottom:.36rem}
  .hero{min-height:211px;border-radius:17px}
  .hero.hero-started{min-height:170px}
  .hero-content{width:min(86%,29rem);padding:1.3rem 1.15rem}
  .hero h2{font-size:clamp(1.95rem,7.2vw,3.2rem);margin:.4rem 0 .5rem}
  .hero-eyebrow{font-size:.75rem;letter-spacing:.055em}
  .hero-actions{margin-top:.8rem}
  .hero-actions:has([data-action="guided-start"]):has(.ghost){
    display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:stretch
  }
  .hero-actions [data-action="guided-start"]+.ghost{padding:0}
  .hero-actions [data-action="guided-start"]+.ghost span{display:none}
  .hero-meta{font-size:.93rem}
  .hero::before{background-size:cover;background-position:67% 56%}
  .hero::after{background:linear-gradient(90deg,#122e24 0%,#122e24f2 24%,#112d22c7 47%,#1028206e 75%,#0d241c19 100%)}
  .dashboard{margin-top:1.1rem;grid-template-columns:1fr;gap:1.3rem}
  .dashboard-side{grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}
  .intention{grid-column:1/-1}
  .notice{bottom:calc(65px + env(safe-area-inset-bottom,0px))}
  .button,.icon-btn,.task-check,.task-copy,.tag-button{min-height:44px}
  .icon-btn,.task-check{width:44px}
  dialog.setup-dialog[open],dialog.reader-dialog[open]{
    position:fixed;inset:var(--dialog-top,0px) 0 auto;
    width:100%;max-width:none;height:var(--dialog-height,100dvh);max-height:none;
    margin:0;border:0;border-radius:0;overflow:hidden;
    padding:calc(.95rem + env(safe-area-inset-top,0px)) max(1rem,env(safe-area-inset-right,0px))
      calc(.55rem + env(safe-area-inset-bottom,0px)) max(1rem,env(safe-area-inset-left,0px));
  }
  .setup-layout,.reader{display:flex;flex-direction:column;height:100%;min-height:0}
  .setup-layout>.modal-head,.reader>.modal-head{flex:none;margin:0 0 .75rem}
  .setup-choices,#setup-list{display:flex;flex:1;flex-direction:column;min-height:0}
  .setup-choices .search{flex:none;margin-bottom:.3rem}
  .setup-fields{flex:1;min-height:0;overflow:auto;padding:.2rem .2rem .55rem;overscroll-behavior:contain}
  .setup-dialog .picker{max-height:none;min-height:0;flex:1;align-content:start}
  .setup-actions,.reader-actions{
    margin:.45rem -.05rem 0;border-top:1px solid var(--border);padding:.55rem .05rem 0;
    flex:none;justify-content:flex-start;
  }
  .setup-actions .primary,.reader-actions .primary,.reader-actions .button:only-child{flex:1}
  .reader-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem;align-items:stretch}
  .reader-meta{flex:none}
  .reader-text{flex:1;max-height:none;min-height:0}
  .reader-actions:empty{display:none}
  .reader-actions .button{white-space:normal}
  .setup-dialog[data-short] .modal-head{margin-bottom:.33rem}
  .setup-dialog[data-short] .modal-head h2{font-size:1.3rem}
  .setup-dialog[data-short] .modal-head p,.setup-dialog[data-short] .step-track{display:none}
  .setup-dialog[data-short] .picker-count{margin:.15rem 0 .22rem}
}
@media(max-width:500px){
  .settings-grid,.dashboard-side{grid-template-columns:1fr}
  .surah-grid{grid-template-columns:1fr}
  .library-tools{display:grid;grid-template-columns:minmax(0,1fr) minmax(95px,auto);gap:.5rem}
  .library-tools .search{min-width:0}
  .library-tools .search input{font-size:1rem}
  .library-filters{display:none}
  .library-filter-mobile{display:grid;margin:0}
  .library-filter-mobile select{min-height:45px;font-size:1rem}
  .results-label{margin:.68rem 0 .36rem}
  .surah-grid{gap:.5rem}
  .surah-card{display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto auto;gap:0 .35rem;padding:.4rem .5rem}
  .surah-open{grid-column:1;grid-row:1;padding:.24rem}
  .surah-controls{display:contents}
  .surah-controls .icon-btn{grid-column:2;grid-row:1/-1;align-self:center;background:var(--green-pale)}
  .surah-controls .tag-button{grid-column:1;grid-row:2;justify-self:start;padding:.2rem .24rem .12rem;min-height:33px}
  .surah-ar{max-width:7rem}
  .hero-content{width:min(90%,24rem)}
  .hero::before{background-position:62% 50%}
  .hero::after{background:linear-gradient(90deg,#122e24fb 0%,#122e24e8 28%,#112d22ba 56%,#10282052 100%)}
  .empty-panel{padding:.65rem .8rem;min-height:69px}
  .empty-panel .button{white-space:normal}
  .section-head{gap:.3rem}
  .section-head h2{font-size:1.45rem}
  .tag{font-size:.77rem}
  .task-row{padding:.5rem .6rem;gap:.52rem}
  .task-row .sq-icon{width:37px;height:37px;border-radius:9px}
  .course-header{padding:.58rem .55rem;gap:.45rem}
  .plan-summary{padding:.46rem}
  .plan-summary>div{padding:.24rem .36rem}
  .plan-summary strong{font-size:1.14rem}
  .plan-summary span{font-size:.78rem}
  .plan-part{padding:.58rem .7rem}
  .plan-part .button{padding:.48rem .6rem}
  .catch-up{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.48rem .62rem}
  .catch-up-actions{grid-column:1/-1;justify-content:stretch}
  .catch-up-actions .button.secondary{flex:1}
  .part-actions{max-width:65%}
  .course-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto}
  .course-fields .field:first-child{grid-column:1/-1}
  .reader-controls .button{font-size:.82rem;padding:.5rem .51rem}
  .field.mini{margin-left:0}
  dialog{padding:1rem}
}
@media(max-width:350px){
  .page-head h1{font-size:2.55rem}
  .hero-content{width:96%}
  .hero h2{font-size:1.92rem}
  .field-grid{grid-template-columns:1fr}
  .mobile-nav a{font-size:.74rem}
  .course-header .tag{max-width:5.5rem}
  .reader-actions .button{font-size:.82rem;padding-inline:.5rem}
}

.order-list{padding-inline-start:1.65rem}
.order-row{padding:.48rem 0;border-bottom:1px solid var(--line)}
.order-row strong{margin-inline-end:.5rem}
.order-buttons{display:inline-flex;flex-wrap:wrap;gap:.35rem;margin-top:.25rem}
.order-buttons button:disabled{opacity:.45;cursor:default}
.course-field>[data-action="course-extend"]{margin-top:.55rem}

.level-grid{grid-template-columns:repeat(auto-fill,minmax(6.3rem,1fr));align-content:start}
.level-tile{min-width:0;min-height:4.6rem;display:grid;gap:.1rem;align-content:start;text-align:left;padding:.45rem;border:1px solid #d9ded3;border-radius:9px;background:#f3f3ed;color:#40483f}
.level-tile strong{font-size:.86rem;line-height:1.2;overflow-wrap:anywhere}
.level-tile small{font-size:.75rem}
.level-number{font-size:.75rem;font-weight:700}
.level-tile.known{background:#e4efe1;color:#2a5033}
.level-tile.forgotten{background:#f7e3e9;color:#78384c}
.level-tile.goal{background:#f8edce;color:#644710}
.level-tile.learning{background:#e6eef2;color:#33536a}
.levels-wrapper .picker{max-height:min(64dvh,33rem)}
.weekly-programs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.9rem;margin:.9rem 0;align-items:start}
.weekly-days,.review-day-list{list-style:none;padding:0;margin:0}
.weekly-days>li{display:grid;gap:.25rem;padding:.55rem 0;border-bottom:1px solid var(--line)}
.weekly-days>li>span{color:var(--muted)}
.review-day-list li{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.35rem;padding:.18rem 0}
.review-day-list select{max-width:100%;min-height:2.4rem}
.target-fields{min-width:0;margin:0 0 .65rem;padding:.45rem .65rem;border:1px solid #d9ded3;border-radius:9px}
.target-fields legend{font-weight:700}
@media(max-width:720px){.weekly-programs{grid-template-columns:1fr}.review-day-list select{min-height:44px}}

.revision-settings{margin-top:.8rem}
.revision-settings summary{cursor:pointer;font-weight:700}
.mushaf-link{display:inline-block;align-self:flex-start;margin:.15rem 0 .45rem}

.settings-help{margin-bottom:1rem}
.settings-help summary{cursor:pointer;font-weight:700}
.settings-help-copy{max-width:68ch}
.settings-help-copy h3,.settings-help-copy h4{margin:1rem 0 .35rem}
.settings-help-copy .button{margin-top:.85rem}
.target-value{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.target-value input{flex:1 1 4rem;min-width:0;width:auto}
.target-value small{white-space:nowrap}
