/* Memorization: one reading action, a quiet notebook, a compact native dialog. */
.hifz-page { max-width: 920px; margin: 12px auto 72px; color: var(--text); }
.hifz-header { padding: 18px 0 28px; border-bottom: 1px solid var(--stroke); }
.hifz-eyebrow { display: flex; align-items: center; gap: 8px; color: var(--gold-2); font-size: .8rem; }
.hifz-eyebrow svg { width: 19px; height: 19px; }
.hifz-title-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 12px; }
.hifz-title-row h1 { margin: 0; font-size: clamp(1.8rem,4vw,2.5rem); line-height: 1.4; color: #fff4d8; }
.hifz-title-row p { margin: 6px 0 0; color: var(--muted); font-size: .94rem; }
.hifz-button, .hifz-text-button, .hifz-review { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border: 1px solid var(--stroke); border-radius: 10px; padding: 10px 16px; background: transparent; color: var(--gold-2); font: 700 .88rem var(--font-ui); text-decoration: none; cursor: pointer; }
.hifz-button.primary { flex-shrink: 0; background: var(--gold); border-color: var(--gold); color: #10251b; }
.hifz-button:hover, .hifz-review:hover:not(:disabled) { border-color: var(--gold-2); }
.hifz-button:disabled, .hifz-review:disabled { color: #bed1bb; cursor: default; }
.hifz-text-button { padding: 4px 0; border: 0; justify-content: start; }
.hifz-overview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 20px; margin: 26px 0 36px; }
.hifz-overview > section { min-width: 0; border-radius: 14px; border: 1px solid var(--stroke); padding: 20px 22px; background: #0e241c; }
.hifz-overview > section:only-child { grid-column: 1 / -1; }
.hifz-section-label { display: flex; align-items: center; justify-content: space-between; color: var(--gold-2); font-weight: 700; font-size: .88rem; }
.hifz-overview p { margin: 10px 0 8px; color: var(--muted); font-size: .9rem; }
.hifz-overview .hifz-last-range, .hifz-wird-range { display: block; margin: 12px 0 6px; font-weight: 700; font-size: 1.05rem; color: #fff2d4; overflow-wrap: anywhere; text-decoration: none; }
.hifz-wird-range:hover { text-decoration: underline; text-underline-offset: 5px; }
.hifz-wird .hifz-button { margin-top: 8px; }
.hifz-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hifz-section-title h2 { font-size: 1.2rem; color: #fff2d4; margin: 0; }
.hifz-due-badge { padding: 5px 10px; border-radius: 20px; background: rgba(227,182,79,.1); color: var(--gold-2); font-size: .75rem; }
.hifz-entries { display: grid; gap: 10px; }
.hifz-entry { border: 1px solid var(--stroke); border-radius: 12px; background: #0d221b; padding: 18px 20px 12px; }
.hifz-entry.is-due { border-color: rgba(227,182,79,.4); box-shadow: none; }
.hifz-entry-row { display: flex; align-items: center; gap: 18px; }
.hifz-entry-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hifz-open { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--gold); border-radius: 10px; background: var(--gold); color: #14291d; font: 800 .82rem var(--font-ui); text-decoration: none; }
.hifz-open:hover { background: var(--gold-2); }
.hifz-entry-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.hifz-symbol { display: grid; place-items: center; flex: none; width: 40px; height: 44px; color: var(--gold-2); border-radius: 10px; background: rgba(227,182,79,.08); }
.hifz-symbol svg { width: 22px; height: 22px; }
.hifz-entry h3 { font-size: 1rem; line-height: 1.5; color: #fff2d4; margin: 0; overflow-wrap: anywhere; }
.hifz-entry-link:hover h3 { color: var(--gold-2); }
.hifz-entry-link p { margin: 4px 0 0; color: var(--muted); font-size: .75rem; }
.hifz-entry-link p span { margin: 0 7px; }
.hifz-review { flex-shrink: 0; padding: 8px 12px; font-size: .8rem; }
.hifz-more { margin-top: 10px; }
.hifz-more summary, .hifz-backup summary { color: var(--muted); font-size: .78rem; cursor: pointer; padding: 5px 0; width: fit-content; }
.hifz-more .hifz-actions { margin: 8px 0 0; }
.hifz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hifz-actions button { min-height: 40px; padding: 7px 11px; font-size: .8rem; }
.hifz-actions button { border: 1px solid var(--stroke); border-radius: 8px; background: transparent; color: #efe2c5; font-family: var(--font-ui); cursor: pointer; }
.hifz-actions .hifz-delete { color: #ffc3b2; }
.hifz-inline-note { display: block; width: 100%; min-height: 90px; margin: 12px 0; padding: 12px; border: 1px solid var(--stroke); border-radius: 8px; background: #081b13; color: #fff2d4; font: .9rem var(--font-ui); resize: vertical; }
.hifz-review-count { color: var(--muted); font-size: .78rem; border: 0; background: none; min-width: auto; padding: 0 6px; }
.hifz-note { border-inline-start: 2px solid var(--stroke); padding: 8px 12px; background: rgba(255,255,255,.025); font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.hifz-backup { margin-top: 30px; padding: 16px 0; border-top: 1px solid var(--stroke); }
.hifz-backup p { max-width: 560px; color: var(--muted); font-size: .82rem; }
.hifz-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 270px; padding: 32px 20px; border: 1px solid var(--stroke); border-radius: 14px; text-align: center; background: rgba(255,255,255,.015); }
.hifz-empty-symbol { display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid rgba(227,182,79,.2); border-radius: 18px; color: var(--gold-2); background: rgba(227,182,79,.05); }
.hifz-empty-symbol svg { width: 30px; height: 30px; }
.hifz-empty h3 { margin: 20px 0 8px; color: #fff2d4; font-size: 1.15rem; }
.hifz-empty p { max-width: 370px; margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.9; }
.hifz-empty-steps { display: flex; align-items: center; gap: 16px; margin-top: 22px; color: var(--muted); font-size: .8rem; }
.hifz-empty-steps span { display: inline-flex; align-items: center; gap: 8px; }
.hifz-empty-steps b { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--stroke); border-radius: 50%; font: 500 .75rem var(--font-ui); color: var(--gold-2); }
.hifz-empty-steps i { font-style: normal; letter-spacing: 3px; }
.ayah-hifz-btn svg { width: 18px; height: 18px; }
.ayah-hifz-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 5px 10px; border: 1px solid var(--stroke); border-radius: 10px; color: var(--gold-2); background: var(--card-strong); font: 700 .82rem var(--font-ui); cursor: pointer; }
.ayah-hifz-btn:hover { border-color: var(--gold); }
.hifz-reader-link { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 14px 18px; border: 1px solid var(--stroke); border-radius: 12px; background: #0e241c; color: var(--gold-2); }
.hifz-reader-link > div { display: grid; flex: 1; }
.hifz-reader-link small { color: var(--muted); font-size: .77rem; }
.hifz-marker { box-sizing: border-box; width: calc(100% - 32px); max-width: 410px; max-height: calc(100dvh - 32px); margin: auto; overflow-y: auto; overscroll-behavior: contain; padding: 22px; border: 1px solid rgba(227,182,79,.3); border-radius: 20px; background: #10271e; color: #fff2d4; font: 400 1rem var(--font-ui); box-shadow: 0 24px 90px #0008; }
.hifz-marker::backdrop { background: rgba(0,12,7,.58); backdrop-filter: blur(3px); }
.hifz-marker-head { display: grid; grid-template-columns: minmax(0,1fr) 44px; align-items: center; gap: 12px; margin-bottom: 16px; }
.hifz-marker-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hifz-marker-heading .hifz-symbol { width: 36px; height: 40px; }
.hifz-icon-close { display: grid; place-items: center; flex-shrink: 0; box-sizing: border-box; appearance: none; -webkit-appearance: none; width: 44px; min-width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 1px solid var(--stroke); border-radius: 12px; background: #0b2118; color: var(--gold-2); line-height: 1; cursor: pointer; touch-action: manipulation; }
.hifz-icon-close svg { display: block; width: 20px; height: 20px; margin: 0; padding: 0; pointer-events: none; }
.hifz-icon-close:hover { background: #244334; }
.hifz-marker h2 { margin: 0; color: #fff2d4; font-size: clamp(1.0625rem,4.7vw,1.25rem); line-height: 1.5; overflow-wrap: anywhere; }
.hifz-marker-ref { margin: 0 0 16px; font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.hifz-marker-ref > span { display: block; margin-top: 5px; font-size: .78rem; color: var(--muted); }
.hifz-mark-modes { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--stroke); border-radius: 10px; background: #081b13; }
.hifz-mark-modes button { flex: 1; min-height: 44px; border: 0; border-radius: 7px; padding: 6px; background: transparent; color: var(--muted); font: 600 .875rem var(--font-ui); cursor: pointer; }
.hifz-mark-modes button[aria-pressed="true"] { color: #fff2d4; background: #244334; box-shadow: 0 1px 4px #0002; }
.hifz-marker-state { margin: 16px 0; font-size: .875rem; color: var(--muted); line-height: 1.7; }
.hifz-marker-state p { margin: 4px 0; }
.hifz-marker-state strong { color: #eee0ba; font-weight: 600; }
.hifz-mark-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hifz-mark-actions button { min-height: 48px; border: 1px solid var(--stroke); border-radius: 10px; padding: 10px; background: transparent; color: #efe2c5; font: 700 .95rem var(--font-ui); cursor: pointer; }
.hifz-mark-actions button.primary { background: var(--gold); border-color: var(--gold); color: #14291d; }
.hifz-mark-actions button:disabled { opacity: .4; cursor: default; }
.hifz-mark-listen { display: block; width: 100%; min-height: 44px; margin-top: 18px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--stroke); background: transparent; color: var(--gold-2); font: 600 .85rem var(--font-ui); cursor: pointer; }
.hifz-mark-error { color: #ffbeb1; font-size: .82rem; margin: 12px 0 0; }
.hifz-mark-error:empty { display: none; }
.unit-menu .unit-hifz-mark svg { flex-shrink: 0; width: 19px; height: 19px; }
.unit-menu .unit-hifz-mark:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.unit-menu .unit-hifz-mark { display: flex; align-items: center; justify-content: center; flex: none; gap: 8px; width: calc(100% - 32px); min-height: 44px; margin: 4px 16px 12px; padding: 9px 12px; border: 1px solid rgba(227,182,79,.6); border-radius: 9px; background: rgba(227,182,79,.12); color: var(--gold-2); font: 800 .9rem var(--font-ui); cursor: pointer; }
.hifz-reading-status { display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 12px 16px; border: 1px solid rgba(227,182,79,.4); border-radius: 12px; background: #173426; color: #f5e8c6; font-size: .82rem; }
.hifz-reading-status > svg { width: 23px; height: 23px; flex-shrink: 0; color: var(--gold-2); }
.hifz-reading-status > div { display: grid; flex: 1; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.hifz-reading-status span { color: #c5cdbd; font-size: .78rem; }
.hifz-reading-status button { flex-shrink: 0; width: 44px; height: 44px; background: transparent; color: #f5e8c6; border: 0; font-size: 1.5rem; cursor: pointer; }
.m-ayah.hifz-range-start, .ayah-card.hifz-range-start { outline: 2px solid #a68236; outline-offset: 4px; border-radius: 5px; }
.hifz-page :focus-visible, .hifz-marker :focus-visible { outline: 2px solid var(--gold-2); outline-offset: 4px; }
@media (max-width: 600px) {
  .hifz-title-row { flex-direction: column; align-items: stretch; gap: 20px; }
  .hifz-title-row .hifz-button { width: 100%; }
  .hifz-overview { grid-template-columns: 1fr; gap: 12px; margin: 22px 0 28px; }
  .hifz-overview > section { padding: 18px; }
  .hifz-entry { padding: 14px 12px 10px; }
  .hifz-entry-row { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; align-items: start; }
  .hifz-entry-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hifz-entry-link { gap: 10px; }
  .hifz-entry-link .hifz-symbol { width: 28px; height: 36px; background: transparent; }
  .hifz-review { padding: 8px; min-width: 44px; }
  .hifz-review span { line-height: 1.5; }
  .hifz-marker { width: 100%; max-width: 100%; max-height: calc(100dvh - 16px); margin: auto 0 0; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
}
