/* Study / My requests / chat — phone & tablet only.
   EVERY rule must stay inside @media (max-width: 980px).
   Desktop (≥981px) is untouched. Obic navy/blue palette only. */

/* Desktop: never show phone-only path promo pill */
.path-promo-pill {
  display: none !important;
}

/* Desktop: never show mobile/tablet-only payment card collapse toggle */
.ssp-pay-toggle {
  display: none !important;
}

@media (max-width: 980px) {
  :root {
    --sm-navy: #0b1f3a;
    --sm-navy-2: #122a4a;
    --sm-blue: #1a6dff;
    --sm-blue-deep: #0b4fd6;
    --sm-soft: #e8f1ff;
    --sm-page: #f5f7fb;
    --sm-sendbar-h: 4.5rem;
    --sm-helper-bar-h: 3.75rem;
    --sm-stick-h: 2rem;
  }

  /* iOS Safari zooms the whole page when a text field is under 16px and then
     pushes the left edge off-screen. Keep every text field at 16px on phones. */
  body.page-study-portal input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
  body.page-study-portal textarea,
  body.page-study-portal select {
    font-size: 16px !important;
  }

  /* ── Page chrome ── */
  body.page-study-portal,
  body.page-my-requests {
    background: var(--sm-page) !important;
  }

  body.page-study-portal {
    /* Never pad the body — that paints a light band under the footer. */
    padding-bottom: 0 !important;
  }
  /* Sticky Send + Helper sit over the page. Extra room stays inside the navy footer. */
  body.page-study-portal .study-portal-footer {
    padding-bottom: calc(
      var(--sm-sendbar-h) + var(--sm-helper-bar-h) + 1.25rem + env(safe-area-inset-bottom, 0px)
    );
  }
  /* Bar hidden: only the Send row needs room. No light band under the footer. */
  body.page-study-portal.ssp-bar-hidden .study-portal-footer {
    padding-bottom: calc(var(--sm-sendbar-h) + 1.25rem + env(safe-area-inset-bottom, 0px));
  }

  body.page-study-portal main {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Decision flow first; search / ads / hotels after form */
  body.page-study-portal main > .path-req {
    order: 1;
  }
  body.page-study-portal main > #study-inquiry-gate,
  body.page-study-portal main > #study-inquiry {
    order: 2;
  }
  /* Phone: hide major-search / guide rail portal (desktop keeps it). */
  body.page-study-portal main > .study-portal,
  body.page-study-portal .study-portal-shell {
    display: none !important;
  }
  body.page-study-portal main > .study-travel-ads {
    order: 11;
  }
  /* Phone: hide embassy/official-sources tall ad card */
  body.page-study-portal a.path-sources-ad.study-travel-sources-ad,
  body.page-study-portal .study-travel-sources-ad {
    display: none !important;
  }
  /* Phone: hide tall hotel/flight ad background photo */
  body.page-study-portal img.study-travel-ad-bg,
  body.page-study-portal .study-travel-ad-bg {
    display: none !important;
  }
  /* Phone: hide whole hotels/flights partner ad cards */
  body.page-study-portal article#hotel-partners,
  body.page-study-portal .study-travel-ad-hotel,
  body.page-study-portal article#flight-partners,
  body.page-study-portal .study-travel-ad-flight {
    display: none !important;
  }
  /* If both ads gone, collapse the travel section wrapper on phone */
  body.page-study-portal section#study-travel {
    display: none !important;
  }
  body.page-study-portal main > .study-promo-modal {
    order: 20;
  }

  /*
   * Stacking on phone:
   * Send bar (bottom) → Helper/Requests bar above it → Noor FAB above that.
   * Never let Helper cover إرسال الطلب.
   */
  body.page-study-portal .study-mobile-sendbar {
    z-index: 90 !important;
  }
  /* Noor open: hide sticky Send + Helper/Requests so they don’t sit on top of chat */
  body.page-study-portal.obic-sa-open .study-mobile-sendbar,
  body.page-study-portal.obic-sa-open .ssp-mobile-bar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  /* Helper/Requests sheet open: sticky Send must not sit under or over the panel (phone & tablet ≤980px) */
  body.page-study-portal.ssp-drawer-open .study-mobile-sendbar,
  body.page-study-portal.ssp-float-open .study-mobile-sendbar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  body.page-study-portal.obic-ssp-active.ssp-float-closed .ssp-mobile-bar {
    bottom: calc(var(--sm-sendbar-h) + 0.4rem + env(safe-area-inset-bottom, 0px)) !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    z-index: 85 !important;
  }
  html[dir="rtl"] body.page-study-portal.obic-ssp-active.ssp-float-closed .ssp-mobile-bar {
    left: 0.75rem !important;
    right: 0.75rem !important;
  }
  body.page-study-portal.ssp-bar-hidden .ssp-mobile-bar {
    display: none !important;
  }
  /* Hidden Noor tucks to a slim stick on the side, above Helper + Send. */
  body.page-study-portal .obic-sa-show {
    inset-inline-end: 0 !important;
    inset-inline-start: auto !important;
    bottom: calc(
      var(--sm-sendbar-h) + var(--sm-helper-bar-h) + 0.35rem + env(safe-area-inset-bottom, 0px)
    ) !important;
    z-index: 88 !important;
  }
  /* Hidden Helper/Requests: same side, just above Send. */
  body.page-study-portal.ssp-bar-hidden .ssp-bar-show:not([hidden]) {
    inset-inline-end: 0 !important;
    inset-inline-start: auto !important;
    bottom: calc(var(--sm-sendbar-h) + 0.35rem + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 86 !important;
  }
  /* Both hidden: stack Noor’s stick above the Helper stick. */
  body.page-study-portal.ssp-bar-hidden.obic-sa-fab-hidden .obic-sa-show {
    bottom: calc(
      var(--sm-sendbar-h) + 0.35rem + var(--sm-stick-h) + 0.2rem + env(safe-area-inset-bottom, 0px)
    ) !important;
  }
  /* Noor above Helper (85), below sticky Send (90) — never paint under الطلبات/المساعد */
  body.page-study-portal.obic-ssp-active.ssp-float-closed .obic-sa-dock:not(.is-open) {
    bottom: calc(
      var(--sm-sendbar-h) + var(--sm-helper-bar-h) + 0.55rem + env(safe-area-inset-bottom, 0px)
    ) !important;
    z-index: 87 !important;
  }
  /* Bar hidden and Noor still out: she drops to just above Send. */
  body.page-study-portal.ssp-bar-hidden .obic-sa-dock:not(.is-open):not(.is-user-placed) {
    bottom: calc(var(--sm-sendbar-h) + 0.55rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* Dragged Noor wins over sticky-stack bottom — still above Helper */
  body.page-study-portal.obic-ssp-active.ssp-float-closed
    .obic-sa-dock.is-user-placed:not(.is-open) {
    bottom: auto !important;
    top: var(--sa-fab-top) !important;
    left: var(--sa-fab-left) !important;
    right: auto !important;
    inset-inline-end: auto !important;
    z-index: 87 !important;
  }

  /* ── 1. Path head — “Study in China” brand hero (phone only, not a button) ── */
  body.page-study-portal .path-req {
    padding: 0.55rem 0 0.15rem;
  }
  body.page-study-portal .path-req > .wrap {
    padding-inline: 0.85rem;
  }
  body.page-study-portal .path-head {
    margin: 0 0 0.85rem;
    padding: 1.05rem 1.05rem 1.1rem;
    border-radius: 18px;
    background:
      radial-gradient(90% 80% at 100% 0%, rgba(255, 255, 255, 0.28) 0%, transparent 55%),
      linear-gradient(155deg, #4d94ff 0%, #1a6dff 48%, #0b63f0 100%);
    color: #fff;
    box-shadow:
      0 14px 28px rgba(26, 109, 255, 0.32),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(11, 79, 214, 0.35);
    text-align: start;
  }
  body.page-study-portal .path-head::before {
    content: "OBIC";
    display: block;
    margin: 0 0 0.45rem;
    font-family: "Sora", "Noto Sans Arabic", system-ui, sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1;
  }
  html[dir="rtl"] body.page-study-portal .path-head::before {
    letter-spacing: 0.16em;
  }
  /* Swap visible title to Study in China (keep real h2 for a11y/desktop packs). */
  body.page-study-portal .path-head h2 {
    margin: 0;
    color: transparent;
    font-size: 0;
    line-height: 0;
  }
  body.page-study-portal .path-head h2::after {
    content: "Study in China";
    display: block;
    color: #fff;
    font-family: "Sora", "Noto Sans Arabic", system-ui, sans-serif;
    font-size: clamp(1.45rem, 6.2vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.12;
    text-shadow: none;
  }
  html[lang="ar"] body.page-study-portal .path-head h2::after,
  html[dir="rtl"] body.page-study-portal .path-head h2::after {
    content: "الدراسة في الصين";
    letter-spacing: -0.02em;
  }
  html[lang="zh"] body.page-study-portal .path-head h2::after {
    content: "来华留学";
    letter-spacing: 0.02em;
  }
  body.page-study-portal .path-head .path-sub {
    margin: 0.5rem 0 0;
    color: transparent;
    font-size: 0;
    line-height: 0;
  }
  body.page-study-portal .path-head .path-sub::after {
    content: "Apply with OBIC — universities, CSC & language paths";
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-family: "Sora", "Noto Sans Arabic", system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    max-width: 34rem;
  }
  html[lang="ar"] body.page-study-portal .path-head .path-sub::after,
  html[dir="rtl"] body.page-study-portal .path-head .path-sub::after {
    content: "قدّم مع أوبك — جامعات وCSC ومسارات اللغة";
  }
  html[lang="zh"] body.page-study-portal .path-head .path-sub::after {
    content: "通过 OBIC 申请 — 院校、CSC 与语言路径";
  }

  /* First 30 · $100 off — phone hero offer pill (desktop keeps path-head clean) */
  body.page-study-portal .path-promo-pill {
    display: flex !important;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin: 0.95rem 0 0;
    padding: 0.72rem 0.85rem 0.72rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 16px;
    background: #fff;
    color: var(--sm-navy);
    text-align: start;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.16);
    -webkit-tap-highlight-color: transparent;
    font: inherit;
  }
  body.page-study-portal .path-promo-pill-glow {
    position: absolute;
    inset: -40% auto -40% -20%;
    width: 42%;
    background: linear-gradient(
      100deg,
      transparent 0%,
      rgba(255, 255, 255, 0.22) 48%,
      transparent 100%
    );
    transform: translateX(-120%) skewX(-18deg);
    animation: sm-promo-sheen 4.8s ease-in-out infinite;
    pointer-events: none;
  }
  @keyframes sm-promo-sheen {
    0%,
    55% {
      transform: translateX(-120%) skewX(-18deg);
    }
    75%,
    100% {
      transform: translateX(320%) skewX(-18deg);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    body.page-study-portal .path-promo-pill-glow {
      animation: none;
      display: none;
    }
  }
  body.page-study-portal .path-promo-pill-badge {
    flex: 0 0 auto;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe7a3 0%, #f5c84b 100%);
    color: #0b1f3a;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(245, 200, 75, 0.35);
  }
  body.page-study-portal .path-promo-pill-copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
  }
  body.page-study-portal .path-promo-pill-copy strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
  }
  body.page-study-portal .path-promo-pill-copy em {
    display: block;
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(11, 31, 58, 0.62);
    line-height: 1.3;
  }
  body.page-study-portal .path-promo-pill-arrow {
    flex: 0 0 auto;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: rgba(26, 109, 255, 0.12);
    border: 1px solid rgba(26, 109, 255, 0.22);
    position: relative;
  }
  body.page-study-portal .path-promo-pill-arrow::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0.42rem;
    height: 0.42rem;
    border-inline-end: 2px solid var(--sm-navy);
    border-bottom: 2px solid var(--sm-navy);
    transform: rotate(-45deg);
    translate: -1px 0;
  }
  html[dir="rtl"] body.page-study-portal .path-promo-pill-arrow::before {
    transform: rotate(135deg);
    translate: 1px 0;
  }
  body.page-study-portal .path-promo-pill:active {
    transform: scale(0.985);
  }

  /* ── 2. Language — two buttons side by side (phone only) ── */
  body.page-study-portal .teach-pick {
    margin: 0 0 1rem;
    padding: 0.95rem 1rem 1.05rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(11, 31, 58, 0.08);
    box-shadow: 0 8px 20px rgba(11, 31, 58, 0.05);
  }
  body.page-study-portal .teach-ask {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--sm-navy);
  }
  body.page-study-portal .teach-ask::before {
    content: "1 · ";
    color: var(--sm-blue);
  }
  html[lang="ar"] body.page-study-portal .teach-ask::before,
  html[dir="rtl"] body.page-study-portal .teach-ask::before {
    content: "١ · ";
  }
  body.page-study-portal .teach-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }
  body.page-study-portal .teach-option {
    min-height: 48px;
    width: 100%;
    min-width: 0;
    padding: 0.75rem 0.65rem 0.8rem;
    padding-inline-end: 1.7rem;
    border-radius: 14px;
    border: 2px solid rgba(11, 31, 58, 0.12);
    background: #fff;
    box-shadow: none;
    transform: none;
  }
  body.page-study-portal .teach-option strong {
    font-size: 0.92rem;
    line-height: 1.25;
  }
  body.page-study-portal .teach-option span {
    font-size: 0.72rem;
    line-height: 1.35;
  }
  body.page-study-portal .teach-option:hover,
  body.page-study-portal .teach-option.is-on {
    transform: none;
    border-color: transparent;
    background: linear-gradient(155deg, var(--sm-blue) 0%, var(--sm-blue-deep) 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(26, 109, 255, 0.28);
  }
  body.page-study-portal .teach-option.is-on strong,
  body.page-study-portal .teach-option.is-on span,
  body.page-study-portal .teach-option:hover strong,
  body.page-study-portal .teach-option:hover span {
    color: #fff;
  }
  body.page-study-portal .teach-option.is-on::after {
    content: "✓";
    position: absolute;
    inset-inline-end: 0.4rem;
    top: 0.45rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  body.page-study-portal .teach-option {
    position: relative;
  }

  /* Programs stay closed until a language is chosen */
  body.page-study-portal #path-programs[hidden] {
    display: none !important;
  }
  /* ── 3. Programs as big cards — 2/row phone, 3/row tablet ── */
  body.page-study-portal #path-programs {
    margin-top: 0.25rem;
    position: relative;
    z-index: 1;
    overflow: visible;
  }
  body.page-study-portal #path-programs::before {
    content: "2 · Program";
    display: block;
    margin: 0 0 0.55rem;
    padding: 0 0.15rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--sm-navy);
  }
  html[lang="ar"] body.page-study-portal #path-programs::before,
  html[dir="rtl"] body.page-study-portal #path-programs::before {
    content: "٢ · البرنامج";
  }
  /*
   * Desktop lead-forms makes #path-tabs sticky (z-index 25). On phone the
   * tall program cards then paint over the form / length list below.
   * Keep a normal document flow grid instead.
   */
  body.page-study-portal #path-tabs,
  body.page-study #path-tabs {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    margin-bottom: 0.75rem;
    padding: 0 !important;
    padding-inline-end: 0 !important;
    background: transparent !important;
    overflow: visible;
  }
  body.page-study-portal .path-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    overflow: visible;
    flex-wrap: unset;
    align-items: stretch;
  }
} /* end max-width 980 — tablet 3-col continues below */

@media (min-width: 700px) and (max-width: 980px) {
  body.page-study-portal .path-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  /* resume shared mobile rules */
  body.page-study-portal .path-tabs button {
    position: relative;
    z-index: 1;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    min-height: 7.5rem;
    height: auto;
    min-width: 0;
    padding: 0.85rem 0.75rem 0.8rem;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    background: linear-gradient(165deg, #4d94ff 0%, #1a6dff 58%, #0b63f0 100%);
    box-shadow: 0 8px 18px rgba(26, 109, 255, 0.22);
    text-align: start;
    white-space: normal;
    color: #fff;
    transform: none !important;
    overflow: visible;
  }
  body.page-study-portal .path-tabs button span,
  body.page-study-portal .path-tabs button .path-card-bullets,
  body.page-study-portal .path-tabs button .path-card-bullets li {
    color: rgba(255, 255, 255, 0.94);
  }
  /* Keep inquiry / length / checklist below the grid, never under sticky cards */
  body.page-study-portal .path-length-row,
  body.page-study-portal .path-foot-block,
  body.page-study-portal #study-inquiry-gate,
  body.page-study-portal #study-inquiry {
    position: relative;
    z-index: 3;
  }
  body.page-study-portal .path-tabs button > span:first-child {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.25;
    padding-inline-start: 1.85rem;
  }
  body.page-study-portal .path-tabs button::before {
    content: "";
    position: absolute;
    inset-inline-start: 0.7rem;
    top: 0.85rem;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M4 19V5h16v14'/%3E%3Cpath d='M8 9h8M8 13h5'/%3E%3C/svg%3E");
    background-size: 0.85rem;
    background-repeat: no-repeat;
    background-position: center;
  }
  body.page-study-portal .path-tabs button[data-path-tab="lang"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/%3E%3C/svg%3E");
  }
  body.page-study-portal .path-tabs button[data-path-tab="ma"]::before,
  body.page-study-portal .path-tabs button[data-path-tab="phd"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M3 9l9-5 9 5-9 5-9-5Z'/%3E%3Cpath d='M7 11.5v4.5c0 1.5 2.2 3 5 3s5-1.5 5-3v-4.5'/%3E%3C/svg%3E");
  }
  body.page-study-portal .path-tabs button.is-on {
    z-index: 2;
    border-color: #fff;
    background: linear-gradient(165deg, #5aa0ff 0%, #1a6dff 55%, #0b4fd6 100%);
    color: #fff;
    box-shadow:
      0 0 0 3px rgba(26, 109, 255, 0.35),
      0 14px 28px rgba(11, 79, 214, 0.4);
    transform: none !important;
  }
  body.page-study-portal .path-tabs button.is-on span,
  body.page-study-portal .path-tabs button.is-on .path-card-bullets,
  body.page-study-portal .path-tabs button.is-on .path-card-bullets li {
    color: #fff;
  }
  body.page-study-portal .path-tabs button.is-on::after {
    content: "✓";
    position: absolute;
    inset-inline-end: 0.5rem;
    top: 0.5rem;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: #fff;
    color: #0b4fd6;
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(11, 31, 58, 0.18);
  }
  body.page-study-portal .path-tabs .path-card-bullets {
    margin: 0.15rem 0 0;
    padding: 0 0 0 1.05rem;
    list-style: disc;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.72rem;
    line-height: 1.35;
    font-weight: 550;
  }
  html[dir="rtl"] body.page-study-portal .path-tabs .path-card-bullets {
    padding: 0 1.05rem 0 0;
  }
  body.page-study-portal .path-tabs .path-card-bullets li {
    margin: 0.1rem 0;
  }

  body.page-study-portal .path-panel-head {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--sm-soft);
  }
  body.page-study-portal .path-foot-block {
    margin-top: 0.75rem;
  }

  /* ── 5. Conditions card (existing terms points) ── */
  body.page-study-portal .lead-terms {
    margin-top: 0.85rem;
    padding: 1rem 1rem 1.1rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(11, 31, 58, 0.1);
    box-shadow: 0 8px 18px rgba(11, 31, 58, 0.05);
  }
  body.page-study-portal .lead-terms-points {
    counter-reset: sm-terms;
    list-style: none;
    margin: 0.65rem 0 0.85rem;
    padding: 0;
    display: grid;
    gap: 0.45rem;
  }
  body.page-study-portal .lead-terms-points li {
    counter-increment: sm-terms;
    position: relative;
    padding: 0.65rem 0.75rem 0.65rem 2.35rem;
    border-radius: 10px;
    background: var(--sm-page);
    color: var(--sm-navy);
    font-size: 0.88rem;
    line-height: 1.45;
  }
  html[dir="rtl"] body.page-study-portal .lead-terms-points li {
    padding: 0.65rem 2.35rem 0.65rem 0.75rem;
  }
  body.page-study-portal .lead-terms-points li::before {
    content: counter(sm-terms);
    position: absolute;
    inset-inline-start: 0.55rem;
    top: 0.6rem;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: var(--sm-navy);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ── 6. Inquiry form as numbered steps ── */
  body.page-study-portal #study-inquiry.lead-layout {
    display: block;
    padding-inline: 0.85rem;
  }
  body.page-study-portal #study-inquiry .lead-aside {
    display: none;
  }
  body.page-study-portal #study-inquiry .lead-card {
    margin: 0;
    padding: 1rem 0.95rem 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(11, 31, 58, 0.08);
    background: #fff;
    box-shadow: 0 10px 24px rgba(11, 31, 58, 0.06);
  }
  body.page-study-portal #study-inquiry-gate {
    padding-inline: 0.85rem;
  }
  body.page-study-portal .lead-inquiry-gate {
    border-radius: 14px;
    border: 1px dashed rgba(26, 109, 255, 0.35);
    background: var(--sm-soft);
    padding: 1rem;
  }
  body.page-study-portal .study-identity-block::before,
  body.page-study-portal #path-docs::before,
  body.page-study-portal #study-pay::before {
    display: block;
    margin: 0 0 0.65rem;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--sm-navy);
  }
  body.page-study-portal .study-identity-block::before {
    content: "3 · Personal info";
  }
  body.page-study-portal #path-docs::before {
    content: "4 · Uploads";
  }
  body.page-study-portal #study-pay::before {
    content: "5 · Path A / Path B";
  }
  html[lang="ar"] body.page-study-portal .study-identity-block::before,
  html[dir="rtl"] body.page-study-portal .study-identity-block::before {
    content: "٣ · البيانات الشخصية";
  }
  html[lang="ar"] body.page-study-portal #path-docs::before,
  html[dir="rtl"] body.page-study-portal #path-docs::before {
    content: "٤ · المرفقات";
  }
  html[lang="ar"] body.page-study-portal #study-pay::before,
  html[dir="rtl"] body.page-study-portal #study-pay::before {
    content: "٥ · المسار أ / ب";
  }
  body.page-study-portal .lead-terms::before {
    content: "6 · Terms";
    display: block;
    margin: 0 0 0.55rem;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--sm-navy);
  }
  html[lang="ar"] body.page-study-portal .lead-terms::before,
  html[dir="rtl"] body.page-study-portal .lead-terms::before {
    content: "٦ · الشروط";
  }

  body.page-study-portal .upload-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  body.page-study-portal .upload-card {
    min-height: 5.5rem;
    padding: 0.95rem;
    border-radius: 14px;
    border: 2px dashed rgba(26, 109, 255, 0.35);
    background: var(--sm-soft);
  }
  body.page-study-portal .upload-drop {
    min-height: 3.25rem;
    border-radius: 10px;
    border: 1px solid rgba(11, 31, 58, 0.12);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem;
  }
  body.page-study-portal .upload-drop-label,
  body.page-study-portal .lead-doc-file {
    font-size: 0.85rem;
    font-weight: 650;
    color: var(--sm-navy);
    word-break: break-word;
  }
  body.page-study-portal .upload-chips {
    width: 100%;
    justify-content: flex-start;
  }
  body.page-study-portal .upload-drop {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.45rem;
  }
  body.page-study-portal .upload-chip {
    max-width: 100%;
  }
  body.page-study-portal .upload-chip-name {
    max-width: 11.5rem;
  }
  body.page-study-portal .upload-card.has-file {
    border-style: solid;
    border-color: rgba(26, 109, 255, 0.45);
    background: #fff;
  }
  body.page-study-portal .lead-pay-paths {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  body.page-study-portal .lead-pay-path {
    min-height: 48px;
    padding: 1rem;
    border-radius: 14px;
    border: 2px solid rgba(11, 31, 58, 0.12);
    background: #fff;
    text-align: start;
  }
  body.page-study-portal .lead-pay-path[aria-pressed="true"],
  body.page-study-portal .lead-pay-path.is-on {
    border-color: var(--sm-blue);
    background: var(--sm-soft);
    box-shadow: 0 0 0 1px rgba(26, 109, 255, 0.35);
  }
  body.page-study-portal .lead-names-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }
  body.page-study-portal #study-form .field input,
  body.page-study-portal #study-form .field select,
  body.page-study-portal #study-form .field textarea {
    min-height: 48px;
    font-size: 16px; /* avoid iOS zoom */
  }
  body.page-study-portal #study-form .field textarea {
    min-height: 6rem;
  }

  /* Hide inline submit (sticky bar replaces it on mobile) */
  body.page-study-portal #study-form .field-actions {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* ── 7. Sticky Send — single solid CTA (no double frame / outline box) ── */
  body.page-study-portal .study-mobile-sendbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: var(--sm-sendbar-h);
    padding: 0.55rem 0.85rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    background: transparent;
    border: 0;
    border-top: 0;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: none;
  }
  body.page-study-portal .study-mobile-sendbar[hidden] {
    display: none !important;
  }
  body.page-study-portal .study-mobile-sticky-send,
  body.page-study-portal .study-mobile-sticky-send.btn,
  body.page-study-portal .study-mobile-sticky-send.btn-primary {
    pointer-events: auto;
    width: 100%;
    max-width: 36rem;
    min-height: 52px;
    margin: 0;
    padding: 0.85rem 1.15rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #2a7bff 0%, var(--sm-blue) 55%, var(--sm-blue-deep) 100%) !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow:
      0 10px 24px rgba(26, 109, 255, 0.38),
      0 1px 0 rgba(255, 255, 255, 0.18) inset !important;
    color: #fff !important;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    transform: none !important;
    -webkit-tap-highlight-color: transparent;
  }
  body.page-study-portal .study-mobile-sticky-send:hover,
  body.page-study-portal .study-mobile-sticky-send:focus-visible {
    transform: none !important;
    background: linear-gradient(180deg, #2a7bff 0%, var(--sm-blue) 55%, var(--sm-blue-deep) 100%) !important;
    outline: 0 !important;
  }
  body.page-study-portal .study-mobile-sticky-send:active {
    background: var(--sm-blue-deep) !important;
    box-shadow: 0 4px 12px rgba(11, 31, 58, 0.28) !important;
  }

  /* ── Below form: ads as cards (portal/search shell stays hidden on phone) ── */
  body.page-study-portal .study-portal {
    display: none !important;
  }
  body.page-study-portal .study-portal-rail.study-guide-rail {
    position: relative;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.55rem;
    margin: 0;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(11, 31, 58, 0.08);
    box-shadow: 0 6px 16px rgba(11, 31, 58, 0.05);
    scrollbar-width: thin;
  }
  body.page-study-portal .study-guide-rail .study-rail-item {
    flex: 0 0 auto;
    min-width: max-content;
    max-width: none;
    width: auto;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: var(--sm-soft);
    border: 1px solid rgba(26, 109, 255, 0.18);
    color: var(--sm-navy);
  }
  body.page-study-portal .study-guide-rail .study-rail-ico {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.85rem;
  }
  body.page-study-portal .study-guide-rail .study-rail-label {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
  }
  body.page-study-portal .study-guide-rail .study-rail-mega {
    display: none !important;
  }
  body.page-study-portal .study-portal-top {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }
  body.page-study-portal .study-portal-search-col,
  body.page-study-portal .study-portal-side,
  body.page-study-portal .study-portal-promos,
  body.page-study-portal .study-travel-ad,
  body.page-study-portal .study-uni-partners {
    border-radius: 16px;
    overflow: hidden;
  }
  body.page-study-portal .study-portal-side {
    max-height: 22rem;
  }
  body.page-study-portal .study-travel-ads {
    padding-inline: 0.85rem;
    margin-top: 0.5rem;
  }
  body.page-study-portal .study-travel-ads-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  /* ═══════════════════════════════════════════
     My requests (same file, mobile only)
     ═══════════════════════════════════════════ */
  body.page-my-requests .req-page {
    padding: 1.15rem 0 calc(2.5rem + env(safe-area-inset-bottom, 0px));
  }
  body.page-my-requests .req-hero h1 {
    font-size: clamp(1.45rem, 6vw, 1.85rem);
  }
  body.page-my-requests .req-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.45rem;
    border-radius: 14px;
  }
  body.page-my-requests .req-tab {
    min-height: 48px;
    justify-content: center;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 750;
    background: #fff;
    border: 1px solid rgba(11, 31, 58, 0.1);
  }
  body.page-my-requests .req-tab.is-on {
    background: var(--sm-navy);
    color: #fff;
    border-color: var(--sm-navy);
  }
  body.page-my-requests .req-status-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
  }
  body.page-my-requests .req-status-chip {
    flex: 0 0 auto;
    min-height: 40px;
    border-radius: 999px;
    white-space: nowrap;
  }
  body.page-my-requests .req-card {
    border-radius: 16px;
    border: 1px solid rgba(11, 31, 58, 0.1);
    box-shadow: 0 8px 20px rgba(11, 31, 58, 0.06);
    padding: 0.95rem;
    background: #fff;
  }
  body.page-my-requests .req-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
  }
  body.page-my-requests .req-status {
    min-height: 1.7rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: none;
  }
  body.page-my-requests .req-status.new {
    background: var(--sm-soft);
    color: var(--sm-blue-deep);
  }
  body.page-my-requests .req-status.in_progress {
    background: #e8f1ff;
    color: var(--sm-navy);
  }
  body.page-my-requests .req-status.waiting,
  body.page-my-requests .req-status.action {
    background: #eef2f8;
    color: var(--sm-navy-2);
  }
  body.page-my-requests .req-status.done {
    background: var(--sm-soft);
    color: var(--sm-blue-deep);
  }
  body.page-my-requests .req-status.spam,
  body.page-my-requests .req-status.closed {
    background: #e8ecf2;
    color: #475569;
  }
  body.page-my-requests .req-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
  }
  body.page-my-requests .req-card-actions .btn,
  body.page-my-requests .req-chat-toggle {
    min-height: 44px;
    border-radius: 11px;
    font-weight: 750;
  }
  body.page-my-requests .req-chat-toggle {
    width: 100%;
    background: var(--sm-navy);
    color: #fff;
    border: 0;
  }
  body.page-my-requests .req-chat-panel {
    margin-top: 0.65rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(11, 31, 58, 0.1);
    background: var(--sm-page);
  }
  body.page-my-requests .req-chat:has(.req-chat-panel.is-open) {
    margin-top: 0.35rem;
  }
  body.page-my-requests .req-chat-panel.is-open {
    border-radius: 14px;
    overflow: hidden;
  }
  body.page-my-requests .req-chat-panel.is-open::before {
    content: "OBIC advisor";
    display: block;
    padding: 0.7rem 0.85rem;
    background: var(--sm-navy);
    color: #fff;
    font-weight: 800;
    font-size: 0.92rem;
  }
  html[lang="ar"] body.page-my-requests .req-chat-panel.is-open::before,
  html[dir="rtl"] body.page-my-requests .req-chat-panel.is-open::before {
    content: "مستشار أوبك";
  }
  body.page-my-requests .req-chat-stream {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: 55vh;
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--sm-page);
  }
  body.page-my-requests .req-chat-row {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
  }
  body.page-my-requests .req-chat-row.mine {
    flex-direction: row-reverse;
  }
  body.page-my-requests .req-chat-bubble {
    max-width: 88%;
    padding: 0.65rem 0.8rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
  }
  body.page-my-requests .req-chat-row.mine .req-chat-bubble {
    background: var(--sm-blue);
    color: #fff;
    border-bottom-right-radius: 4px;
  }
  html[dir="rtl"] body.page-my-requests .req-chat-row.mine .req-chat-bubble {
    border-bottom-right-radius: 14px;
    border-bottom-left-radius: 4px;
  }
  body.page-my-requests .req-chat-row.theirs .req-chat-bubble {
    background: #fff;
    color: var(--sm-navy);
    border: 1px solid rgba(11, 31, 58, 0.08);
    border-bottom-left-radius: 4px;
  }
  html[dir="rtl"] body.page-my-requests .req-chat-row.theirs .req-chat-bubble {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 4px;
  }
  body.page-my-requests .req-chat-compose {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.65rem;
    background: #fff;
    border-top: 1px solid rgba(11, 31, 58, 0.08);
  }
  body.page-my-requests .req-chat-compose textarea {
    min-height: 48px;
    border-radius: 12px;
    font-size: 16px;
  }
  body.page-my-requests .req-chat-tools {
    display: grid;
    grid-template-columns: 1fr 1fr 1.35fr;
    gap: 0.4rem;
  }
  body.page-my-requests .req-chat-tools .btn {
    min-height: 48px;
    border-radius: 12px;
    font-weight: 750;
  }
  body.page-my-requests .req-chat-tools [data-act="attach"],
  body.page-my-requests .req-chat-tools [data-act="voice"] {
    background: var(--sm-soft);
    color: var(--sm-navy);
    border: 1px solid rgba(26, 109, 255, 0.2);
  }
  body.page-my-requests .req-chat-tools button[type="submit"],
  body.page-my-requests .req-chat-tools [data-act="send"] {
    background: var(--sm-blue);
    color: #fff;
    border: 0;
  }
  body.page-my-requests .req-file-name,
  body.page-my-requests .req-chat-file-name,
  body.page-my-requests .req-msg-file,
  body.page-my-requests a.req-file {
    display: inline-block;
    max-width: 100%;
    font-weight: 700;
    color: var(--sm-blue-deep);
    word-break: break-all;
  }

  /* Study side-panel desk chat on study page (same mobile chrome) */
  body.page-study-portal .ssp-head,
  body.page-my-requests .req-chat-head {
    background: var(--sm-navy) !important;
    color: #fff;
  }
  body.page-study-portal .ssp-msg.is-user {
    background: var(--sm-blue) !important;
    color: #fff !important;
  }
  body.page-study-portal .ssp-msg.is-bot {
    background: #fff !important;
    color: var(--sm-navy) !important;
    border: 1px solid rgba(11, 31, 58, 0.08);
  }

  /* ── Study request chat sheet: keyboard/visualViewport + compact blue pay card + blue online bar (≤980px only) ── */
  html.ssp-sheet-scroll-lock,
  body.ssp-sheet-scroll-lock {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body.page-study-portal #study-side-panel .ssp-shell {
    overscroll-behavior: contain;
  }

  body.page-study-portal #study-side-panel .ssp-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-bottom: 0.85rem;
  }

  body.page-study-portal #study-side-panel .ssp-form {
    flex-shrink: 0;
    position: relative;
    z-index: 3;
  }

  body.page-study-portal #study-side-panel .ssp-form input,
  body.page-study-portal #study-side-panel .ssp-form textarea {
    font-size: 16px !important;
  }

  /* Office online bar ("المكتب متصل" / EN / ZH): soft blue #E8F1FF + blue #1A6DFF dot + navy #0B1F3A text (no green/beige) */
  body.page-study-portal #study-side-panel .ssp-hours,
  body.page-study-portal #study-side-panel .ssp-hours.is-open,
  body.page-study-portal #study-side-panel .ssp-hours.is-away {
    background: #e8f1ff !important;
    background-image: none !important;
    color: #0b1f3a !important;
    border-bottom: 1px solid rgba(26, 109, 255, 0.2) !important;
  }

  body.page-study-portal #study-side-panel .ssp-hours .ssp-hours-dot,
  body.page-study-portal #study-side-panel .ssp-hours.is-open .ssp-hours-dot {
    background: #1a6dff !important;
    box-shadow: 0 0 0 3px rgba(26, 109, 255, 0.2) !important;
  }

  body.page-study-portal #study-side-panel .ssp-hours.is-away .ssp-hours-dot {
    background: #64748b !important;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2) !important;
  }

  body.page-study-portal #study-side-panel .ssp-hours-avatar {
    box-shadow: 0 0 0 1px rgba(11, 31, 58, 0.14);
  }

  /* Payment card ("رسوم الخدمة · ادفع / ارفع الإيصال"): soft blue #E8F1FF, navy #0B1F3A text, blue #1A6DFF button, sticky top, compact/collapsible */
  body.page-study-portal #study-side-panel .ssp-pay-strip {
    position: sticky;
    top: 0;
    z-index: 2;
    flex-shrink: 0;
    background: #e8f1ff !important;
    background-image: none !important;
    border: 1px solid rgba(26, 109, 255, 0.24) !important;
    color: #0b1f3a !important;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip p,
  body.page-study-portal #study-side-panel .ssp-pay-strip strong {
    color: #0b1f3a !important;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip .ssp-btn-primary {
    background: #1a6dff !important;
    background-image: none !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(26, 109, 255, 0.22) !important;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible] .ssp-pay-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(26, 109, 255, 0.28);
    background: #fff;
    color: #0b1f3a;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.16s ease;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-compact,
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible] {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0.28rem 0.55rem 0.15rem;
    padding: 0.36rem 0.5rem;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-compact p,
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible] p {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-compact p br,
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible] p br {
    display: none;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-compact p strong::after,
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible] p strong::after {
    content: " · ";
    font-weight: 600;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-compact .ssp-btn,
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible] .ssp-btn {
    flex: 0 0 auto;
    width: auto !important;
    min-height: 1.85rem;
    padding: 0.3rem 0.62rem;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded:not(.ssp-force-compact) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0.3rem 0.55rem 0.2rem;
    padding: 0.55rem 0.65rem;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded p {
    flex: 1 1 calc(100% - 2.3rem);
    min-width: 0;
    margin: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded p br {
    display: inline;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded p strong::after {
    content: none;
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded .ssp-pay-toggle {
    transform: rotate(180deg);
  }

  body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded .ssp-btn {
    flex: 1 1 100%;
    width: 100% !important;
  }

  /* When keyboard is open, always force compact even if previously expanded */
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded {
    flex-wrap: nowrap;
    align-items: center;
    padding: 0.36rem 0.5rem;
    margin: 0.22rem 0.55rem 0.12rem;
  }
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded p {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded p br {
    display: none;
  }
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded p strong::after {
    content: " · ";
  }
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded .ssp-pay-toggle {
    transform: none;
  }
  body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-pay-strip[data-ssp-pay-collapsible].is-expanded .ssp-btn {
    flex: 0 0 auto;
    width: auto !important;
  }

  /* Phone sheet (≤767px): resize cleanly above the virtual keyboard using 100dvh + --ssp-vvh / --ssp-vv-bottom */
  @media (max-width: 767px) {
    body.page-study-portal #study-side-panel .ssp-shell {
      top: auto !important;
      bottom: var(--ssp-vv-bottom, 0px) !important;
      left: 0 !important;
      right: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      height: min(90dvh, calc(var(--ssp-vvh, 100dvh) - 0.5rem)) !important;
      max-height: calc(var(--ssp-vvh, 100dvh) - 0.5rem) !important;
    }

    body.page-study-portal #study-side-panel .ssp-shell.is-kb-open {
      height: var(--ssp-vvh, 100dvh) !important;
      max-height: var(--ssp-vvh, 100dvh) !important;
      border-radius: 12px 12px 0 0;
      padding-bottom: 0 !important;
    }

    body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-head {
      padding: 0.32rem 0.5rem 0.28rem;
      row-gap: 0.22rem;
    }

    body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-chat-back {
      padding: 0.25rem 0.65rem 0.1rem;
    }

    body.page-study-portal #study-side-panel .ssp-shell.is-kb-open .ssp-form {
      padding-bottom: 0.45rem;
    }
  }

  /* Tablet sheet (768px–980px): keep floating sheet above keyboard via --ssp-vvh / --ssp-vv-bottom */
  @media (min-width: 768px) and (max-width: 980px) {
    body.page-study-portal #study-side-panel .ssp-shell {
      bottom: calc(0.75rem + var(--ssp-vv-bottom, 0px) + env(safe-area-inset-bottom, 0px)) !important;
      height: min(640px, calc(var(--ssp-vvh, 100dvh) - 1.5rem)) !important;
      max-height: calc(var(--ssp-vvh, 100dvh) - 1.5rem) !important;
    }

    body.page-study-portal #study-side-panel .ssp-shell.is-kb-open {
      bottom: var(--ssp-vv-bottom, 0px) !important;
      height: min(640px, calc(var(--ssp-vvh, 100dvh) - 0.5rem)) !important;
      max-height: calc(var(--ssp-vvh, 100dvh) - 0.5rem) !important;
    }
  }

  /* Dark theme readable equivalent (no green, no beige) on phone/tablet */
  @media (prefers-color-scheme: dark) {
    body.page-study-portal #study-side-panel .ssp-hours,
    body.page-study-portal #study-side-panel .ssp-hours.is-open,
    body.page-study-portal #study-side-panel .ssp-hours.is-away {
      background: #10243f !important;
      color: #e8f1ff !important;
      border-bottom-color: rgba(90, 162, 255, 0.28) !important;
    }

    body.page-study-portal #study-side-panel .ssp-hours .ssp-hours-dot,
    body.page-study-portal #study-side-panel .ssp-hours.is-open .ssp-hours-dot {
      background: #4d94ff !important;
      box-shadow: 0 0 0 3px rgba(77, 148, 255, 0.28) !important;
    }

    body.page-study-portal #study-side-panel .ssp-hours.is-away .ssp-hours-dot {
      background: #94a3b8 !important;
      box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25) !important;
    }

    body.page-study-portal #study-side-panel .ssp-pay-strip {
      background: #10243f !important;
      border-color: rgba(90, 162, 255, 0.34) !important;
      color: #e8f1ff !important;
    }

    body.page-study-portal #study-side-panel .ssp-pay-strip p,
    body.page-study-portal #study-side-panel .ssp-pay-strip strong {
      color: #e8f1ff !important;
    }

    body.page-study-portal #study-side-panel .ssp-pay-strip .ssp-btn-primary {
      background: #1a6dff !important;
      color: #fff !important;
    }

    body.page-study-portal #study-side-panel .ssp-pay-strip[data-ssp-pay-collapsible] .ssp-pay-toggle {
      background: #1b365d !important;
      color: #e8f1ff !important;
      border-color: rgba(90, 162, 255, 0.4) !important;
    }
  }

  /* Phone only: small list flush under the header. Noor stays her button. */
  @media (max-width: 767px) {
    body.page-study-portal.ssp-phone-rail main {
      padding-right: 3.55rem;
      box-sizing: border-box;
    }
    body.page-study-portal.ssp-phone-rail .ssp-bar-show {
      display: none !important;
    }
    body.page-study-portal.obic-sa-open .sm-rail,
    body.page-study-portal.ssp-drawer-open .sm-rail {
      visibility: hidden;
    }
    body.page-study-portal .sm-rail {
      position: fixed;
      z-index: 86;
      top: calc(var(--nav-h) + 0.85rem);
      right: 0;
      left: auto;
      bottom: auto;
      width: 3.35rem;
      height: auto;
      display: flex;
      flex-direction: column;
      gap: 0;
      margin: 0;
      padding: 0;
      overflow: hidden;
      border-radius: 12px 0 0 12px;
      background: #1a6dff;
      box-shadow: -6px 8px 16px rgba(11, 79, 214, 0.22);
      pointer-events: auto;
    }
    body.page-study-portal .sm-rail[hidden] {
      display: none !important;
    }
    body.page-study-portal .sm-rail button {
      position: relative;
      flex: 0 0 auto;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.16rem;
      width: 100%;
      min-height: 2.85rem;
      margin: 0;
      border: 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.28);
      border-radius: 0;
      background: transparent;
      color: #fff;
      font: inherit;
      font-size: 0.55rem;
      font-weight: 800;
      line-height: 1.15;
      text-align: center;
      padding: 0.28rem 0.18rem 0.26rem;
      cursor: pointer;
    }
    body.page-study-portal .sm-rail button.sm-rail-hide {
      min-height: 0;
      flex-direction: row;
      padding: 0.08rem 0.2rem 0.12rem;
      font-size: 0.85rem;
      font-weight: 700;
      line-height: 1;
    }
    body.page-study-portal .sm-rail-show {
      position: fixed;
      z-index: 86;
      top: calc(var(--nav-h) + 0.85rem);
      right: 0;
      left: auto;
      display: inline-flex;
      align-items: center;
      gap: 0.2rem;
      border: 0;
      border-radius: 10px 0 0 10px;
      background: #1a6dff;
      color: #fff;
      font: inherit;
      font-size: 0.62rem;
      font-weight: 800;
      line-height: 1.1;
      padding: 0.42rem 0.45rem;
      cursor: pointer;
    }
    body.page-study-portal .sm-rail-show[hidden] {
      display: none !important;
    }
    body.page-study-portal.obic-sa-open .sm-rail-show,
    body.page-study-portal.ssp-drawer-open .sm-rail-show {
      visibility: hidden;
    }
    body.page-study-portal .sm-rail-show .sm-rail-badge {
      position: static;
      min-width: 0.9rem;
    }
    body.page-study-portal .sm-rail button[hidden] {
      display: none !important;
    }
    body.page-study-portal .sm-rail button:last-child {
      border-bottom: 0;
    }
    body.page-study-portal .sm-rail button.is-on {
      background: rgba(5, 40, 110, 0.28);
    }
    body.page-study-portal .sm-rail-ico {
      display: flex;
      width: 0.9rem;
      height: 0.9rem;
      color: #fff;
    }
    body.page-study-portal .sm-rail-ico svg {
      width: 0.9rem;
      height: 0.9rem;
    }
    body.page-study-portal .sm-rail-helper-mark {
      display: grid;
      place-items: center;
      width: 1.35rem;
      height: 1.35rem;
      border-radius: 6px;
      background: linear-gradient(155deg, #5eead4 0%, #14b8a6 55%, #0f766e 100%);
      color: #fff;
    }
    body.page-study-portal .sm-rail-helper-mark svg {
      width: 0.85rem;
      height: 0.85rem;
    }
    body.page-study-portal .sm-rail-label {
      display: block;
      max-width: 100%;
    }
    body.page-study-portal .sm-rail-badge {
      position: absolute;
      top: 0.12rem;
      left: 0.12rem;
      min-width: 0.9rem;
      height: 0.9rem;
      padding: 0 0.15rem;
      border-radius: 999px;
      background: #fff;
      color: #0b4fd6;
      font-size: 0.55rem;
      font-weight: 800;
      line-height: 0.9rem;
      text-align: center;
    }
    body.page-study-portal .sm-rail-badge[hidden] {
      display: none !important;
    }
    body.page-study-portal .sm-rail-pop {
      position: fixed;
      z-index: 94;
      top: calc(var(--nav-h) + 0.85rem);
      left: 0.45rem;
      right: 3.7rem;
      bottom: calc(var(--sm-sendbar-h) + 0.35rem + env(safe-area-inset-bottom, 0px));
      display: flex;
    }
    body.page-study-portal .sm-rail-pop[hidden] {
      display: none !important;
    }
    body.page-study-portal .sm-rail-pop-card {
      display: flex;
      flex-direction: column;
      min-height: 0;
      width: 100%;
      background: #fff;
      color: #0b1f3a;
      border-radius: 16px;
      box-shadow: 0 12px 32px rgba(11, 31, 58, 0.22);
      overflow: hidden;
    }
    body.page-study-portal .sm-rail-pop-head {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      background: #1a6dff;
      color: #fff;
      padding: 0.55rem 0.65rem;
    }
    body.page-study-portal .sm-rail-pop-head strong {
      flex: 1 1 auto;
      font-size: 0.92rem;
    }
    body.page-study-portal .sm-rail-pop-head button {
      border: 0;
      background: transparent;
      color: #fff;
      font-size: 1.35rem;
      line-height: 1;
      cursor: pointer;
    }
    body.page-study-portal .sm-rail-pop-body {
      overflow: auto;
      padding: 0.7rem 0.7rem 1.1rem;
    }
    body.page-study-portal .sm-rail-q {
      border-bottom: 1px solid rgba(11, 31, 58, 0.08);
    }
    body.page-study-portal .sm-rail-q-btn {
      display: block;
      width: 100%;
      text-align: start;
      border: 0;
      background: transparent;
      color: #0b1f3a;
      font: inherit;
      font-weight: 800;
      padding: 0.7rem 0.15rem;
      cursor: pointer;
    }
    body.page-study-portal .sm-rail-q-a {
      margin: 0 0 0.7rem;
      font-size: 0.86rem;
      line-height: 1.45;
    }
    body.page-study-portal .sm-rail-req-hint {
      margin: 0 0 0.65rem;
      color: #5b6b82;
      font-size: 0.8rem;
      font-weight: 700;
    }
    body.page-study-portal .sm-rail-req-opts {
      display: flex;
      flex-direction: column;
      gap: 0.7rem;
    }
    body.page-study-portal .sm-rail-req-opt {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.55rem;
      width: 100%;
      margin: 0;
      border: 0;
      border-radius: 14px;
      padding: 0.9rem 0.85rem;
      background: linear-gradient(180deg, #f8fbff 0%, #e7f0ff 100%);
      color: #0b1f3a;
      font: inherit;
      font-weight: 800;
      text-align: start;
      cursor: pointer;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 5px 0 #b9d0fb,
        0 9px 14px rgba(26, 109, 255, 0.14);
    }
    body.page-study-portal .sm-rail-req-opt strong {
      font-size: 0.92rem;
      line-height: 1.35;
    }
    body.page-study-portal .sm-rail-req-opt::after {
      content: "›";
      flex: 0 0 auto;
      color: #1a6dff;
      font-size: 1.35rem;
      line-height: 1;
    }
    body.page-study-portal .sm-rail-pop[dir="rtl"] .sm-rail-req-opt::after {
      content: "‹";
    }
    body.page-study-portal .sm-rail-req-opt:active {
      transform: translateY(3px);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 2px 0 #b9d0fb;
    }
    body.page-study-portal .sm-rail-req-back {
      display: inline-flex;
      margin: 0 0 0.75rem;
      border: 0;
      border-radius: 999px;
      padding: 0.38rem 0.75rem;
      background: #eef4ff;
      color: #0b4fd6;
      font: inherit;
      font-size: 0.78rem;
      font-weight: 800;
      cursor: pointer;
      box-shadow: 0 3px 0 #c5d8fb;
    }
    body.page-study-portal .sm-rail-req-back:active {
      transform: translateY(2px);
      box-shadow: 0 1px 0 #c5d8fb;
    }
    body.page-study-portal .sm-rail-req-list {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }
    body.page-study-portal .sm-rail-req-card {
      border-radius: 16px;
      padding: 0.75rem 0.8rem 0.85rem;
      background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
      border: 1px solid rgba(26, 109, 255, 0.1);
      box-shadow:
        inset 0 1px 0 #fff,
        0 6px 0 #d5e4fb,
        0 12px 16px rgba(11, 31, 58, 0.06);
    }
    body.page-study-portal .sm-rail-req-card-top {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      margin-bottom: 0.4rem;
    }
    body.page-study-portal .sm-rail-req-n {
      width: 1.5rem;
      height: 1.5rem;
      display: grid;
      place-items: center;
      border-radius: 8px;
      background: linear-gradient(180deg, #4d94ff, #1a6dff);
      color: #fff;
      font-size: 0.72rem;
      font-weight: 800;
      box-shadow: 0 2px 0 #0b4fd6;
    }
    body.page-study-portal .sm-rail-req-badge {
      margin-inline-start: auto;
      padding: 0.12rem 0.48rem;
      border-radius: 999px;
      background: #e8eef6;
      color: #3d5270;
      font-size: 0.68rem;
      font-weight: 800;
    }
    body.page-study-portal .sm-rail-req-badge.is-req {
      background: #e5f0ff;
      color: #0b4fd6;
    }
    body.page-study-portal .sm-rail-req-badge.is-no {
      background: #f1f3f6;
      color: #66758a;
    }
    body.page-study-portal .sm-rail-req-badge.is-uni,
    body.page-study-portal .sm-rail-req-badge.is-emb {
      background: #fff4d6;
      color: #8a5a00;
    }
    body.page-study-portal .sm-rail-req-badge.is-if {
      background: #e7f8f4;
      color: #0f766e;
    }
    body.page-study-portal .sm-rail-req-card strong {
      display: block;
      font-size: 0.9rem;
      line-height: 1.35;
    }
    body.page-study-portal .sm-rail-req-card p {
      margin: 0.32rem 0 0;
      color: #3d5270;
      font-size: 0.8rem;
      line-height: 1.5;
    }
  }
}
