/* بيت معلمتي — التطبيق (نموذج أولي) · هوية «نور الشباك» */
:root {
  --navy: #1C2744;
  --navy-700: #2A3860;
  --navy-600: #3A4A78;
  --navy-900: #131B31;
  --navy-50: #EEF1F7;
  --navy-100: #DCE2EE;
  --amber: #C17E20;
  --amber-300: #E3B66F;
  --amber-100: #F5E4C6;
  --amber-50: #FBF4E8;
  --cream: #FBF8F2;
  --sand: #F4EEE3;
  --paper: #FFFFFF;
  --ink: #1C2744;
  --muted: #4E5874;
  --line: #E6DED0;
  --line-strong: #D6CBB8;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(28, 39, 68, .06), 0 2px 8px rgba(28, 39, 68, .05);
  --shadow: 0 2px 6px rgba(28, 39, 68, .06), 0 12px 32px rgba(28, 39, 68, .08);
  --shadow-lg: 0 8px 24px rgba(19, 27, 49, .12), 0 24px 64px rgba(19, 27, 49, .14);
  --font: "IBM Plex Sans Arabic", "Tajawal", system-ui, sans-serif;
  --ok: #2F6B4F;
  --danger: #A23B2A;
  --gutter: 16px;
  --proto-h: 34px;
  --top-h: 60px;
  --chrome-h: calc(var(--proto-h) + var(--top-h));
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --container: 1280px;
}
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 900px) { :root { --gutter: 40px; --top-h: 76px; } }

/* ---------- أساسيات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--chrome-h) + 16px); overflow-x: clip; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink);
  background: var(--cream); overflow-x: clip; overflow-wrap: break-word; word-break: normal;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, ol, dl, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font-size: 1.6rem; line-height: 1.3; font-weight: 700; }
h2 { font-size: 1.25rem; line-height: 1.4; font-weight: 700; }
h3, .h3 { font-size: 1.05rem; line-height: 1.45; font-weight: 600; }
@media (min-width: 900px) { h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--amber); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; display: flex; justify-content: center; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; }
.danger { color: var(--danger) !important; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); }
.skip:focus { top: 8px; }

/* ---------- الإطار ---------- */
.chrome { position: sticky; top: 0; z-index: 40; }
.proto-bar {
  height: var(--proto-h); display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 var(--gutter); background: var(--navy-900); color: #F5E4C6; font-size: .8rem; white-space: nowrap; overflow: hidden;
}
.proto-bar b { color: #fff; font-weight: 600; }
.proto-bar span:last-child { overflow: hidden; text-overflow: ellipsis; }
.proto-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(193, 126, 32, .25); flex: none; }
.topbar { height: var(--top-h); background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: var(--container); height: 100%; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; flex: none; border-radius: 8px; }
.brand-full { width: 118px; height: auto; }
.brand-mark { display: none; }
@media (max-width: 359px) { .brand-full { display: none; } .brand-mark { display: block; } }
@media (min-width: 900px) { .brand-full { width: 146px; } }
.top-search { display: none; }
.topnav { display: none; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.top-avatar { display: none; border-radius: 50%; }
.top-avatar img { width: 36px; height: 36px; border-radius: 50%; }
.top-avatar.is-on img { box-shadow: 0 0 0 2px var(--amber); }
.mode-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; color: var(--amber); background: var(--amber-50); border: 1px solid var(--amber-100); border-radius: 999px; padding: 2px 10px; }
.mode-tag svg { width: 14px; height: 14px; }
.top-actions .mode-tag { display: none; }
.mode-btn span { font-size: .85rem; }
@media (min-width: 900px) {
  .top-search {
    display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 8px 0 0; padding-inline: 18px 6px;
    border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm);
    text-decoration: none; color: var(--muted); font-size: .9rem; min-width: 240px;
  }
  .top-search > svg { width: 18px; height: 18px; color: var(--navy); }
  .top-search-go { margin-inline-start: auto; width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; }
  .top-search-go svg { width: 18px; height: 18px; }
  .topnav { display: flex; gap: 4px; margin-inline-start: auto; }
  .topnav a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
  .topnav a svg { width: 20px; height: 20px; }
  .topnav a:hover { background: var(--sand); color: var(--navy); }
  .topnav a.is-on { background: var(--navy-50); color: var(--navy); }
  .top-actions { margin-inline-start: 8px; }
  .top-avatar { display: block; }
  .top-actions .mode-tag { display: inline-flex; }
}
@media (min-width: 900px) and (max-width: 1100px) { .top-search { min-width: 0; } .top-search > span:not(.top-search-go) { display: none; } .topnav a svg { display: none; } }

main { display: block; max-width: var(--container); margin: 0 auto; padding: 20px var(--gutter) calc(var(--tab-h) + var(--safe-b) + 32px); outline: none; min-height: 60vh; min-width: 0; }
body.hide-tabbar-m main { padding-bottom: calc(var(--safe-b) + 32px); }
@media (min-width: 900px) { main, body.hide-tabbar-m main { padding-top: 28px; padding-bottom: 64px; } }

/* شريط التبويب السفلي */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .98); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(28, 39, 68, .05);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 500; position: relative; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.is-on { color: var(--navy); font-weight: 700; }
.tabbar a.is-on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--amber); }
body.hide-tabbar-m .tabbar { display: none; }
@media (min-width: 900px) { .tabbar { display: none !important; } }

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 12px; border: 1.5px solid transparent; font-weight: 600; font-size: .95rem; text-decoration: none; line-height: 1.2;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease; white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 6px 16px rgba(28, 39, 68, .18); }
.btn-primary:hover { background: var(--navy-700); }
.btn-accent { background: var(--amber); color: #fff; box-shadow: 0 6px 16px rgba(193, 126, 32, .28); }
.btn-accent:hover { background: #A96D19; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy-50); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--sand); }
.btn-link { background: none; border: 0; color: var(--navy); text-decoration: underline; padding: 0 8px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .875rem; border-radius: 10px; }
.btn-block { width: 100%; min-height: 52px; font-size: 1.05rem; }
.btn-icon { width: 48px; padding: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; min-height: 32px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 0; background: transparent; color: var(--navy); flex: none; }
.icon-btn:hover { background: var(--sand); }
.icon-btn-spacer { width: 44px; flex: none; }
.mode-btn { padding: 0 10px; }
@media (max-width: 420px) { .mode-btn span { font-size: .8rem; } }

/* ---------- عناصر مشتركة ---------- */
.demo-note { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); background: var(--sand); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 3px 12px 3px 10px; line-height: 1.5; }
.demo-note svg { width: 14px; height: 14px; flex: none; color: var(--amber); }
.pill { position: absolute; top: 12px; inset-inline-start: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: rgba(255, 255, 255, .95); color: var(--navy); box-shadow: var(--shadow-sm); }
.pill svg { width: 14px; height: 14px; color: var(--amber); }
.pill-new { inset-inline-start: auto; inset-inline-end: 60px; background: var(--amber); color: #fff; }
.pill-inline { position: static; box-shadow: none; border: 1px solid var(--line); }
.pill-new.pill-inline { border-color: var(--amber); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--navy); font-size: .9rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.chip:hover { border-color: var(--navy); }
.chip.is-on, .chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip.is-on .muted { color: var(--navy-100); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: #fff; border: 1px solid var(--line-strong); }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: .875rem; }
.seg-btn svg { width: 18px; height: 18px; }
.seg-btn[aria-pressed="true"], .seg-btn[aria-checked="true"] { background: var(--navy); color: #fff; }
.seg-wide { display: flex; width: 100%; flex-wrap: wrap; border-radius: 14px; }
.seg-wide .seg-btn { flex: 1 1 auto; justify-content: center; border-radius: 11px; min-height: 44px; }
.count-badge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--amber); color: #fff; font-size: .72rem; display: inline-grid; place-items: center; padding: 0 6px; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.step-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: #fff; font-size: 1.2rem; line-height: 1; color: var(--navy); }
.step-btn:hover:not([disabled]) { border-color: var(--navy); }
.step-btn[disabled] { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; }
.avatar { border-radius: 50%; flex: none; object-fit: cover; background: var(--sand); }
.rating { display: inline-flex; align-items: center; gap: 4px; }
.rating svg, .card-rating svg, .book-rating svg, .reviews-head svg, .stat-rating svg { color: var(--amber); width: 16px; height: 16px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--navy-50); border: 1px solid var(--navy-100); font-size: .9rem; margin-bottom: 16px; }
.banner svg { width: 20px; height: 20px; flex: none; }
.banner-link { background: var(--amber-50); border-color: var(--amber-100); }
.banner-link svg { color: var(--amber); }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--navy); text-decoration: none; font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.back-link svg { width: 20px; height: 20px; }
.page-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; align-items: flex-start; }
.sec { padding: 28px 0; border-top: 1px solid var(--line); }
.sec > h2 { margin-bottom: 14px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.lead-text { font-size: 1.02rem; line-height: 1.8; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); background: #FBEDEA; color: var(--danger); border: 1px solid #F0CFC8; margin-bottom: 12px; font-weight: 500; }

.empty { text-align: center; padding: 48px 16px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-art { width: 88px; height: 88px; border-radius: 50%; background: var(--amber-50); border: 1px solid var(--amber-100); display: grid; place-items: center; }
.empty .btn { margin-top: 8px; }

.toast { position: fixed; inset-inline: 0; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 80; background: var(--navy-900); color: #fff; padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .92rem; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.is-show { opacity: 1; transform: none; }
body.hide-tabbar-m .toast { bottom: calc(var(--safe-b) + 92px); }
@media (min-width: 900px) { .toast { bottom: 32px; } }

/* ---------- المستكشف ---------- */
.explore { display: flex; flex-direction: column; gap: 16px; }
.search-desktop { display: none; }
.search-mobile {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); text-align: start;
}
.search-mobile > svg { width: 22px; height: 22px; flex: none; }
.sm-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.sm-text b { font-size: .95rem; }
.sm-text .muted { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { display: grid; gap: 12px; }
.sf { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: #fff; }
.sf-label { font-size: .75rem; font-weight: 700; color: var(--navy); }
.sf input, .sf select { border: 0; padding: 0; background: transparent; min-height: 30px; font-size: .95rem; outline: none; width: 100%; color: var(--ink); }
.sf input::placeholder { color: #8A8FA0; }
.sf:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(193, 126, 32, .35); }
@media (min-width: 900px) {
  .search-mobile { display: none; }
  .search-desktop {
    display: grid; grid-template-columns: 1.3fr 1fr 1.1fr 1fr auto; align-items: center; gap: 0; max-width: 960px; width: 100%; margin: 0 auto;
    padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow);
  }
  .search-desktop .sf { border: 0; border-radius: 999px; padding: 8px 22px; position: relative; }
  .search-desktop .sf + .sf::before { content: ""; position: absolute; inset-inline-start: 0; top: 22%; height: 56%; width: 1px; background: var(--line); }
  .search-desktop .sf:hover { background: var(--sand); }
  .search-desktop .sf:focus-within { box-shadow: var(--shadow); background: #fff; }
}
.search-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--amber); color: #fff; font-weight: 700; }
.search-go svg { width: 20px; height: 20px; }
.search-go:hover { background: #A96D19; }
.cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 2px; border-bottom: 1px solid var(--line); scroll-snap-type: x proximity; }
.cats::-webkit-scrollbar { display: none; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 72px; min-height: 64px; padding: 6px 10px 10px; border: 0; background: none; color: var(--muted); font-size: .82rem; font-weight: 500; border-bottom: 2px solid transparent; scroll-snap-align: start; opacity: .8; }
.cat img { width: 26px; height: 26px; }
.cat:hover { opacity: 1; border-bottom-color: var(--line-strong); }
.cat.is-on { color: var(--navy); font-weight: 700; border-bottom-color: var(--navy); opacity: 1; }
@media (min-width: 900px) { .cats { justify-content: center; margin-inline: 0; padding-inline: 0; } }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 420px) { .toolbar-actions { width: 100%; justify-content: space-between; } }

.grid { display: grid; grid-template-columns: 1fr; gap: 28px 20px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { position: relative; min-width: 0; }
.card-link { display: block; text-decoration: none; color: inherit; border-radius: var(--radius); }
.card-media { position: relative; aspect-ratio: 20 / 19; border-radius: var(--radius); overflow: hidden; background: var(--sand); box-shadow: var(--shadow-sm); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card-link:hover .card-media img { transform: scale(1.03); }
.card-body { padding-top: 12px; display: flex; flex-direction: column; gap: 1px; }
.card-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-title { font-size: 1rem; font-weight: 600; line-height: 1.45; }
.card-rating { display: inline-flex; align-items: center; gap: 3px; font-size: .9rem; white-space: nowrap; flex: none; }
.card-sub { font-size: .9rem; color: var(--ink); }
.card-sub.muted { color: var(--muted); }
.card-price { margin-top: 4px; font-size: .95rem; }
.card-price b { font-weight: 700; }
.heart { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: transparent; color: var(--navy); }
.heart svg { width: 24px; height: 24px; transition: transform .15s ease; }
.heart.is-on svg { fill: var(--amber); color: var(--amber); }
.heart:active svg { transform: scale(.85); }
.card-heart { position: absolute; top: 6px; inset-inline-end: 6px; color: #fff; }
.card-heart svg { fill: rgba(19, 27, 49, .35); stroke: #fff; stroke-width: 2; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.card-heart.is-on svg { fill: var(--amber); stroke: #fff; }
.heart-inline { border: 1px solid var(--line-strong); background: #fff; width: 40px; height: 40px; }

/* الخريطة */
.map-wrap { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: var(--sand); }
.map { height: calc(100dvh - var(--chrome-h) - var(--tab-h) - var(--safe-b) - 210px); min-height: 400px; width: 100%; }
@media (min-width: 900px) { .map { height: calc(100dvh - var(--chrome-h) - 260px); min-height: 520px; } }
.map-cities { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 500; display: flex; gap: 6px; }
.map-cities .chip { box-shadow: var(--shadow-sm); }
.map-hint { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 500; display: flex; align-items: center; gap: 6px; max-width: min(320px, calc(100% - 24px)); padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-sm); font-size: .78rem; }
.map-cities + .map + .map-hint { top: 62px; }
.map-hint svg { width: 16px; height: 16px; color: var(--amber); flex: none; }
.map-hint-static { position: static; max-width: none; box-shadow: none; background: none; padding: 10px 0 0; font-size: .875rem; }
.map-preview { position: absolute; z-index: 600; bottom: 16px; inset-inline: 0; margin: 0 auto; width: min(340px, calc(100% - 32px)); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 10px; }
.map-preview .card-media { aspect-ratio: 16 / 9; }
.map-preview .card-heart { top: 14px; inset-inline-end: 14px; }
.pv-close { position: absolute; z-index: 2; top: 16px; inset-inline-start: 16px; background: #fff; box-shadow: var(--shadow-sm); width: 36px; height: 36px; }
.pv-close svg { width: 18px; height: 18px; }
.map-preview .pill { inset-inline-start: 58px; }
.map-fallback { height: 100%; min-height: 240px; display: grid; place-content: center; text-align: center; padding: 24px; direction: rtl; }
.leaflet-container { font-family: var(--font); background: #EDE6D8; direction: ltr; }
.leaflet-control-attribution { font-size: 10px; }
.price-marker-wrap { background: none !important; border: 0 !important; width: auto !important; height: auto !important; }
.price-marker {
  transform: translate(-50%, -50%); display: inline-block; white-space: nowrap; direction: rtl; min-height: 32px; padding: 4px 12px;
  border-radius: 999px; border: 1px solid rgba(28, 39, 68, .12); background: #fff; color: var(--navy); font: 700 13px/1.6 var(--font);
  box-shadow: 0 2px 8px rgba(19, 27, 49, .22); transition: transform .12s ease, background-color .12s ease;
}
.price-marker:hover { transform: translate(-50%, -50%) scale(1.06); }
.price-marker.is-active { background: var(--navy); color: #fff; transform: translate(-50%, -50%) scale(1.08); }

/* ---------- الإعلان ---------- */
.listing-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.listing-actions { display: flex; gap: 8px; align-items: center; }
.listing-title { margin: 4px 0 6px; }
.listing-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .92rem; margin-bottom: 16px; }
.gallery { position: relative; margin-inline: calc(var(--gutter) * -1); }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: center; }
.gallery-count { position: absolute; bottom: 12px; inset-inline-end: 16px; background: rgba(19, 27, 49, .7); color: #fff; font-size: .78rem; padding: 3px 10px; border-radius: 999px; direction: ltr; }
@media (min-width: 600px) { .gallery { margin-inline: 0; } .gallery-track { border-radius: var(--radius-lg); } }
@media (min-width: 900px) {
  .gallery-track { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; overflow: hidden; height: min(52vw, 460px); }
  .gallery-track img { aspect-ratio: auto; height: 100%; }
  .gallery-track img:first-child { grid-row: 1 / 3; }
  .gallery-count { display: none; }
}
.notes-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.listing-layout { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.listing, .gallery, .week { min-width: 0; }
@media (min-width: 900px) { .listing-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 56px; align-items: start; } }
@media (min-width: 1100px) { .listing-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 72px; } }
.host-row { display: flex; align-items: center; gap: 14px; padding: 20px 0; }
.host-row > div { flex: 1; min-width: 0; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: 24px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.facts svg { width: 22px; height: 22px; flex: none; color: var(--navy-600); margin-top: 2px; }
.facts span { display: flex; flex-direction: column; min-width: 0; }
.facts b { font-size: .92rem; font-weight: 600; }
.facts small { color: var(--muted); font-size: .8rem; }
@media (min-width: 1100px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badges li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--navy-50); font-size: .85rem; font-weight: 500; }
.badges svg { width: 16px; height: 16px; color: var(--navy-600); }
.ticks { display: grid; gap: 12px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks svg { width: 22px; height: 22px; flex: none; color: var(--navy-600); }
.ticks-shield svg { color: var(--amber); }
@media (min-width: 700px) { .listing .ticks { grid-template-columns: 1fr 1fr; } }
.week { display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; padding: 4px 2px 8px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-snap-type: x proximity; max-width: calc(100% + 2 * var(--gutter)); }
@media (min-width: 900px) { .week { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 2px; } }
.day { flex: 0 0 112px; display: flex; flex-direction: column; gap: 8px; padding: 12px 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); scroll-snap-align: start; }
.day-empty { background: var(--sand); }
.day-head { display: flex; flex-direction: column; line-height: 1.3; }
.day-head b { font-size: .92rem; }
.day-head span { font-size: .78rem; }
.day-slots { display: flex; flex-direction: column; gap: 6px; }
.slot { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: 4px 6px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong); background: #fff; color: var(--navy); font-weight: 600; font-size: .85rem; line-height: 1.2; }
.slot:hover:not(.is-full):not(.is-mine) { border-color: var(--navy); }
.slot small { font-size: .7rem; font-weight: 500; }
.slot.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.slot.is-full { background: var(--sand); color: #8A8FA0; border-style: dashed; cursor: not-allowed; }
.slot.is-full span { text-decoration: line-through; }
.slot.is-mine { background: var(--amber-50); border-color: var(--amber-300); color: #8A5A15; cursor: default; }
.mini-map { height: 260px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--sand); }
@media (min-width: 900px) { .mini-map { height: 320px; } }
.reviews-head { display: flex; align-items: center; gap: 6px; font-size: 1.1rem; margin-bottom: 16px; }
.reviews { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 700px) { .reviews { grid-template-columns: 1fr 1fr; gap: 20px 32px; } }
.review { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.review figcaption { display: flex; align-items: center; gap: 10px; }
.review figcaption > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.mono-sm { width: 40px; height: 40px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; font-weight: 700; flex: none; color: var(--navy-600); }
.review-stars { color: var(--amber); font-size: .85rem; letter-spacing: 2px; }
.review blockquote { line-height: 1.7; }

.book-card { display: none; }
@media (min-width: 900px) {
  .book-card { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--chrome-h) + 24px); margin-top: 20px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
}
.book-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.book-price b { font-size: 1.4rem; }
.book-rating { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; }
.book-fields { border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; }
.book-field { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 10px 14px; border: 0; background: #fff; text-align: start; min-height: 56px; }
.book-field + .book-field { border-top: 1px solid var(--line-strong); }
.book-field-row { flex-direction: row; justify-content: space-between; align-items: center; }
.book-field-row > span:first-child { display: flex; flex-direction: column; }
.bf-label { font-size: .72rem; font-weight: 700; color: var(--navy); }
.bf-val { font-size: .92rem; }
.breakdown { display: grid; gap: 10px; font-size: .92rem; }
.breakdown > div { display: flex; justify-content: space-between; gap: 12px; }
.breakdown dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.breakdown .total { padding-top: 12px; border-top: 1px solid var(--line); font-weight: 700; font-size: 1rem; }
.link-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--amber-50); border: 1px solid var(--amber-100); font-size: .85rem; margin-top: 8px; }
.link-note svg { width: 18px; height: 18px; color: var(--amber); flex: none; margin-top: 2px; }
.book-bar {
  position: fixed; inset-inline: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 44; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(28, 39, 68, .08);
}
.book-bar > div { min-width: 0; line-height: 1.3; }
.book-bar .link-btn { max-width: 58vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
.book-bar .btn { min-width: 120px; min-height: 48px; }
.listing { padding-bottom: 84px; }
@media (min-width: 900px) { .book-bar { display: none; } .listing { padding-bottom: 0; } }

/* المعلمة */
.teacher-card { display: flex; gap: 20px; align-items: center; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.teacher-stats { display: flex; gap: 24px; margin-top: 10px; }
.teacher-stats li { display: flex; flex-direction: column; line-height: 1.3; }
.teacher-stats b { font-size: 1.15rem; }
.teacher-stats small { color: var(--muted); font-size: .8rem; }
.teacher .sec .demo-note { margin-bottom: 16px; }
@media (max-width: 480px) { .teacher-card { flex-direction: column; text-align: center; } .teacher-stats { justify-content: center; } }

/* ---------- الورقة المنبثقة ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(19, 27, 49, .5); opacity: 0; transition: opacity .2s ease; }
.sheet {
  position: relative; width: 100%; max-height: 90dvh; display: flex; flex-direction: column; background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg); transform: translateY(24px); opacity: 0; transition: transform .25s ease, opacity .2s ease; outline: none;
}
.sheet-wrap.is-open .sheet { transform: none; opacity: 1; }
.sheet-wrap.is-open .sheet-backdrop { opacity: 1; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 1.05rem; text-align: center; flex: 1; }
.sheet-body { padding: 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .sheet-wrap { align-items: center; }
  .sheet { width: min(520px, calc(100% - 48px)); max-height: 86vh; border-radius: var(--radius-lg); }
  .sheet-wide { width: min(640px, calc(100% - 48px)); }
  .sheet-grip { display: none; }
  .sheet-foot { padding-bottom: 14px; }
}
.search-sheet { gap: 10px; }
.fsec { padding: 18px 0; border-bottom: 1px solid var(--line); }
.fsec:last-child { border-bottom: 0; }
.fsec h3 { margin-bottom: 10px; }
.fsec-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.fsec-row h3 { margin: 0; }
.price-range { display: flex; align-items: center; gap: 10px; }
.price-range label { flex: 1; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 12px; min-width: 0; }
.price-range label:focus-within { border-color: var(--navy); }
.price-range label > span:first-child { font-size: .78rem; color: var(--muted); }
.price-range input { border: 0; outline: none; width: 100%; min-width: 0; min-height: 36px; background: transparent; }
.unit { font-size: .8rem; color: var(--muted); }
.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-ui { width: 52px; height: 32px; border-radius: 16px; background: var(--line-strong); position: relative; transition: background-color .15s ease; }
.switch-ui::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: inset-inline-start .15s ease; }
.switch input:checked + .switch-ui { background: var(--navy); }
.switch input:checked + .switch-ui::after { inset-inline-start: 23px; }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- الحجز ---------- */
.book h1 { margin-bottom: 16px; }
.steps { display: flex; gap: 8px; margin-bottom: 20px; counter-reset: s; }
.steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); padding-bottom: 10px; border-bottom: 3px solid var(--line); min-width: 0; }
.steps li > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); font-weight: 700; flex: none; }
.step-n svg { width: 16px; height: 16px; }
.steps .current { color: var(--navy); font-weight: 700; border-color: var(--amber); }
.steps .current .step-n { background: var(--navy); color: #fff; }
.steps .done { color: var(--navy); border-color: var(--navy); }
.steps .done .step-n { background: var(--navy-50); color: var(--navy); }
.book-layout { display: grid; gap: 24px; }
.book-main { display: flex; flex-direction: column; gap: 18px; outline: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.book-sum { display: none; }
@media (min-width: 900px) {
  .book-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
  .book-main { padding: 28px; }
  .book-sum { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--chrome-h) + 24px); padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
}
.sum-head { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sum-head img, .review-box img { border-radius: 12px; object-fit: cover; flex: none; aspect-ratio: 4 / 3; }
.sum-head svg { display: inline; width: 14px; height: 14px; color: var(--amber); vertical-align: -2px; }
.book-nav { position: sticky; bottom: 0; z-index: 30; display: flex; justify-content: space-between; gap: 12px; margin: 20px calc(var(--gutter) * -1) 0; padding: 12px var(--gutter) calc(12px + var(--safe-b)); background: rgba(251, 248, 242, .97); border-top: 1px solid var(--line); }
.book-nav .btn { min-height: 50px; flex: 1; max-width: 260px; }
@media (min-width: 900px) { .book-nav { position: static; background: none; border: 0; margin: 24px 0 0; padding: 0; max-width: calc(100% - 400px); } }
.fs { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fs legend, .fs-label { font-weight: 700; font-size: .95rem; margin-bottom: 8px; padding: 0; }
.fs-static { font-weight: 600; }
.fs-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.slot-list { display: grid; gap: 14px; }
.slot-day { display: flex; flex-direction: column; gap: 8px; }
.slot-day .day-slots { flex-direction: row; flex-wrap: wrap; }
.slot-day .slot { min-width: 96px; }
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea, .composer input {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; font-weight: 400; font-size: 1rem;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus, .composer input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(193, 126, 32, .3); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.req { color: var(--amber); }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.err { color: var(--danger); font-weight: 500; font-size: .82rem; min-height: 0; }
.err:empty { display: none; }
.review-box { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); }
.review-box > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; cursor: pointer; min-height: 56px; }
.pay span { display: flex; flex-direction: column; line-height: 1.35; }
.pay:has(input:checked) { border-color: var(--navy); background: var(--navy-50); }
.pay.is-disabled { opacity: .6; cursor: not-allowed; }
.pay input, .check input, .radio input { width: 20px; height: 20px; accent-color: var(--navy); flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: 3px; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radio { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; cursor: pointer; font-weight: 500; }
.radio:has(input:checked) { border-color: var(--navy); background: var(--navy-50); }

/* ---------- الرحلة والنجاح ---------- */
.success { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 0 24px; }
.success-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 8px var(--amber-100); animation: pop .4s ease; }
.success-mark svg { width: 36px; height: 36px; stroke-width: 2.4; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.trip h1 { margin-bottom: 16px; }
.trip-card { display: grid; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); max-width: 900px; }
.trip-card > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.trip-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.trip-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; background: var(--amber-50); border-radius: 12px; }
@media (min-width: 760px) { .trip-card { grid-template-columns: 300px 1fr; } .trip-card > img { height: 100%; aspect-ratio: auto; } }
.kv { display: grid; gap: 10px; padding: 12px 0; border-block: 1px solid var(--line); }
.kv > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.kv dt { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.kv dt svg { width: 18px; height: 18px; }
.kv dd { margin: 0; font-weight: 600; text-align: end; font-size: .92rem; }
.next-steps ol { list-style: decimal; padding-inline-start: 22px; display: grid; gap: 6px; }
.trip-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 16px; align-items: center; }
.status { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.status-ok { background: #E6F0EA; color: var(--ok); }
.status-done { background: var(--navy-50); color: var(--navy-600); }
.status-off { background: #F6E7E4; color: var(--danger); }
.status-wait { background: var(--amber-50); color: #8A5A15; border: 1px solid var(--amber-100); }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { min-height: 48px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.is-on { color: var(--navy); border-color: var(--navy); }
.trip-list { display: grid; gap: 14px; }
@media (min-width: 900px) { .trip-list { grid-template-columns: 1fr 1fr; gap: 20px; } }
.trip-item { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); }
.trip-item-link { display: flex; gap: 14px; color: inherit; text-decoration: none; align-items: flex-start; }
.trip-item-link img { width: 108px; border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; flex: none; }
.trip-item-link > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trip-item-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.trip-item h3 { font-size: 1rem; }
.trip-item .btn-link { align-self: flex-end; min-height: 40px; }

/* ---------- الرسائل ---------- */
.threads { display: flex; flex-direction: column; }
.thread-item { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); text-decoration: none; color: inherit; min-height: 72px; }
.thread-item:hover { background: var(--sand); }
.thread-item.is-on { background: var(--navy-50); }
.thread-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.4; }
.thread-top { display: flex; justify-content: space-between; gap: 8px; }
.thread-listing, .thread-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-last { font-size: .9rem; }
.threads li + li .thread-item { border-top: 1px solid var(--line); border-radius: 0; }
.threads li + li .thread-item.is-on, .threads li + li .thread-item:hover { border-radius: var(--radius); }
.msgs { display: grid; gap: 24px; }
.msgs-pane { display: none; }
.msgs.has-thread .msgs-list { display: none; }
.msgs.has-thread .msgs-pane { display: flex; }
.msgs-pane { flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; height: calc(100dvh - var(--chrome-h) - 40px - var(--safe-b)); min-height: 420px; }
.msgs-empty { align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.msgs-empty svg { width: 40px; height: 40px; margin: 0 auto 8px; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.thread-head > div { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.thread-head a.small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-notice { display: flex; gap: 8px; align-items: flex-start; margin: 10px 12px 0; padding: 8px 12px; background: var(--amber-50); border: 1px solid var(--amber-100); border-radius: 12px; font-size: .8rem; }
.thread-notice svg { width: 16px; height: 16px; color: var(--amber); flex: none; margin-top: 2px; }
.bubbles { flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(var(--cream), #fff); }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px; line-height: 1.6; box-shadow: var(--shadow-sm); }
.bubble time { display: block; opacity: .7; margin-top: 2px; font-size: .72rem; }
.bubble.me { align-self: flex-start; background: var(--navy); color: #fff; border-start-start-radius: 6px; }
.bubble.them { align-self: flex-end; background: #fff; border: 1px solid var(--line); border-start-end-radius: 6px; }
.composer { display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: #fff; }
.composer input { flex: 1; border-radius: 999px; }
.composer .btn { border-radius: 50%; width: 48px; min-height: 48px; }
.composer .btn svg { width: 22px; height: 22px; }
@media (min-width: 900px) {
  .msgs { grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
  .msgs .msgs-list, .msgs.has-thread .msgs-list { display: block; position: sticky; top: calc(var(--chrome-h) + 28px); }
  .msgs .msgs-pane { display: flex; height: calc(100dvh - var(--chrome-h) - 92px); }
  .thread-head .icon-btn { display: none; }
  .composer { padding-bottom: 10px; }
}

/* ---------- الحساب ---------- */
.profile { max-width: 720px; }
.profile-card { display: flex; gap: 16px; align-items: center; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.mode-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin: 16px 0; padding: 20px; border-radius: var(--radius-lg); background: var(--navy); color: #fff; }
.mode-card .muted { color: var(--navy-100); }
.mode-card .btn-primary { background: var(--amber); box-shadow: none; }
.mode-card .btn-primary:hover { background: #A96D19; }
.mode-card .btn-outline { color: #fff; border-color: #fff; }
.mode-card .btn-outline:hover { background: rgba(255, 255, 255, .08); }
.rows { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.row-link { display: flex; align-items: center; gap: 14px; padding: 14px 18px; min-height: 60px; text-decoration: none; color: inherit; }
.row-link:hover { background: var(--sand); }
.row-link > span { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.row-link > svg { width: 22px; height: 22px; flex: none; color: var(--navy-600); }
.row-link > svg:last-child { width: 18px; height: 18px; color: var(--muted); }
.info-card { margin: 16px 0; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--amber-50); border: 1px solid var(--amber-100); }
.info-card h3 { margin-bottom: 6px; }
.danger-zone { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 8px; }
.prose { max-width: 720px; }
.prose h2 { margin: 28px 0 12px; }
.prose p { margin-bottom: 10px; line-height: 1.8; }

/* ---------- وضع المعلمة ---------- */
.host-head { gap: 12px; }
.host-id { display: flex; align-items: center; gap: 12px; }
.host-id .mode-tag { margin-bottom: 2px; }
.subnav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1) 20px; padding: 2px var(--gutter); }
.subnav::-webkit-scrollbar { display: none; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stats-3 { grid-template-columns: 1fr; }
@media (min-width: 600px) { .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.stat b { font-size: 1.4rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat-rating { display: inline-flex; align-items: center; gap: 4px; }
.stat-strong { background: var(--navy); color: #fff; border-color: var(--navy); }
.link-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--amber-50); border: 1px solid var(--amber-100); margin-bottom: 8px; }
.link-card h2 { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.link-card h2 svg { width: 20px; height: 20px; color: var(--amber); }
.link-card code { display: inline-block; margin-top: 6px; padding: 4px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; overflow-wrap: anywhere; }
.link-actions { display: flex; gap: 8px; }
.hb-list, .hl-list { display: grid; gap: 12px; }
.hb { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); flex-wrap: wrap; }
.hb-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.hb-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.hb-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: end; }
.hb-actions { display: flex; gap: 8px; margin-top: 8px; }
.src { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--navy-50); color: var(--navy-600); }
.src svg { width: 13px; height: 13px; }
.src-link { background: var(--amber-50); color: #8A5A15; }
.hl-list { margin-top: 16px; }
.hl { display: grid; grid-template-columns: 96px 1fr; gap: 12px 14px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); align-items: center; }
.hl img { width: 96px; border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; }
.hl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hl-body svg { display: inline; width: 14px; height: 14px; color: var(--amber); vertical-align: -2px; }
.hl-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.hl.is-off img { filter: grayscale(.8); opacity: .7; }
.hl.is-new { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-100); }
@media (min-width: 700px) { .hl { grid-template-columns: 140px 1fr auto; } .hl img { width: 140px; } .hl-actions { grid-column: auto; flex-direction: column; } }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; max-width: 820px; box-shadow: var(--shadow-sm); }
@media (min-width: 900px) { .form-card { padding: 28px; } }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; align-items: end; height: 240px; padding: 12px 8px 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); background-image: linear-gradient(to top, var(--line) 1px, transparent 1px); background-size: 100% 25%; background-position: 0 -36px; }
.bar-col { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 6px 8px; border-radius: 8px; outline-offset: -2px; }
.bar { width: min(56px, 70%); height: calc((100% - 56px) * var(--h) / 100); min-height: 2px; background: var(--navy); border-radius: 4px 4px 0 0; }
.bar-col:hover .bar, .bar-col:focus-visible .bar { background: var(--navy-600); }
.bar-val { font-size: .78rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.bar-label { font-size: .78rem; color: var(--muted); text-align: center; line-height: 1.3; min-height: 2em; }
.bar-tip { position: absolute; bottom: calc(100% - 24px); background: var(--navy-900); color: #fff; font-size: .75rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2; text-align: center; }
.bar-col:hover .bar-tip, .bar-col:focus-visible .bar-tip { opacity: 1; }
.splits { display: grid; gap: 14px; margin-bottom: 10px; }
@media (min-width: 700px) { .splits { grid-template-columns: 1fr 1fr; } }
.split { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; }
.split-link { background: var(--amber-50); border-color: var(--amber-100); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 720px; }
.table th, .table td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { background: var(--sand); font-weight: 700; font-size: .8rem; color: var(--muted); }
.table td { font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 700; background: var(--cream); border-bottom: 0; }

/* ---------- حركة مخفّضة ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
