/* OBIC Study side panel — Helper AI + Requests (navy / Ctrip Study language) */

.ssp {
  --ssp-navy: #0b1f3a;
  --ssp-navy-2: #122a4a;
  --ssp-blue: #1a6dff;
  --ssp-blue-deep: #0b4fd6;
  --ssp-cyan: #14b8a6;
  --ssp-cyan-deep: #0f766e;
  --ssp-soft: #e8f1ff;
  --ssp-soft-teal: #e6f7f4;
  --ssp-bg: #f4f7fb;
  --ssp-line: rgba(11, 31, 58, 0.1);
  --ssp-muted: rgba(11, 31, 58, 0.58);
  --ssp-vv-bottom: 0px;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: flex;
  flex-direction: column;
}

.ssp *,
.ssp *::before,
.ssp *::after {
  box-sizing: border-box;
}

.ssp-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(26, 109, 255, 0.14), transparent 52%),
    linear-gradient(180deg, #ffffff 0%, var(--ssp-bg) 100%);
  /* Crisp on white page areas — avoid washed teal/white edge */
  border: 1px solid rgba(11, 31, 58, 0.16);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 22px 48px rgba(8, 24, 48, 0.28),
    0 8px 18px rgba(26, 109, 255, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.65);
}

.ssp-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.55rem 0.55rem 0.65rem;
  color: #fff;
  flex-shrink: 0;
}

/* Helper: cool teal-tinted navy — not Noor's photo + amber status look */
.ssp-head.is-helper {
  background:
    linear-gradient(115deg, rgba(20, 184, 166, 0.22), transparent 42%),
    linear-gradient(120deg, #07263a 0%, var(--ssp-navy) 48%, #0e3a52 100%);
  border-bottom: 1px solid rgba(20, 184, 166, 0.28);
}

/* Requests: warmer desk/Noor chrome */
.ssp-head.is-requests {
  background: linear-gradient(120deg, var(--ssp-navy), var(--ssp-navy-2));
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
}

.ssp-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 0 1 auto;
}

.ssp-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(155deg, #2dd4bf 0%, var(--ssp-cyan) 45%, var(--ssp-cyan-deep) 100%);
  color: #fff;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.18),
    0 8px 16px rgba(15, 118, 110, 0.35);
  flex-shrink: 0;
}

.ssp-mark svg {
  display: block;
}

.ssp-brand-avatar,
.ssp-brand img {
  width: 34px;
  height: 44px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  background: linear-gradient(165deg, #d6e4f0, #fff);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.ssp-brand strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 780;
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
}

.ssp-brand > div > span {
  display: block;
  font-size: 0.62rem;
  opacity: 0.78;
  line-height: 1.2;
  margin-top: 0.1rem;
}

.ssp-tabs {
  display: flex;
  gap: 0.25rem;
  margin-inline-start: auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.18rem;
  flex-shrink: 0;
}

.ssp-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.ssp-tab:hover {
  color: #fff;
}

.ssp-tab.is-on {
  background: #fff;
  color: var(--ssp-navy);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.ssp-close {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ssp-msg-body {
  white-space: pre-wrap;
}

.ssp-teach {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.ssp-teach-step {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ssp-line);
  background: #f8fafc;
}

.ssp-teach-num {
  display: block;
  padding: 0.25rem 0.5rem 0.1rem;
  font-size: 0.64rem;
  font-weight: 780;
  color: var(--ssp-cyan-deep);
  letter-spacing: 0.02em;
}

.ssp-teach-zoom {
  appearance: none;
  display: block;
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #e2e8f0;
  cursor: zoom-in;
}

/* Compact thumbs in-chat so the message stream stays tall; tap opens lightbox */
.ssp-teach-zoom img,
.ssp-teach-step > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 96px;
  object-fit: cover;
  object-position: top center;
  background: #e2e8f0;
}

.ssp-teach-zoom-hint {
  position: absolute;
  right: 0.4rem;
  bottom: 0.35rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(11, 31, 58, 0.72);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  pointer-events: none;
}

html[dir="rtl"] .ssp-teach-zoom-hint,
.ssp[dir="rtl"] .ssp-teach-zoom-hint {
  right: auto;
  left: 0.4rem;
}

.ssp-teach-step figcaption {
  padding: 0.28rem 0.5rem 0.4rem;
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--ssp-muted);
  font-weight: 650;
}

.ssp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  background: rgba(8, 18, 36, 0.88);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.ssp-lightbox[hidden] {
  display: none !important;
}

.ssp-lightbox-figure {
  margin: 0;
  max-width: min(960px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.ssp-lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: min(78dvh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #0b1f3a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.ssp-lightbox-figure figcaption {
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 650;
  text-align: center;
  max-width: 36rem;
  line-height: 1.4;
}

.ssp-lightbox-close {
  position: absolute;
  top: max(0.55rem, env(safe-area-inset-top));
  right: max(0.55rem, env(safe-area-inset-right));
  appearance: none;
  border: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.ssp-lightbox-close:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}

body.ssp-lb-open {
  overflow: hidden;
}

/* Floating Helper pop-back bubble — physical bottom-left (opposite Noor bottom-right) */
.ssp-fab {
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.92);
  position: fixed;
  z-index: 66;
  /* Physical left always (opposite Noor). Avoid inset-inline — it flips under html[dir=rtl]. */
  inset-inline-start: auto;
  inset-inline-end: auto;
  left: 1rem;
  right: auto;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem 0.5rem 0.5rem;
  border-radius: 999px;
  background: linear-gradient(120deg, #041828 0%, #0a2f44 48%, #0c5c56 100%);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow:
    0 14px 34px rgba(4, 16, 32, 0.45),
    0 4px 12px rgba(15, 118, 110, 0.28),
    0 0 0 1px rgba(7, 38, 58, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
  animation: ssp-fab-pop 0.38s ease;
}

.ssp-fab[hidden] {
  display: none !important;
}

.ssp-fab .ssp-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.35),
    0 6px 14px rgba(4, 24, 40, 0.35);
}

.ssp-fab-bubble {
  white-space: nowrap;
  color: #fff;
}

/* Unread count — FAB / Requests tab / mobile pop-back */
.ssp-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

.ssp-notif-badge[hidden] {
  display: none !important;
}

.ssp-fab .ssp-notif-badge,
.ssp-mobile-btn .ssp-notif-badge {
  position: absolute;
  top: -0.2rem;
  inset-inline-end: -0.15rem;
}

.ssp-tab .ssp-notif-badge {
  position: absolute;
  top: -0.28rem;
  inset-inline-end: -0.1rem;
  min-width: 1rem;
  height: 1rem;
  font-size: 0.58rem;
  box-shadow: 0 0 0 1.5px rgba(11, 31, 58, 0.55);
}

.ssp-tab.is-on .ssp-notif-badge {
  box-shadow: 0 0 0 1.5px #fff;
}

.ssp-notif-badge-inline {
  position: static;
  vertical-align: middle;
  margin-inline-start: 0.35rem;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.95);
}

.ssp-mobile-btn {
  position: relative;
}

@keyframes ssp-fab-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.obic-ssp-active.ssp-float-closed .ssp-fab:not([hidden]) {
  display: inline-flex;
}

/* Noor stays physical bottom-right on Study — never same corner as Helper FAB.
   Reset base scholarship-assistant inset-inline-end first (it flips under RTL),
   then pin with physical right. Logical !important after physical would wipe corners. */
body.page-study-portal .obic-sa-dock {
  inset-inline-start: auto;
  inset-inline-end: auto;
  left: auto !important;
  right: 0.85rem !important;
  /* Above Helper shell (70) so Noor stays tappable if edges ever meet */
  z-index: 72;
}

/* User-dragged Noor: release the physical right pin */
body.page-study-portal .obic-sa-dock.is-user-placed:not(.is-open),
html[dir="rtl"] body.page-study-portal .obic-sa-dock.is-user-placed:not(.is-open) {
  left: var(--sa-fab-left) !important;
  right: auto !important;
  top: var(--sa-fab-top) !important;
  bottom: auto !important;
  inset-inline-start: auto !important;
  inset-inline-end: auto !important;
}

/* Open chat: ignore drag left/top; keep physical right pin for desktop panel */
body.page-study-portal .obic-sa-dock.is-user-placed.is-open,
html[dir="rtl"] body.page-study-portal .obic-sa-dock.is-user-placed.is-open {
  left: auto !important;
  top: auto !important;
  right: 0.85rem !important;
  inset-inline-start: auto !important;
  inset-inline-end: auto !important;
}

@media (max-width: 430px) {
  body.page-study-portal .obic-sa-dock.is-user-placed.is-open,
  html[dir="rtl"] body.page-study-portal .obic-sa-dock.is-user-placed.is-open {
    right: auto !important;
    left: 0 !important;
    inset: var(--sa-vv-top, 0px) 0 auto 0 !important;
  }
}

/* Pin Helper FAB + open shell to physical left even when page dir=rtl (AR). */
html[dir="rtl"] .ssp-fab,
html[dir="rtl"] body.obic-ssp-active .ssp-fab,
html[dir="rtl"] body.page-study-portal #study-side-panel .ssp-shell {
  inset-inline-start: auto;
  inset-inline-end: auto;
  left: 1rem !important;
  right: auto !important;
}

html[dir="rtl"] body.page-study-portal .obic-sa-dock {
  inset-inline-start: auto;
  inset-inline-end: auto;
  left: auto !important;
  right: 0.85rem !important;
}

/* One X only: hide nested pay-sheet close inside Requests (panel header X closes all) */
.ssp-pay-host .obic-asp-close,
[data-ssp-pay-host] .obic-asp-close {
  display: none !important;
}

/* Helper-only availability strip — teal, never amber Noor clone */
.ssp-helper-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--ssp-cyan-deep);
  background: linear-gradient(90deg, var(--ssp-soft-teal), rgba(232, 241, 255, 0.7));
  border-bottom: 1px solid rgba(20, 184, 166, 0.18);
  flex-shrink: 0;
}

.ssp-help-btn {
  flex: 1 1 100%;
  margin: 0.15rem 0 0;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: #0b1f3a;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.ssp-help-btn:disabled {
  opacity: 0.6;
}

.ssp-help-phone,
.ssp-help-chat {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
}

.ssp-help-phone[hidden],
.ssp-help-chat[hidden] {
  display: none !important;
}

.ssp-help-phone label,
.ssp-help-phone-err {
  margin: 0;
  font-size: 0.78rem;
}

.ssp-help-phone-row {
  display: flex;
  gap: 0.4rem;
}

.ssp-help-phone-row select,
.ssp-help-phone-row input,
.ssp-help-form input {
  min-width: 0;
  border: 1px solid rgba(11, 31, 58, 0.16);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
  color: #0b1f3a;
}

.ssp-help-phone-row select {
  flex: 0 1 46%;
}

.ssp-help-phone-row input {
  flex: 1 1 auto;
}

.ssp-help-phone-err {
  color: #9f1239;
}

.ssp-help-phone button,
.ssp-help-form button {
  border: 0;
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  background: #1a6dff;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ssp-help-chat {
  flex: 1 1 auto;
}

.ssp-help-log {
  flex: 1 1 auto;
  min-height: 8rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ssp-help-bubble {
  max-width: 85%;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ssp-help-bubble.is-mine {
  align-self: flex-end;
  background: #1a6dff;
  color: #fff;
}

.ssp-help-bubble.is-desk {
  align-self: flex-start;
  background: #fff;
  color: #0b1f3a;
  border: 1px solid rgba(11, 31, 58, 0.08);
}

.ssp-help-form {
  display: flex;
  gap: 0.4rem;
}

.ssp-help-form input {
  flex: 1 1 auto;
}

.ssp-helper-strip[hidden] {
  display: none !important;
}

.ssp-helper-strip-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--ssp-cyan);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
  flex-shrink: 0;
}

/* Requests-only desk/Noor hours (amber/green) */
.ssp-hours {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 650;
  color: #9a3412;
  background: linear-gradient(90deg, #fff7ed, #fffbeb);
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
  flex-shrink: 0;
}

.ssp-hours[hidden] {
  display: none !important;
}

.ssp-hours-avatar {
  width: 22px;
  height: 28px;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(154, 52, 18, 0.12);
}

.ssp-hours-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.ssp-hours.is-open {
  color: #047857;
  background: linear-gradient(90deg, #ecfdf5, #f0fdf4);
  border-bottom-color: rgba(34, 197, 94, 0.22);
}

.ssp-hours.is-open .ssp-hours-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.ssp-hours.is-away .ssp-hours-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.ssp-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.ssp-pane[hidden] {
  display: none !important;
}

.ssp-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  flex-shrink: 0;
  overscroll-behavior-x: contain;
}

.ssp-chip {
  appearance: none;
  border: 1px solid rgba(26, 109, 255, 0.22);
  background: #fff;
  color: var(--ssp-navy);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ssp-chip:hover,
.ssp-chip.is-on {
  background: var(--ssp-soft);
  border-color: rgba(26, 109, 255, 0.45);
  color: var(--ssp-blue-deep);
}

.ssp-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* auto so wheel/trackpad can chain out via ObicWheelBreakout at edges */
  overscroll-behavior: auto;
  padding: 0.45rem 0.7rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  -webkit-overflow-scrolling: touch;
}

.ssp-msg {
  max-width: 92%;
  padding: 0.62rem 0.75rem;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ssp-msg.is-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--ssp-line);
  color: var(--ssp-navy);
  border-end-start-radius: 5px;
  box-shadow: 0 4px 12px rgba(11, 31, 58, 0.05);
}

.ssp-msg.is-user {
  align-self: flex-end;
  background: linear-gradient(165deg, #5aa2ff 0%, var(--ssp-blue) 55%, var(--ssp-blue-deep) 100%);
  color: #fff;
  border-end-end-radius: 5px;
  box-shadow: 0 8px 16px rgba(26, 109, 255, 0.22);
}

.ssp-msg.is-sys {
  align-self: stretch;
  max-width: 100%;
  background: rgba(11, 31, 58, 0.04);
  color: var(--ssp-muted);
  font-size: 0.75rem;
  text-align: center;
  border-radius: 10px;
}

.ssp-msg-who {
  display: block;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.2rem;
}

.ssp-form {
  display: flex;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ssp-line);
  background: rgba(255, 255, 255, 0.92);
  flex-shrink: 0;
}

.ssp-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--ssp-line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  background: #fff;
  color: var(--ssp-navy);
}

.ssp-form input:focus {
  outline: 2px solid rgba(26, 109, 255, 0.35);
  border-color: rgba(26, 109, 255, 0.45);
}

.ssp-form button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0.65rem 0.95rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 780;
  background: linear-gradient(180deg, #5aa2ff 0%, var(--ssp-blue) 55%, var(--ssp-blue-deep) 100%);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(26, 109, 255, 0.22);
}

.ssp-form button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ssp-note {
  margin: 0;
  padding: 0 0.7rem 0.55rem;
  font-size: 0.65rem;
  line-height: 1.35;
  color: var(--ssp-muted);
  flex-shrink: 0;
}

.ssp-gate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 1rem 0.85rem;
  margin: 0.65rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--ssp-line);
  box-shadow: 0 8px 20px rgba(11, 31, 58, 0.06);
}

.ssp-gate strong {
  font-size: 0.95rem;
  color: var(--ssp-navy);
}

.ssp-gate p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ssp-muted);
}

.ssp-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

/* Requests root — fills pane so Noor pay sheet can embed like the dock */
[data-ssp-req-root] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

[data-ssp-req-root].is-paying {
  overflow: hidden;
}

.ssp-consult {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.ssp-consult-head {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem 0.2rem;
}

.ssp-consult-head strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--ssp-navy);
  line-height: 1.25;
}

.ssp-consult-head p {
  margin: 0.18rem 0 0;
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--ssp-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ssp-consult-head .ssp-gate-actions {
  margin-top: 0.3rem;
}

.ssp-consult-head .ssp-btn {
  padding: 0.4rem 0.65rem;
  font-size: 0.72rem;
}

.ssp-pay-host {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ssp-req-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  padding: 0.35rem 0.65rem 0.75rem;
  flex-shrink: 0;
}

.ssp-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.ssp-btn-primary {
  background: linear-gradient(180deg, #5aa2ff 0%, var(--ssp-blue) 55%, var(--ssp-blue-deep) 100%);
  color: #fff;
  box-shadow: 0 8px 16px rgba(26, 109, 255, 0.2);
}

.ssp-btn-ghost {
  background: var(--ssp-soft);
  color: var(--ssp-navy);
  border: 1px solid rgba(26, 109, 255, 0.18);
}

.ssp-req-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}

.ssp-req-item {
  appearance: none;
  width: 100%;
  text-align: start;
  border: 1px solid var(--ssp-line);
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  color: var(--ssp-navy);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ssp-req-item:hover,
.ssp-req-item.is-on {
  border-color: rgba(26, 109, 255, 0.4);
  box-shadow: 0 6px 16px rgba(26, 109, 255, 0.1);
}

.ssp-req-item strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.25;
}

.ssp-req-item em {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.7rem;
  color: var(--ssp-muted);
}

.ssp-req-badge {
  display: inline-flex;
  margin-top: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 750;
  background: #fff7ed;
  color: #c2410c;
}

.ssp-req-badge.is-ok {
  background: #ecfdf5;
  color: #047857;
}

.ssp-req-badge.is-pending {
  background: #eff6ff;
  color: #1d4ed8;
}

.ssp-req-item.is-cancelled {
  opacity: 0.88;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.ssp-req-item.is-cancelled:hover,
.ssp-req-item.is-cancelled.is-on {
  border-color: #cbd5e1;
  box-shadow: none;
}

.ssp-req-badge.is-cancelled {
  background: #f1f5f9;
  color: #475569;
}

.ssp-cancel-banner {
  margin: 0.35rem 0.7rem 0.15rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.ssp-cancel-banner strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 750;
  color: #475569;
}

.ssp-cancel-banner p {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #64748b;
}

.ssp-chat-back {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ssp-blue);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 750;
  padding: 0.45rem 0.7rem 0.15rem;
  cursor: pointer;
  align-self: flex-start;
  flex-shrink: 0;
}

.ssp-loading,
.ssp-empty {
  padding: 1.25rem 0.85rem;
  text-align: center;
  color: var(--ssp-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

/*
 * Side column shows study ad carousel again (Hangzhou/Shanghai/Beijing/Guangzhou).
 * Helper is a body-level floating overlay — do NOT hide .study-portal-side.
 */
body.page-study-portal #study-side-panel.ssp {
  position: fixed;
  z-index: 70;
  inset: auto;
  width: 0;
  height: 0;
  min-height: 0;
  pointer-events: none;
  overflow: visible;
}

body.page-study-portal #study-side-panel .ssp-shell {
  pointer-events: auto;
  position: fixed;
  z-index: 70;
  /* Open beside Helper FAB (physical left) — leave Noor free on the right */
  inset-inline-start: auto;
  inset-inline-end: auto;
  left: 1rem;
  right: auto;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  /* Leave ~Noor FAB width free on the right on narrow viewports */
  width: min(350px, calc(100vw - 6rem));
  /* Taller panel = chat rises up; teach thumbs stay compact above */
  height: min(640px, calc(100dvh - 4.25rem));
  max-height: calc(var(--ssp-vv-height, 100dvh) - 3.75rem - var(--ssp-vv-bottom, 0px));
  border-radius: 18px;
  transform: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.page-study-portal #study-side-panel .ssp-shell[hidden] {
  display: none !important;
}

.ssp-mobile-bar {
  display: none;
}

/* Bring-back pill is phone-only. Desktop keeps the side panel. */
@media (min-width: 768px) {
  .ssp-bar-show {
    display: none !important;
  }
}

.ssp-backdrop {
  display: none;
}

@media (min-width: 768px) and (max-width: 1199px) {
  .ssp-brand > div > span {
    display: none;
  }

  .ssp-tab {
    padding: 0.35rem 0.55rem;
    font-size: 0.68rem;
  }
}

/* Mobile <768: full-width bottom sheet (Noor chat sheet pattern) */
@media (max-width: 767px) {
  /* Two-row header: brand + close on row 1; Helper / Requests full-width row 2 */
  .ssp-head {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0.38rem;
    column-gap: 0.4rem;
    padding: 0.48rem 0.5rem 0.42rem;
  }

  .ssp-brand {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 2.6rem);
  }

  .ssp-brand > div {
    min-width: 0;
  }

  .ssp-brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .ssp-brand > div > span {
    display: none;
  }

  .ssp-close {
    order: 2;
    margin-inline-start: auto;
    flex-shrink: 0;
  }

  .ssp-tabs {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    margin-inline-start: 0;
    margin-inline-end: 0;
    justify-content: stretch;
    gap: 0.2rem;
    padding: 0.14rem;
  }

  .ssp-tab {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 0.34rem 0.45rem;
    font-size: 0.68rem;
  }

  body.page-study-portal #study-side-panel .ssp-shell {
    inset: auto 0 0 0;
    inset-inline: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: min(
      90dvh,
      calc(var(--ssp-vv-height, 100dvh) - var(--ssp-vv-top, 0px) - 0.35rem)
    );
    max-height: min(
      90dvh,
      calc(var(--ssp-vv-height, 100dvh) - var(--ssp-vv-top, 0px) - 0.35rem)
    );
    border-radius: 18px 18px 0 0;
    border-inline-width: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -12px 36px rgba(11, 31, 58, 0.22);
  }

  html[dir="rtl"] body.page-study-portal #study-side-panel .ssp-shell {
    inset-inline: 0;
    left: 0 !important;
    right: 0 !important;
  }

  /* Soft dim only — never block Noor clicks on the right */
  .ssp-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 69;
    background: rgba(8, 20, 40, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  body.ssp-drawer-open .ssp-backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: none;
  }

  /*
   * Must match/exceed desktop show rule specificity
   * (body.obic-ssp-active.ssp-float-closed .ssp-fab:not([hidden])).
   * Otherwise both desktop FAB + mobile Helper/Requests bar stack and overlap.
   */
  body.obic-ssp-active.ssp-float-closed .ssp-fab:not([hidden]) {
    display: none;
  }

  body.obic-ssp-active.ssp-float-closed .ssp-mobile-bar {
    display: flex;
    position: fixed;
    z-index: 65;
    /* Physical edges last — never follow with inset-inline:auto (wipes left/right). */
    inset-inline-start: auto;
    inset-inline-end: auto;
    left: 0.75rem;
    right: 5.5rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    gap: 0.4rem;
    pointer-events: none;
  }

  html[dir="rtl"] body.obic-ssp-active.ssp-float-closed .ssp-mobile-bar {
    inset-inline-start: auto;
    inset-inline-end: auto;
    left: 0.75rem;
    right: 5.5rem;
  }

  body.obic-ssp-active.ssp-float-closed .ssp-mobile-bar > * {
    pointer-events: auto;
  }

  body.obic-ssp-active.ssp-float-closed .ssp-mobile-bar[hidden],
  body.ssp-bar-hidden .ssp-mobile-bar {
    display: none !important;
  }

  .ssp-bar-hide {
    position: absolute;
    top: -11px;
    left: 50%;
    z-index: 2;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    transform: translateX(-50%);
    background: #0b1f3a;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(11, 31, 58, 0.35);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .ssp-bar-show {
    display: none;
  }

  body.ssp-bar-hidden .ssp-bar-show:not([hidden]) {
    position: fixed;
    z-index: 86;
    /* Same edge as Noor so the two sticks stack. Do not set left/right after this. */
    inset-inline-end: 0;
    inset-inline-start: auto;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0.32rem 0.45rem;
    border: 1px solid rgba(11, 31, 58, 0.14);
    border-inline-end: 0;
    border-radius: 10px 0 0 10px;
    background: #fff;
    color: #0b1f3a;
    font: inherit;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.1;
    cursor: pointer;
    box-shadow: -4px 6px 14px rgba(8, 24, 48, 0.22);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  html[dir="rtl"] body.ssp-bar-hidden .ssp-bar-show:not([hidden]) {
    border-radius: 0 10px 10px 0;
    border-inline-end: 1px solid rgba(11, 31, 58, 0.14);
    border-inline-start: 0;
    box-shadow: 4px 6px 14px rgba(8, 24, 48, 0.22);
  }

  body.ssp-drawer-open .ssp-bar-show,
  body.obic-sa-open .ssp-bar-show {
    display: none !important;
  }

  .ssp-mobile-btn {
    appearance: none;
    flex: 1 1 0;
    border: 0;
    border-radius: 14px;
    padding: 0.78rem 0.7rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 780;
    cursor: pointer;
    position: relative;
    box-shadow: 0 12px 28px rgba(8, 24, 48, 0.28);
  }

  .ssp-mobile-btn-helper {
    background: linear-gradient(120deg, #041828 0%, #0a2f44 48%, #0c5c56 100%);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    box-shadow:
      0 12px 28px rgba(4, 16, 32, 0.4),
      0 0 0 1px rgba(7, 38, 58, 0.5);
  }

  .ssp-mobile-btn-requests {
    background: #fff;
    color: var(--ssp-navy);
    border: 1px solid rgba(245, 158, 11, 0.28);
    box-shadow: 0 12px 28px rgba(154, 52, 18, 0.12);
  }

  /* Noor FAB: lift above sticky Send + Helper/Requests (phone stack) */
  body.page-study-portal.obic-ssp-active.ssp-float-closed .obic-sa-dock:not(.is-open) {
    bottom: calc(8.8rem + env(safe-area-inset-bottom, 0px));
  }

  /* Helper open: tuck Noor so Send/input is not covered */
  body.ssp-drawer-open .obic-sa-dock:not(.is-open) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body.ssp-drawer-open .obic-sa-dock:not(.is-open) > * {
    pointer-events: none;
  }
}

/* RTL */
html[dir="rtl"] .ssp-msg.is-bot {
  border-end-start-radius: 14px;
  border-end-end-radius: 5px;
}

html[dir="rtl"] .ssp-msg.is-user {
  border-end-end-radius: 14px;
  border-end-start-radius: 5px;
}

html[dir="rtl"] .ssp-tabs {
  margin-inline-start: 0;
  margin-inline-end: auto;
}

/* reqchat1 — unpaid strip above chat (no hard pay wall) */
.ssp-pay-strip {
  flex-shrink: 0;
  margin: 0.35rem 0.65rem 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 186, 73, 0.16);
  border: 1px solid rgba(196, 122, 18, 0.28);
}
.ssp-pay-strip p {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #5c3d0a;
}
.ssp-pay-strip .ssp-btn {
  width: 100%;
  min-height: 2rem;
  font-size: 0.78rem;
}
.ssp-pay-strip-pending {
  background: rgba(26, 109, 255, 0.1);
  border-color: rgba(26, 109, 255, 0.28);
}
.ssp-pay-strip-pending p {
  margin: 0;
  color: #0b3a7a;
}

.ssp-timer-strip {
  background: rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.28);
}
.ssp-timer-strip p {
  margin: 0;
  color: #0f766e;
  font-weight: 750;
}
.ssp-timer-strip.is-ended {
  background: rgba(225, 29, 72, 0.08);
  border-color: rgba(225, 29, 72, 0.25);
}
.ssp-timer-strip.is-ended p {
  color: #9f1239;
}

.ssp-extend-box {
  margin: 0.35rem 0.65rem 0.15rem;
  padding: 0.65rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(11, 31, 58, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.ssp-extend-box strong {
  font-size: 0.78rem;
  color: var(--ssp-navy);
}
.ssp-extend-box label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--ssp-muted);
}
.ssp-extend-box select,
.ssp-extend-box input[type="file"] {
  font: inherit;
  font-size: 0.78rem;
}
.ssp-ext-msg {
  margin: 0;
  font-size: 0.72rem;
  color: #0b3a7a;
}
.ssp-form.is-muted {
  opacity: 0.55;
  pointer-events: none;
}

.ssp-live-toast {
  position: fixed;
  top: calc(var(--nav-h, 72px) + 0.55rem);
  left: 0.75rem;
  right: 0.75rem;
  bottom: auto;
  max-width: 24rem;
  margin: 0 auto;
  z-index: 210;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #0b1f3a;
  color: #fff;
  box-shadow: 0 10px 28px rgba(11, 31, 58, 0.35);
  animation: ssp-toast-in 0.28s ease-out;
}
.ssp-live-toast.is-clickable {
  cursor: pointer;
}
.ssp-live-toast strong {
  font-size: 0.82rem;
  font-weight: 750;
}
.ssp-live-toast span {
  font-size: 0.74rem;
  opacity: 0.92;
  line-height: 1.35;
}
@keyframes ssp-toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
