:root {
  --bg: #eef1f4;
  --surface: #fff;
  --ink: #172333;
  --muted: #5b6b76;
  --line: #e3e8ec;
  --accent: #08786d;
  --accent-soft: #e7f5f3;
  --rail: 72px;
  --rail-wide: 260px;
  --shadow: 0 10px 28px rgba(20, 33, 43, .06);
  --font: "Vazirmatn", Tahoma, sans-serif;
  --color-school: #08786d;
  --color-institute: #2563eb;
  --color-tutor: #966500;
  --color-ad: #e11d48;
  --site-wrap: min(1180px, calc(100% - 32px));
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.lucide { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-wrap { width: var(--site-wrap); margin-inline: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0;
  background: var(--accent); color: #fff; font-weight: 800; cursor: pointer;
}
.btn.secondary { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
.text-link { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-weight: 700; font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 12px 40px;
  max-width: 1480px;
  margin: 0 auto;
}
.rail {
  position: sticky; top: 12px; align-self: start; z-index: 45;
  width: var(--rail);
  height: calc(100vh - 24px);
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow);
  padding: 10px 6px; display: flex; flex-direction: column; gap: 4px;
  overflow: visible; transition: width .2s ease;
}
body.rail-open .rail { overflow: auto; }
.rail-toggle {
  border: 0; background: #f3f6f7; color: var(--ink); border-radius: 12px;
  min-height: 40px; display: grid; place-items: center; cursor: pointer; margin-bottom: 4px;
}
.rail-toggle .lucide { width: 20px; height: 20px; }
.rail a {
  display: grid; grid-template-columns: 1fr; place-items: center; gap: 3px;
  padding: 10px 4px; border-radius: 14px;
  color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap;
}
.rail a .lucide { width: 22px; height: 22px; flex-shrink: 0; }
.rail a .rail-label { overflow: hidden; }
.rail-label-short,
.rail-label-full { display: block; }
body:not(.rail-open) .rail-label-full { display: none; }
body.rail-open .rail-label-short { display: none; }
.rail a.is-on, .rail a:hover { background: var(--accent-soft); color: var(--accent); }
.rail-group { position: relative; }
.rail-group > a { width: 100%; }
.rail-sub {
  display: none; position: absolute; top: 0; z-index: 60;
  inset-inline-start: calc(100% + 10px); inset-inline-end: auto;
  min-width: 188px; padding: 8px; border-radius: 14px; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 12px 28px rgba(20,33,43,.14);
}
.rail-sub::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 12px;
  inset-inline-start: -12px; inset-inline-end: auto;
}
.rail-sub a {
  display: flex !important; grid-template-columns: none !important;
  justify-content: flex-start; align-items: center; gap: 0;
  padding: 9px 12px !important; font-size: 13px !important; font-weight: 700 !important;
  white-space: nowrap; color: #33454f !important;
}
.rail-sub a:hover { background: var(--accent-soft) !important; color: var(--accent) !important; }
body:not(.rail-open) .rail-group:hover > .rail-sub,
body:not(.rail-open) .rail-group:focus-within > .rail-sub { display: grid; gap: 2px; }
body:not(.rail-open) .rail-group:hover > a,
body:not(.rail-open) .rail-group:focus-within > a { background: var(--accent-soft); color: var(--accent); }
body.rail-open .rail-sub {
  display: none; position: static; inset: auto; min-width: 0; margin: 2px 4px 6px;
  padding: 4px; box-shadow: none; border: 0; background: #f5f8f9; border-radius: 12px;
}
body.rail-open .rail-sub::before { display: none; }
body.rail-open .rail-group.is-open > .rail-sub { display: grid !important; gap: 2px; }
body.rail-open .rail-sub a { font-size: 12.5px !important; padding: 8px 10px !important; }
.rail-chevron {
  display: none !important; width: 16px; height: 16px; margin-inline-start: auto; opacity: .55;
  transition: transform .15s ease;
}
body.rail-open .rail-group > a .rail-chevron { display: block !important; }
.rail-group.is-open > a .rail-chevron { transform: rotate(-90deg); }
.rail-foot {
  margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line);
  display: grid; gap: 4px;
}
body.rail-open .shell { grid-template-columns: var(--rail-wide) minmax(0, 1fr); }
body.rail-open .rail { width: var(--rail-wide); padding: 12px 10px; }
body.rail-open .rail a {
  grid-template-columns: 28px 1fr auto;
  justify-items: start; align-items: center;
  gap: 10px; padding: 11px 12px; font-size: 13.5px; font-weight: 700;
}
body.rail-open .rail a .lucide { width: 20px; height: 20px; }
body.rail-open .rail-toggle { grid-template-columns: 28px 1fr; justify-items: start; gap: 10px; padding: 0 12px; font-weight: 700; font-size: 13.5px; }
body.rail-open .rail-toggle::after { content: "بستن منو"; }
.rail-backdrop {
  display: none; position: fixed; inset: 0; z-index: 30;
  background: rgba(15, 23, 42, .18);
}
body.rail-open .rail-backdrop { display: block; }
.main { min-width: 0; display: grid; gap: 12px; }
.topbar {
  position: relative; z-index: 35;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border-radius: 22px; padding: 10px 14px; box-shadow: var(--shadow);
}
/* Sticky wrap (not only .topbar): short wrap otherwise ends sticky as soon as header scrolls past. */
.topbar-wrap {
  position: sticky;
  top: 12px;
  z-index: 70;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; min-width: 0; }
.brand a { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #0aa394, #06665d); color: #fff; font-weight: 800;
}
.shell-brand.brand-block {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit;
}
.shell-brand .brand-copy {
  display: grid; gap: 1px; min-width: 0; line-height: 1.25;
}
.shell-brand .brand-name {
  font-size: 15px; font-weight: 900; color: #172333; white-space: nowrap;
}
.shell-brand .brand-tagline {
  font-size: 11px; font-weight: 700; color: #5b6b76;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.shell-brand .brand-icon,
.shell-brand img {
  width: 40px; height: 40px; border-radius: 12px; object-fit: contain; flex: 0 0 auto;
}
.top-search {
  display: grid; grid-template-columns: 120px 1fr auto; align-items: center;
  background: #f4f7f8; border: 1px solid var(--line); border-radius: 999px; padding: 5px;
  min-height: 48px;
}
.top-search select,
.top-search input {
  border: 0; background: transparent; outline: none; padding: 10px 12px; color: var(--ink); min-width: 0;
}
.top-search select {
  color: var(--muted); font-weight: 700; border-inline-end: 1px solid var(--line); appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6b76' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 10px center; padding-inline-start: 26px;
}
.top-search input::placeholder { color: #8a98a1; }
.top-search button {
  border: 0; border-radius: 999px; padding: 0 18px; min-height: 38px;
  background: var(--accent); color: #fff; font-weight: 700; cursor: pointer;
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-search-toggle {
  display: none; border: 0; background: #f3f6f7; color: var(--ink);
  width: 40px; height: 40px; border-radius: 12px; place-items: center; cursor: pointer; flex: 0 0 auto;
}
.top-search-toggle .lucide { width: 18px; height: 18px; }
.top-search-toggle[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.top-search-backdrop {
  display: none; position: fixed; inset: 0; z-index: 34;
  border: 0; padding: 0; margin: 0; background: rgba(15, 23, 42, .28); cursor: pointer;
}
.top-search-backdrop[hidden] { display: none !important; }
.ghost {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 10px 14px; color: var(--ink); font-weight: 600; cursor: pointer;
}
.account {
  border: 0; border-radius: 999px; padding: 10px 16px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; cursor: pointer;
}
.notice {
  background: #fff8e8; border: 1px solid #f0dfb0; color: #7a5b00;
  border-radius: 14px; padding: 10px 14px; font-size: .86rem; font-weight: 600;
}
.footer-note { text-align: center; color: var(--muted); font-size: .82rem; padding: 4px 0 8px; }

.mob-tabbar {
  display: none;
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(20, 33, 43, .08);
}
.mob-tab {
  display: grid; place-items: center; gap: 3px;
  padding: 6px 2px; border: 0; background: transparent; color: var(--muted);
  font-size: 10px; font-weight: 700; cursor: pointer; border-radius: 12px;
}
.mob-tab .lucide { width: 20px; height: 20px; }
.mob-tab.is-on { color: var(--accent); background: var(--accent-soft); }
.mob-tab[data-kind="institutes"].is-on { color: var(--color-institute); background: #eaf0ff; }
.mob-tab[data-kind="learning-centers"].is-on { color: var(--color-learning-center); background: #ecfeff; }
.mob-tab[data-kind="tutors"].is-on { color: var(--color-tutor); background: #fff6df; }
.mob-tab[data-kind="ads"].is-on { color: var(--color-ad); background: #ffe8ee; }
.topbar-menu {
  display: none; border: 0; background: #f3f6f7; color: var(--ink);
  width: 40px; height: 40px; border-radius: 12px; place-items: center; cursor: pointer;
}
.topbar-menu .lucide { width: 20px; height: 20px; }
.topbar-menu[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }

.site-mobile-nav[hidden] { display: none !important; }
.site-mobile-nav {
  display: none; position: absolute; inset-inline: 8px; top: calc(100% + 6px); z-index: 70;
  margin: 0; padding: 8px; flex-direction: column; gap: 4px;
  background: #fff; border: 1px solid #dce5e9; border-radius: 8px;
  box-shadow: 0 12px 28px rgba(42,54,90,.14);
  max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain;
}
.site-mobile-nav.is-open { display: flex !important; }
.site-mobile-nav a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px;
  border-radius: 6px; color: #33454f; font-weight: 500;
}
.site-mobile-nav a > .lucide { width: 18px; height: 18px; color: #657982; }
.site-mobile-nav a[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.site-mobile-nav a[aria-current] > .lucide { color: var(--accent); }
.site-mobile-nav a:hover { background: #f1f4f6; }
.site-mobile-nav-group { display: flex; flex-direction: column; gap: 4px; }
.site-mobile-nav-row { display: flex; align-items: stretch; gap: 4px; }
.site-mobile-nav-row > a { flex: 1; min-width: 0; }
.site-mobile-submenu-toggle {
  flex: 0 0 44px; width: 44px; min-height: 44px; border: 0; border-radius: 6px;
  background: #eef3f5; color: #33454f; font-size: 22px; font-weight: 700; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.site-mobile-submenu-toggle[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.site-mobile-submenu {
  display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  margin: 0 0 6px; padding: 6px 8px 10px; background: #f6faf9; border-radius: 10px;
}
.site-mobile-submenu:not([hidden]),
.site-mobile-submenu.is-open { display: grid !important; }
.site-mobile-submenu[hidden] { display: none !important; }
.site-mobile-nav-child {
  min-height: 40px !important; padding: 8px 10px !important; font-size: 12px !important;
  color: #33454f !important; font-weight: 600 !important; line-height: 1.4;
}

@media (max-width: 1100px) {
  .top-search { grid-template-columns: 120px 1fr auto; border-radius: 18px; }
}
@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 8px 8px calc(78px + env(safe-area-inset-bottom));
    gap: 8px;
  }
  .rail, .rail-backdrop { display: none !important; }
  body.rail-open .shell { grid-template-columns: 1fr; }
  body.rail-open .rail-backdrop { display: none !important; }
  .mob-tabbar { display: grid; }
  body.shell-360 .site-back-top {
    inset-inline-end: 14px;
    inset-block-end: calc(78px + env(safe-area-inset-bottom));
    z-index: 55;
  }
  .topbar-menu {
    display: grid; width: 34px; height: 34px; border-radius: 8px;
    place-items: center; position: relative; z-index: 2; flex: 0 0 auto;
  }
  .topbar-wrap { top: 6px; }
  .topbar {
    position: relative; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 6px 8px;
    border-radius: 14px;
  }
  .brand { gap: 6px; min-width: 0; }
  .brand-mark { width: 34px; height: 34px; border-radius: 8px; }
  .shell-brand.brand-block { gap: 7px; min-width: 0; }
  .shell-brand .brand-copy { display: grid; gap: 0; min-width: 0; }
  .shell-brand .brand-tagline {
    display: block !important;
    font-size: 10px;
    font-weight: 700;
    color: #5b6b76;
    max-width: min(160px, 42vw);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }
  .shell-brand .brand-name { font-size: 13px; line-height: 1.2; }
  .shell-brand .brand-icon,
  .shell-brand img { width: 34px; height: 34px; border-radius: 8px; }
  .top-actions { gap: 4px; }
  .top-actions .ghost { display: none; }
  .top-actions .compare-cart.ghost {
    display: inline-flex !important;
    width: 34px; height: 34px; padding: 0; border-radius: 8px;
    align-items: center; justify-content: center;
  }
  .top-actions .account {
    padding: 0 10px; min-height: 34px; font-size: 12px; border-radius: 8px;
    background: #f7c948; color: #5a4300;
  }
  .top-search-toggle { display: grid; width: 34px; height: 34px; border-radius: 8px; }
  .top-search {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 8px);
    z-index: 36;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 0;
    min-height: 52px;
    padding: 6px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 14px 32px rgba(20, 33, 43, .16);
  }
  .topbar-wrap.is-search-open .top-search {
    display: grid;
  }
  .topbar-wrap.is-search-open .top-search-backdrop {
    display: block;
  }
  .top-search select {
    font-size: 12px; padding: 10px 8px 10px 20px; border-inline-end: 1px solid var(--line);
    background-position: left 6px center;
  }
  .top-search input { grid-column: auto; font-size: 14px; padding: 10px 12px; }
  .top-search button {
    grid-column: auto; min-height: 40px; padding: 0 12px; font-size: 0; width: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center;
  }
  .notice { font-size: .78rem; padding: 8px 10px; border-radius: 12px; }
  .footer-note { padding-bottom: 12px; }
}

a.mob-tab { text-decoration: none; color: inherit; }
body.shell-360 .newsletter-band {
  margin: 0 0 12px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
body.shell-360 .home-engage-band {
  margin: 0 0 12px;
}
body.shell-360 .home-engage-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
body.shell-360 .home-engage-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
body.shell-360 .home-engage-card--register {
  background: #0b1624;
  color: #f4f7fb;
}
body.shell-360 .home-engage-card--newsletter {
  background: #f7c948;
  color: #17251f;
}
body.shell-360 .home-engage-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
body.shell-360 .home-engage-copy h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}
body.shell-360 .home-engage-copy p {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.5;
  opacity: .82;
}
body.shell-360 .home-engage-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
}
body.shell-360 .home-engage-card--newsletter .home-engage-icon {
  background: rgba(23, 37, 31, .1);
}
body.shell-360 .home-engage-icon .lucide {
  width: 18px;
  height: 18px;
}
body.shell-360 .home-engage-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: #08786d;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
body.shell-360 .home-engage-btn:hover { background: #06665d; }
body.shell-360 .home-engage-form {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 280px;
}
body.shell-360 .home-engage-form .newsletter-input-row input {
  min-height: 40px;
  border-radius: 12px;
}
body.shell-360 .home-engage-form .newsletter-submit {
  flex-basis: 40px;
  width: 40px;
  min-height: 40px;
  border-radius: 12px;
}
@media (max-width: 820px) {
  body.shell-360 .home-engage-inner { grid-template-columns: 1fr; }
  body.shell-360 .home-engage-card { flex-wrap: wrap; }
  body.shell-360 .home-engage-form { max-width: none; flex-basis: 100%; }
}
body.shell-360 .site-footer,
body.shell-360 footer.site-footer { margin-top: 8px; border-radius: 22px; overflow: hidden; }
