/* Brand presentation; quiz correctness/state styles remain in styles.css. */
@font-face { font-family: Tajawal; src: url('./assets/fonts/Tajawal-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Tajawal; src: url('./assets/fonts/Tajawal-Bold.ttf') format('truetype'); font-weight: 600 900; font-display: swap; }
@font-face { font-family: Manrope; src: url('./assets/fonts/Manrope.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }
:root { color-scheme: light; font-family: Manrope, Arial, sans-serif; color: #173d3e; background: #f2f3ee; --blue: #173d3e; --border: #d5ddd7; --gold: #f4b354; line-height: 1.8; }
:root[lang="ar"] { font-family: Tajawal, Tahoma, sans-serif; font-size: 18px; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body, .about-screen { background: #f2f3ee; }
::selection { background: #f4b354; color: #173d3e; }
.page, .about-screen > .page { max-width: 1320px; padding: 24px 40px 28px; position: relative; }
.site-header { display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; align-items: center; gap: 34px; direction: ltr; margin: 0 0 24px; }
.brand-mark { display: block; width: 104px; }
.brand-mark .brand-logo, .company-mark .company-logo { width: 100%; max-width: none; height: auto; }
.site-header > div:not(.page-tools) { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.site-header .site-title { font-size: .92rem; line-height: 1.5; margin: 0; max-width: 220px; font-weight: 700; color: #173d3e; }
[dir="rtl"] .site-header > div:not(.page-tools) { direction: rtl; }
.site-nav { margin: 0; gap: 28px; }
.site-nav a { color: #526965; font-size: .88rem; padding: 8px 0; min-width: 44px; justify-content: center; }
.site-nav a[aria-current="page"] { color: #173d3e; border-color: #d99128; }
.page-tools { margin: 0; direction: inherit; }
[dir="rtl"] .page-tools { direction: rtl; }
.language-trigger { font-family: inherit; background: transparent; color: #173d3e; border-color: #d2dcd4; border-radius: 24px; padding: 8px 14px; }
.language-menu { border-color: #d5ddd7; border-radius: 16px; z-index: 6; }
.language-menu button { color: #173d3e; border-radius: 10px; }
.language-menu button[aria-pressed="true"] { background: #e9efe8; color: #173d3e; }
.language-check { color: #8b611d; }
.language-picker { z-index: 6; }
h1, h2, h3, .site-title { letter-spacing: -.035em; color: #173d3e; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] .site-title { letter-spacing: 0; }
h2 { font-size: clamp(1.55rem, 3vw, 2.05rem); line-height: 1.5; }
p, li { text-wrap: pretty; }
.muted, .about-detail, .language-note { color: #596e68; }
.cinema, .cinema.about-intro { display: flex; position: relative; isolation: isolate; overflow: hidden; min-height: 580px; padding: 0; margin: 0; align-items: center; justify-content: flex-end; border-radius: 24px; background: #173d3e; color: #fff; touch-action: pan-y; }
.about-intro > div { flex: initial; padding: 0; background: transparent; border: 0; border-radius: 0; }
.cinema .cinema-images { position: absolute; inset: 0; z-index: -2; overflow: hidden; width: 100%; height: 100%; }
.cinema-slide { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 38% center; opacity: 0; transform: scale(1.035); transition: opacity 1.2s ease; animation: cinema-drift 17s ease-in-out infinite alternate; animation-play-state: paused; }
.cinema-slide.is-active { opacity: 1; }
.cinema[data-playing="true"] .cinema-slide.is-active { animation-play-state: running; }
.cinema::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(8 25 27 / .08) 12%, rgb(8 25 27 / .2) 40%, rgb(8 25 27 / .83) 100%), linear-gradient(0deg, rgb(8 25 27 / .72), transparent 40%); }
.cinema .cinema-copy { width: 52%; padding: 64px 54px 130px; flex: 0 0 52%; margin-left: auto; margin-right: 0; }
.hero-brand { display: inline-block; color: #f4c578; font-family: Manrope, Arial, sans-serif; font-size: .72rem; font-weight: 700; letter-spacing: .04em; margin-bottom: 22px; }
.cinema h1 { color: #fff; font-size: clamp(2.5rem, 4.7vw, 4.1rem); font-weight: 700; line-height: 1.13; margin-bottom: 24px; text-wrap: balance; }
[lang="ar"] .cinema h1 { font-size: clamp(3rem, 5.5vw, 4.6rem); line-height: 1.16; }
.cinema .hero-description, .cinema .about-lead { max-width: 36ch; color: #e7eee7; font-size: 1.02rem; line-height: 1.9; margin-bottom: 28px; }
.primary-link { min-height: 52px; padding: 12px 26px; border-radius: 28px; background: #173d3e; font-size: .9rem; transition: background .2s, transform .2s; }
.primary-link:hover { background: #265957; transform: translateY(-2px); }
.cinema .hero-start { display: inline-flex; gap: 24px; background: #f4b354; color: #163b3b; box-shadow: 0 4px 18px rgb(0 0 0 / .08); }
.cinema .hero-start:hover { background: #ffd08b; }
.hero-start svg { width: 20px; height: 20px; }
.cinema .cinema-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; position: absolute; inset: auto 34px 28px; }
.cinema-caption { margin: 0; font-size: .8rem; max-width: 48ch; }
.cinema .cinema-bottom .cinema-caption { color: #f1f3ef; }
.cinema :focus-visible { outline-color: #ffd38c; }
.cinema-empty::after { background: linear-gradient(120deg, #26514e, #173d3e); }
@keyframes cinema-drift { from { transform: scale(1.035) translateX(-.8%); } to { transform: scale(1.1) translateX(.8%); } }
.home-screen:not([data-view="categories"]) [data-landing] { display: none; }
#app { scroll-margin-top: 28px; }
.start-panel { background: transparent; box-shadow: none; border: 0; border-radius: 0; padding: 54px 0 40px; }
.start-panel > h2 { margin-bottom: 8px; }
.start-panel > .muted { max-width: 55ch; }
.mode-picker { margin-top: 28px; }
.mode-picker legend { color: #526962; font-size: .83rem; margin-bottom: 12px; }
.mode-choices { max-width: 760px; gap: 14px; }
.mode-choice { padding: 18px 22px; background: #fff; border: 1px solid #d5ddd7; border-radius: 12px; transition: background .2s, border-color .2s; }
.mode-choice:has(input:checked) { border-color: #173d3e; background: #e7eee6; box-shadow: inset 0 0 0 1px #173d3e; }
.mode-copy strong { color: #173d3e; font-size: 1rem; }
.mode-copy > span { color: #596e68; font-size: .8rem; }
.mode-choice > .icon { margin-inline-start: auto; width: 30px; height: 30px; color: #6c8175; }
.mode-choice:has(input:checked) > .icon { color: #8e641f; }
.categories { gap: 24px; margin: 32px 0 24px; }
.category-choice { border: 0; border-radius: 16px; background: #fff; color: #173d3e; box-shadow: 0 6px 24px rgb(25 49 39 / .04); transition: transform .25s, box-shadow .25s; }
.category-choice:hover:not(:disabled) { background: #fff; transform: translateY(-5px); box-shadow: 0 12px 28px rgb(25 49 39 / .1); }
.category-choice .category-media { aspect-ratio: 1.55; background: #dfe7df; }
.category-photo { transition: transform .8s cubic-bezier(.2,.65,.3,1); }
.category-choice:hover .category-photo { transform: scale(1.06); }
.category-caption { padding: 23px; }
.category-copy strong { font-size: 1.18rem; }
.category-hint { color: #61756d; font-size: .8rem; }
.category-icon, .category-choice[data-category] .category-icon { inset-inline-start: 18px; bottom: 16px; width: 46px; height: 46px; border: 1px solid rgb(255 255 255 / .6); border-radius: 50%; background: rgb(247 248 242 / .95); color: #173d3e; box-shadow: none; }
.category-arrow { display: block; width: 32px; height: 32px; padding: 5px; border-radius: 50%; border: 1px solid #d8e0d8; }
.selection-note { border-color: #d6dfd5; color: #596e68; font-size: .83rem; }
.selection-note .icon { color: #8b611d; }
.home-guide { display: grid; grid-template-columns: .8fr 1.2fr; gap: 60px; background: #173d3e; border-radius: 20px; padding: 48px; margin: 12px 0 54px; color: #e5ede7; }
.guide-intro h2 { color: #fff; font-size: clamp(2rem, 3.5vw, 3rem); margin-bottom: 18px; }
.guide-intro p { color: #c3d2c7; max-width: 32ch; }
.guide-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 24px; }
.guide-steps li { display: flex; align-items: flex-start; gap: 22px; }
.step-number { flex-shrink: 0; width: 32px; font: 500 .8rem Manrope, Arial, sans-serif; color: #f4c578; padding-top: 7px; }
.guide-steps h3 { color: #fff; margin-bottom: 6px; font-size: 1rem; }
.guide-steps p { color: #c3d2c7; margin: 0; font-size: .85rem; }
.home-screen:not([data-view="categories"]) #app, .home-screen:not([data-view="categories"]) .language-status { max-width: 850px; margin-inline: auto; }
.home-screen:not([data-view="categories"]) .site-header { padding-bottom: 18px; margin-bottom: 34px; border-bottom: 1px solid #d5ddd7; }
.panel:not(.start-panel):not(.about-details) { border: 1px solid #d7dfd7; border-radius: 20px; padding: 36px; box-shadow: 0 8px 34px rgb(20 55 45 / .04); }
.question-meta { font-size: .87rem; color: #5b716b; }
.question-timer { display: flex; align-items: center; gap: 16px; margin: -10px 0 24px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 14px; background: #edf2eb; color: var(--text, #173d3e); }
.timer-face { position: relative; flex: 0 0 64px; width: 64px; height: 64px; }
.timer-face svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-width: 3; }
.timer-track { stroke: #ccd9cf; }
.timer-arc { stroke: #8b611d; stroke-linecap: round; }
.timer-digits { position: absolute; inset: 0; display: grid; place-items: center; font: 750 .9rem Manrope, Arial, sans-serif; font-variant-numeric: tabular-nums; }
.timer-copy { display: grid; gap: 2px; line-height: 1.6; }
.timer-copy strong { font-size: .9rem; }
.timer-copy > span { font-size: .78rem; }
.question-timer[data-urgent="true"] { border-color: var(--danger, #a3232b); color: var(--danger, #a3232b); background: var(--danger-bg, #fff0f1); }
.question-timer[data-urgent="true"] .timer-arc { stroke: currentColor; }
.question-notice { padding: 12px 16px; border-inline-start: 3px solid var(--gold); background: var(--surface-raised, #fff4df); font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.category-label { color: #173d3e; }
.mode-badge { background: #e9efe6; color: #466157; }
progress { height: 5px; margin-bottom: 30px; }
progress::-webkit-progress-bar { background: #e9eee6; }
progress::-webkit-progress-value { background: #b68027; transition: width .3s; }
progress::-moz-progress-bar { background: #b68027; }
legend { font-size: 1.32rem; line-height: 1.9; color: #173d3e; }
.option { border-color: #d4ded5; border-radius: 12px; padding: 17px 18px; transition: background .18s, border-color .18s; }
.option:hover { background: #f1f5ef; }
.option:has(input:checked) { border-color: #173d3e; background: #edf3ec; }
button { border-radius: 24px; transition: background .2s; }
button:hover:not(:disabled) { background: #285553; }
button.secondary { border-color: #d0dace; }
button.secondary:hover:not(:disabled), button.quiet:hover { background: #edf2e9; }
input[type="radio"] { accent-color: #173d3e; }
.actions button { padding-inline: 26px; }
.answer-feedback { border-radius: 12px; }
.result-heading h2 { font-size: 1.5rem; }
.score strong { color: #173d3e; }
.score-fill { stroke: #b68027; }
.score-track { stroke: #e6ede3; }
.review-item { border-radius: 12px; border-color: #d7dfd7; border-inline-start-color: #17603c; }
.review-item.incorrect { border-inline-start-color: #a3232b; }
.loading-visual { background: #e6eee5; }
.loading-road { background: #d0ddd2; border-color: #b5c9ba; }
.loading-car { color: #173d3e; fill: #f4b354; }
.loading-spinner { border-color: #d5ded5; border-top-color: #b68027; }
.about-details { background: transparent; padding: 0; box-shadow: none; border: 0; border-radius: 0; }
.about-section { margin-top: 0; padding: 48px 0; border-color: #d5ded5; }
.about-details > .company-section:first-child { margin: 36px 0 48px; padding: 40px; border-radius: 20px; background: #fff; grid-template-columns: 260px minmax(0, 1fr); gap: 64px; }
.company-mark { display: block; width: 100%; max-width: 260px; justify-self: center; }
.company-details h2 { font: 750 clamp(1.2rem, 2vw, 1.6rem)/1.5 Manrope, sans-serif; }
.company-type { color: #8b611d; margin-top: 4px; }
.about-page h3 { color: #173d3e; }
.contact-link { border-color: #d8e1d7; background: #f6f8f2; border-radius: 12px; padding-block: 16px; }
.contact-link bdi { font-size: .96rem; }
.contact-link:hover { background: #fff5e4; }
.contact-link svg { color: #966921; }
.social-link { border-color: #d7dfd5; border-radius: 10px; }
.about-intro-text { max-width: 75ch; color: #5d7169; margin-bottom: 26px; }
.about-modes { gap: 24px; }
.about-mode { padding: 30px; border-radius: 16px; background: #fff; }
.about-mode + .about-mode { border: 0; padding: 30px; }
.about-mode:first-child { border-top: 3px solid #dca042; }
.about-mode:last-child { border-top: 3px solid #50716a; }
.about-mode h3 { font-size: 1.4rem; }
.about-mode h3 { display: flex; align-items: center; gap: 14px; }
.mode-symbol { width: 34px; height: 34px; flex-shrink: 0; color: #8e641f; }
.about-mode p { color: #3f5c52; }
.about-detail { font-size: .84rem; }
.about-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 46px; padding-inline-start: 24px; }
.about-steps li { margin: 0; padding-inline-start: 8px; }
.about-steps li::marker { color: #9b6b22; }
.about-steps h3 { font-size: 1.1rem; }
.about-steps p { color: #617268; font-size: .9rem; }
.learning-detail { padding: 22px 0; border-bottom: 1px solid #d5ded5; }
.learning-detail summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; cursor: pointer; min-height: 44px; color: #173d3e; font-weight: 700; list-style: none; }
.learning-detail summary::-webkit-details-marker { display: none; }
.learning-detail summary::after { content: '+'; font-family: Manrope, sans-serif; font-size: 1.5rem; color: #9b6b22; }
.learning-detail[open] summary::after { content: '−'; }
.learning-detail p { padding-top: 14px; margin: 0; color: #596f64; max-width: 78ch; }
.about-action { margin: 28px 0; padding: 28px; background: #e5ebdf; border: 0; border-radius: 16px; }
.about-action p { color: #234b40; }
footer, .about-screen footer { padding: 34px 0 0; margin-top: 32px; border-top: 1px solid #d5ddd3; border-radius: 0; background: transparent; color: #5b7164; font-size: .78rem; }
.footer-company { margin-bottom: 26px; }
.footer-company-name { font-family: Manrope, sans-serif; text-decoration: none; color: #173d3e; font-size: 1rem; }
.footer-company a { color: #234d43; }
.footer-contacts { gap: 12px; margin-top: 14px; font-size: .86rem; }
.footer-socials { margin-top: 26px; }
.footer-socials .social-links { gap: 10px; }
.footer-socials .social-link { background: transparent; }
.footer-company .social-link:hover { background: #e7ede2; }
.language-status { margin-top: 22px; }
dialog { border-radius: 20px; border-color: #cdd9ce; padding: 30px; }
dialog::backdrop { background: rgb(16 45 40 / .55); backdrop-filter: blur(5px); }
:focus-visible { outline-color: #ab741b; }
/* Keep the landing photos behind the viewport, with readable surfaces above. */
:is(.home-screen[data-view="categories"], .about-screen) { isolation: isolate; background: #173d3e; }
:is(.home-screen[data-view="categories"], .about-screen) .site-header { position: relative; z-index: 2; padding: 12px 24px; border: 1px solid rgb(255 255 255 / .55); border-radius: 20px; background: rgb(242 243 238 / .93); backdrop-filter: blur(16px); }
:is(.home-screen, .about-screen) .home-hero { isolation: auto; overflow: visible; border-radius: 0; background: transparent; min-height: calc(100svh - 195px); }
.home-hero .cinema-images, .home-hero::after { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.home-hero::after { background: linear-gradient(90deg, rgb(8 25 27 / .06) 12%, rgb(8 25 27 / .22) 40%, rgb(8 25 27 / .83) 100%), linear-gradient(0deg, rgb(8 25 27 / .8), transparent 48%); }
.home-hero .cinema-copy { padding: 70px 20px 150px 48px; }
.home-hero .cinema-bottom { inset-inline: 0; bottom: 30px; }
:is(.home-screen[data-view="categories"], .about-screen) :is(.start-panel, .about-details) { margin: 28px 0; padding: 46px; border: 1px solid rgb(255 255 255 / .65); border-radius: 24px; background: #f2f3ee; }
:is(.home-screen[data-view="categories"], .about-screen) .home-guide { margin: 28px 0; background: rgb(17 49 50 / .95); border: 1px solid rgb(255 255 255 / .2); }
:is(.home-screen[data-view="categories"], .about-screen) footer { margin-top: 28px; padding: 36px 40px 24px; border: 1px solid rgb(255 255 255 / .65); border-radius: 24px; background: #f2f3ee; }
:is(.home-screen[data-view="categories"], .about-screen) .language-status:not(:empty) { padding: 16px 24px; border-radius: 14px; background: #f2f3ee; }
.home-hero.cinema-empty::after { background: linear-gradient(120deg, #26514e, #173d3e); }
@media (max-width: 1050px) {
  .page, .about-screen > .page { padding-inline: 28px; }
  .site-header { gap: 22px; }
  .site-header > div:not(.page-tools) { flex-direction: column; gap: 6px; align-items: flex-start; }
  .site-header .site-title { max-width: none; }
  .site-nav { gap: 24px; }
  .cinema .cinema-copy { width: 58%; flex-basis: 58%; padding: 52px 34px 130px; }
  .cinema, .cinema.about-intro { min-height: 570px; }
  .about-details > .company-section:first-child { grid-template-columns: 200px minmax(0, 1fr); gap: 34px; padding: 30px; }
  .home-guide { padding: 34px; gap: 32px; }
  .home-hero .cinema-copy { padding-inline: 24px 0; }
  :is(.home-screen[data-view="categories"], .about-screen) :is(.start-panel, .about-details) { padding: 34px; }
}
@media (max-width: 760px) {
  .site-header { grid-template-columns: 88px minmax(0, 1fr) auto; gap: 16px; }
  .brand-mark { width: 84px; }
  .site-header .site-title { font-size: .78rem; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: .8rem; }
  .language-trigger { gap: 7px; padding: 8px 10px; font-size: .78rem; }
  .language-chevron { margin: 0; }
  .cinema, .cinema.about-intro { min-height: 610px; align-items: flex-end; }
  .cinema::after { background: linear-gradient(0deg, rgb(10 32 32 / .97), rgb(10 32 32 / .75) 52%, rgb(10 32 32 / .08) 100%); }
  .cinema .cinema-copy { width: 100%; flex-basis: 100%; padding: 220px 30px 130px; }
  .cinema h1, [lang="ar"] .cinema h1 { font-size: 2.8rem; max-width: 15ch; }
  .cinema .hero-description, .cinema .about-lead { max-width: 42ch; font-size: .94rem; }
  .cinema-slide { object-position: 30% center; }
  .cinema .cinema-bottom { inset-inline: 26px; bottom: 22px; }
  .cinema-caption { max-width: 25ch; font-size: .72rem; }
  .categories { gap: 14px; }
  .category-caption { padding: 18px 14px; }
  .category-copy strong { font-size: 1rem; }
  .home-guide { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .guide-intro p { max-width: none; }
  .about-details > .company-section:first-child { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .company-mark { max-width: 190px; }
  .about-steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .about-steps p { max-width: 65ch; }
  .home-hero::after { background: linear-gradient(0deg, rgb(10 32 32 / .97), rgb(10 32 32 / .72) 45%, rgb(10 32 32 / .08) 100%); }
  .home-hero .cinema-copy { padding: 160px 10px 130px; }
}
@media (max-width: 560px) {
  .page, .about-screen > .page { padding: 16px 18px 24px; }
  .site-header { grid-template-columns: 1fr auto; gap: 10px 18px; text-align: start; margin-bottom: 18px; }
  .brand-mark { width: 86px; grid-column: 1; grid-row: 1; }
  .site-header > .page-tools { grid-column: 2; grid-row: 1; }
  .site-header > div:not(.page-tools) { grid-column: 1 / -1; grid-row: 2; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; border-top: 1px solid #d8e0d6; }
  .site-header .site-title { font-size: .73rem; max-width: 165px; }
  .site-nav { justify-content: flex-start; flex-wrap: nowrap; gap: 18px; }
  .site-nav a { white-space: nowrap; font-size: .76rem; min-height: 44px; }
  .language-trigger { padding: 8px 12px; }
  .language-menu { width: 210px; }
  .cinema, .cinema.about-intro { min-height: 610px; border-radius: 18px; flex-direction: row; }
  .cinema .cinema-copy { padding: 235px 24px 144px; }
  .hero-brand { font-size: .62rem; margin-bottom: 16px; }
  .cinema h1, [lang="ar"] .cinema h1 { font-size: 2.5rem; line-height: 1.16; margin-bottom: 18px; }
  .cinema .hero-description, .cinema .about-lead { font-size: .91rem; line-height: 1.8; margin-bottom: 22px; }
  .hero-start { min-height: 48px; font-size: .83rem; padding-inline: 22px; }
  .cinema .cinema-bottom { inset-inline: 24px; bottom: 18px; gap: 12px; }
  .cinema-caption { max-width: none; flex: 1; font-size: .72rem; }
  .start-panel { padding: 36px 0 30px; }
  .start-panel > .muted { font-size: .9rem; }
  .mode-choices { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mode-choice { padding: 16px; }
  .categories { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .category-choice { flex-direction: row; min-height: 145px; border-radius: 14px; }
  .category-choice .category-media { width: 45%; aspect-ratio: auto; }
  .category-choice .category-photo { position: absolute; inset: 0; }
  .category-caption { padding: 20px 14px; gap: 10px; }
  .category-choice .category-icon { width: 34px; height: 34px; inset-inline-start: 10px; bottom: 10px; }
  .category-icon .icon { width: 24px; height: 24px; }
  .category-arrow { width: 26px; height: 26px; flex-shrink: 0; }
  .category-copy strong { font-size: 1.02rem; }
  .category-hint { font-size: .74rem; }
  .home-guide { padding: 28px 24px; border-radius: 16px; margin-bottom: 36px; }
  .guide-intro h2 { font-size: 2.2rem; }
  .guide-intro p, .guide-steps p { font-size: .84rem; }
  .guide-steps li { gap: 12px; }
  .panel:not(.start-panel):not(.about-details) { padding: 24px 18px; border-radius: 16px; }
  .home-screen:not([data-view="categories"]) .site-header { margin-bottom: 24px; }
  legend { font-size: 1.2rem; }
  .option { padding: 14px 12px; }
  .question-meta { font-size: .83rem; }
  .question-timer { gap: 12px; padding: 12px; }
  .actions button { padding-inline: 18px; }
  .about-details > .company-section:first-child { margin: 26px 0 32px; padding: 28px 20px; border-radius: 16px; }
  .company-details h2 { font-size: 1.15rem; }
  .company-type { font-size: .9rem; }
  .company-details > p { font-size: .88rem; }
  .contact-link { padding: 16px 12px; }
  .contact-link bdi { font-size: .89rem; }
  .about-section { padding: 32px 0; }
  .about-intro-text { font-size: .9rem; }
  .about-modes { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .about-mode, .about-mode + .about-mode { padding: 24px; }
  .about-mode p { font-size: .9rem; }
  .learning-detail { padding: 16px 0; }
  .learning-detail p { font-size: .88rem; }
  .about-action { padding: 24px; align-items: stretch; gap: 16px; }
  .footer-contacts { gap: 10px; font-size: .82rem; }
  .footer-contacts a { width: 100%; padding-inline: 12px; }
  footer, .about-screen footer { font-size: .74rem; padding-top: 28px; }
  :is(.home-screen[data-view="categories"], .about-screen) .site-header { padding: 10px 16px; border-radius: 16px; }
  :is(.home-screen, .about-screen) .home-hero { min-height: calc(100svh - 220px); }
  .home-hero .cinema-copy { padding: 120px 6px 140px; }
  .home-hero .cinema-bottom { inset-inline: 6px; bottom: 24px; }
  .home-hero .cinema-slide { object-position: 27% center; }
  :is(.home-screen[data-view="categories"], .about-screen) :is(.start-panel, .about-details) { padding: 28px 18px; margin-block: 18px; border-radius: 18px; }
  :is(.home-screen[data-view="categories"], .about-screen) .home-guide { padding: 28px 24px; margin-block: 18px; }
  :is(.home-screen[data-view="categories"], .about-screen) footer { margin-top: 18px; padding: 28px 20px 18px; border-radius: 18px; }
}
@media (max-width: 360px) {
  .page, .about-screen > .page { padding-inline: 14px; }
  .site-header .site-title { max-width: 135px; font-size: .68rem; }
  .site-nav { gap: 12px; }
  .cinema .cinema-copy { padding-inline: 20px; }
  .cinema h1, [lang="ar"] .cinema h1 { font-size: 2.2rem; }
  .category-caption { padding-inline: 10px; }
  .category-copy strong { font-size: .91rem; }
  .category-arrow { width: 23px; height: 23px; }
  :is(.home-screen[data-view="categories"], .about-screen) .site-header { padding-inline: 12px; }
  :is(.home-screen[data-view="categories"], .about-screen) .site-header > div:not(.page-tools) { gap: 10px; }
  .home-hero .cinema-copy { padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
  .cinema-slide { animation: none; transform: none; }
  .category-choice:hover:not(:disabled), .category-choice:hover .category-photo, .primary-link:hover { transform: none; }
}

/* Match the device theme without adding another control to the navigation. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #0d2021;
    --surface: #132d2e;
    --surface-raised: #1d3a3b;
    --text: #edf3ee;
    --muted: #b8cbc4;
    --border: #68847c;
    --blue: #f4b354;
    --success: #afe7c5;
    --success-bg: #163e30;
    --danger: #ffc1c4;
    --danger-bg: #48272e;
    color: var(--text);
    background: var(--canvas);
  }
  body, .about-screen { background: var(--canvas); }
  :is(.home-screen[data-view="categories"], .about-screen) .site-header { background: rgb(13 32 33 / .96); border-color: #49625c; }
  .site-header > div:not(.page-tools), .home-screen:not([data-view="categories"]) .site-header { border-color: #3c5753; }
  h1, h2, h3, legend, .site-header .site-title, .about-page h3, .about-note h2,
  .mode-copy strong, .category-label, .learning-detail summary, .score strong { color: var(--text); }
  .site-nav a { color: var(--muted); }
  .site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold); border-color: var(--gold); }
  .language-trigger { color: var(--text); border-color: var(--border); background: var(--surface); }
  .language-trigger:hover { background: var(--surface-raised); border-color: var(--gold); }
  .language-menu { background: var(--surface); border-color: var(--border); box-shadow: 0 12px 30px rgb(0 0 0 / .3); }
  .language-menu button { color: var(--text); background: transparent; }
  .language-menu button:hover:not(:disabled), .language-menu button[aria-pressed="true"] { background: var(--surface-raised); color: var(--gold); }
  .language-check { color: var(--gold); }
  .panel:not(.about-details), .panel:not(.start-panel):not(.about-details), .review-item,
  :is(.home-screen[data-view="categories"], .about-screen) :is(.start-panel, .about-details), :is(.home-screen[data-view="categories"], .about-screen) footer,
  .about-details > .company-section:first-child, .about-mode { background: var(--surface); border-color: #3c5753; }
  .muted, .language-note, .about-detail, .about-intro-text, .about-note,
  .mode-copy > span, .mode-picker legend, .category-hint, .selection-note, .question-meta,
  .practice-summary-note, .score span, .explanation, .about-mode p, .about-steps p,
  .learning-detail p, footer, .about-screen footer { color: var(--muted); }
  .selection-note, .explanation, .about-section, .learning-detail, footer, .about-screen footer { border-color: #3c5753; }
  .mode-choice { background: var(--surface-raised); border-color: var(--border); }
  .mode-choice:has(input:checked) { border-color: var(--gold); background: #29413b; box-shadow: inset 0 0 0 1px var(--gold); }
  .mode-choice > .icon, .mode-choice:has(input:checked) > .icon,
  .selection-note .icon, .mode-symbol, .company-type, .contact-link svg,
  .learning-detail summary::after, .about-steps li::marker { color: var(--gold); }
  .category-choice { background: var(--surface-raised); color: var(--text); }
  .category-choice:hover:not(:disabled) { background: #294846; color: var(--text); }
  .category-choice .category-media { background: #24423f; }
  .category-arrow { border-color: var(--border); }
  .mode-badge, .about-action { background: var(--surface-raised); color: var(--muted); }
  .question-timer { background: var(--surface-raised); }
  .timer-track { stroke: #49625c; }
  .timer-arc { stroke: var(--gold); }
  .about-action p { color: var(--text); }
  button, .primary-link { color: #173d3e; background: var(--gold); }
  button:hover:not(:disabled), .primary-link:hover { background: #ffd08b; }
  button.secondary { background: var(--surface-raised); color: var(--text); border-color: var(--border); }
  button.secondary:hover:not(:disabled), button.quiet:hover { background: #294846; }
  button.quiet { background: transparent; color: var(--muted); }
  button:disabled, button.secondary:disabled { background: #294443; color: #c1d0cc; }
  input[type="radio"] { accent-color: var(--gold); }
  .option { border-color: var(--border); }
  .option:hover { background: var(--surface-raised); }
  .option:has(input:checked) { border-color: var(--gold); background: #29413b; }
  .options .option.answer-correct { color: var(--success); background: var(--success-bg); border-color: #78c99d; box-shadow: inset -3px 0 #78c99d; }
  .options .option.answer-incorrect { color: var(--danger); background: var(--danger-bg); border-color: #ee8e98; box-shadow: inset -3px 0 #ee8e98; }
  [dir="ltr"] .options .option.answer-correct { box-shadow: inset 3px 0 #78c99d; }
  [dir="ltr"] .options .option.answer-incorrect { box-shadow: inset 3px 0 #ee8e98; }
  .option.answer-correct input { accent-color: #78c99d; }
  .option.answer-incorrect input { accent-color: #ee8e98; }
  .answer-feedback.correct, .result-total { color: var(--success); background: var(--success-bg); }
  .answer-feedback.incorrect, .result-total.cross, .error { color: var(--danger); background: var(--danger-bg); }
  .error { border-color: #ee8e98; }
  .review-item.correct { border-inline-start-color: #78c99d; }
  .review-item.incorrect { border-inline-start-color: #ee8e98; }
  .verdict { color: var(--success); }
  .incorrect .verdict { color: var(--danger); }
  .question-image { background: #fff; padding: 8px; border-radius: 8px; }
  progress { background: #36524c; }
  progress::-webkit-progress-bar { background: #36524c; }
  progress::-webkit-progress-value { background: var(--gold); }
  progress::-moz-progress-bar { background: var(--gold); }
  .score-fill { stroke: var(--gold); }
  .score-track { stroke: #36524c; }
  .loading-visual { background: var(--surface-raised); }
  .loading-road { background: #36524c; border-color: #78948b; }
  .loading-car { color: #173d3e; fill: var(--gold); }
  .loading-spinner { border-color: #36524c; border-top-color: var(--gold); }
  .contact-link, .footer-contacts a, .social-link, .footer-socials .social-link { background: var(--surface-raised); border-color: var(--border); color: var(--text); }
  .contact-link:hover, .footer-contacts a:hover, .social-link:hover, .footer-company .social-link:hover { background: #294846; border-color: var(--gold); }
  .contact-label, .social-link bdi { color: var(--muted); }
  .footer-company a { color: var(--text); }
  .social-instagram svg { color: #f6a5d0; }
  .social-tiktok svg { color: var(--text); }
  .language-status, :is(.home-screen[data-view="categories"], .about-screen) .language-status:not(:empty) { background: #3d341e; color: #ffdb97; }
  dialog { background: var(--surface); color: var(--text); border-color: var(--border); }
  dialog::backdrop { background: rgb(0 12 13 / .75); }
  :focus-visible, .mode-choice:has(input:focus-visible), .option:has(input:focus-visible) { outline-color: #ffd08b; }
}
/* High-resolution question signs with a keyboard- and touch-accessible detail view. */
.sign-viewer { display: block; max-width: 100%; width: fit-content; margin: 0 auto 22px; padding: 12px; color: #294641; background: #fff; border: 1px solid #d5ded7; border-radius: 14px; box-shadow: none; cursor: zoom-in; }
.sign-viewer:hover:not(:disabled) { background: #fff; border-color: #a1793c; box-shadow: 0 6px 20px #132e2510; }
.sign-viewer .question-image { width: auto; max-width: 100%; max-height: 340px; margin: 0 auto; padding: 0; border-radius: 4px; }
.sign-viewer-hint { display: block; padding-top: 8px; color: #4f6863; font-size: .8rem; font-weight: 500; }
.sign-dialog { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px; overflow: auto; }
.sign-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sign-dialog-header h2 { margin: 0; font-size: 1.1rem; }
.sign-dialog-close { flex-shrink: 0; }
.sign-dialog-zoom { margin-bottom: 12px; }
.sign-dialog-viewport { max-height: calc(100dvh - 210px); overflow: auto; overscroll-behavior: contain; background: #fff; border-radius: 8px; }
.sign-dialog-image { display: block; width: 100%; max-height: calc(100dvh - 210px); object-fit: contain; background: #fff; }
.sign-dialog-viewport.magnified .sign-dialog-image { width: 200%; max-width: none; max-height: none; }
@media (max-width: 600px) { .sign-viewer { padding: 10px; } .sign-viewer .question-image { max-height: 300px; } .sign-dialog { padding: 14px; } .sign-dialog-header { gap: 10px; } .sign-dialog-header h2 { font-size: 1rem; } .sign-dialog-close { padding: 10px 12px; font-size: .88rem; } }
