/* ==========================================================================
   Academic Hub — Design System
   Light, flat, quiet. Thin borders instead of shadows; colour used only as
   small accents so long reading sessions stay comfortable.
   ========================================================================== */

:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #FBFCFD;
  --border: #E8EAEE;
  --border-strong: #D5D9E0;

  --ink: #1A2233;
  --ink-soft: #4A5468;
  --muted: #79839A;

  --primary: #2F6F62;
  --primary-hover: #255A50;
  --primary-soft: #E9F1EF;

  /* Program accents — the four dots. */
  --c-pt: #3A9E6F;
  --c-ot: #DD6B3C;
  --c-slp: #3B82AE;
  --c-po: #8B5FC0;

  --ok: #3A8A5F;   --ok-soft: #E8F3ED;
  --warn: #9A7020; --warn-soft: #FAF2E2;
  --danger: #B4534C; --danger-soft: #FAECEB;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;

  --maxw: 1120px;
  --header-h: 60px;
}

[data-theme="dark"] {
  --bg: #14171C;
  --surface: #1B1F26;
  --surface-2: #21262E;
  --border: #2A303A;
  --border-strong: #3A4250;

  --ink: #E7EAEF;
  --ink-soft: #B4BCCA;
  --muted: #838D9F;

  --primary: #6FB5A4;
  --primary-hover: #85C5B5;
  --primary-soft: #1F2A28;

  --c-pt: #57B98A;
  --c-ot: #E58755;
  --c-slp: #5C9DC7;
  --c-po: #A57DD4;

  --ok: #6BAE86;   --ok-soft: #1C2722;
  --warn: #C79B47; --warn-soft: #2A2418;
  --danger: #CE8983; --danger-soft: #2B1F1E;
}

/* ---------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* Sticky footer: on short pages the footer sits at the bottom of the
     viewport instead of floating up under the content. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
body > .site-footer { flex-shrink: 0; }
html[lang="ar"] body { font-size: 16px; }

h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); letter-spacing: -.02em; }
h2 { font-size: 1.15rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: 50%; top: -60px; transform: translateX(50%);
  background: var(--primary); color: #fff; padding: .5rem 1.1rem;
  border-radius: 0 0 var(--r) var(--r); z-index: 200; transition: top .2s;
}
.skip-link:focus { top: 0; }

/* --------------------------------------------------------------- layout -- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: clamp(2rem, 4vw, 3rem); }
.section--tight { padding-block: 1.25rem; }

.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Section label: small icon + heading, as in the reference. */
.sec-head {
  display: flex; align-items: center; gap: .5rem;
  margin: 0 0 1rem; font-size: 1.02rem; font-weight: 700; color: var(--ink);
}
.sec-head__icon { font-size: 1rem; opacity: .75; }

/* --------------------------------------------------------------- header -- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--maxw); margin-inline: auto; padding: 0 24px;
  height: var(--header-h); display: flex; align-items: center; gap: 1rem;
}

.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: .98rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--ink); color: var(--surface);
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
}

.nav { display: flex; gap: .15rem; align-items: center; margin-inline: auto; }
.nav a {
  color: var(--ink-soft); font-weight: 500; font-size: .88rem;
  padding: .35rem .7rem; border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.header-actions { display: flex; gap: .35rem; align-items: center; flex-shrink: 0; }

.icon-btn {
  display: grid; place-items: center; height: 32px; min-width: 32px; padding: 0 .5rem;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-soft);
  cursor: pointer; font-size: .85rem; font-family: inherit; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--ink); }

.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset-block-start: var(--header-h); inset-inline: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; gap: 0; padding: .4rem; margin: 0;
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .65rem .9rem; }
  .header-actions { margin-inline-start: auto; }
}

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-family: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
[data-theme="dark"] .btn--primary { color: #121A18; }

.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); }

.btn--soft { background: var(--primary-soft); color: var(--primary); }
.btn--soft:hover { background: color-mix(in srgb, var(--primary-soft) 80%, var(--primary) 12%); }

.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--sm { padding: .3rem .7rem; font-size: .8rem; }

/* ---------------------------------------------------------------- cards -- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.25rem;
}

/* Program tile: colour dot + name. Deliberately flat — no icon boxes.
   Sized a touch larger so the cards don't feel empty. */
.program-card {
  display: flex; flex-direction: column; width: 100%; text-align: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.5rem 1.5rem 1.35rem;
  min-height: 150px;
  cursor: pointer; font-family: inherit; color: inherit;
  transition: border-color .15s, background .15s;
}
.program-card:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }
.program-card__dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--tone, var(--primary)); display: block; margin-bottom: 1.1rem;
}
.program-card__title { display: block; font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.program-card__en {
  display: block; font-size: .78rem; color: var(--muted); margin-top: .1rem;
  unicode-bidi: plaintext;
}
.program-card__meta {
  display: block; font-size: .78rem; color: var(--muted);
  margin-top: auto; padding-top: .6rem;
}

/* Tool tile */
.tool-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.15rem; color: inherit;
  transition: border-color .15s, background .15s;
}
.tool-card:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }
.tool-card__icon { font-size: 1.15rem; margin-bottom: .6rem; }
.tool-card__title { font-size: .95rem; font-weight: 600; color: var(--ink); margin: 0 0 .2rem; }
.tool-card__desc { font-size: .84rem; color: var(--muted); margin: 0; }

/* ------------------------------------------------------------ page head -- */
.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem;
}
.back-link:hover { color: var(--ink); text-decoration: none; }
.back-link__arrow { font-size: .95rem; }
html[dir="rtl"] .back-link__arrow { transform: scaleX(-1); }

.page-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.page-head__badge {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--tone, var(--primary)) 14%, transparent);
}
.page-head__dot { width: 13px; height: 13px; border-radius: 50%; background: var(--tone, var(--primary)); }
.page-head h1 { margin: 0; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); }
.page-head__sub { font-size: .84rem; color: var(--muted); margin: .1rem 0 0; }

/* ----------------------------------------------------------- filter bar -- */
/* One white strip: a quiet "Filters" label, then every control right-aligned.
   Same shell is reused on the practice page. */
.filter-bar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: .7rem .9rem; margin-bottom: 1.25rem;
}
.filter-bar__label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .84rem; font-weight: 500; color: var(--muted); flex-shrink: 0;
}
.filter-bar__controls {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
  margin-inline-start: auto;
}
.filter-bar__search { position: relative; min-width: 180px; flex: 1 1 180px; }
.filter-bar__search .input { padding-inline-start: 2rem; font-size: .84rem; padding-block: .35rem; }
.filter-bar__search::before {
  content: "\2315"; position: absolute; inset-inline-start: .6rem; top: 50%;
  transform: translateY(-50%) scaleX(-1); color: var(--muted); font-size: .9rem; pointer-events: none;
}

.mini-select {
  appearance: none; font-family: inherit; font-size: .83rem; font-weight: 500;
  color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: .35rem 1.7rem .35rem .65rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2379839A' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 13px; background-position: right .5rem center;
}
html[dir="rtl"] .mini-select { padding: .35rem .65rem .35rem 1.7rem; background-position: left .5rem center; }
.mini-select:hover { border-color: var(--muted); }
/* An active filter reads as selected, so state is obvious without extra chrome. */
.mini-select[data-active="true"] {
  border-color: var(--primary); color: var(--primary); background-color: var(--primary-soft);
}

.result-count { font-size: .83rem; color: var(--muted); margin: 0 0 .9rem; }

/* --------------------------------------------------------- course cards -- */
.course-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.course-card {
  display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: .95rem 1.05rem 1.1rem; color: inherit;
  transition: border-color .15s, background .15s;
}
.course-card:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }

.course-card__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-bottom: .75rem;
}
.course-card__tags { display: flex; gap: .3rem; flex-shrink: 0; }

.course-card__title {
  font-size: .98rem; font-weight: 600; color: var(--ink);
  margin: 0; line-height: 1.4;
}
/* This line mixes scripts (an Arabic course name next to "3 cr · Faculty").
   Left alone, the bidi algorithm takes its direction from the first strong
   character and reorders the whole line — so the name is wrapped in <bdi>,
   which isolates it and lets the rest follow the page direction. */
.course-card__sub {
  font-size: .79rem; color: var(--muted); margin: .25rem 0 0;
  text-align: start;
}

/* Small square-ish label used for the code and the Y#/S# markers. */
.chip {
  display: inline-block;
  font-size: .68rem; font-weight: 600; letter-spacing: .03em;
  padding: .12rem .4rem; border-radius: 4px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); white-space: nowrap;
}
.chip--code { direction: ltr; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- pills -- */
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .74rem; font-weight: 500;
  padding: .12rem .5rem; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); white-space: nowrap;
}
.pill--ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill--warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill--primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* --------------------------------------------------------------- forms -- */
label { display: block; font-size: .83rem; font-weight: 600; color: var(--ink); margin-bottom: .3rem; }

.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: .9rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: .5rem .7rem; line-height: 1.6;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
.textarea { resize: vertical; min-height: 78px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2379839A' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 14px;
  background-position: right .6rem center; padding-inline-end: 2rem;
}
html[dir="rtl"] .select { background-position: left .6rem center; }

.field + .field { margin-top: .9rem; }
.hint { font-size: .79rem; color: var(--muted); margin: .3rem 0 0; }

/* --------------------------------------------------------------- modal -- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__backdrop {
  position: absolute; inset: 0; background: rgba(20, 23, 28, .45);
  animation: fade .15s ease-out;
}
.modal__panel {
  position: relative; width: min(440px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.6rem;
  box-shadow: 0 16px 48px rgba(20, 23, 28, .16);
  animation: pop .16s ease-out;
}
.modal__close {
  position: absolute; inset-block-start: 12px; inset-inline-end: 12px;
  width: 28px; height: 28px; border-radius: var(--r-sm);
  border: none; background: transparent; color: var(--muted);
  font-size: .95rem; cursor: pointer; display: grid; place-items: center;
}
.modal__close:hover { background: var(--surface-2); color: var(--ink); }

@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) } }

.opt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.opt-grid--3 { grid-template-columns: repeat(3, 1fr); }
.opt {
  padding: .55rem .3rem; text-align: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-soft);
  font-family: inherit; font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: all .12s;
}
.opt:hover { border-color: var(--border-strong); color: var(--ink); }
.opt[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
[data-theme="dark"] .opt[aria-pressed="true"] { color: #121A18; }

/* ------------------------------------------------------------ resource -- */
.res-group { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.res-group + .res-group { margin-top: .6rem; }

.res-group__head {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .85rem 1.1rem; background: none; border: none; cursor: pointer;
  font-family: inherit; text-align: start; color: var(--ink);
}
.res-group__head:hover { background: var(--surface-2); }
.res-group__icon { font-size: 1rem; flex-shrink: 0; opacity: .8; }
.res-group__title { font-weight: 600; font-size: .92rem; }
.res-group__sub { font-size: .78rem; color: var(--muted); font-weight: 400; }
.res-group__chev { margin-inline-start: auto; color: var(--muted); transition: transform .2s; font-size: .8rem; }
.res-group[data-open="true"] .res-group__chev { transform: rotate(180deg); }
.res-group__body { display: none; padding: 0 1.1rem 1rem; }
.res-group[data-open="true"] .res-group__body { display: block; }

.file-row {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .75rem; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface-2);
}
.file-row + .file-row { margin-top: .4rem; }
.file-row__icon { font-size: 1rem; flex-shrink: 0; }
.file-row__main { min-width: 0; flex: 1; }
.file-row__name { font-weight: 500; font-size: .88rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__meta { font-size: .75rem; color: var(--muted); }
.file-row__actions { display: flex; gap: .3rem; flex-shrink: 0; }

.viewer { margin-top: .7rem; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.viewer__bar { display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem; border-bottom: 1px solid var(--border); font-size: .82rem; font-weight: 600; }
.viewer__frame { width: 100%; height: min(75vh, 700px); border: 0; display: block; background: #fff; }

/* ------------------------------------------------------------ feedback -- */
.empty {
  text-align: center; padding: 2.5rem 1.5rem;
  border: 1px dashed var(--border-strong); border-radius: var(--r);
  color: var(--muted); background: var(--surface);
}
.empty__icon { font-size: 1.6rem; margin-bottom: .4rem; }

.note {
  padding: .8rem 1rem; border-radius: var(--r-sm);
  border-inline-start: 3px solid var(--primary);
  background: var(--primary-soft); color: var(--ink-soft); font-size: .87rem;
}
.note--warn { border-color: var(--warn); background: var(--warn-soft); }
.note--ok { border-color: var(--ok); background: var(--ok-soft); }

.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .9rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs span { margin-inline: .35rem; }

.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding-block: 2rem; margin-top: 2.5rem; font-size: .84rem; color: var(--muted);
}
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--ink); }

.toast-host {
  position: fixed; inset-block-end: 24px; inset-inline-start: 50%;
  transform: translateX(-50%); z-index: 300;
  display: flex; flex-direction: column; gap: .4rem; align-items: center; pointer-events: none;
}
html[dir="rtl"] .toast-host { transform: translateX(50%); }
.toast {
  background: var(--ink); color: var(--bg);
  padding: .55rem 1rem; border-radius: var(--r-sm);
  font-size: .85rem; font-weight: 500; animation: pop .16s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
}

/* ============================================================== carousel == */
/* The home-page "fields" slider: one program panel at a time, auto-advancing,
   swipeable, and clickable straight into the year/semester dialog. */
.carousel { position: relative; }
.carousel__viewport { overflow: hidden; border-radius: var(--r-lg); }
.carousel__track { display: flex; transition: transform .5s cubic-bezier(.4, .0, .2, 1); }
@media (prefers-reduced-motion: reduce) { .carousel__track { transition: none; } }

.carousel__slide { flex: 0 0 100%; min-width: 100%; }
.slide {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2.25rem);
  width: 100%; min-height: clamp(240px, 30vw, 340px);
  text-align: start; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--tone) 14%, var(--surface)), var(--surface) 58%);
  padding: clamp(1.75rem, 4vw, 3.25rem); font-family: inherit; color: inherit;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
html[dir="rtl"] .slide {
  background: linear-gradient(-105deg, color-mix(in srgb, var(--tone) 14%, var(--surface)), var(--surface) 58%);
}
.slide:hover {
  border-color: color-mix(in srgb, var(--tone) 45%, var(--border));
  box-shadow: 0 10px 34px color-mix(in srgb, var(--tone) 16%, transparent);
  transform: translateY(-2px);
  text-decoration: none;
}
/* A big, faint watermark of the same icon on the far side fills the extra
   height without clutter. */
.slide__ghost {
  position: absolute; inset-block: 50%; inset-inline-end: clamp(1rem, 4vw, 3rem);
  transform: translateY(-50%);
  font-size: clamp(6rem, 16vw, 11rem); line-height: 1;
  opacity: .06; pointer-events: none; user-select: none;
}
.slide__mark {
  width: clamp(64px, 8vw, 84px); height: clamp(64px, 8vw, 84px);
  border-radius: 22px; flex-shrink: 0;
  background: color-mix(in srgb, var(--tone) 18%, transparent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--tone) 8%, transparent);
  display: grid; place-items: center;
}
.slide__icon { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1; }
.slide__dot { width: 22px; height: 22px; border-radius: 50%; background: var(--tone); }
.slide__body { display: block; min-width: 0; }
.slide__eyebrow {
  display: block; width: fit-content;
  font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tone); margin: 0 0 .3rem;
}
.slide__title { display: block; font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2rem); font-weight: 800; color: var(--ink); margin: 0 0 .45rem; letter-spacing: -.01em; }
.slide__desc { display: block; font-size: clamp(.95rem, .9rem + .3vw, 1.08rem); color: var(--ink-soft); margin: 0 0 1.1rem; max-width: 48ch; line-height: 1.6; }
.slide__cta {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .95rem; font-weight: 700; color: var(--tone);
}
.slide__cta-arrow { transition: transform .15s; }
html[dir="rtl"] .slide__cta-arrow { transform: scaleX(-1); }
.slide:hover .slide__cta-arrow { transform: translateX(3px); }
html[dir="rtl"] .slide:hover .slide__cta-arrow { transform: scaleX(-1) translateX(3px); }

@media (max-width: 620px) {
  .slide { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.5rem; }
  .slide__title { font-size: 1.2rem; }
}

.carousel__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--ink-soft); cursor: pointer; z-index: 2;
  display: grid; place-items: center; font-size: 1rem;
  transition: background .15s, color .15s;
}
.carousel__nav:hover { background: var(--surface-2); color: var(--ink); }
.carousel__nav--prev { inset-inline-start: -8px; }
.carousel__nav--next { inset-inline-end: -8px; }
/* Arrow glyphs are set in JS per direction, and the buttons position
   themselves via logical inset — so no transform flip is needed here. */
@media (max-width: 560px) { .carousel__nav { display: none; } }

.carousel__dots { display: flex; justify-content: center; gap: .4rem; margin-top: .9rem; }
.carousel__dot {
  width: 7px; height: 7px; border-radius: 50%; padding: 0;
  border: none; background: var(--border-strong); cursor: pointer;
  transition: width .2s, background .2s;
}
.carousel__dot[aria-selected="true"] { width: 20px; border-radius: 4px; background: var(--primary); }

/* ================================================================ stats == */
.stats {
  display: grid; gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.stat { background: var(--surface); padding: 1.4rem 1.1rem; text-align: center; }
.stat__icon { font-size: 1.1rem; opacity: .7; margin-bottom: .35rem; }
.stat__num {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); font-weight: 700;
  color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat__label { font-size: .8rem; color: var(--muted); margin-top: .2rem; }

/* ========================================================= email list ==== */
.email-group { margin-bottom: 1.5rem; }
.email-group__head {
  font-size: .82rem; font-weight: 600; color: var(--muted);
  padding-bottom: .5rem; margin-bottom: .8rem; border-bottom: 1px solid var(--border);
}
.email-card {
  display: flex; align-items: center; gap: .9rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: .8rem 1rem;
}
.email-card + .email-card { margin-top: .5rem; }
.email-card__avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.email-card__main { flex: 1; min-width: 0; }
.email-card__name { font-weight: 600; font-size: .92rem; color: var(--ink); }
.email-card__meta { font-size: .78rem; color: var(--muted); }
.email-card__mail {
  font-size: .8rem; color: var(--ink-soft); direction: ltr;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.email-card__actions { display: flex; gap: .3rem; flex-shrink: 0; }

/* ---------------------------------------------------------- hero image -- */
.hero-img {
  max-width: min(100%, 620px);
  margin-inline: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

/* ------------------------------------------------------- owner console -- */
.owner-sec { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 1.25rem; }
.owner-sec + .owner-sec { margin-top: 1rem; }
.owner-sec__title { font-size: 1rem; font-weight: 700; margin: 0 0 .2rem; }
.owner-sec__desc { font-size: .84rem; color: var(--muted); margin: 0 0 1rem; }
.editor-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .75rem; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface-2);
}
.editor-row + .editor-row { margin-top: .4rem; }
.editor-row__email { flex: 1; min-width: 0; font-size: .88rem; direction: ltr; text-align: start;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-preview { max-width: 260px; border-radius: var(--r-sm); border: 1px solid var(--border); margin-bottom: .8rem; }

/* Small segmented control (upload contact type toggle) */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg button {
  font-family: inherit; font-size: .82rem; font-weight: 600;
  padding: .4rem .9rem; border: none; background: var(--surface);
  color: var(--ink-soft); cursor: pointer;
}
.seg button + button { border-inline-start: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--primary); color: #fff; }
[data-theme="dark"] .seg button[aria-pressed="true"] { color: #121A18; }
