:root {
  --bg: #071611;
  --surface: #10271f;
  --surface-2: #17362b;
  --line: rgba(211, 180, 101, .18);
  --gold: #d3b465;
  --gold-light: #f0d98e;
  --text: #f6f0df;
  --muted: #a7b7ae;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100vh; color: var(--text); font-family: "DM Sans", sans-serif; background: radial-gradient(circle at 50% -15%, #1f4c3b 0, var(--bg) 45%); }
body::before { content: ""; position: fixed; inset: 0; opacity: .045; pointer-events: none; background-image: linear-gradient(30deg, #fff 12%, transparent 12.5%, transparent 87%, #fff 87.5%, #fff), linear-gradient(150deg, #fff 12%, transparent 12.5%, transparent 87%, #fff 87.5%, #fff); background-size: 80px 140px; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: min(100%, 480px); min-height: 100vh; margin: auto; padding: max(24px, env(safe-area-inset-top)) 20px max(30px, env(safe-area-inset-bottom)); position: relative; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.eyebrow { margin: 0 0 4px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { font-family: "Playfair Display", serif; margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
.icon-button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(16,39,31,.82); font-size: 21px; cursor: pointer; }
.icon-button.off { color: #66776f; }
.quote-card { position: relative; overflow: hidden; padding: 18px 20px 17px 46px; margin-bottom: 16px; background: linear-gradient(135deg, rgba(211,180,101,.14), rgba(16,39,31,.88)); border: 1px solid var(--line); border-radius: 18px; }
.quote-card p { font: 600 15px/1.5 "Playfair Display", serif; margin: 0 0 6px; }
.quote-card small { color: var(--muted); }
.quote-mark { position: absolute; left: 14px; top: 5px; color: var(--gold); font: 50px/1 "Playfair Display", serif; opacity: .65; }
.install-banner { display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin: -3px 0 16px; border: 1px solid rgba(211,180,101,.22); border-radius: 17px; background: linear-gradient(120deg, rgba(211,180,101,.12), rgba(16,39,31,.88)); }
.install-banner[hidden] { display: none; }
.install-app-icon { flex: none; width: 38px; height: 38px; padding: 3px; border-radius: 11px; background: rgba(211,180,101,.12); }
.install-app-icon img { width: 100%; height: 100%; display: block; border-radius: 9px; }
.install-copy { min-width: 0; flex: 1; }
.install-copy strong, .install-copy span { display: block; }
.install-copy strong { color: var(--text); font-size: 12px; }
.install-copy span { overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.install-banner > button { flex: none; padding: 9px 13px; color: #12241c; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--gold-light), var(--gold)); font-size: 10px; font-weight: 700; cursor: pointer; }
.counter-card { position: relative; overflow: hidden; padding: 20px; background: radial-gradient(circle at 50% 30%, rgba(44,91,70,.48), transparent 45%), linear-gradient(160deg, rgba(23,54,43,.98), rgba(10,28,22,.98)); border: 1px solid rgba(211,180,101,.24); border-radius: 28px; box-shadow: var(--shadow); }
.counter-card::before { content: ""; position: absolute; width: 190px; height: 190px; right: -110px; top: -100px; border: 1px solid rgba(211,180,101,.09); border-radius: 50%; box-shadow: 0 0 0 28px rgba(211,180,101,.025), 0 0 0 58px rgba(211,180,101,.018); pointer-events: none; }
.dhikr-row { display: flex; align-items: center; gap: 10px; position: relative; }
.dhikr-row.refined { padding: 2px 0 13px; }
.dhikr-select { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 0; border: 0; background: transparent; cursor: pointer; }
.dhikr-select small, .stat-card small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 3px; }
.dhikr-copy { min-width: 0; padding-right: 8px; }
.dhikr-select strong { display: block; overflow: hidden; text-overflow: ellipsis; font: 600 23px "Playfair Display", serif; }
.dhikr-copy > span { display: block; overflow: hidden; color: #8fa79c; font-size: 11px; margin-top: 3px; white-space: nowrap; text-overflow: ellipsis; }
.dhikr-copy > .dhikr-arabic { color: var(--gold-light); font-family: "Noto Naskh Arabic", Tahoma, Arial, sans-serif; font-size: 16px; line-height: 1.35; opacity: .92; }
.change-dhikr { flex: none; display: flex; align-items: center; gap: 4px; padding: 8px 9px 8px 12px; color: var(--gold-light); background: rgba(211,180,101,.1); border: 1px solid rgba(211,180,101,.2); border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.change-dhikr svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.quick-dhikrs { position: relative; display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 13px; scrollbar-width: none; }
.quick-dhikrs::-webkit-scrollbar { display: none; }
.quick-dhikrs button { flex: none; padding: 8px 11px; color: #8fa79c; border: 1px solid rgba(255,255,255,.07); border-radius: 999px; background: rgba(255,255,255,.035); font-size: 10px; cursor: pointer; }
.quick-dhikrs button.active { color: #14271f; border-color: var(--gold); background: linear-gradient(135deg, var(--gold-light), var(--gold)); font-weight: 700; }
.session-row { position: relative; display: flex; align-items: center; justify-content: space-between; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.06); }
.session-label { display: flex; align-items: center; gap: 7px; color: #8fa79c; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; }
.session-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(211,180,101,.08); }
.target-chip { flex: none; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); color: var(--gold-light); border-radius: 999px; padding: 7px 11px; font-size: 11px; background: rgba(255,255,255,.035); cursor: pointer; }
.target-chip span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.target-quick { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0 2px; }
.target-quick > span { color: #789086; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.target-quick > div { display: flex; gap: 5px; }
.target-quick button { min-width: 34px; padding: 6px 8px; color: #8fa79c; border: 1px solid rgba(255,255,255,.07); border-radius: 9px; background: rgba(255,255,255,.025); font-size: 9px; cursor: pointer; }
.target-quick button.active { color: #16291f; border-color: var(--gold); background: var(--gold); font-weight: 700; }
.progress-ring { position: relative; width: min(70vw, 280px); aspect-ratio: 1; margin: 10px auto 3px; cursor: pointer; user-select: none; transition: transform .08s ease; }
.progress-ring:active, .progress-ring.pulse { transform: scale(.97); }
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 16px rgba(211,180,101,.18)); }
.ring-track, .ring-progress { fill: none; stroke-width: 8; }
.ring-track { stroke: rgba(255,255,255,.07); }
.ring-progress { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 653.45; stroke-dashoffset: 653.45; transition: stroke-dashoffset .3s ease; }
.counter-content { position: absolute; inset: 16%; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(circle at 40% 26%, #285844, #0b2018 70%); border: 1px solid rgba(240,217,142,.28); box-shadow: inset 0 0 35px rgba(0,0,0,.22), 0 8px 32px rgba(0,0,0,.2); }
.count { font: 700 clamp(66px, 20vw, 92px)/1 "Playfair Display", serif; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.tap-hint { margin-top: 10px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.progress-message { position: relative; min-height: 18px; margin: 0 0 12px; color: #91a89d; text-align: center; font-size: 11px; }
.counter-actions { position: relative; display: flex; justify-content: center; gap: 12px; }
.secondary-button, .reset-button { height: 44px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.04); cursor: pointer; }
.secondary-button { width: 48px; color: var(--gold); font-size: 22px; }
.reset-button { min-width: 96px; padding: 0 20px; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.stat-card { display: flex; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(16,39,31,.82); }
.stat-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: rgba(211,180,101,.1); color: var(--gold); }
.stat-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stat-card strong { font-size: 20px; }
.history-card { padding: 18px; background: rgba(16,39,31,.82); border: 1px solid var(--line); border-radius: 22px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; }
.section-heading > span { font-size: 10px; color: var(--gold-light); background: rgba(211,180,101,.1); border-radius: 999px; padding: 6px 9px; }
.week-chart { height: 105px; display: flex; align-items: end; justify-content: space-around; gap: 8px; padding-top: 18px; }
.day-bar { height: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 6px; }
.bar { width: min(22px, 70%); min-height: 4px; border-radius: 99px 99px 4px 4px; background: linear-gradient(var(--gold-light), #8b7337); transition: height .4s ease; }
.day-bar small { color: var(--muted); font-size: 9px; }
footer { text-align: center; color: #668077; font-size: 11px; padding: 22px 0 0; }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: flex; align-items: end; justify-content: center; padding: 16px; background: rgba(0,0,0,.65); backdrop-filter: blur(5px); }
.modal-backdrop[hidden] { display: none; }
.sheet { width: min(100%, 480px); max-height: 82vh; overflow: auto; padding: 10px 20px 24px; border: 1px solid var(--line); border-radius: 28px 28px 18px 18px; background: #10271f; box-shadow: var(--shadow); animation: rise .25s ease; }
.sheet.compact { padding-bottom: 28px; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.sheet-handle { width: 42px; height: 4px; background: #537064; border-radius: 99px; margin: 0 auto 14px; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet-header button { border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; }
.dhikr-options { display: grid; gap: 9px; }
.dhikr-option { width: 100%; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.035); cursor: pointer; }
.dhikr-option.active { color: var(--gold-light); background: rgba(211,180,101,.1); }
.dhikr-option strong { display: block; }
.dhikr-option small { color: var(--muted); }
.option-arabic { display: block; float: right; max-width: 46%; padding-left: 10px; color: var(--gold-light); font: 17px/1.6 "Noto Naskh Arabic", Tahoma, Arial, sans-serif; text-align: right; }
.add-custom { width: 100%; margin-top: 12px; padding: 13px; border: 1px dashed var(--line); border-radius: 14px; background: transparent; color: var(--gold); cursor: pointer; }
.target-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.target-options button { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.04); cursor: pointer; }
.target-options button.active { background: var(--gold); color: #11241c; font-weight: 700; }
.input-label { display: block; color: var(--muted); font-size: 12px; margin: 18px 0; }
.input-label input { width: 100%; margin-top: 7px; padding: 14px; color: var(--text); border: 1px solid var(--line); border-radius: 14px; outline: none; background: #0a1c16; }
.primary-button { width: 100%; padding: 14px; border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #10231b; font-weight: 700; cursor: pointer; }
.install-guide-icon { width: 76px; height: 76px; margin: 3px auto 14px; }
.install-guide-icon img { display: block; width: 100%; height: 100%; border-radius: 20px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.install-guide-text { color: var(--muted); font-size: 13px; line-height: 1.55; text-align: center; }
.install-steps { margin: 16px 0 20px; padding-left: 24px; color: var(--text); font-size: 13px; line-height: 1.55; }
.install-steps li { padding: 4px 0 4px 5px; }
.toast { position: fixed; z-index: 20; bottom: 28px; left: 50%; max-width: calc(100% - 40px); transform: translate(-50%, 20px); padding: 11px 16px; color: #11241c; background: var(--gold-light); border-radius: 999px; opacity: 0; pointer-events: none; font-size: 13px; font-weight: 700; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 700px) { body { padding: 24px 0; } .app-shell { min-height: auto; border: 1px solid var(--line); border-radius: 34px; background: rgba(7,22,17,.55); box-shadow: var(--shadow); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
