:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #60706a;
  --line: #d8e1dc;
  --paper: #fff;
  --wash: #f3f7f4;
  --green: #176b55;
  --green-soft: #e5f3ed;
  --red: #a33a31;
  --red-soft: #fff0ed;
  --gold: #e5b94f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--wash); color: var(--ink); }
button, input { font: inherit; }
a { text-decoration: none; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #79b7a3; outline-offset: 2px; }
.site-shell { width: min(96rem, calc(100% - 2rem)); margin: 0 auto; }
main#app { flex: 1 0 auto; }
.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid #e4e4e7; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); }
.site-header-top { display: flex; align-items: center; gap: 1rem; min-height: 4.25rem; }
.site-brand { display: inline-flex; align-items: center; gap: .75rem; flex: 0 0 auto; min-width: 0; color: #18181b; }
.site-brand-mark { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; overflow: hidden; border: 1px solid #e4e4e7; border-radius: 999px; background: #fafafa; box-shadow: inset 0 0 0 1px rgba(255,255,255,.6); }
.site-brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; padding: .3rem; }
.site-brand-copy { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.site-brand-name { font-size: 1.125rem; font-weight: 800; letter-spacing: -.02em; color: #18181b; white-space: nowrap; }
.site-brand-name span { color: #059669; }
.site-brand-sub { margin-top: .2rem; font-family: Tahoma, Arial, sans-serif; font-size: .95rem; color: #52525b; white-space: nowrap; }
.site-header-actions { margin-left: auto; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; }
.site-youtube-badge { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.25rem; padding: 0 .9rem; border-radius: 999px; background: #dc2626; color: #fff; font-size: .8rem; font-weight: 800; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.site-youtube-badge:hover { background: #ef4444; }
.site-youtube-icon { display: inline-grid; place-items: center; width: 1rem; height: 1rem; font-size: .72rem; line-height: 1; }
.site-menu-toggle { display: none; align-items: center; gap: .7rem; min-height: 2.75rem; padding: .6rem .9rem; border: 1px solid #d4d4d8; border-radius: .85rem; background: #fff; color: #18181b; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.site-menu-toggle-bars { display: inline-grid; gap: .22rem; }
.site-menu-toggle-bars span { display: block; width: 1.2rem; height: 2px; border-radius: 999px; background: currentColor; }
.site-menu-toggle-label { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .05rem; line-height: 1; }
.site-menu-toggle-ar { font-family: Tahoma, Arial, sans-serif; font-size: .95rem; font-weight: 700; }
.site-menu-toggle-en { font-size: .75rem; font-weight: 700; color: #64748b; }
.site-auth-group { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.site-auth-pill { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 2.75rem; padding: .55rem .95rem; border-radius: .85rem; border: 1px solid #d4d4d8; background: #fff; color: #18181b; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.site-auth-pill:hover { background: #f4f4f5; border-color: #a1a1aa; }
.site-auth-ar { font-family: Tahoma, Arial, sans-serif; font-size: 1rem; font-weight: 700; line-height: 1.05; }
.site-auth-en { margin-top: .05rem; font-size: .8rem; font-weight: 700; color: #52525b; line-height: 1.05; }
.site-auth-progress .site-auth-ar, .site-auth-subscription .site-auth-ar { color: #166534; }
.site-auth-progress .site-auth-en, .site-auth-subscription .site-auth-en { color: #15803d; }
.site-auth-subscription { background: #f59e0b; border-color: #d97706; color: #fff; }
.site-auth-subscription .site-auth-en, .site-auth-subscription .site-auth-ar { color: #fff; }
.site-auth-login, .site-auth-signup { min-width: 6.5rem; }
.site-auth-signup { background: #059669; border-color: #059669; color: #fff; }
.site-auth-signup .site-auth-en, .site-auth-signup .site-auth-ar { color: #ecfdf5; }
.site-main-nav { display: flex; flex-wrap: wrap; gap: .5rem .4rem; padding: .75rem 0 1rem; border-top: 1px solid #f4f4f5; }
.site-nav-link { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 3.25rem; padding: .55rem .85rem; border-radius: .75rem; color: #0f172a; background: transparent; }
.site-nav-link:hover { background: #f8fafc; color: #14532d; }
.site-nav-ar { font-family: Tahoma, Arial, sans-serif; font-size: 1rem; font-weight: 700; line-height: 1.05; }
.site-nav-en { font-size: .8rem; font-weight: 700; color: #64748b; line-height: 1.05; }
.site-footer { margin-top: auto; color: #fff; background: #0f172a; }
.site-footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(4, minmax(0, 1fr)); gap: 2rem; padding: 3.5rem 0 2.25rem; }
.site-footer-brandcol { max-width: 22rem; }
.site-footer-brandlink { display: inline-flex; flex-direction: column; gap: .15rem; color: #fff; margin-bottom: 1rem; }
.site-footer-brandname { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.site-footer-brandaccent { font-size: .8rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #4ade80; line-height: 1; }
.site-footer-ar { margin: 0 0 .35rem; font-family: Tahoma, Arial, sans-serif; font-size: .95rem; font-weight: 600; color: #cbd5e1; line-height: 1.7; }
.site-footer-en { margin: 0; color: #94a3b8; font-size: .95rem; line-height: 1.7; }
.site-footer-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.site-footer-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; background: #1e293b; color: #cbd5e1; font-size: .78rem; }
.site-footer-col { min-width: 0; }
.site-footer-heading-ar { margin: 0; font-family: Tahoma, Arial, sans-serif; font-size: 1rem; font-weight: 700; color: #e2e8f0; }
.site-footer-heading-en { margin: .2rem 0 1rem; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: #64748b; }
.site-footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.site-footer-links a { color: #94a3b8; font-size: .95rem; line-height: 1.5; }
.site-footer-links a:hover { color: #fff; }
.site-footer-bar { border-top: 1px solid #1e293b; }
.site-footer-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1.1rem 0 1.25rem; }
.site-footer-copy { display: grid; gap: .25rem; }
.site-footer-copy p { margin: 0; }
.site-footer-copy-ar { font-family: Tahoma, Arial, sans-serif; color: #94a3b8; font-size: .95rem; line-height: 1.5; }
.site-footer-copy-en { color: #64748b; font-size: .95rem; line-height: 1.5; }
.site-footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; color: #475569; font-size: .95rem; }
.site-footer-legal a { color: #94a3b8; }
.site-footer-legal a:hover { color: #fff; }
.site-mobile-scrim { position: fixed; inset: 0; z-index: 44; background: rgba(15, 23, 42, .46); backdrop-filter: blur(2px); }
.site-mobile-menu { position: fixed; inset: 4.7rem 0 0 0; z-index: 45; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 1rem 1rem 2rem; background: #fff; border-top: 1px solid #e4e4e7; box-shadow: 0 18px 50px rgba(15,23,42,.18); }
.site-mobile-menu-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #e4e4e7; }
.site-mobile-menu-title { margin: 0; font-family: Tahoma, Arial, sans-serif; font-size: 1.1rem; font-weight: 700; color: #18181b; }
.site-mobile-menu-sub { margin: .15rem 0 0; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: #64748b; }
.site-mobile-close { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid #d4d4d8; border-radius: .75rem; background: #fff; color: #18181b; font-size: 1.2rem; line-height: 1; }
.site-mobile-section { padding: 1rem 0 0; }
.site-mobile-section-title { margin: 0 0 .6rem; font-family: Tahoma, Arial, sans-serif; font-size: 1rem; font-weight: 700; color: #0f172a; }
.site-mobile-links { display: grid; gap: .6rem; }
.site-mobile-link { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border: 1px solid #e4e4e7; border-radius: .9rem; background: #f8fafc; color: #0f172a; }
.site-mobile-link:hover { border-color: #94a3b8; background: #fff; }
.site-mobile-link-ar { font-family: Tahoma, Arial, sans-serif; font-size: .98rem; font-weight: 700; line-height: 1.2; }
.site-mobile-link-en { font-size: .8rem; font-weight: 700; color: #64748b; line-height: 1.2; }
body.mobile-menu-open { overflow: hidden; }
.shell { width: min(920px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 56px; }
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.75rem, 5vw, 2.75rem); line-height: 1.08; }
h2, h3, p { margin-top: 0; }
.arabic { direction: rtl; font-family: Tahoma, Arial, sans-serif; }
.subhead { margin: 9px 0 0; color: var(--muted); }
.top-progress { position: sticky; top: 0; z-index: 10; margin: 20px 0; padding: 12px 14px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 7px 20px rgba(24,46,38,.06); }
.preview-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 13px 15px; color: #604c16; background: #fff8e6; border: 1px solid #efd98d; border-radius: 13px; }
.preview-banner.saving { color: #115a45; background: var(--green-soft); border-color: #b8dece; }
.preview-banner p { margin: 0; }
.preview-banner .preview-ar { margin-bottom: 3px; font-weight: 800; }
.preview-banner a { color: inherit; font-weight: 800; white-space: nowrap; text-decoration: underline; }
.programme-nav { display: grid; grid-template-columns: minmax(92px, auto) minmax(180px, 1fr) minmax(92px, auto); gap: 10px; align-items: center; margin: -8px 0 20px; }
.programme-nav select { width: 100%; min-height: 42px; padding: 8px 34px 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.programme-nav a:last-child { text-align: right; }
.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; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: .86rem; font-weight: 700; }
.track { height: 9px; overflow: hidden; background: #e5ebe7; border-radius: 99px; }
.track span { display: block; width: 0; height: 100%; background: var(--green); transition: width .25s ease; }
.panel { margin-top: 16px; padding: clamp(18px, 4vw, 30px); background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 30px rgba(24,46,38,.05); }
.concept { border-top: 5px solid var(--gold); }
.formula { display: inline-block; margin: 10px 0 0; padding: 10px 14px; background: #fff8e6; border-radius: 9px; font-weight: 800; }
.phase-title { display: flex; align-items: center; gap: 10px; }
.phase-number { display: grid; width: 32px; height: 32px; place-items: center; flex: 0 0 auto; color: #fff; background: var(--green); border-radius: 50%; font-weight: 800; }
.demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.demo-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.instruction-intro { color: var(--muted); line-height: 1.6; }
.instruction-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.instruction-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--wash); }
.instruction-card .audio-row { margin-top: 10px; }
.sentence { margin-bottom: 4px; font-size: 1.28rem; font-weight: 850; }
.meaning { margin-bottom: 12px; color: var(--muted); }
.guidance { margin-bottom: 15px; padding: 11px 13px; color: #115a45; background: var(--green-soft); border-radius: 9px; }
.audio-row { display: flex; flex-wrap: wrap; gap: 7px; }
.audio-button, .word, .action, .secondary { min-height: 42px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.audio-button:hover, .word:hover, .secondary:hover { border-color: var(--green); }
.audio-button.playing { color: #fff; background: var(--green); border-color: var(--green); }
.audio-note { margin: 10px 0 0; color: var(--muted); font-size: .78rem; }
.practice-head { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.sentence-count { color: var(--muted); font-size: .86rem; white-space: nowrap; }
.task { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.task h3 { margin-bottom: 5px; font-size: 1rem; }
.task-instruction { margin-bottom: 11px; color: var(--muted); font-size: .9rem; }
.word-bank, .answer-line, .input-row, .footer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.answer-line { min-height: 48px; margin-top: 9px; padding: 8px; align-items: center; background: var(--wash); border: 1px dashed #afbeb6; border-radius: 10px; }
.answer-line:empty::before { content: "Build the sentence here"; color: #8a9992; }
.word.used { opacity: .35; cursor: default; }
input { min-width: 180px; min-height: 44px; flex: 1 1 230px; padding: 9px 12px; border: 1px solid #adbbb4; border-radius: 9px; }
.action { color: #fff; background: var(--green); border-color: var(--green); font-weight: 750; }
.action:disabled { opacity: .45; cursor: not-allowed; }
.feedback { display: none; margin: 10px 0 0; padding: 10px 12px; border-radius: 9px; font-weight: 700; }
.feedback.show { display: block; }
.feedback.correct { color: #115a45; background: var(--green-soft); }
.feedback.wrong { color: var(--red); background: var(--red-soft); }
.hint { display: block; margin-top: 4px; font-weight: 500; }
.footer-actions { justify-content: space-between; margin-top: 22px; }
.next-step { margin: 18px 0 -10px; padding: 10px 12px; color: var(--muted); background: var(--wash); border-radius: 9px; text-align: center; }
.next-step.complete { color: #115a45; background: var(--green-soft); }
.completion-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.complete { text-align: center; border-top: 5px solid var(--green); }
.programme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.stage-card { display: block; padding: 18px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 6px 20px rgba(24,46,38,.04); }
.stage-card:hover { border-color: var(--green); transform: translateY(-1px); }
.stage-card h2 { margin: 14px 0 6px; font-size: 1.1rem; }
.stage-card p { margin-bottom: 10px; color: var(--muted); }
.stage-card-head { display: flex; justify-content: space-between; align-items: center; color: var(--green); font-weight: 800; }
.complete-mark { font-size: 2.8rem; }
.loading, .error { width: min(700px, calc(100% - 28px)); margin: 50px auto; }
.error { color: var(--red); }
.save-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(14,29,24,.64); }
.save-dialog { width: min(520px, 100%); padding: clamp(22px, 5vw, 32px); background: #fff; border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.24); }
.save-dialog h2 { margin-bottom: 12px; font-size: clamp(1.5rem, 5vw, 2rem); }
.save-dialog p { line-height: 1.7; }
.save-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.save-actions .action, .save-actions .secondary { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 190px; }

@media (max-width: 720px) {
  .site-header-top { flex-direction: row; align-items: center; gap: .75rem; }
  .site-footer-bar-inner { flex-direction: column; align-items: flex-start; }
  .site-header-actions, .site-header-navwrap { display: none; }
  .site-menu-toggle { display: inline-flex; margin-left: auto; }
  .site-footer-grid { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2.25rem; }
  .site-footer-bar-inner { gap: .9rem; }
  .demo-grid { grid-template-columns: 1fr; }
  .instruction-grid { grid-template-columns: 1fr; }
  .programme-grid { grid-template-columns: 1fr; }
  .practice-head { display: block; }
  .sentence-count { margin-bottom: 10px; }
  .programme-nav { grid-template-columns: 1fr 1fr; }
  .programme-nav label { grid-column: 1 / -1; grid-row: 1; }
  .preview-banner { display: block; }
  .preview-banner a { display: inline-block; margin-top: 9px; }
}
