.hadis-page { --ink: #173f39; --muted: #54716c; --line: #d9e5e2; --accent: #007a73; background: #f7faf9; letter-spacing: 0; }
.hadis-page :is(h1,h2,h3,p,button,select,label) { letter-spacing: 0; }
.hadis-page button, .hadis-page select, .hadis-page input { font: inherit; }
.hadis-page button { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.hadis-page button:disabled { opacity: .4; cursor: default; }
.hadis-page [hidden] { display: none !important; }
.hadis-page :is(button,a,input,select):focus-visible { outline: 3px solid #e6ad25; outline-offset: 3px; }
.hadis-page i, .hadis-page svg { width: 19px; height: 19px; flex-shrink: 0; }
.hadis-header { min-height: 84px; padding: 10px 32px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.hadis-header img { width: 175px; height: auto; }
.hadis-header > a:last-child { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; }
.hadis-heading { padding: 25px 32px 22px; display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.kicker, .scene-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: 0; }
.hadis-heading h1 { font-size: 27px; line-height: 1.3; margin-top: 5px; max-width: 580px; }
.hadis-heading h1 span { color: #d76e37; }
.mode-switch { display: flex; border: 1px solid var(--line); border-radius: 6px; padding: 4px; gap: 4px; background: #fff; flex-shrink: 0; }
.mode-switch button { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 4px; padding: 8px 13px; font-size: 13px; font-weight: 650; }
.mode-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.hadis-workspace { display: grid; grid-template-columns: 248px minmax(0,1fr); border-top: 1px solid var(--line); }
.hadis-library { padding: 23px 18px; border-right: 1px solid var(--line); background: #fff; min-width: 0; }
.library-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.library-heading h2 { font-size: 16px; }
.library-heading > span { font-size: 12px; color: var(--muted); }
#library-toggle { display: none; }
.search-box { display: flex; align-items: center; gap: 7px; padding: 8px 10px; background: #f4f8f7; border: 1px solid var(--line); border-radius: 4px; }
.search-box input { border: 0; background: transparent; width: 100%; min-width: 0; font-size: 12px; color: var(--ink); outline-offset: 6px; }
.filter-label { display: block; font-size: 12px; margin: 13px 0 4px; }
.hadis-library select { width: 100%; padding: 9px 6px; background: #fff; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font-size: 12px; }
.favorites-filter { display: flex; gap: 7px; align-items: center; font-size: 12px; padding: 12px 0; }
.hadis-page input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.hadis-list { display: grid; gap: 3px; max-height: 465px; overflow-y: auto; overscroll-behavior: contain; padding: 3px; margin: 0 -3px; }
.hadis-list button { display: grid; grid-template-columns: 26px minmax(0,1fr) 14px; align-items: center; text-align: left; gap: 7px; border: 0; border-radius: 4px; min-height: 44px; padding: 8px; font-size: 12px; line-height: 1.4; }
.hadis-list button:hover { background: #eff8f6; }
.hadis-list button[aria-pressed="true"] { background: #dbf0eb; font-weight: 700; }
.hadis-list .list-number { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hadis-list .list-done { color: var(--accent); }
.hadis-library #empty-library { font-size: 13px; padding: 10px 0; }
.learning-progress { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; font-size: 12px; }
.learning-progress progress { width: 100%; height: 6px; accent-color: var(--accent); margin-top: 8px; }
.storage-status { font-size: 10px; color: var(--muted); margin-top: 5px; }
.hadis-main { min-width: 0; background: #fff; }
.reader-toolbar { min-height: 58px; padding: 8px 23px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reader-toolbar > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; font-size: 12px; color: var(--muted); }
#hadis-position { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.reader-tools { display: flex; align-items: center; gap: 6px; }
.hadis-page .icon-button { height: 36px; width: 36px; border-radius: 4px; display: grid; place-items: center; }
.icon-button[aria-pressed="true"] { background: #fff0f0; color: #af445d; border-color: #e6c2cc; }
.return-button { display: flex; gap: 7px; align-items: center; padding: 8px 10px; border-radius: 4px; font-size: 12px !important; }
.hadis-scene { position: relative; isolation: isolate; width: 100%; min-width: 0; min-height: 465px; display: flex; align-items: stretch; overflow: hidden; background: #eef7ed; }
.hadis-scene > img { position: absolute; z-index: -1; inset: 0 0 0 auto; width: 50%; height: 100%; object-fit: contain; object-position: center; max-width: none; }
.scene-loading { position: absolute; right: 4%; top: 42%; width: 38%; text-align: center; font-size: 12px; color: var(--muted); }
.scene-loading:has(#scene-status[hidden]) { display: none; }
.hadis-copy { width: 50%; padding: 34px 30px; display: flex; flex-direction: column; justify-content: center; background: #f4fbfb; }
.scene-kicker { color: #477a79; }
.hadis-copy h2 { font-size: 28px; line-height: 1.3; margin-top: 12px; overflow-wrap: break-word; }
.arabic { font-family: 'Geeza Pro', 'Noto Naskh Arabic', 'Amiri', 'Traditional Arabic', serif; font-size: 37px; line-height: 1.9; margin: 15px 0 12px; text-align: right; overflow-wrap: break-word; }
.arabic.long-quote { font-size: 30px; line-height: 1.85; }
.latin { font-size: 13px; color: #527477; margin-bottom: 10px; font-style: italic; overflow-wrap: anywhere; }
.meaning { font-size: 19px; font-weight: 600; line-height: 1.55; }
.hadis-reference { display: inline-flex; width: fit-content; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; margin-top: 18px; text-decoration: underline; text-underline-offset: 3px; }
.hadis-reference svg { width: 13px; height: 13px; }
.meaning-note { font-size: 9px; line-height: 1.6; color: var(--muted); margin-top: 7px; }
.reader-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 24px; border-bottom: 1px solid var(--line); }
.reader-navigation label { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.hadis-page .text-command { display: inline-flex; min-height: 40px; padding: 8px 10px; align-items: center; justify-content: center; gap: 8px; border: 0; font-size: 13px; font-weight: 650; border-radius: 4px; background: transparent; }
.text-command:hover { background: #eaf5f2; }
.learning-activity { display: grid; grid-template-columns: 1fr 1fr; gap: 35px; padding: 30px; }
.learning-activity h3 { font-size: 18px; line-height: 1.4; margin: 8px 0 13px; }
.story-content > p:not(.kicker) { font-size: 14px; line-height: 1.75; }
.daily-action { display: flex; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; }
.daily-action > svg { color: var(--accent); margin-top: 3px; }
.daily-action strong { font-size: 12px; }
.daily-action p { margin-top: 5px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.hadis-choices { display: grid; gap: 8px; }
.hadis-choices button { min-height: 50px; display: flex; gap: 12px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 6px; font-size: 13px; line-height: 1.6; }
.hadis-choices button > span:first-child { color: var(--muted); font-weight: 700; width: 18px; flex-shrink: 0; }
.hadis-choices button[data-feedback="helpful"] { background: #e3f3e8; border-color: #75a688; }
.hadis-choices button[data-feedback="rethink"] { background: #fff5da; border-color: #d8b363; }
.choice-feedback { padding: 14px 0; font-size: 13px; line-height: 1.7; }
.choice-feedback strong { display: block; margin-bottom: 5px; color: var(--accent); }
.practice-mark { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 20px; }
.source-notes { border-top: 1px solid var(--line); margin: 0 30px; padding: 15px 0; }
.source-notes summary { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 650; cursor: pointer; }
.source-notes > div { padding: 14px 0; font-size: 12px; color: var(--muted); }
.source-notes p + p { margin-top: 10px; }
.wallpaper-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 18px 24px; border-top: 1px solid var(--line); }
.wallpaper-controls label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.wallpaper-controls select { padding: 8px; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; background: #fff; max-width: 220px; font-size: 12px; }
.wallpaper-controls p { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.wallpaper-controls #wallpaper-preview-panel { flex-basis: 100%; font-size: 12px; }
#wallpaper-preview { max-width: 760px; width: 100%; max-height: 500px; object-fit: contain; object-position: left top; margin-top: 12px; }
.hadis-page .solid-command { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; min-height: 42px; background: var(--ink); border-color: var(--ink); color: #fff; border-radius: 4px; font-size: 12px; }
.class-discussion { padding: 25px 30px; border-top: 1px solid var(--line); }
.class-discussion h3 { font-size: 21px; line-height: 1.5; max-width: 920px; margin: 10px 0 18px; }
.class-discussion #class-answer { max-width: 900px; padding-top: 18px; font-size: 16px; }
.class-discussion strong { display: block; padding-top: 13px; }
.hadis-footer { padding: 24px 32px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--muted); }
.noscript-note { padding: 20px; }
.sr-only { position: absolute; height: 1px; width: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hadis-page[data-mode="class"] .hadis-workspace, .hadis-page[data-mode="wallpaper"] .hadis-workspace { display: block; }
.hadis-page:not([data-mode="learn"]) :is(.hadis-library,.learning-activity,.source-notes,.hadis-footer) { display: none; }
.hadis-page:not([data-mode="learn"]) .hadis-scene { min-height: 565px; }
.hadis-page:not([data-mode="learn"]) .hadis-copy { width: 52%; padding: 38px 55px; }
.hadis-page:not([data-mode="learn"]) .hadis-scene > img { width: 48%; }
.hadis-page:not([data-mode="learn"]) .hadis-copy h2 { font-size: 34px; }
.hadis-page:not([data-mode="learn"]) .arabic { font-size: 48px; }
.hadis-page:not([data-mode="learn"]) .arabic.long-quote { font-size: 37px; }
.hadis-page:not([data-mode="learn"]) .meaning { font-size: 24px; }
.hadis-page:not([data-mode="learn"]) .hadis-heading { padding-block: 16px; }
.hadis-page:fullscreen { overflow-y: auto; background: #fff; }
.hadis-page:fullscreen :is(.hadis-header,.hadis-heading,.hadis-footer) { display: none; }
.hadis-page:fullscreen .hadis-scene { min-height: calc(100dvh - 155px); }
@media (min-width: 1700px) { .hadis-main { max-width: 1650px; } .hadis-workspace { grid-template-columns: 280px minmax(0,1fr); } }
@media (max-width: 1000px) {
  .hadis-heading { align-items: flex-start; flex-direction: column; }
  .hadis-workspace { grid-template-columns: 210px minmax(0,1fr); }
  .hadis-copy { width: 62%; padding: 25px 22px; }
  .hadis-copy h2 { font-size: 23px; }
  .arabic { font-size: 31px; }
  .arabic.long-quote { font-size: 26px; }
  .meaning { font-size: 17px; }
  .learning-activity { grid-template-columns: 1fr; gap: 20px; padding: 24px; }
}
@media (min-width: 701px) and (max-width: 1000px) {
  .hadis-scene, .hadis-page:not([data-mode="learn"]) .hadis-scene { display: block; aspect-ratio: auto; min-height: 0; padding-bottom: 295px; }
  .hadis-scene > img, .hadis-page:not([data-mode="learn"]) .hadis-scene > img { inset: auto 0 0; width: 100%; height: 295px; }
  .hadis-copy, .hadis-page:not([data-mode="learn"]) .hadis-copy { width: 100%; min-height: 290px; padding: 28px; }
}
@media (max-width: 700px) {
  .hadis-header { min-height: 69px; padding: 8px 18px; }
  .hadis-header img { width: 130px; }
  .hadis-header > a:last-child { font-size: 12px; }
  .hadis-heading { padding: 20px 18px; gap: 16px; }
  .hadis-heading h1 { font-size: 24px; }
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1; padding-inline: 7px; }
  .hadis-workspace { display: flex; flex-direction: column; }
  .hadis-library { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; }
  .library-heading { margin-bottom: 12px; }
  #library-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 5px 8px; font-size: 11px; border-radius: 4px; }
  .hadis-library:not(.is-open) #hadis-library-content { display: none; }
  .hadis-library:not(.is-open) .library-heading { margin-bottom: 0; }
  .hadis-library:not(.is-open) .storage-status { display: none; }
  .hadis-list { display: flex; max-height: none; overflow-x: auto; gap: 5px; margin-top: 5px; }
  .hadis-list button { flex-shrink: 0; width: 170px; grid-template-columns: 22px 1fr 12px; }
  .filter-label { margin-top: 10px; }
  .hadis-library select { max-width: 100%; }
  .favorites-filter { padding-block: 8px; }
  .learning-progress { margin-top: 9px; padding-top: 8px; }
  .storage-status { font-size: 10px; }
  .reader-toolbar { padding: 10px 14px; }
  .reader-toolbar > div:first-child { gap: 6px; font-size: 11px; max-width: 135px; }
  .reader-tools { gap: 4px; }
  .hadis-page .icon-button { width: 33px; height: 33px; }
  .hadis-scene { display: block; min-height: 0; aspect-ratio: auto; padding-bottom: 245px; }
  .hadis-scene > img, .hadis-page:not([data-mode="learn"]) .hadis-scene > img { inset: auto 0 0; width: 100%; height: 245px; }
  .scene-loading { top: auto; bottom: 90px; right: 18px; width: calc(100% - 36px); }
  .hadis-copy, .hadis-page:not([data-mode="learn"]) .hadis-copy { width: 100%; min-height: 290px; padding: 25px 23px; background: #f2fbfb; }
  .hadis-copy h2, .hadis-page:not([data-mode="learn"]) .hadis-copy h2 { font-size: 26px; }
  .arabic, .hadis-page:not([data-mode="learn"]) .arabic { font-size: 36px; line-height: 1.85; }
  .arabic.long-quote, .hadis-page:not([data-mode="learn"]) .arabic.long-quote { font-size: 29px; }
  .meaning, .hadis-page:not([data-mode="learn"]) .meaning { font-size: 18px; }
  .reader-navigation { padding: 10px 12px; gap: 5px; flex-wrap: wrap; }
  .reader-navigation label { font-size: 11px; }
  .reader-navigation .text-command { font-size: 12px; gap: 5px; padding-inline: 4px; }
  .source-notes { margin-inline: 24px; }
  .hadis-footer { flex-direction: column; gap: 8px; padding-inline: 24px; }
  .hadis-page:not([data-mode="learn"]) .hadis-scene { min-height: 0; }
  .wallpaper-controls { padding: 16px 18px; gap: 12px; }
  .wallpaper-controls label { flex-wrap: wrap; }
  .return-button { max-width: 92px; font-size: 10px !important; line-height: 1.3; }
  .class-discussion h3 { font-size: 18px; }
  .hadis-page:fullscreen .hadis-scene { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .hadis-page { scroll-behavior: auto; } }
@media print {
  .hadis-page :is(.hadis-header,.hadis-heading,.hadis-library,.reader-toolbar,.reader-navigation,.wallpaper-controls,.hadis-footer,.hadis-choices,.practice-mark) { display: none !important; }
  .hadis-workspace { display: block; }
  .hadis-scene { break-inside: avoid; min-height: 430px; print-color-adjust: exact; }
  .hadis-page .source-notes { display: block; }
}
