/* =========================================================
   غذائي الذكي — الهوية البصرية
   قاعدة كريمية دافئة، أخضر غذائي، لمسات عسلية ومرجانية
   ========================================================= */

:root {
  --cream: #FBF6EC;
  --cream-deep: #F4ECDC;
  --paper: #FFFFFF;
  --ink: #22312B;
  --ink-soft: #5B6B62;
  --green: #2E7D5B;
  --green-deep: #1F5C43;
  --green-soft: #E3F1E9;
  --amber: #D99A2B;
  --amber-soft: #FBF0DA;
  --coral: #C2604C;
  --coral-soft: #F9E7E2;
  --sky: #3C7EA8;
  --sky-soft: #E5EFF6;
  --line: #E7DFCF;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(31, 92, 67, 0.07);
  --shadow-lift: 0 18px 44px rgba(31, 92, 67, 0.12);
  --font-body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'Baloo Bhaijaan 2', 'IBM Plex Sans Arabic', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 88% -10%, rgba(217, 154, 43, 0.13), transparent 45%),
    radial-gradient(circle at 4% 8%, rgba(46, 125, 91, 0.11), transparent 42%),
    radial-gradient(rgba(34, 49, 43, 0.045) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.28;
  margin: 0 0 0.4em;
  font-weight: 700;
  color: var(--ink);
}

p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }

a { color: var(--green-deep); text-decoration: none; border-bottom: 1px solid rgba(46,125,91,.35); }
a:hover { color: var(--green); }

button, .btn { user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px;
  background: var(--green); color: #fff; padding: 10px 16px;
  border-radius: 0 0 12px 12px; z-index: 90; border: none;
}
.skip-link:focus { top: 0; }

/* ---------- الترويسة ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 246, 236, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; border: none; color: var(--ink); }
.brand:hover { color: var(--green-deep); }
.brand-mark {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--green) 0%, var(--green-deep) 100%);
  color: #fff; box-shadow: 0 6px 16px rgba(31,92,67,.25);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.brand-text small { font-size: 11.5px; color: var(--ink-soft); letter-spacing: 0; }

.main-nav {
  display: flex; gap: 4px; overflow-x: auto; max-width: 100%;
  scrollbar-width: none; -ms-overflow-style: none;
  padding: 2px;
}
.main-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  flex: 0 0 auto;
  font-family: var(--font-body); font-size: 14.5px; font-weight: 500;
  color: var(--ink-soft); background: transparent;
  border: 1px solid transparent; border-radius: 999px;
  padding: 9px 14px; min-height: 42px; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
  white-space: nowrap;
}
.nav-btn:hover { background: rgba(46,125,91,.08); color: var(--green-deep); }
.nav-btn:active { transform: scale(.97); }
.nav-btn.active {
  background: var(--green-soft); color: var(--green-deep);
  border-color: rgba(46,125,91,.28); font-weight: 600;
}

/* ---------- التخطيط ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 28px 20px 56px; }
.container.narrow { max-width: 860px; }

.view.hidden { display: none !important; }

.eyebrow {
  display: inline-block;
  font-size: 12.5px; font-weight: 600; color: var(--green-deep);
  background: var(--green-soft); border: 1px solid rgba(46,125,91,.2);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(28px, 4.5vw, 38px); margin-bottom: 6px; }
.page-head p { color: var(--ink-soft); max-width: 68ch; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}
.card h2 { font-size: 21px; margin-bottom: 10px; }

.muted { color: var(--ink-soft); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.tiny-note { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  background: var(--green-soft); color: var(--green-deep);
  border-radius: 999px; padding: 4px 12px;
  border: 1px solid rgba(46,125,91,.18);
}
.pill.ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: 16px; font-weight: 600;
  min-height: 50px; padding: 12px 24px;
  border-radius: 999px; border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  text-align: center;
}
.btn:active { transform: scale(.975); }
.btn:focus-visible { outline: 3px solid rgba(60,126,168,.55); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(160deg, #35906A 0%, var(--green-deep) 100%);
  color: #fff; box-shadow: 0 10px 22px rgba(31,92,67,.24);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(31,92,67,.3); }
.btn-secondary {
  background: var(--green-soft); color: var(--green-deep);
  border-color: rgba(46,125,91,.3);
}
.btn-secondary:hover { background: #d7ebe0; }
.btn-ghost {
  background: var(--paper); color: var(--ink);
  border-color: var(--line); box-shadow: 0 4px 14px rgba(31,92,67,.05);
}
.btn-ghost:hover { border-color: rgba(46,125,91,.35); color: var(--green-deep); }
.btn-sm { min-height: 42px; font-size: 14px; padding: 8px 16px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------- الواجهة الرئيسية ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: 28px; align-items: center;
  padding: 14px 0 30px;
}
.hero-title {
  font-size: clamp(38px, 7vw, 60px);
  margin: 0 0 10px;
  letter-spacing: 0;
  color: var(--green-deep);
}
.hero-sub { font-size: 17.5px; color: var(--ink-soft); max-width: 52ch; }
.hero-sub strong { color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.hero-art { position: relative; display: grid; place-items: center; min-height: 260px; }
.art-blob {
  position: absolute; width: min(320px, 82vw); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #EAF6EF 0%, #D6EBDF 55%, #C6E2D3 100%);
  box-shadow: inset 0 0 0 1px rgba(46,125,91,.12);
}
.mascot-frame { position: relative; z-index: 2; width: min(260px, 68vw); aspect-ratio: 1; display: grid; place-items: center; }
.mascot-frame img {
  width: 100%; height: 100%; object-fit: contain;
  animation: bob 4.6s ease-in-out infinite;
  filter: drop-shadow(0 14px 20px rgba(31,92,67,.16));
}
.mascot-fallback::after { content: '🍎'; font-size: 110px; line-height: 1; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }

.art-dot { position: absolute; border-radius: 50%; z-index: 1; }
.dot-1 { width: 16px; height: 16px; background: var(--amber); top: 12%; inset-inline-start: 8%; }
.dot-2 { width: 11px; height: 11px; background: var(--coral); bottom: 16%; inset-inline-end: 6%; }
.dot-3 { width: 22px; height: 22px; background: rgba(46,125,91,.22); bottom: 6%; inset-inline-start: 18%; }

.section-head { margin: 26px 0 16px; }
.section-head h2 { font-size: clamp(21px, 3.4vw, 27px); }
.section-head p { color: var(--ink-soft); margin: 0; }

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 22px;
}
.feature { margin-bottom: 0; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }
.feature-icon {
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 14px; margin-bottom: 12px;
}
.feature-icon svg { width: 24px; height: 24px; }
.tone-green { background: var(--green-soft); color: var(--green-deep); }
.tone-amber { background: var(--amber-soft); color: #8A6114; }
.tone-coral { background: var(--coral-soft); color: #9A4331; }

.lesson-card { display: grid; grid-template-columns: 1.35fr .65fr; gap: 26px; }
.lesson-card h2 { font-size: 27px; color: var(--green-deep); margin-bottom: 4px; }
.lesson-unit { font-weight: 600; color: var(--ink); }
.warn-note {
  font-size: 14px; background: var(--amber-soft);
  border: 1px solid rgba(217,154,43,.35);
  color: #6E4E0F;
  border-radius: var(--radius-sm); padding: 12px 14px; margin: 14px 0 18px;
}
.warn-note strong { color: #5A3F08; }
.lesson-side { border-inline-start: 1px dashed var(--line); padding-inline-start: 22px; }
.lesson-side h3 { font-size: 16px; color: var(--ink-soft); font-weight: 600; }
.skill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.skill-list li { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 500; }
.skill-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }

.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.status-list li { display: flex; gap: 14px; align-items: flex-start; }
.status-list strong { display: block; font-size: 15.5px; }
.status-list p { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.status-badge {
  flex: 0 0 auto; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.status-badge.ok { background: var(--green-soft); color: var(--green-deep); border-color: rgba(46,125,91,.28); }
.status-badge.info { background: var(--sky-soft); color: #2A5C7C; border-color: rgba(60,126,168,.28); }
.status-badge.muted { background: #EFEBE1; color: var(--ink-soft); border-color: var(--line); }

/* ---------- صفحة التعلم ---------- */
.learn-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.learn-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.counter { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }

.progress-track {
  height: 10px; border-radius: 999px; background: #EBE4D6;
  overflow: hidden; margin-bottom: 20px;
}
.progress-track > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #4CA37C, var(--green));
  transition: width .4s ease;
}

.passage {
  background: #FFFDF7; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 18px;
}
.passage summary {
  cursor: pointer; font-weight: 600; font-size: 15px;
  color: var(--green-deep); list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.passage summary::-webkit-details-marker { display: none; }
.passage summary::after { content: '▾'; margin-inline-start: auto; color: var(--ink-soft); }
.passage[open] summary::after { content: '▴'; }
.passage-badge {
  font-size: 11.5px; font-weight: 700; background: var(--amber-soft);
  color: #7A5510; border-radius: 999px; padding: 2px 10px;
}
.passage-note { font-size: 12.5px; color: var(--ink-soft); margin: 10px 0 8px; }
.passage-text { font-size: 17px; line-height: 2; margin: 0; }

.question-card { padding: 24px; }
.q-kicker {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 10px;
}
.q-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.q-prompt { font-size: clamp(20px, 3.4vw, 25px); margin-bottom: 18px; }

.speak-btn {
  margin-inline-start: auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--sky-soft); color: #2A5C7C;
  border: 1px solid rgba(60,126,168,.25); border-radius: 999px;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; min-height: 36px; cursor: pointer;
}
.speak-btn:hover { background: #D8E8F3; }
.speak-btn svg { width: 16px; height: 16px; }

.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.option {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; min-height: 58px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #FFFDF8; cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, transform .12s ease, box-shadow .16s ease;
}
.option:hover { border-color: rgba(46,125,91,.45); background: #FCFAF3; }
.option:active { transform: scale(.995); }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-letter {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: #F1EADA; color: var(--ink-soft);
  font-weight: 700; font-size: 15px;
  transition: background-color .16s ease, color .16s ease;
}
.option-text { font-size: 16.5px; font-weight: 500; }
.option.selected {
  border-color: var(--green); background: var(--green-soft);
  box-shadow: 0 6px 18px rgba(46,125,91,.12);
}
.option.selected .option-letter { background: var(--green); color: #fff; }
.option:focus-within { outline: 3px solid rgba(60,126,168,.45); outline-offset: 2px; }

.answer-box { margin-bottom: 16px; }
.answer-input {
  width: 100%; font-family: var(--font-body); font-size: 17px;
  padding: 15px 18px; min-height: 56px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #FFFDF8; color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.answer-input::placeholder { color: #A79C88; }
.answer-input:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(46,125,91,.14);
}

.attempt-note { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 14px; }

.question-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.inline-warn {
  background: var(--coral-soft); color: #8B3B29;
  border: 1px solid rgba(194,96,76,.35);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 14.5px; font-weight: 500; margin-bottom: 14px;
}
.inline-warn.hidden { display: none; }

/* ---------- التغذية الراجعة ---------- */
.feedback-card { border-width: 1.5px; }
.feedback-card.tone-good { border-color: rgba(46,125,91,.4); background: linear-gradient(180deg, #F4FBF7 0%, #FFFFFF 60%); }
.feedback-card.tone-warn { border-color: rgba(217,154,43,.45); background: linear-gradient(180deg, #FDF7EA 0%, #FFFFFF 60%); }
.feedback-card.tone-bad { border-color: rgba(194,96,76,.4); background: linear-gradient(180deg, #FDF1EE 0%, #FFFFFF 60%); }
.feedback-card.tone-neutral { border-color: var(--line); background: linear-gradient(180deg, #F7F6F2 0%, #FFFFFF 60%); }

.feedback-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.verdict-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 700; border-radius: 999px;
  padding: 5px 14px; border: 1px solid transparent;
}
.verdict-chip svg { width: 16px; height: 16px; }
.verdict-chip.good { background: var(--green-soft); color: var(--green-deep); border-color: rgba(46,125,91,.3); }
.verdict-chip.warn { background: var(--amber-soft); color: #7A5510; border-color: rgba(217,154,43,.4); }
.verdict-chip.bad { background: var(--coral-soft); color: #8B3B29; border-color: rgba(194,96,76,.35); }
.verdict-chip.neutral { background: #F1EFE8; color: var(--ink-soft); border-color: var(--line); }

.feedback-card h2 { font-size: clamp(21px, 3.4vw, 26px); margin-bottom: 10px; }
.answer-echo { font-size: 15px; color: var(--ink-soft); margin-bottom: 10px; }
.answer-echo strong { color: var(--ink); font-weight: 600; }
.feedback-message { font-size: 16.5px; margin-bottom: 10px; }
.praise {
  background: rgba(46,125,91,.08); border-inline-start: 4px solid var(--green);
  border-radius: 10px; padding: 10px 14px; font-weight: 500; margin: 0;
}

.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.help-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px;
}
.help-card h3 { font-size: 15.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.help-card p { font-size: 15px; margin: 0; color: var(--ink); }
.help-card.hint { background: var(--amber-soft); border-color: rgba(217,154,43,.35); }
.help-card.hint h3 { color: #7A5510; }
.help-card.explain { background: #F4FBF7; border-color: rgba(46,125,91,.28); }
.help-card.explain h3 { color: var(--green-deep); }
.help-card.model { background: #F2F7FB; border-color: rgba(60,126,168,.3); }
.help-card.model h3 { color: #2A5C7C; }
.help-card .hint-level { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }

.reveal-banner {
  background: var(--sky-soft); color: #23506C;
  border: 1px solid rgba(60,126,168,.3);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 14.5px; margin-bottom: 16px;
}

.decision {
  background: #FAF7F0; border: 1px dashed var(--line);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px;
}
.decision summary {
  cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-soft);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.decision summary::-webkit-details-marker { display: none; }
.decision summary::after { content: '▾'; margin-inline-start: auto; }
.decision[open] summary::after { content: '▴'; }
.decision p { font-size: 14px; margin: 10px 0 0; color: var(--ink); }
.decision .rule-tag {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  background: #EFEBE1; color: var(--ink-soft);
  border-radius: 999px; padding: 2px 10px; margin-bottom: 6px;
}

.feedback-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.link-btn {
  background: none; border: none; padding: 8px 4px; min-height: 44px;
  font-family: var(--font-body); font-size: 14px; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.link-btn:hover { color: var(--coral); }

/* ---------- بطاقة الذكاء الاصطناعي ---------- */
.ai-card { border-style: dashed; border-color: rgba(60,126,168,.4); }
.ai-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-head h2 { font-size: 19px; margin: 0; }
.ai-note { font-size: 14px; color: var(--ink-soft); }
.ai-result {
  background: #F2F7FB; border: 1px solid rgba(60,126,168,.28);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 12px;
}
.ai-result .ai-verdict {
  display: inline-block; font-weight: 700; font-size: 13px;
  background: #DCEBF5; color: #23506C; border-radius: 999px; padding: 3px 12px; margin-bottom: 8px;
}
.ai-result dl { margin: 0; display: grid; gap: 8px; }
.ai-result dt { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.ai-result dd { margin: 0; font-size: 14.5px; }
.ai-error {
  background: var(--coral-soft); color: #8B3B29;
  border: 1px solid rgba(194,96,76,.3);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14.5px;
}

/* ---------- التقدم ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat-tile {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px;
  box-shadow: var(--shadow);
}
.stat-tile .stat-value {
  font-family: var(--font-display); font-size: 30px; font-weight: 700;
  color: var(--green-deep); line-height: 1.1;
}
.stat-tile .stat-label { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

.skill-row { margin-bottom: 16px; }
.skill-row:last-child { margin-bottom: 0; }
.skill-row-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 6px; flex-wrap: wrap;
}
.skill-row-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.skill-bar { height: 10px; border-radius: 999px; background: #EDE7DA; overflow: hidden; }
.skill-bar > span { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.skill-tag { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.skill-tag.high { background: var(--green-soft); color: var(--green-deep); }
.skill-tag.mid { background: var(--amber-soft); color: #7A5510; }
.skill-tag.low { background: var(--sky-soft); color: #23506C; }
.skill-tag.none { background: #F1EFE8; color: var(--ink-soft); }

.error-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.error-item:last-child { border-bottom: none; padding-bottom: 0; }
.error-count {
  flex: 0 0 auto; min-width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--amber-soft); color: #7A5510; font-weight: 700; font-size: 14px;
}
.error-item strong { display: block; font-size: 15px; }
.error-item p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft); }

.empty-state {
  text-align: center; padding: 28px 18px;
  background: #FFFDF7; border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}
.empty-state p { color: var(--ink-soft); }

/* ---------- لوحة المعلم ---------- */
.demo-banner {
  background: var(--amber-soft); border: 1px solid rgba(217,154,43,.45);
  color: #6E4E0F; border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 14px; margin-bottom: 16px;
}
.data-switch { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.seg-btn {
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  padding: 9px 18px; min-height: 44px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink-soft); cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.seg-btn:hover { border-color: rgba(46,125,91,.35); }
.seg-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; text-align: start; vertical-align: top; }
table.data thead th {
  background: #F7F2E7; font-weight: 700; font-size: 13px;
  color: var(--ink-soft); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid #F1EBDD; }
table.data tbody tr:last-child { border-bottom: none; }
table.data tbody tr:nth-child(even) { background: #FFFDF8; }
.tag {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.tag.correct { background: var(--green-soft); color: var(--green-deep); }
.tag.partial { background: var(--amber-soft); color: #7A5510; }
.tag.incorrect { background: var(--coral-soft); color: #8B3B29; }
.tag.insufficient { background: #F1EFE8; color: var(--ink-soft); }

.field-label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 8px; }
.textarea {
  width: 100%; min-height: 130px; resize: vertical;
  font-family: var(--font-body); font-size: 15.5px; line-height: 1.8;
  padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: #FFFDF8; color: var(--ink);
}
.textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(46,125,91,.14); }
.card-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head-row h2 { margin: 0; }

.approved-text {
  background: #FFFDF7; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 15.5px; line-height: 1.9; white-space: normal;
  margin-bottom: 12px;
}

.info-list { margin: 0 0 12px; display: grid; gap: 10px; }
.info-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
.info-list dt { font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.info-list dd { margin: 0; font-size: 15px; }
.info-list dd.warn { color: #8B3B29; font-weight: 600; }

.check-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; font-size: 14.8px; }
.link-list { margin: 0 0 10px; padding-inline-start: 20px; display: grid; gap: 8px; font-size: 15px; }

/* ---------- التذييل ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.55);
  padding: 24px 0 34px;
  margin-top: 20px;
}
.site-footer p { margin: 0 0 4px; font-size: 14px; }

.noscript {
  position: fixed; inset: auto 16px 16px 16px;
  background: var(--coral); color: #fff; padding: 14px 18px;
  border-radius: 14px; text-align: center; z-index: 99;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- الاستجابة ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 4px; }
  .hero-sub { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-art { order: -1; min-height: 200px; }
  .lesson-card { grid-template-columns: 1fr; }
  .lesson-side { border-inline-start: none; border-top: 1px dashed var(--line); padding-inline-start: 0; padding-top: 16px; }
  .help-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .container { padding: 20px 16px 46px; }
  .header-inner { padding: 8px 14px; gap: 8px; }
  .brand-text small { display: none; }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .brand-text strong { font-size: 18px; }
  .main-nav { width: 100%; justify-content: flex-start; }
  .nav-btn { font-size: 13.5px; padding: 8px 12px; min-height: 40px; }
  .card { padding: 18px; border-radius: 18px; }
  .hero-title { font-size: 40px; }
  .hero-sub { font-size: 16px; }
  .question-card { padding: 18px; }
  .option { padding: 12px 14px; min-height: 54px; }
  .option-text { font-size: 15.5px; }
  .stat-tile .stat-value { font-size: 26px; }
  .info-list > div { grid-template-columns: 1fr; gap: 2px; }
  .btn { width: 100%; }
  .question-actions .btn, .feedback-actions .btn { width: 100%; }
  .speak-btn { margin-inline-start: 0; }
  .verdict-chip { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .mascot-frame img { animation: none; }
}