/* نور المسير — طبقة الهوية الطباعية واللمسات البصرية */
:root {
  --ui-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --display-font: "Alexandria", "IBM Plex Sans Arabic", sans-serif;
  --quran-font: "Noto Naskh Arabic", "Traditional Arabic", serif;
  --ink-strong: #102e29;
  --surface: #fffefa;
  --surface-soft: #f5f4ed;
  --shadow-soft: 0 12px 34px rgba(5, 47, 41, .075);
  --shadow-lift: 0 22px 55px rgba(5, 47, 41, .14);
}

html { font-size: 16px; }
body {
  color: var(--ink-strong);
  font-family: var(--ui-font);
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font-family: var(--ui-font); }
h1, h2, h3, h4 { font-family: var(--display-font); font-weight: 700; }
strong, b { font-family: var(--ui-font); }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

/* هوية التنقل */
.topbar {
  border: 1px solid rgba(18, 50, 44, .08);
  border-top: 0;
  box-shadow: 0 10px 32px rgba(5, 47, 41, .07);
}
.brand strong { font-family: var(--display-font); font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand small { font-size: 11px; font-weight: 500; }
.top-main-nav button { font-size: 12px; font-weight: 600; }
.rail-brand strong { font-size: 18px; font-weight: 700; }
.rail-brand small, .rail-navigation small { font-size: 10px; line-height: 1.55; }
.rail-navigation b { font-size: 12px; font-weight: 600; }

/* البطولة الرئيسية */
.sanctuary-hero {
  box-shadow: 0 28px 75px rgba(3, 34, 30, .22);
}
.sanctuary-copy h1,
.hero-card h1 {
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.12;
}
.sanctuary-copy > p,
.hero-card > p { font-size: 16px; font-weight: 400; line-height: 1.9; }
.eyebrow, .kicker { font-size: 12px; font-weight: 700; letter-spacing: .025em; }
.verse-signature p,
.hero-quote p { font-family: var(--quran-font); font-weight: 600; letter-spacing: 0; }

/* التسلسل الطباعي */
.section-heading h2,
.day-section-heading h2 { font-weight: 700; letter-spacing: -.035em; line-height: 1.25; }
.section-heading > p,
.day-section-heading > p { font-size: 14px; line-height: 1.9; }
.field-group > label,
.mode-selector legend,
.pace-row label,
.minutes-editor label { font-size: 10px; font-weight: 600; letter-spacing: .01em; }
.privacy-badge { font-size: 9px; font-weight: 600; }

/* البطاقات والحقول */
.planner-card,
.feature-card,
.map-card,
.ward-card,
.principles-card,
.science-card,
.progress-main,
.goal-card {
  border-color: rgba(14, 65, 56, .09);
  box-shadow: var(--shadow-soft);
}
.feature-card,
.home-command-bar > button,
.mode-selector label span,
.input-row {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}
.feature-card:hover,
.home-command-bar > button:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.feature-card h3 { font-size: 21px; font-weight: 700; line-height: 1.35; }
.feature-card p { font-size: 13px; line-height: 1.9; }
.feature-card > b { font-size: 12px; font-weight: 600; }
.home-command-bar small { font-size: 9px; font-weight: 600; }
.home-command-bar b { font-size: 12px; font-weight: 700; }
.home-command-bar em { font-size: 9px; line-height: 1.55; }
.input-row { background: rgba(255, 255, 255, .92); }
.input-row input { font-size: 13px; font-weight: 500; }
.mode-selector label span { font-size: 11px; font-weight: 600; }
.mode-selector label small { font-size: 9px; font-weight: 400; }
.primary-button, .secondary-button { font-size: 13px; font-weight: 700; }
.primary-button:focus-visible,
.secondary-button:focus-visible,
button:focus-visible,
a:focus-visible { outline: 3px solid rgba(202, 166, 75, .75); outline-offset: 3px; }

/* الآيات والمصحف */
.mushaf-page-text,
.ayah-text,
.story-caption p,
.zamzam-copy blockquote {
  font-family: var(--quran-font);
  font-weight: 600;
  letter-spacing: 0;
}
.mushaf-page-text { font-size: clamp(24px, 2vw, 34px); line-height: 2.15; font-variant-ligatures: common-ligatures; }
.ayah-text { line-height: 2.15; }

/* مساحات أكثر راحة للأقسام الخدمية */
.view > .section-heading,
.value-section .section-heading { margin-bottom: 25px; }
.stories-hero,
.companion-hero,
.mobility-hero,
.notes-hero,
.adhkar-hero,
.manasik-hero,
.heritage-hero,
.zakat-hero,
.quiz-hero,
.ramadan-hero { box-shadow: 0 22px 55px rgba(4, 39, 34, .15); }

/* مكتبة القراءات العشر */
.qiraat-hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 34px; color: #fff; background: linear-gradient(135deg, #073a32, #0c5a4b); border-radius: 28px; box-shadow: var(--shadow-lift); }
.qiraat-hero h1 { margin: 6px 0 10px; font-size: clamp(28px, 4vw, 48px); }
.qiraat-hero p { max-width: 720px; margin: 0; color: rgba(255,255,255,.8); font-size: 15px; line-height: 1.9; }
.qiraat-hero-mark { display: grid; place-items: center; flex: 0 0 94px; height: 94px; color: #173f37; background: #f0d88f; border-radius: 30px; font-family: var(--quran-font); font-size: 48px; }
.qiraat-readers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin: 20px 0; }
.qiraat-readers span { padding: 11px 8px; color: #31534d; background: #fffdf7; border: 1px solid rgba(7,58,50,.09); border-radius: 14px; text-align: center; font-weight: 600; }
.qiraat-library { padding: 26px; background: #fffdf8; border: 1px solid rgba(7,58,50,.1); border-radius: 26px; box-shadow: var(--shadow-soft); }
.qiraat-controls { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 14px; }
.qiraat-controls label { display: grid; gap: 7px; color: #526b66; font-size: 12px; font-weight: 600; }
.qiraat-controls input, .qiraat-controls select { min-height: 50px; padding: 0 14px; color: #12322c; background: #fff; border: 1px solid #dbe4e0; border-radius: 14px; font-size: 14px; }
.qiraat-player { display: grid; grid-template-columns: minmax(180px, .7fr) 1.3fr; align-items: center; gap: 20px; margin: 22px 0; padding: 18px; color: #fff; background: #073a32; border-radius: 19px; }
.qiraat-player span { display: block; color: #e2c76e; font-size: 11px; }
.qiraat-player strong { display: block; margin-top: 4px; }
.qiraat-player audio { width: 100%; }
.qiraat-status { margin: 24px 0; color: #687b77; text-align: center; }
.qiraat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.qiraat-card { display: grid; gap: 9px; padding: 18px; background: #fff; border: 1px solid #e2e8e5; border-radius: 18px; }
.qiraat-card small { color: #9a7720; font-weight: 700; }
.qiraat-card b { font-size: 16px; line-height: 1.55; }
.qiraat-card p { min-height: 42px; margin: 0; color: #687b77; font-size: 12px; line-height: 1.7; }
.qiraat-card button { min-height: 43px; color: #fff; background: #0a4a3e; border: 0; border-radius: 12px; font-weight: 700; cursor: pointer; }
.qiraat-source-note { margin: 18px 4px; color: #657873; font-size: 12px; line-height: 1.9; }
.qiraat-source-note a { color: #0a5c4b; font-weight: 700; }

/* معلّم التلاوة */
.teacher-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 34px; color: #fff; background: linear-gradient(135deg, #123f37, #062b26); border-radius: 28px; box-shadow: var(--shadow-lift); }
.teacher-hero h1 { margin: 6px 0 10px; font-size: clamp(30px, 4vw, 50px); }
.teacher-hero p { max-width: 720px; margin: 0; color: rgba(255,255,255,.78); line-height: 1.9; }
.teacher-lock { padding: 11px 16px; color: #173b34; background: #f0d88f; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.teacher-studio { margin-top: 20px; padding: 28px; background: #fffdf8; border: 1px solid rgba(7,58,50,.1); border-radius: 28px; box-shadow: var(--shadow-soft); }
.teacher-picker { display: grid; grid-template-columns: 1.4fr .65fr auto; align-items: end; gap: 12px; }
.teacher-picker label { display: grid; gap: 7px; color: #58716c; font-size: 12px; font-weight: 600; }
.teacher-picker select, .teacher-picker input, .teacher-picker button { min-height: 50px; padding: 0 14px; border: 1px solid #dbe4e0; border-radius: 14px; font-family: var(--ui-font); }
.teacher-picker button { padding-inline: 24px; color: #fff; background: #0a4a3e; border: 0; font-weight: 700; cursor: pointer; }
.teacher-ayah { margin: 24px 0; padding: clamp(24px, 5vw, 48px); background: #f8f2df; border: 1px solid #eadba9; border-radius: 24px; text-align: center; }
.teacher-ayah span { color: #8d6c1b; font-size: 12px; font-weight: 700; }
.teacher-ayah p { margin: 14px 0 0; color: #172e29; font-family: var(--quran-font); font-size: clamp(25px, 3.5vw, 42px); font-weight: 600; line-height: 2.15; }
.teacher-actions { display: flex; align-items: center; justify-content: center; gap: 12px; }
.teacher-actions button { min-height: 48px; padding: 0 20px; color: #fff; background: #0a4a3e; border: 0; border-radius: 14px; font-weight: 700; cursor: pointer; }
.teacher-actions button:first-child { background: #9f3c32; }
.teacher-actions button:disabled { opacity: .45; cursor: not-allowed; }
#teacherTimer { min-width: 64px; color: #506762; font-variant-numeric: tabular-nums; font-weight: 700; }
#teacherPlayback { width: 100%; margin-top: 18px; }
.teacher-result { display: grid; grid-template-columns: 130px 1fr; gap: 22px; align-items: center; margin-top: 22px; padding: 20px; background: #edf5f2; border-radius: 20px; }
.teacher-score { display: grid; place-items: center; min-height: 112px; background: #fff; border-radius: 18px; }
.teacher-score strong { color: #0a5b4b; font-family: var(--display-font); font-size: 34px; }
.teacher-score span { color: #6a7e79; font-size: 10px; }
.teacher-result h3 { margin: 0 0 7px; }
.teacher-result p { margin: 0 0 7px; line-height: 1.8; }
.teacher-result small { color: #61746f; line-height: 1.8; }
.teacher-caution { margin-top: 16px; padding: 17px 20px; color: #66572b; background: #fff7dc; border: 1px solid #efdda0; border-radius: 17px; font-size: 12px; line-height: 1.9; }

/* بوصلة قبلة مبسطة */
.qibla-card { grid-template-columns: 1fr 210px; }
.compass-wrap { gap: 12px; }
.compass {
  width: 176px;
  height: 176px;
  background: #fff;
  border: 2px solid #d8e2de;
  box-shadow: 0 12px 30px rgba(7,58,50,.09), inset 0 0 0 8px #f3f6f4;
}
.compass::before { content: ""; position: absolute; inset: 50%; width: 8px; height: 8px; transform: translate(-50%,-50%); background: #073a32; border-radius: 50%; }
.compass > .north { top: 13px; right: 50%; transform: translateX(50%); color: #7b8d88; font-size: 9px; font-weight: 700; }
.qibla-arrow { inset: 18px; }
.qibla-arrow i { top: 9px; width: 4px; height: 56px; background: #caa64b; }
.qibla-arrow i::before { top: -9px; border-right-width: 8px; border-left-width: 8px; border-top: 15px solid #caa64b; }
.qibla-arrow b { width: 32px; height: 32px; color: #e6c75f; background: #073a32; border-radius: 9px; font-size: 13px; transform: translate(50%,-50%) rotate(45deg); }
.compass-degree { padding: 7px 12px; color: #31554d; background: #edf3f0; border-radius: 999px; font-size: 11px; font-weight: 700; }

/* الهاتف */
@media (max-width: 700px) {
  body { line-height: 1.7; }
  .topbar { background: rgba(255, 254, 249, .94); box-shadow: 0 8px 25px rgba(5, 47, 41, .09); }
  .brand strong { font-size: 16px; }
  .sanctuary-copy h1, .hero-card h1 { line-height: 1.15; letter-spacing: -.035em; }
  .sanctuary-copy > p, .hero-card > p { font-size: 15px; line-height: 1.9; }
  .journey-console.planner-card { padding: 22px; }
  .journey-console .section-heading.compact h2 { font-size: 25px; line-height: 1.3; }
  .journey-console .field-group > label,
  .journey-console .console-modes legend,
  .journey-console .console-transport legend { font-size: 10px; }
  .journey-console .console-modes label span,
  .journey-console .console-transport label span { min-height: 48px; font-size: 11px; }
  .journey-console .console-modes label small,
  .journey-console .console-transport label small { font-size: 8px; }
  .day-section-heading h2 { font-size: 30px; }
  .day-section-heading > p { font-size: 13px; }
  .mushaf-page-text { font-size: clamp(22px, 6.2vw, 30px); line-height: 2.2; }
  .home-command-bar b { font-size: 13px; }
  .home-command-bar small, .home-command-bar em { font-size: 9px; }
  .feature-card { padding: 22px; }
  .feature-card h3 { font-size: 20px; }
  .feature-card p { font-size: 11px; }
  .bottom-nav button b { font-size: 9px; font-weight: 600; }
  .qiraat-hero { padding: 24px; }
  .qiraat-hero-mark { display: none; }
  .qiraat-hero p { font-size: 13px; }
  .qiraat-readers { grid-template-columns: repeat(2, 1fr); }
  .qiraat-library { padding: 18px; }
  .qiraat-controls, .qiraat-player { grid-template-columns: 1fr; }
  .qiraat-grid { grid-template-columns: 1fr; }
  .teacher-hero { padding: 24px; align-items: flex-start; flex-direction: column; }
  .teacher-studio { padding: 18px; }
  .teacher-picker { grid-template-columns: 1fr 1fr; }
  .teacher-picker button { grid-column: 1 / -1; }
  .teacher-actions { flex-wrap: wrap; }
  .teacher-result { grid-template-columns: 1fr; }
  .qibla-card { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .journey-console.planner-card { padding: 18px; }
  .journey-console .console-modes,
  .journey-console .console-transport { gap: 7px; }
  .journey-console .console-modes label span,
  .journey-console .console-transport label span { padding-inline: 7px; }
}
