/* ==========================================================================
   canonical-mobile.css — consolidated v4 mobile overrides, adapted to the sg-seminary
   theme on the COMMERCIAL type stack. Generated by assets/.build-canonical.py
   from /design-export/ (do not hand-edit; regenerate from source).

   Transform (a) FONT REMAP: the export's --sg-font-* roles are aliased below to
   the theme's commercial role tokens (--font-display = Quarto, --font-read = Lyon
   Text, --font-ui = Sohne; AR = Zarid Display / Riwaya / Bukra; Quran = the
   certified mushaf face --font-quran). No libre literals (Quarto/Spectral/Source
   Sans 3/Scheherazade/Readex/Reem Kufi) are emitted.

   Transform (b) TOKEN ALIAS: the export references --sg-* custom properties; the
   theme's tokens.css defines un-prefixed ones. Each --sg-* used by the canonical
   CSS is aliased to the nearest theme token here. Shades/tints the theme does not
   define keep a literal fallback (the export's own value).
   ========================================================================== */
:root{
  /* --- Color: brand --- */
  --sg-astral: var(--astral);
  --sg-gamboge: var(--gamboge);
  --sg-soft-sand: var(--rule);              /* #E5D3B3 — the sand rule */
  --sg-burnt-umber: #8A5A44;                /* not a theme token — literal */
  --sg-deep-olive: #6B7B52;                 /* literal */
  --sg-slate-gray: #6A757D;                 /* literal */

  /* --- Color: astral shades/tints (export-defined; literal fallbacks) --- */
  --sg-astral-shade-30: var(--astral-700);  /* #22506A == theme --astral-700 */
  --sg-astral-shade-50: #1B4055;
  --sg-astral-shade-70: #13303F;
  --sg-astral-shade-90: #0A1E29;
  --sg-astral-tint-90: #E8EFF2;

  /* --- Color: gamboge shades --- */
  --sg-gamboge-shade-30: #B8810A;
  --sg-gamboge-shade-50: #84600A;

  /* --- Color: sand tints --- */
  --sg-sand-tint-70: #F5ECDA;

  /* --- Color: foreground / ink --- */
  --sg-fg: var(--ink);
  --sg-fg-muted: var(--muted);
  --sg-fg-subtle: var(--subtle);
  --sg-ink-subtle: #5E646B;                 /* AA-safe small-label grey (export) */

  /* --- Color: surfaces --- */
  --sg-bg-alt: var(--paper-alt);

  /* --- Color: status --- */
  --sg-success: #4F7A4A;
  --sg-danger: #A8452F;

  /* --- Type roles (commercial stack via theme --font-*) --- */
  --sg-font-display: var(--font-display);   /* Quarto (EN) / Zarid Display (AR) */
  --sg-font-serif:   var(--font-display);   /* export alias of display */
  --sg-font-read:    var(--font-read);      /* Lyon Text (EN) / Riwaya (AR) */
  --sg-font-body:    var(--font-ui);        /* export legacy alias → UI sans */
  --sg-font-ui:      var(--font-ui);        /* Sohne (EN) / Bukra (AR) */
  --sg-font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Arabic faces — commercial roles the theme already uses */
  --sg-font-arabic-display: "Zarid Display", "Riwaya", serif;
  --sg-font-arabic-read:    "Riwaya", serif;
  --sg-font-arabic:         "Bukra", system-ui, sans-serif;   /* AR chrome/UI */
  --sg-font-arabic-wordmark:"Zarid Display", "Bukra", sans-serif; /* AR display role */

  /* --- Shape / motion (export-defined; literal) --- */
  --sg-radius-pill: 999px;
  --sg-shadow-xs: 0 1px 2px rgba(20, 40, 60, 0.06);
  --sg-shadow-sm: 0 2px 8px rgba(20, 40, 60, 0.06);
  --sg-shadow-md: 0 4px 16px rgba(20, 40, 60, 0.08);
  --sg-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Mobile overrides: consolidated from v4_mobile.css, v4_mobile_flow.css ===== */

/* ---- begin v4_mobile.css ---- */
/* ==========================================================================
   SeekersGuidance v4 — Sprint 3 mobile peers
   Mobile catalogue · mobile course detail · mobile dashboard
   Each renders as a real 402px page (fills its iframe / device viewport).
   Built on tokens.css + v4.css conventions; sibling to v4_flows.css mobile lesson.
   ========================================================================== */

/* shared mobile shell */
.v4-m { font-family: var(--sg-font-body); background: #FBF6EC; min-height: 100vh; position: relative; color: var(--sg-fg); overflow-x: hidden; }

/* shared top bar */
.v4-m-top {
  position: sticky; top: 0; z-index: 30;
  background: #FFFFFF; border-bottom: 1px solid var(--sg-soft-sand);
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
}
.v4-m-top .ic {
  width: 38px; height: 38px; border-radius: 2px; border: none; background: transparent;
  font-size: 18px; color: var(--sg-fg); cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.v4-m-top .ic:active { background: #FBF6EC; }
.v4-m-top .ttl { flex: 1; min-width: 0; text-align: center; }
.v4-m-top .ttl .k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sg-burnt-umber); display: block; }
.v4-m-top .ttl .t { font-family: var(--sg-font-display); font-weight: 600; font-size: 15px; color: var(--sg-fg); display: block; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   MOBILE CATALOGUE
   ========================================================================== */
/* pinned search */
.v4-mc-search {
  position: sticky; top: 59px; z-index: 25;
  background: #FBF6EC; padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(15,27,34,0.06);
}
.v4-mc-search-box {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid rgba(15,27,34,0.12); border-radius: 8px; padding: 10px 12px;
}
.v4-mc-search-box .ico { color: var(--sg-fg-subtle); font-size: 15px; }
.v4-mc-search-box input { flex: 1; border: none; outline: none; font-family: var(--sg-font-body); font-size: 15px; color: var(--sg-fg); background: transparent; min-width: 0; }
.v4-mc-search-box input::placeholder { color: var(--sg-fg-subtle); }
.v4-mc-filterbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.v4-mc-filterbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  background: var(--sg-astral); color: #fff; border: none; border-radius: 8px;
  font-family: var(--sg-font-body); font-size: 13.5px; font-weight: 600; padding: 0 16px; cursor: pointer;
}
.v4-mc-filterbtn .badge { background: var(--sg-gamboge); color: var(--sg-astral-shade-90); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.v4-mc-sort { margin-left: auto; font-size: 12.5px; color: var(--sg-fg-muted); font-family: var(--sg-font-display); font-style: normal; }
.v4-mc-count { font-size: 12px; color: var(--sg-fg-subtle); padding: 12px 16px 4px; font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.02em; }
.v4-mc-count b { color: var(--sg-burnt-umber); }

/* dense card list, grouped by day */
.v4-mc-list { padding: 4px 16px 28px; }
.v4-mc-daygroup { margin-top: 18px; }
.v4-mc-daygroup:first-child { margin-top: 6px; }
.v4-mc-dayhead {
  font-family: var(--sg-font-display); font-style: normal; font-weight: 500; font-size: 14px;
  color: var(--sg-burnt-umber); margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px;
}
.v4-mc-dayhead .n { font-family: ui-monospace, Menlo, monospace; font-style: normal; font-size: 11px; color: var(--sg-fg-subtle); margin-left: auto; }
.v4-mc-card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid rgba(15,27,34,0.08);
  border-left: 3px solid var(--tint, var(--sg-astral)); border-radius: 2px;
  padding: 13px 15px; margin-bottom: 9px;
}
.v4-mc-card:active { background: #FCFAF4; }
.v4-mc-card .row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.v4-mc-card .code { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; letter-spacing: 0.04em; color: var(--sg-fg-subtle); }
.v4-mc-card .lvl { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.v4-mc-card .lvl.l101 { background: rgba(48,112,142,0.1); color: var(--sg-astral-shade-30); }
.v4-mc-card .lvl.l201 { background: rgba(107,123,82,0.14); color: #46522f; }
.v4-mc-card .lvl.l301 { background: rgba(236,166,8,0.16); color: var(--sg-gamboge-shade-50); }
.v4-mc-card h3 { font-family: var(--sg-font-display); font-weight: 500; font-size: 16.5px; line-height: 1.2; letter-spacing: -0.006em; margin: 0 0 7px; color: var(--sg-fg); }
.v4-mc-card .foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--sg-fg-muted); }
.v4-mc-card .foot .who { font-weight: 600; color: var(--sg-fg); }
.v4-mc-card .foot .when { margin-left: auto; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--sg-burnt-umber); white-space: nowrap; }

/* bottom sheet */
.v4-m-scrim { position: fixed; inset: 0; background: rgba(15,27,34,0.5); z-index: 50; display: flex; align-items: flex-end; }
.v4-m-sheet {
  background: #fff; width: 100%; max-height: 86vh; border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  animation: v4-sheet-up 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes v4-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.v4-m-sheet .handle { width: 44px; height: 4px; border-radius: 2px; background: rgba(15,27,34,0.18); margin: 10px auto 4px; flex-shrink: 0; }
.v4-m-sheet .shead { display: flex; align-items: center; padding: 8px 18px 14px; border-bottom: 1px solid rgba(15,27,34,0.07); flex-shrink: 0; }
.v4-m-sheet .shead h3 { font-family: var(--sg-font-display); font-weight: 500; font-size: 20px; margin: 0; color: var(--sg-fg); }
.v4-m-sheet .shead .reset { margin-left: auto; background: none; border: none; color: var(--sg-astral); font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: var(--sg-font-body); }
.v4-m-sheet .sbody { overflow-y: auto; padding: 4px 18px 12px; flex: 1; }
.v4-mc-fgroup { padding: 16px 0; border-bottom: 1px solid rgba(15,27,34,0.06); }
.v4-mc-fgroup:last-child { border-bottom: none; }
.v4-mc-fgroup h4 { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sg-fg-muted); margin: 0 0 12px; }
.v4-mc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.v4-mc-fchip {
  font-family: var(--sg-font-body); font-size: 13.5px; font-weight: 500; min-height: 38px;
  padding: 0 14px; border-radius: 999px; border: 1px solid rgba(15,27,34,0.14);
  background: #FBF6EC; color: var(--sg-fg); cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.v4-mc-fchip.on { background: var(--sg-astral); border-color: var(--sg-astral); color: #fff; }
.v4-mc-fchip .dot { width: 8px; height: 8px; border-radius: 50%; }
.v4-m-sheet .sfoot { padding: 14px 18px; border-top: 1px solid rgba(15,27,34,0.08); flex-shrink: 0; background: #fff; }
.v4-mc-apply {
  width: 100%; min-height: 50px; background: var(--sg-astral); color: #fff; border: none; border-radius: 8px;
  font-family: var(--sg-font-body); font-size: 15px; font-weight: 600; cursor: pointer;
}
.v4-mc-apply:active { background: var(--sg-astral-shade-30); }

.v4-mc-empty { text-align: center; padding: 48px 24px; }
.v4-mc-empty p { font-family: var(--sg-font-display); font-style: normal; font-size: 16px; color: var(--sg-fg-muted); margin: 0 0 16px; }
.v4-mc-empty button { background: var(--sg-astral); color: #fff; border: none; border-radius: 2px; padding: 10px 20px; font-weight: 600; font-size: 14px; cursor: pointer; }

/* ==========================================================================
   MOBILE COURSE DETAIL
   ========================================================================== */
.v4-mco-body { padding-bottom: 88px; } /* room for the sticky CTA bar */

.v4-mco-hero { background: linear-gradient(180deg, var(--sg-astral-shade-90) 0%, var(--sg-astral-shade-70) 100%); color: #F5ECDA; padding: 22px 18px 24px; }
.v4-mco-hero .code { font-family: ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: 0.06em; color: var(--sg-gamboge); margin: 0 0 8px; }
.v4-mco-hero h1 { font-family: var(--sg-font-display); font-weight: 500; font-size: 27px; line-height: 1.1; letter-spacing: -0.014em; margin: 0 0 6px; color: #FBF6EC; text-wrap: balance; }
.v4-mco-hero h1 em { font-style: normal; color: var(--sg-gamboge); font-weight: 400; }
.v4-mco-hero .sub { font-family: var(--sg-font-display); font-style: normal; font-size: 15px; color: rgba(245,236,218,0.8); margin: 0 0 16px; line-height: 1.4; }
.v4-mco-hero .facts { display: flex; gap: 8px; flex-wrap: wrap; }
.v4-mco-hero .facts span { font-size: 11.5px; color: rgba(245,236,218,0.82); background: rgba(245,236,218,0.08); border: 1px solid rgba(245,236,218,0.14); border-radius: 999px; padding: 5px 11px; }

/* teacher's note in flow */
.v4-mco-sec { padding: 22px 18px; border-bottom: 1px solid rgba(15,27,34,0.07); }
.v4-mco-sec .lab { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sg-burnt-umber); margin: 0 0 12px; }
.v4-mco-teacher { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.v4-mco-teacher .av { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-family: var(--sg-font-display); font-weight: 600; font-size: 16px; color: #F5ECDA; }
.v4-mco-teacher .nm { font-family: var(--sg-font-display); font-weight: 600; font-size: 16px; color: var(--sg-fg); }
.v4-mco-teacher .role { font-size: 12.5px; color: var(--sg-fg-muted); }
.v4-mco-note { font-family: var(--sg-font-display); font-size: 16px; line-height: 1.6; color: var(--sg-fg); margin: 0; text-wrap: pretty; }
.v4-mco-note em { font-style: normal; color: var(--sg-burnt-umber); }
.v4-mco-note + .v4-mco-note { margin-top: 12px; }

/* syllabus — one column, week label leading */
.v4-mco-syl { list-style: none; padding: 0; margin: 0; }
.v4-mco-syl li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(15,27,34,0.06); }
.v4-mco-syl li:last-child { border-bottom: none; }
.v4-mco-syl .wk { font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 600; color: var(--sg-burnt-umber); letter-spacing: 0.04em; padding-top: 2px; }
.v4-mco-syl .t { font-family: var(--sg-font-display); font-size: 15px; line-height: 1.35; color: var(--sg-fg); }
.v4-mco-syl .t .meta { display: block; font-family: var(--sg-font-body); font-size: 12px; color: var(--sg-fg-subtle); margin-top: 2px; }

/* bridge-back card */
.v4-mco-bridge { margin: 18px; padding: 18px; background: linear-gradient(135deg, #F5ECDA, #EFE0C5); border: 1px solid var(--sg-soft-sand); border-radius: 8px; }
.v4-mco-bridge .lab { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sg-burnt-umber); margin: 0 0 8px; }
.v4-mco-bridge h3 { font-family: var(--sg-font-display); font-weight: 500; font-size: 19px; line-height: 1.2; margin: 0 0 8px; color: var(--sg-fg); }
.v4-mco-bridge p { font-size: 13.5px; line-height: 1.5; color: var(--sg-fg-muted); margin: 0 0 14px; }
.v4-mco-bridge a { display: block; text-align: center; background: #fff; border: 1.5px solid var(--sg-burnt-umber); color: var(--sg-burnt-umber); border-radius: 8px; min-height: 46px; line-height: 46px; font-weight: 600; font-size: 14px; text-decoration: none; }

/* sticky bottom CTA bar */
.v4-mco-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--sg-soft-sand);
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.v4-mco-cta.hidden { transform: translateY(110%); }
.v4-mco-cta .price { flex-shrink: 0; }
.v4-mco-cta .price .free { font-family: var(--sg-font-display); font-weight: 600; font-size: 17px; color: var(--sg-fg); display: block; line-height: 1; }
.v4-mco-cta .price .when { font-size: 11px; color: var(--sg-fg-muted); }
.v4-mco-cta a { margin-left: auto; flex: 1; max-width: 60%; text-align: center; background: var(--sg-astral); color: #fff; border-radius: 8px; min-height: 50px; line-height: 50px; font-weight: 600; font-size: 15px; text-decoration: none; }
.v4-mco-cta a:active { background: var(--sg-astral-shade-30); }

/* ==========================================================================
   MOBILE DASHBOARD
   ========================================================================== */
.v4-md-greet { padding: 20px 18px 18px; background: linear-gradient(180deg, #F5ECDA 0%, #FBF6EC 100%); border-bottom: 1px solid rgba(15,27,34,0.06); }
.v4-md-greet .ar { font-family: var(--sg-font-arabic-display); direction: rtl; font-size: 22px; color: var(--sg-astral-shade-50); margin: 0 0 8px; }
.v4-md-greet h1 { font-family: var(--sg-font-display); font-weight: 500; font-size: 25px; line-height: 1.12; letter-spacing: -0.012em; margin: 0 0 6px; color: var(--sg-fg); }
.v4-md-greet .meta { font-size: 12.5px; color: var(--sg-fg-muted); margin: 0; }
.v4-md-greet .meta span { opacity: 0.4; margin: 0 5px; }

.v4-md-section { padding: 22px 0 8px; }
.v4-md-section > .head { display: flex; align-items: baseline; gap: 8px; padding: 0 18px; margin-bottom: 14px; }
.v4-md-section > .head h2 { font-family: var(--sg-font-display); font-weight: 500; font-size: 20px; letter-spacing: -0.01em; margin: 0; color: var(--sg-fg); }
.v4-md-section > .head .sub { font-size: 12px; color: var(--sg-fg-subtle); margin-left: auto; font-family: var(--sg-font-display); font-style: normal; }

/* week swipe deck */
.v4-md-week { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 18px 6px; scrollbar-width: none; }
.v4-md-week::-webkit-scrollbar { display: none; }
.v4-md-sess {
  flex: 0 0 86%; scroll-snap-align: start; background: #fff;
  border: 1px solid rgba(15,27,34,0.08); border-radius: 10px; padding: 16px 18px;
  display: flex; flex-direction: column;
}
.v4-md-sess.soon { border-color: var(--sg-gamboge); box-shadow: 0 6px 20px -10px rgba(236,166,8,0.4); }
.v4-md-sess .when { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.v4-md-sess .when .day { font-family: var(--sg-font-display); font-weight: 600; font-size: 15px; color: var(--sg-burnt-umber); }
.v4-md-sess .when .date { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--sg-fg-subtle); margin-left: auto; }
.v4-md-sess .course { font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--sg-fg-muted); margin: 0 0 4px; text-transform: uppercase; }
.v4-md-sess h3 { font-family: var(--sg-font-display); font-weight: 500; font-size: 18px; line-height: 1.2; margin: 0 0 6px; color: var(--sg-fg); }
.v4-md-sess .scholar { font-size: 13px; color: var(--sg-fg-muted); margin: 0 0 16px; }
.v4-md-sess .act { margin-top: auto; }
.v4-md-sess .act a, .v4-md-sess .act button { display: block; width: 100%; text-align: center; border-radius: 8px; min-height: 44px; line-height: 44px; font-weight: 600; font-size: 14px; text-decoration: none; border: none; cursor: pointer; box-sizing: border-box; }
.v4-md-sess .act .primary { background: var(--sg-gamboge); color: var(--sg-astral-shade-90); }
.v4-md-sess .act .ghost { background: transparent; border: 1.5px solid rgba(15,27,34,0.16); color: var(--sg-fg-muted); }
.v4-md-dots { display: flex; gap: 6px; justify-content: center; padding: 12px 0 0; }
.v4-md-dots .d { width: 6px; height: 6px; border-radius: 50%; background: rgba(15,27,34,0.18); }
.v4-md-dots .d.on { background: var(--sg-burnt-umber); width: 18px; border-radius: 3px; }

/* course rows */
.v4-md-courses { padding: 0 18px; }
.v4-md-course { background: #fff; border: 1px solid rgba(15,27,34,0.08); border-radius: 10px; padding: 15px 16px; margin-bottom: 10px; }
.v4-md-course .top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.v4-md-course .av { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-family: var(--sg-font-display); font-weight: 600; font-size: 14px; color: #F5ECDA; }
.v4-md-course .code { font-family: ui-monospace, Menlo, monospace; font-size: 10px; color: var(--sg-fg-subtle); letter-spacing: 0.04em; }
.v4-md-course h3 { font-family: var(--sg-font-display); font-weight: 500; font-size: 16.5px; line-height: 1.2; margin: 2px 0 2px; color: var(--sg-fg); }
.v4-md-course .by { font-size: 12.5px; color: var(--sg-fg-muted); }
.v4-md-prog { height: 6px; border-radius: 3px; background: rgba(15,27,34,0.08); overflow: hidden; margin-bottom: 6px; position: relative; }
.v4-md-prog .fill { height: 100%; border-radius: 3px; }
.v4-md-course .last { font-size: 11.5px; color: var(--sg-fg-subtle); margin: 0 0 14px; font-family: var(--sg-font-display); font-style: normal; }
.v4-md-course .cont { display: block; width: 100%; text-align: center; background: var(--sg-astral); color: #fff; border-radius: 8px; min-height: 46px; line-height: 46px; font-weight: 600; font-size: 14px; text-decoration: none; border: none; cursor: pointer; box-sizing: border-box; }
.v4-md-course .cont.muted { background: #fff; border: 1.5px solid rgba(15,27,34,0.14); color: var(--sg-fg-muted); }

/* below-the-fold sections (queue, office hours, ask) */
.v4-md-card { margin: 0 18px 12px; background: #fff; border: 1px solid rgba(15,27,34,0.08); border-radius: 10px; padding: 16px; }
.v4-md-card h3 { font-family: var(--sg-font-display); font-weight: 500; font-size: 17px; margin: 0 0 4px; color: var(--sg-fg); }
.v4-md-card .sub { font-size: 12.5px; color: var(--sg-fg-muted); margin: 0 0 14px; font-family: var(--sg-font-display); font-style: normal; }
.v4-md-queue { list-style: none; padding: 0; margin: 0; }
.v4-md-queue li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid rgba(15,27,34,0.05); }
.v4-md-queue li:first-child { border-top: none; padding-top: 0; }
.v4-md-queue .kind { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; background: #FBF6EC; color: var(--sg-burnt-umber); }
.v4-md-queue .t { font-size: 14px; font-weight: 500; color: var(--sg-fg); line-height: 1.25; }
.v4-md-queue .m { font-size: 11.5px; color: var(--sg-fg-subtle); }
.v4-md-oh { display: flex; flex-direction: column; gap: 4px; }
.v4-md-oh .who { font-family: var(--sg-font-display); font-weight: 600; font-size: 15px; color: var(--sg-fg); }
.v4-md-oh .when { font-size: 12.5px; color: var(--sg-burnt-umber); font-family: ui-monospace, Menlo, monospace; }
.v4-md-oh button { margin-top: 10px; background: var(--sg-astral); color: #fff; border: none; border-radius: 8px; min-height: 44px; font-weight: 600; font-size: 14px; cursor: pointer; }
.v4-md-card.tint { background: linear-gradient(135deg, #13303F, #0A1E29); border-color: transparent; }
.v4-md-card.tint h3 { color: #FBF6EC; }
.v4-md-card.tint .sub { color: rgba(245,236,218,0.75); }
.v4-md-card.tint a { display: block; text-align: center; background: var(--sg-gamboge); color: var(--sg-astral-shade-90); border-radius: 8px; min-height: 46px; line-height: 46px; font-weight: 600; font-size: 14px; text-decoration: none; }
.v4-md-done { margin: 4px 18px 28px; }
.v4-md-done .lab { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sg-fg-subtle); margin: 0 0 10px; }
.v4-md-done ul { list-style: none; padding: 0; margin: 0; }
.v4-md-done li { padding: 8px 0; border-top: 1px dotted rgba(15,27,34,0.14); }
.v4-md-done li .t { font-family: var(--sg-font-display); font-size: 14.5px; color: var(--sg-fg); }
.v4-md-done li .s { font-size: 11.5px; color: var(--sg-fg-subtle); }

/* ---- end v4_mobile.css ---- */

/* ---- begin v4_mobile_flow.css ---- */
/* v4_mobile_flow.css — mobile reservation flow (and other mobile multi-step
   screens). Phone-first, single column. Shares the v4-m shell. EN + AR. */

.v4-mf { max-width: 460px; margin: 0 auto; background: #FBF6EC; min-height: 100vh; }

/* Sticky step rail */
.v4-mf-rail { position: sticky; top: 0; z-index: 20; background: rgba(251,246,236,0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--sg-soft-sand); padding: 12px 16px; display: flex; align-items: center; gap: 8px; }
.v4-mf-rail .step { flex: 1; height: 4px; border-radius: 2px; background: rgba(15,27,34,0.12); }
.v4-mf-rail .step.done { background: var(--sg-deep-olive); }
.v4-mf-rail .step.on { background: var(--sg-burnt-umber); }
.v4-mf-rail .lab { font-size: 12px; font-weight: 700; color: var(--sg-fg-muted); white-space: nowrap; letter-spacing: 0.04em; }

.v4-mf-stage { padding: 22px 18px 8px; border-bottom: 10px solid #F1E7D2; }
.v4-mf-stage:last-child { border-bottom: none; padding-bottom: 48px; }
.v4-mf-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sg-burnt-umber); margin: 0 0 6px; }
.v4-mf-tag b { color: var(--sg-astral-shade-30); margin-inline-end: 6px; }
.v4-mf-stage h2 { font-family: var(--sg-font-display); font-weight: 500; font-size: 23px; line-height: 1.18; letter-spacing: -0.01em; margin: 0 0 8px; color: var(--sg-fg); }
.v4-mf-stage h2 em { font-style: normal; color: var(--sg-burnt-umber); }
.v4-mf-note { font-family: var(--sg-font-display); font-style: normal; font-size: 14px; color: var(--sg-fg-muted); line-height: 1.55; margin: 0 0 16px; }
[dir="rtl"] .v4-mf-note { font-style: normal; }

/* Card surface inside a stage (the "screen") */
.v4-mf-card { background: #fff; border: 1px solid rgba(15,27,34,0.09); border-radius: 12px; padding: 18px; box-shadow: 0 10px 24px rgba(20,40,60,0.06); }
.v4-mf-course { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--sg-soft-sand); }
.v4-mf-course .av { width: 42px; height: 42px; border-radius: 50%; background: var(--sg-astral-shade-50); color: #F5ECDA; display: flex; align-items: center; justify-content: center; font-family: "Zarid Display", "Riwaya", serif; font-weight: 600; font-size: 17px; flex-shrink: 0; }
.v4-mf-course .t { font-family: var(--sg-font-display); font-weight: 600; font-size: 15.5px; color: var(--sg-fg); line-height: 1.2; }
.v4-mf-course .m { font-size: 12.5px; color: var(--sg-fg-muted); margin-top: 2px; }

.v4-mf-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.v4-mf-tabs button { flex: 1; border: 1px solid rgba(15,27,34,0.14); background: #fff; border-radius: 999px; padding: 8px; font-size: 13px; font-weight: 600; color: var(--sg-fg-muted); cursor: pointer; }
.v4-mf-tabs button.on { background: var(--sg-astral-shade-50); border-color: var(--sg-astral-shade-50); color: #F5ECDA; }

.v4-mf-field { margin-bottom: 13px; }
.v4-mf-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--sg-fg); margin-bottom: 5px; }
.v4-mf-field input, .v4-mf-field select, .v4-mf-field textarea { width: 100%; border: 1px solid rgba(15,27,34,0.16); border-radius: 8px; padding: 11px 12px; font-size: 15px; font-family: var(--sg-font-body); color: var(--sg-fg); background: #fff; }
.v4-mf-field textarea { min-height: 70px; resize: vertical; line-height: 1.5; }
.v4-mf-field .hint { font-size: 11.5px; color: var(--sg-fg-subtle); margin-top: 5px; font-family: var(--sg-font-display); font-style: normal; }
[dir="rtl"] .v4-mf-field .hint { font-style: normal; }
.v4-mf-field.err input { border-color: var(--sg-danger); background: rgba(168,69,47,0.04); }
.v4-mf-field .errmsg { font-size: 12px; color: var(--sg-danger); margin-top: 5px; display: none; }
.v4-mf-field.err .errmsg { display: block; }

.v4-mf-radio { display: flex; gap: 9px; align-items: flex-start; border: 1px solid rgba(15,27,34,0.12); border-radius: 9px; padding: 11px 12px; margin-bottom: 8px; cursor: pointer; }
.v4-mf-radio.on { border-color: var(--sg-astral); background: #FBF6EC; }
.v4-mf-radio .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(15,27,34,0.25); flex-shrink: 0; margin-top: 2px; }
.v4-mf-radio.on .dot { border-color: var(--sg-astral); background: var(--sg-astral); box-shadow: inset 0 0 0 3px #fff; }
.v4-mf-radio .rt b { display: block; font-size: 14px; color: var(--sg-fg); }
.v4-mf-radio .rt span { font-size: 12.5px; color: var(--sg-fg-muted); }

.v4-mf-btn { display: block; width: 100%; text-align: center; background: var(--sg-burnt-umber); color: #fff; border: none; font-size: 15px; font-weight: 600; padding: 14px; border-radius: 10px; text-decoration: none; cursor: pointer; margin-top: 6px; }
.v4-mf-btn.ghost { background: transparent; color: var(--sg-astral); border: 1px solid rgba(48,112,142,0.3); margin-top: 9px; }
.v4-mf-skip { display: block; text-align: center; font-family: var(--sg-font-display); font-style: normal; font-size: 13.5px; color: var(--sg-fg-muted); text-decoration: none; margin-top: 14px; }
[dir="rtl"] .v4-mf-skip { font-style: normal; }

/* Confirmation seal */
.v4-mf-seal { text-align: center; padding: 8px 0 4px; }
.v4-mf-receipt { list-style: none; margin: 14px 0 0; padding: 0; }
.v4-mf-receipt li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dotted rgba(15,27,34,0.12); font-size: 13.5px; }
.v4-mf-receipt li:last-child { border-bottom: none; }
.v4-mf-receipt .k { color: var(--sg-fg-muted); }
.v4-mf-receipt .v { color: var(--sg-fg); font-weight: 600; text-align: end; }

/* Countdown chip */
.v4-mf-count { background: var(--sg-astral-shade-70); color: #F5ECDA; border-radius: 12px; padding: 16px 18px; text-align: center; }
.v4-mf-count .big { font-family: var(--sg-font-display); font-size: 30px; color: var(--sg-gamboge); line-height: 1; }
.v4-mf-count .sub { font-size: 12.5px; color: rgba(245,236,218,0.78); margin-top: 6px; }

.v4-mf-todo { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.v4-mf-todo li { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid rgba(15,27,34,0.08); border-radius: 9px; padding: 11px 12px; }
.v4-mf-todo .ic { width: 26px; height: 26px; border-radius: 7px; background: #FBF6EC; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--sg-burnt-umber); flex-shrink: 0; }
.v4-mf-todo .tt { font-size: 13.5px; font-weight: 600; color: var(--sg-fg); }
.v4-mf-todo .td { font-size: 12px; color: var(--sg-fg-muted); }

/* Email preview */
.v4-mf-mail { border: 1px solid rgba(15,27,34,0.12); border-radius: 12px; overflow: hidden; }
.v4-mf-mail-h { background: #F1E7D2; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.v4-mf-mail-h .av { width: 30px; height: 30px; border-radius: 50%; background: var(--sg-astral-shade-50); color: #F5ECDA; display: flex; align-items: center; justify-content: center; font-family: "Zarid Display", "Riwaya", serif; font-size: 13px; }
.v4-mf-mail-h .who { font-size: 12.5px; font-weight: 600; color: var(--sg-fg); }
.v4-mf-mail-h .sub { font-size: 11px; color: var(--sg-fg-muted); }
.v4-mf-mail-b { padding: 16px 14px; font-size: 13.5px; line-height: 1.6; color: var(--sg-fg); }
.v4-mf-mail-b .ar-greet { font-family: "Riwaya", serif; font-size: 16px; color: var(--sg-burnt-umber); margin: 0 0 10px; }

/* ── Shared bits for journal / ask / self-check / settings on mobile ─────── */
.v4-mm-chiprow { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 4px; margin: 0 0 14px; -webkit-overflow-scrolling: touch; }
.v4-mm-chiprow::-webkit-scrollbar { display: none; }
.v4-mm-chip { white-space: nowrap; border: 1px solid rgba(15,27,34,0.14); background: #fff; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; color: var(--sg-fg-muted); cursor: pointer; flex-shrink: 0; }
.v4-mm-chip.on { background: var(--sg-astral-shade-50); border-color: var(--sg-astral-shade-50); color: #F5ECDA; }
.v4-mm-chip .ct { opacity: 0.6; margin-inline-start: 4px; }

/* Journal timeline */
.v4-mm-wk { margin-bottom: 22px; }
.v4-mm-wk-h { font-size: 12px; font-weight: 700; color: var(--sg-fg-muted); margin: 0 0 8px; }
.v4-mm-wk-h b { color: var(--sg-fg); }
.v4-mm-entry { background: #fff; border: 1px solid rgba(15,27,34,0.08); border-inline-start: 3px solid var(--sg-gamboge); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; }
.v4-mm-entry .at { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--sg-burnt-umber); }
.v4-mm-entry p { font-size: 14px; line-height: 1.55; color: var(--sg-fg); margin: 5px 0 0; }
.v4-mm-entry .tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.v4-mm-entry .tag { font-size: 11px; color: var(--sg-astral); }

/* Thread (ask) */
.v4-mm-thread { background: #fff; border: 1px solid rgba(15,27,34,0.08); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.v4-mm-thread .st { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; margin-bottom: 8px; }
.v4-mm-thread .st.replied { background: rgba(79,122,74,0.14); color: #355A30; }
.v4-mm-thread .st.awaiting { background: rgba(199,127,26,0.14); color: #7E4F0E; }
.v4-mm-thread .q { font-family: var(--sg-font-display); font-size: 16px; color: var(--sg-fg); margin: 0 0 8px; line-height: 1.3; }
.v4-mm-msg { display: flex; gap: 9px; margin-top: 10px; }
.v4-mm-msg .av { width: 28px; height: 28px; border-radius: 50%; background: var(--sg-astral-shade-50); color: #F5ECDA; display: flex; align-items: center; justify-content: center; font-family: "Zarid Display", "Riwaya", serif; font-size: 13px; flex-shrink: 0; }
.v4-mm-msg.scholar .av { background: var(--sg-burnt-umber); }
.v4-mm-msg .b { font-size: 13.5px; line-height: 1.55; color: var(--sg-fg); }
.v4-mm-msg .who { font-size: 11.5px; color: var(--sg-fg-muted); margin-bottom: 2px; }

/* Self-check prompt */
.v4-mm-prompt { margin-bottom: 14px; }
.v4-mm-prompt .q { font-size: 14.5px; font-weight: 600; color: var(--sg-fg); margin: 0 0 6px; }
.v4-mm-prompt .q .n { color: var(--sg-burnt-umber); margin-inline-end: 6px; }
.v4-mm-acc { background: #fff; border: 1px solid rgba(15,27,34,0.08); border-radius: 9px; margin-bottom: 8px; overflow: hidden; }
.v4-mm-acc summary { padding: 13px 14px; font-size: 14px; font-weight: 600; color: var(--sg-fg); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; list-style: none; }
.v4-mm-acc summary::-webkit-details-marker { display: none; }
.v4-mm-acc .bd { padding: 0 14px 13px; font-size: 13.5px; line-height: 1.55; color: var(--sg-fg-muted); }
.v4-mm-acc .bd .qa { margin-bottom: 10px; }
.v4-mm-acc .bd .qa b { color: var(--sg-fg); display: block; font-size: 12.5px; margin-bottom: 2px; }

/* Settings */
.v4-mm-set { background: #fff; border: 1px solid rgba(15,27,34,0.08); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.v4-mm-set h3 { font-family: var(--sg-font-display); font-weight: 600; font-size: 16px; margin: 0 0 4px; color: var(--sg-fg); }
.v4-mm-set .sub { font-size: 12.5px; color: var(--sg-fg-muted); margin: 0 0 12px; }
.v4-mm-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(15,27,34,0.06); }
.v4-mm-row:first-of-type { border-top: none; }
.v4-mm-row .rt b { font-size: 14px; color: var(--sg-fg); display: block; }
.v4-mm-row .rt span { font-size: 12px; color: var(--sg-fg-muted); }
.v4-mm-sw { width: 42px; height: 24px; border-radius: 999px; background: rgba(15,27,34,0.18); border: none; position: relative; cursor: pointer; flex-shrink: 0; transition: background 0.15s; }
.v4-mm-sw::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start 0.15s; }
.v4-mm-sw.on { background: var(--sg-deep-olive); }
.v4-mm-sw.on::after { inset-inline-start: 20px; }
.v4-mm-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.v4-mm-seg button { border: 1px solid rgba(15,27,34,0.14); background: #fff; border-radius: 8px; padding: 9px 14px; font-size: 14px; color: var(--sg-fg-muted); cursor: pointer; }
.v4-mm-seg button.on { border-color: var(--sg-astral); background: #FBF6EC; color: var(--sg-fg); font-weight: 600; }

/* ---- end v4_mobile_flow.css ---- */
