:root{--bg:#f7f8f3;--card:#fff;--ink:#243d35;--muted:#77817a;--line:#e6eae2;--green:#245a49;--light:#edf3e9;--gold:#a58a57;--dhikr-size:27px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Tahoma,Arial,sans-serif;font-size:14px;line-height:1.7}button,input,select{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #b59758;outline-offset:4px}button{color:inherit}a{color:var(--green)}[hidden]{display:none!important}.sidebar{width:244px;position:fixed;right:0;top:0;bottom:0;background:var(--card);border-left:1px solid var(--line);padding:38px 23px;display:flex;flex-direction:column}.brand{display:flex;gap:14px;align-items:center;text-decoration:none;font-family:Georgia,'Times New Roman',serif;font-size:37px;font-weight:bold;color:var(--green);line-height:1.2}.brandmark{background:var(--green);color:#ead6a8;width:48px;height:53px;border-radius:18px 18px 10px 10px;display:grid;place-items:center;font-size:32px}.brand small{display:block;font:10px Tahoma,Arial,sans-serif;color:var(--muted);margin-top:9px}.nav-label{font-size:11px;color:var(--muted);margin:57px 14px 15px}nav{display:grid;gap:9px}nav button{display:flex;align-items:center;gap:13px;background:none;border:0;border-radius:10px;padding:14px 16px;text-align:right;color:var(--muted);white-space:nowrap}nav button.active{background:var(--light);color:var(--green);font-weight:bold}nav button.active:after{content:'';width:5px;height:5px;border-radius:50%;background:var(--green);margin-right:auto}svg.icon{width:22px;height:22px;flex-shrink:0;vertical-align:middle}.sidebar-bottom{margin-top:auto;padding:30px 14px 0}.sidebar-bottom .leaf{font-size:56px;color:#b1bda7}.sidebar-bottom p{font-size:19px;margin:4px 0 12px;line-height:1.8}.sidebar-bottom small{color:var(--muted);font-size:11px}.settings-link{background:none;border:0;border-top:1px solid var(--line);width:100%;margin-top:35px;padding:20px 0 0;font-size:12px;display:flex;justify-content:space-between;color:var(--muted)}main{max-width:1600px;margin-right:244px;padding:32px 44px}.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:28px}.eyebrow{font-size:11px;color:var(--muted)}h1{font-size:23px;margin:3px 0 0}h2{font-size:22px;margin:5px 0}h3{font-size:17px;margin:7px 0 16px}.top-actions{display:flex;gap:20px;align-items:center}.date{font-size:12px;color:var(--muted)}.icon-button{display:grid;place-items:center;background:var(--card);border:1px solid var(--line);width:39px;height:39px;border-radius:50%;font-size:23px}.hero{height:253px;border-radius:18px;background:#1d5144;color:#fff;display:flex;justify-content:space-between;position:relative;overflow:hidden;padding:33px 39px}.hero-copy{z-index:1}.hero-label{color:#d7c797;font-size:11px;letter-spacing:2px}.hero h2{font-family:Georgia,'Times New Roman',serif;font-weight:400;font-size:39px;margin:12px 0 3px}.hero p{color:#c6d9ce;font-size:13px;margin:0 0 25px}.hero-button{background:#f1e9d4;color:#264c3e;border:0;border-radius:8px;padding:11px 18px;font-weight:bold;font-size:12px;display:flex;gap:25px;align-items:center}.stats{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:17px;margin:22px 0 34px}.stats article{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px;display:flex;align-items:center;gap:13px}.stat-icon{background:var(--light);color:var(--green);border-radius:11px;width:43px;height:43px;display:grid;place-items:center}.stat-label{font-size:11px;color:var(--muted)}.stats strong{display:block;line-height:1.3;margin-top:5px}.stats b{font-size:26px}.stats small{font-size:11px;color:var(--muted);font-weight:normal}.tiny-tag{font-size:9px;color:var(--gold);margin-right:auto;white-space:nowrap}.content-grid{display:grid;grid-template-columns:minmax(0,1fr) 258px;gap:24px;align-items:start}.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.quiet-button{background:none;border:1px solid var(--line);border-radius:7px;padding:6px 11px;font-size:10px;color:var(--muted)}.quiet-button[aria-pressed=true]{background:var(--light);color:var(--green)}.progress-label{font-size:11px;display:flex;justify-content:space-between;color:var(--muted);margin-bottom:8px}.track{height:4px;background:var(--line);border-radius:4px;overflow:hidden;margin-bottom:21px}.track>span{height:100%;display:block;background:#739579;transition:width .2s}.dhikr-card{border:1px solid var(--line);border-radius:13px;background:var(--card);padding:21px 25px 17px;margin-bottom:15px;scroll-margin-top:20px;transition:border-color .2s}.dhikr-card.done{border-color:#a5bca2}.card-top{display:flex;align-items:center;gap:10px;font-size:12px}.number{font-size:10px;width:25px;height:25px;border-radius:50%;background:var(--light);display:grid;place-items:center;color:var(--green)}.repeat-label{font-size:10px;color:var(--muted);margin-right:auto}.dhikr-text{font:var(--dhikr-size)/2.05 'Traditional Arabic','Amiri','Noto Naskh Arabic','Times New Roman',serif;white-space:pre-line;margin:22px 0;text-align:center;color:var(--ink)}.card-bottom{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding-top:13px;gap:10px}.card-bottom details{font-size:10px;color:var(--muted);max-width:50%}summary{cursor:pointer}details a{display:inline-block;margin-top:8px;text-decoration:none}details p{font-size:11px;line-height:1.9;color:var(--muted)}.counter-controls{display:flex;align-items:center;gap:8px}.count-button{background:var(--light);border:1px solid #dae6d7;border-radius:8px;min-width:106px;padding:9px 13px;color:var(--green);font-size:12px;transition:transform .1s}.count-button:active{transform:scale(.95)}.count-button:disabled{background:var(--green);color:#fff;border-color:var(--green)}.undo{border:0;background:none;color:var(--muted);font-size:21px;padding:6px 10px}.undo:disabled{opacity:.25}.week-card{border:1px solid var(--line);border-radius:13px;background:var(--card);padding:23px 20px}.journey{padding-top:4px}.week{display:grid;grid-template-columns:repeat(7,1fr);gap:5px;direction:rtl;margin:20px 0}.day{text-align:center;font-size:9px;color:var(--muted)}.day .dot{display:grid;place-items:center;width:24px;height:24px;margin:8px auto;border-radius:50%;background:var(--light);font-size:11px}.day.today .dot{outline:1px solid var(--green);outline-offset:3px}.day.finished .dot{background:var(--green);color:#fff}.week-card>p{font-size:11px;color:var(--muted);margin:15px 0}.week-card details{border-top:1px solid var(--line);padding-top:12px;font-size:10px;color:var(--muted)}.note-card{background:#eeeee2;border:1px solid #e5e5d5;border-radius:13px;padding:23px;margin-top:17px}.note-card>span{color:#998b60;font-size:28px}.note-card h3{font-size:15px;margin:3px 0 10px}.note-card p{color:#7d806b;font-size:12px;margin:0;line-height:2}.local-note{text-align:center;color:var(--muted);font-size:10px;line-height:2;margin-top:22px}footer{text-align:center;color:var(--muted);font-size:11px;padding:36px 0 10px}footer span{padding:0 8px;color:var(--gold)}footer p{font-size:10px}.toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);background:#244d3f;color:white;border-radius:10px;padding:12px 23px;box-shadow:0 6px 25px #0002;z-index:10;opacity:0;pointer-events:none;transition:opacity .2s;max-width:90%;text-align:center;font-size:12px}.toast.show{opacity:1}dialog{border:1px solid var(--line);border-radius:18px;background:var(--card);color:var(--ink);max-width:460px;width:calc(100% - 32px);padding:30px;box-shadow:0 25px 100px #0003}dialog::backdrop{background:#10271e77;backdrop-filter:blur(4px)}dialog .close{float:left}dialog h2{margin-bottom:25px}dialog p{font-size:12px;color:var(--muted);line-height:2}input[type=range]{display:block;width:100%;accent-color:var(--green);margin:18px 0 30px}.primary{background:var(--green);color:white;border:0;border-radius:8px;padding:11px 18px}#storage-warning{padding:12px;background:#fff0ce;color:#664c17;border-radius:8px;margin-bottom:15px}.empty{text-align:center;padding:45px;background:var(--card);border:1px solid var(--line);border-radius:13px}.free-card{text-align:center;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:27px}.free-card select{background:var(--bg);border:1px solid var(--line);padding:10px;border-radius:8px;color:var(--ink);max-width:100%}.free-counter{display:flex;align-items:center;justify-content:center;flex-direction:column;width:210px;height:210px;border-radius:50%;margin:25px auto;background:var(--light);border:7px solid #b9cbb4;color:var(--green)}.free-counter strong{font-size:55px;line-height:1.2}.free-counter span{font-size:12px}.free-card p{color:var(--muted);font-size:12px}.free-actions{display:flex;justify-content:center;gap:15px;margin-top:25px}.dark{--bg:#15251f;--card:#1e3028;--ink:#e1e8dd;--muted:#a0afa3;--line:#34483c;--green:#a3c9ac;--light:#2b4133;--gold:#ccb981}.dark .hero{background:#234e3e}.dark .primary,.dark .count-button:disabled{color:#173326}.dark .note-card{background:#30392b;border-color:#44503a}.dark .note-card p{color:#b2b8a0}.dark .brandmark{color:#203d2c}.dark .count-button{border-color:#4a6452}.dark .day.finished .dot{color:#163326}@media(min-width:1500px){main{padding-right:65px;padding-left:65px}.hero{height:280px}.dhikr-card{padding:25px 35px}}@media(max-width:1150px){main{padding:25px;margin-right:210px}.sidebar{width:210px;padding:28px 16px}.content-grid{grid-template-columns:minmax(0,1fr) 230px;gap:17px}.tiny-tag{display:none}.hero{padding:30px 26px}.hero h2{font-size:33px}.stats article{padding:15px 12px}.stat-icon{width:35px;height:35px}.dhikr-card{padding:20px}.date{display:none}}@media(max-width:900px){.content-grid{grid-template-columns:1fr}.journey{display:grid;grid-template-columns:1fr 1fr;gap:15px}.note-card{margin:0}.local-note{grid-column:1/-1;margin-top:0}.hero h2{font-size:30px}.stats{gap:9px}.stat-icon{display:none}.stat-label{font-size:10px}.stats b{font-size:24px}}@media(max-width:650px){.sidebar{position:static;width:auto;padding:18px 20px 0;border-left:0;background:var(--bg)}.brand{font-size:29px}.brandmark{width:37px;height:42px;font-size:26px}.brand small{font-size:9px;margin-top:5px}.nav-label,.sidebar-bottom{display:none}nav{display:flex;gap:5px;margin:22px -5px 0;overflow:auto;border-bottom:1px solid var(--line);padding-bottom:12px}nav button{padding:10px 9px;font-size:11px;gap:6px;flex-shrink:0}nav button.active:after{display:none}nav .icon{width:16px;height:16px}main{margin:0;padding:20px}.topbar{margin-bottom:20px}h1{font-size:19px}.hero{height:228px;padding:25px 23px}.hero h2{font-size:29px;max-width:210px;line-height:1.5;margin:9px 0}.hero p{font-size:11px;max-width:185px;margin-bottom:18px}.hero-button{padding:9px 13px;font-size:11px;gap:17px}.hero-label{font-size:9px}.stats{margin:17px 0 26px;gap:7px}.stats article{padding:12px 8px;justify-content:center;text-align:center}.stat-label{font-size:9px}.stats b{font-size:23px}.stats small{font-size:9px}.section-head h2{font-size:20px}.quiet-button{font-size:9px}.dhikr-card{padding:17px}.dhikr-text{font-size:var(--dhikr-size);line-height:1.95;margin:23px 0}.card-top{font-size:11px}.repeat-label{font-size:9px}.journey{grid-template-columns:1fr}.local-note{grid-column:auto}.week-card{padding:22px}.week-card .dot{width:30px;height:30px}.note-card{display:none}.card-bottom details{max-width:43%}.count-button{min-width:100px;padding:9px 10px}.toast{width:max-content;max-width:90%}}@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* The book mark sits inside an eightfold rosette, with light coming from the reading margin. */
.hero {
  --banner-start: #295a4e;
  --banner-end: #153e38;
  --banner-glow: rgb(186 211 158 / 32%);
  --banner-rim: rgb(243 226 174 / 44%);
  height: auto;
  min-height: clamp(254px, 24vw, 304px);
  column-gap: clamp(14px, 4vw, 58px);
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgb(251 238 195 / 14%), 0 9px 26px -20px #10332e;
}
.hero[data-section="morning"] {
  --banner-start: #305544;
  --banner-end: #18453a;
  --banner-glow: rgb(255 208 131 / 44%);
}
.hero[data-section="evening"] {
  --banner-start: #203e55;
  --banner-end: #153e3d;
  --banner-glow: rgb(152 198 206 / 36%);
  --banner-rim: rgb(203 224 215 / 46%);
}
.hero, .dark .hero {
  background-color: var(--banner-end);
  background-image: radial-gradient(ellipse 46% 110% at 9% 14%, var(--banner-glow), transparent 79%),
    linear-gradient(112deg, var(--banner-start), var(--banner-end) 72%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 27% 0 0;
  pointer-events: none;
  background: repeating-radial-gradient(ellipse at -22% 128%, transparent 0 50px, rgb(236 224 181 / 17%) 51px, transparent 52px 75px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%, transparent 98%);
  mask-image: linear-gradient(90deg, transparent, #000 35%, transparent 98%);
}
.hero-emblem {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-inline-size: 0;
  align-self: center;
  flex: 0 0 clamp(64px, 24%, 174px);
  aspect-ratio: 1;
  margin-inline-end: clamp(5px, 2.8vw, 40px);
  pointer-events: none;
}
.hero-emblem::before {
  content: "";
  position: absolute;
  inset: -37%;
  background: url("banner-rosette.svg") center / contain no-repeat,
    radial-gradient(circle, rgb(245 227 175 / 17%) 20%, transparent 68%);
}
.hero-logo {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22%;
  box-shadow: 0 0 0 1px var(--banner-rim), 0 5px 16px rgb(6 28 28 / 28%);
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
  text-align: start;
}
.hero .hero-label {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #efdbac;
}
.hero-label::after {
  content: "";
  width: 2rem;
  height: 1px;
  background: linear-gradient(to left, currentColor, transparent);
}
.hero h2 {
  color: #fffaf0;
  line-height: 1.5;
  text-wrap: balance;
}
.hero .hero-copy p { color: #d9e8dd; }
.hero-button {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 44px;
  margin-block-start: auto;
  white-space: nowrap;
  line-height: 1.4;
  direction: rtl;
  background: #f5ebd5;
  box-shadow: 0 2px 7px rgb(9 32 26 / 18%);
}
.hero-button:focus-visible { outline-color: #f2d293; }
.hero-button .button-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
@media (hover: hover) {
  .hero-button:hover { background: #fff5df; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-emblem::before { animation: rosette-appear .8s ease-out both; }
  @keyframes rosette-appear {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
  }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hero-button .button-arrow { transition: transform .18s ease-out; }
  .hero-button:hover .button-arrow { transform: translateX(-3px); }
}
@media (max-width: 650px) {
  .hero { min-height: 228px; column-gap: clamp(12px, 3.5vw, 20px); }
  .hero-copy { padding-inline-end: 5px; }
  .hero-emblem { margin-inline-end: clamp(4px, 2.4vw, 16px); }
  .hero-emblem::before { inset: -34%; }
}
@media (max-width: 365px) {
  .hero { padding-inline: 17px; }
  .hero-emblem { margin-inline-end: 4px; }
}

.source-note{padding:13px 16px;margin-bottom:18px;border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--muted);font-size:11px}.source-note p{line-height:2}.alternative{padding:12px 15px;background:var(--light);border-radius:8px;margin-bottom:17px;text-align:center}.alternative span,.alternative small{font-size:11px;color:var(--muted)}.alternative p{font:var(--dhikr-size)/1.9 "Traditional Arabic","Times New Roman",serif;margin:8px 0}.repeat-label{white-space:nowrap}.count-button{white-space:nowrap}

/* Readable Arabic UI text, including secondary labels on phones. */
body{font-size:16px}
.brand small,.nav-label,.sidebar-bottom small,.settings-link,.eyebrow,.date,
.stat-label,.stats small,.tiny-tag,.quiet-button,.progress-label,
.repeat-label,.card-bottom details,.week-card>p,.week-card details,
.local-note,footer,footer p,.source-note,.alternative span,.alternative small,
.free-counter span,.free-card p,.toast{font-size:14px}
.hero-label{font-size:14px;letter-spacing:0}
.hero p{font-size:15px;line-height:1.9}
.hero-button,.count-button{font-size:15px}
.card-top{font-size:16px;flex-wrap:wrap}
.card-top strong{flex:1;min-width:120px}
.number{font-size:13px;width:30px;height:30px}
.repeat-label{white-space:normal}
details p,dialog p,.note-card p{font-size:14px;line-height:1.95}
.note-card h3{font-size:18px}
.quiet-button,.count-button,.free-card select{min-height:44px}
.free-card select{font-size:16px}
.free-card .dhikr-text{font-size:var(--dhikr-size);line-height:2.05}
.free-picker {
  display: grid;
  gap: 12px;
  inline-size: min(100%, 34rem);
  margin: 26px auto 24px;
  text-align: start;
}
.free-picker label { color: var(--ink); font-size: 16px; font-weight: 600; }
.free-picker select, .free-picker textarea {
  box-sizing: border-box;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.free-picker select { text-overflow: ellipsis; }
.free-picker textarea { resize: vertical; line-height: 1.8; }
.free-picker textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.free-picker-actions, .free-goal-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.free-picker-actions button { min-block-size: 44px; color: var(--green); }
.free-picker-actions .primary { color: var(--card); }
#free-add-form { display: grid; gap: 10px; }
.free-goal-row { justify-content: center; }
.free-card #free-phrase { color: var(--ink); overflow-wrap: anywhere; }
.icon-button{width:44px;height:44px}
.day{font-size:13px}.day .dot{font-size:13px}
.section-head{gap:12px;flex-wrap:wrap}
@media(max-width:650px){
 nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;gap:8px}
 nav button{font-size:14px;min-height:46px;padding:10px 12px;gap:9px}
 nav .icon{width:20px;height:20px}
 .brand small{font-size:13px}
 .hero p{max-width:230px;font-size:15px}
 .hero-button{font-size:15px}
 .stats article{display:block;padding:14px 8px}
 .stat-label{display:flex;align-items:center;justify-content:center;min-height:3.4em;font-size:14px;line-height:1.7}
 .stats b{font-size:28px}.stats small{font-size:13px}
 .stats strong{margin-top:10px}
 .quiet-button,.repeat-label{font-size:14px}
 .card-top{font-size:16px}
 .card-bottom{flex-wrap:wrap;align-items:flex-start}
 .card-bottom details{flex:1;min-width:90px;max-width:none;padding-top:9px}
 .counter-controls{flex-shrink:0}
 .top-actions{gap:10px}
}

/* Keep navigation and progress together above the cards. */
#reading { min-inline-size: 0; container-type: inline-size; }

.reading-toolbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 6px;
  margin-block-end: 14px;
  border-block-end: 1px solid var(--line);
  background: var(--bg);
}
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .reading-toolbar {
    background-color: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
  .reading-toolbar {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

#collection-progress { flex: 1; min-inline-size: 0; color: var(--ink); }
#collection-progress .progress-label {
  align-items: baseline;
  gap: 6px;
  margin-block-end: 5px;
  color: var(--ink);
  line-height: 1.5;
}
.progress-copy { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .55em; }
.progress-copy > span { white-space: nowrap; }
.progress-percent { flex: none; color: var(--green); font-weight: 600; }
#collection-progress .track { height: 4px; margin: 0; }
#collection-progress .track > span { background: var(--green); }

.scroll-shortcuts {
  display: flex;
  flex: none;
  gap: 2px;
  padding-inline-start: 6px;
  border-inline-start: 1px solid var(--line);
}
.scroll-shortcuts button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--green);
  font-size: 14px;
}
.scroll-shortcuts svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shortcut-label { display: none; }
@container (min-width: 38rem) {
  .shortcut-label { display: inline; white-space: nowrap; }
  .scroll-shortcuts button { padding-inline: 12px; }
}
@media (hover: hover) {
  .scroll-shortcuts button:hover { background: var(--light); }
}
.scroll-shortcuts button:active,
.scroll-shortcuts button:focus-visible { background: var(--light); }
#cards :where(button, summary, a), #free-panel :where(button, select) {
  scroll-margin-block-start: calc(6rem + env(safe-area-inset-top, 0px));
}

.brand .brand-icon{object-fit:contain;padding:0;flex-shrink:0}.brand small{line-height:1.5}.brand{align-items:center}

/* Prominent brand and reading controls available before every collection. */
.brand{gap:12px}
.brand>span{min-width:0}
.brand .brand-icon{width:68px;height:68px;border-radius:15px;background:transparent}
.brand small{max-width:11em}
.reading-tools{margin-bottom:16px;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--light)}
.reading-tools-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.reading-tools-heading label{font-weight:bold;font-size:16px}
.font-preview{margin-block-start:12px;padding:10px 12px;border-block-start:1px solid var(--line);text-align:center}
.font-preview>span{font-size:14px;color:var(--muted)}
.font-preview .dhikr-text{color:var(--ink);font-size:var(--dhikr-size);margin:4px 0 0}
.source-links{display:grid;gap:8px;margin-block:8px;overflow-wrap:anywhere}
.source-links a,.free-source a,.source-note a{color:var(--green);text-underline-offset:.2em}
.pulse-target{position:relative;display:inline-grid}
.pulse-hit{display:none}
.free-pulse-target{display:block;width:fit-content;max-width:100%;margin:25px auto}
.free-pulse-target .free-counter{margin:0}
.touch-counter-feedback .pulse-target>button:enabled+.pulse-hit{
  display:block;position:absolute;inset:0;cursor:pointer;touch-action:manipulation
}
.free-pulse-target .pulse-hit{clip-path:circle(50%)}
.pulse-hit input{position:absolute;top:50%;left:50%;width:1px;height:1px;margin:0;opacity:0;pointer-events:none}
.reading-tools .quiet-button{background:var(--card);color:var(--ink)}
.font-size-controls{display:flex;align-items:center;gap:12px;margin-top:8px}
.font-size-controls input[type=range]{flex:1;min-width:0;width:auto;min-height:44px;margin:0;cursor:pointer}
.font-step{width:44px;height:44px;flex-shrink:0;border:1px solid var(--line);border-radius:9px;background:var(--card);font-size:21px;font-weight:bold;line-height:1;direction:rtl}
.font-step:disabled{opacity:.4}
.general-label{display:inline-block;margin-inline-start:8px;font:normal 13px/1.8 Tahoma,Arial,sans-serif;color:var(--green);background:var(--light);padding:1px 8px;border-radius:6px}
.dhikr-note{font-size:14px;line-height:1.9;color:var(--muted);text-align:center;margin:0 0 18px}
.dhikr-card{scroll-margin-top:100px}
@media(max-width:650px){.brand{font-size:34px;gap:16px}.brand .brand-icon{width:72px;height:72px;border-radius:16px}.reading-tools{padding:12px}.reading-tools-heading{gap:8px}}

/* Familiar controls, visible streak marker, and compact navigation. */
.font-step{direction:ltr;font-family:Arial,sans-serif;font-size:20px}
.topbar{gap:12px;flex-wrap:wrap}
.other-tools{border:1px solid var(--line);border-radius:12px;background:var(--card);padding:16px;margin-bottom:16px}
.other-tools p{margin:0 0 12px;font-size:15px;color:var(--muted)}
.other-tool-row{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.other-tools select{font-size:16px;padding:8px;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:8px;max-width:100%;min-height:44px}
.other-tools small{display:block;color:var(--muted);font-size:13px;line-height:1.9;margin-top:10px}
#reading-end { block-size: 1px; outline: none; scroll-margin-block-end: 12px; }
#footer-top { color: var(--green); margin-block-start: 8px; }
#footer-top b { margin-inline-start: .3em; }
.toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
#reminders-dialog{max-height:calc(100dvh - 32px);overflow-y:auto;max-width:500px}
.reminder-times{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:20px 0}
.reminder-times label{font-size:15px;font-weight:bold;min-width:0}
.reminder-times input{display:block;width:100%;min-width:0;min-height:46px;margin-top:8px;padding:8px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font-size:17px;direction:ltr}
.reminder-toggle,.haptics-option{display:flex;align-items:center;gap:10px;min-height:44px;font-size:15px}
.reminder-toggle input,.haptics-option input{width:22px;height:22px;accent-color:var(--green);flex-shrink:0}
#haptics-info{margin:0 0 18px}
.haptics-option,.haptics-option input{cursor:pointer}
.reminder-actions{display:flex;gap:8px;flex-wrap:wrap}
.reminder-actions button,.calendar-reminders button{min-height:44px;font-size:14px}
.reminder-actions button:disabled{opacity:.6}
.reminder-limit{padding:12px;background:var(--light);border-radius:9px}
.calendar-reminders{border-top:1px solid var(--line);padding-top:16px;margin-top:20px}
.calendar-reminders small{font-size:13px;line-height:1.9;color:var(--muted)}
#reminder-status,#calendar-status{min-height:1.8em}
@media(max-width:650px){.top-actions{gap:8px}#reminders-dialog{padding:22px}}

.install-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-inline-size: 100%;
  min-block-size: 48px;
  margin-block-end: 16px;
  padding: 8px 16px;
  border: 1px solid var(--green);
  border-radius: 10px;
  background: var(--green);
  color: var(--card);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}
.install-link svg { flex: none; }
@media (max-width: 650px) { .install-link { width: 100%; } }
#settings-dialog, #install-dialog { max-block-size: calc(100dvh - 32px); overflow-y: auto; }
#install-dialog h2 { margin: 12px 0; font-size: 20px; }
.install-icon { display: block; border-radius: 12px; }
.install-steps { padding-inline-start: 1.5em; margin-block: 14px 0; line-height: 1.85; }
.install-steps li + li { margin-block-start: 8px; }
.install-steps svg { vertical-align: -.16em; color: var(--green); }
.install-steps [lang="en"] { font-size: .88em; }
.install-open { display: inline-flex; align-items: center; min-block-size: 44px; }
.install-open-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; }
#install-url { width:100%; margin-block-start:8px; padding:8px; font-size:16px; }
#install-copy-status:empty { display:none; }
#install-native { min-block-size: 44px; margin-block-start: 8px; color: var(--card); }

/* Brand and streak */
.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}
.sidebar-header .brand { max-width: 100%; }
.streak-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--light);
  line-height: 1.5;
}
.streak-symbol {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--card);
  background: var(--green);
}
.streak-label { font-size: 14px; }
.streak-badge strong { color: var(--green); font-size: 16px; font-variant-numeric: tabular-nums; }
.best-streak {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.best-streak strong { color: var(--ink); font-size: 16px; }
.hero { margin-bottom: 28px; }

.count-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  font-variant-numeric: tabular-nums;
}
.extra-repetitions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
}
.extra-repetitions bdi { font-weight: bold; font-variant-numeric: tabular-nums; }
.extra-repetitions button { color: var(--green); }
.count-button:disabled { color: var(--card); }
.undo, #free-undo {
  font-size: 14px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-inline-size: 44px;
  min-block-size: 44px;
  color: var(--green);
  border-radius: 8px;
}
.undo:active:not(:disabled), .undo:focus-visible { background: var(--light); }
.tap-feedback { animation: counter-pulse 180ms ease-out; }
.goal-feedback { animation: counter-pulse 440ms ease-out; }
@keyframes counter-pulse {
  from { box-shadow: 0 0 0 2px var(--green); }
  to { box-shadow: 0 0 0 6px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .tap-feedback, .goal-feedback { animation-name: counter-highlight; }
  @keyframes counter-highlight {
    from, to { box-shadow: 0 0 0 2px var(--green); }
  }
}
.dhikr-card:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* Keep mobile navigation in page flow. Only the fixed wide sidebar needs its own scroll area. */
@media (min-width: 650.01px) {
  .sidebar {
    bottom: auto;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--muted) var(--card);
    padding-top: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .sidebar > * { flex-shrink: 0; }
  .sidebar:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
  .sidebar .nav-label { margin-top: 20px; margin-bottom: 10px; }
  .sidebar nav button { white-space: normal; text-align: start; }
  .sidebar nav button span { min-width: 0; overflow-wrap: anywhere; }
}
@media (min-width: 650.01px) and (max-height: 650px) {
  .sidebar-bottom { padding-top: 14px; }
  .sidebar-bottom .leaf, .sidebar-bottom p, .sidebar-bottom small { display: none; }
  .sidebar-bottom .settings-link { margin-top: 0; padding-top: 14px; }
}
@media (max-width: 650px) {
  .sidebar-header { flex-flow: row wrap; align-items: center; justify-content: space-between; }
  .hero { margin-bottom: 24px; }
}
