/* =============================================================================
   Subscriber portal — premium read-only experience (login · overview · invoices).
   Mobile-first; brand-forward; shares the console design tokens & components.
   All values via tokens — light/dark + 3 theme skins inherit automatically.
   ========================================================================== */

.subscriber-portal {
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}

/* Brand-tinted ambient backdrop — premium depth, never over content/text. */
.subscriber-portal::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 55% at 50% -8%,
    color-mix(in srgb, var(--accent) 13%, transparent), transparent 68%);
}
.subscriber-portal > * { position: relative; z-index: 1; }

/* ---------------------------------------------------------------------------
   TOP BAR
   -------------------------------------------------------------------------- */
.subscriber-portal__bar {
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) clamp(var(--space-4), 4vw, var(--space-6));
  border-block-end: var(--border-width) solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-sticky);
}
.subscriber-portal__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-md);
  letter-spacing: var(--tracking-tight);
}
html[lang="ar"] .subscriber-portal__brand { font-family: var(--font-arabic); }
.subscriber-portal__brand-logo {
  inline-size: 1.65rem; block-size: 1.65rem; flex: none;
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--accent) 30%, transparent));
}

/* ---------------------------------------------------------------------------
   MAIN / CARD
   -------------------------------------------------------------------------- */
.subscriber-portal__main {
  flex: 1;
  display: grid;
  place-items: start center;
  inline-size: 100%;
  padding: clamp(var(--space-5), 5vw, var(--space-8)) var(--space-4);
}
.subscriber-portal__card {
  inline-size: min(100%, 52rem);
  border-radius: var(--radius-xl);
}
/* Login = focused, tighter card. */
.subscriber-portal__card--narrow { inline-size: min(100%, 25rem); }

/* ---------------------------------------------------------------------------
   LOGIN
   -------------------------------------------------------------------------- */
.subscriber-portal__brandhead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  margin-block-end: var(--space-2);
}
.subscriber-portal__brandhead-logo {
  inline-size: 2.75rem; block-size: 2.75rem;
  filter: drop-shadow(0 4px 14px color-mix(in srgb, var(--accent) 34%, transparent));
}
.subscriber-portal__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
html[lang="ar"] .subscriber-portal__title { font-family: var(--font-arabic); }
.subscriber-portal__form { text-align: start; }
.subscriber-portal__secure {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  margin-block-start: var(--space-2);
  color: var(--text-muted); font-size: var(--text-xs);
}

/* ---------------------------------------------------------------------------
   DASHBOARD — hero
   -------------------------------------------------------------------------- */
.subscriber-portal__hero {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-block-end: var(--space-4);
  border-block-end: var(--border-width) solid var(--divider);
}
.subscriber-portal__dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block-end: var(--space-3);
  border-block-end: var(--border-width) solid var(--divider);
}
.subscriber-portal__dashboard-copy {
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.subscriber-portal__dashboard-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
}
html[lang="ar"] .subscriber-portal__dashboard-title { font-family: var(--font-arabic); }
.subscriber-portal__dashboard-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.subscriber-portal__dashboard-status { flex: none; }
.subscriber-portal__hero-avatar {
  inline-size: 3rem; block-size: 3rem; border-radius: var(--radius-lg);
  display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent);
  border: var(--border-width) solid var(--accent-soft-border);
  font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-lg);
}
.subscriber-portal__hero-meta { display: flex; flex-direction: column; gap: var(--space-1); min-inline-size: 0; }
.subscriber-portal__hero .subscriber-portal__title { font-size: var(--text-xl); }
.subscriber-portal__hero-phone { margin: 0; color: var(--text-2); font-size: var(--text-sm); }

/* ---------------------------------------------------------------------------
   KPI GRID
   -------------------------------------------------------------------------- */
.subscriber-portal__kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: var(--space-3);
}
.kpi--compact,
.subscriber-portal__kpi {
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  min-inline-size: 0;
}
.kpi--compact .kpi__label,
.subscriber-portal__kpi .kpi__label {
  color: var(--text-muted); font-size: var(--text-2xs);
  font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide);
}
.kpi--compact .kpi__value,
.subscriber-portal__kpi .kpi__value {
  font-family: var(--font-display); font-weight: var(--weight-bold);
  font-size: var(--text-lg); line-height: var(--leading-tight);
  margin-block-start: var(--space-1); word-break: break-word;
}
/* Drop the premium theme's corner-orb + diamond KPI signature on these compact
   portal tiles — it clips awkwardly at this size. Keep the tiles clean. */
.subscriber-portal__kpi.kpi--compact::before,
.subscriber-portal__kpi.kpi--compact::after { content: none; }
/* Odd KPI count (5: plan/speed/usage/due/balance) leaves the last card alone on a
   row — let it span full width instead of a dead gap (also emphasizes the balance). */
.subscriber-portal__kpi-grid > .subscriber-portal__kpi:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* ---------------------------------------------------------------------------
   FUP METER
   -------------------------------------------------------------------------- */
.subscriber-portal__fup {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

/* ---------------------------------------------------------------------------
   BOOST BANNER
   -------------------------------------------------------------------------- */
.subscriber-portal__boost {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-3); text-align: center;
}

/* ---------------------------------------------------------------------------
   INVOICES TIMELINE
   -------------------------------------------------------------------------- */
.subscriber-portal__invoice-item {
  border-inline-start: 3px solid var(--accent);
  transition: box-shadow var(--dur-2) var(--ease-standard),
              border-color var(--dur-2) var(--ease-standard);
}
.subscriber-portal__invoice-item:hover { box-shadow: var(--shadow-1); }
.subscriber-portal__invoice-item .badge--danger {
  --badge-bg: color-mix(in srgb, var(--danger) 12%, transparent);
}

/* ---------------------------------------------------------------------------
   LOGOUT
   -------------------------------------------------------------------------- */
.subscriber-portal__logout { align-self: flex-start; margin-block-start: var(--space-2); }

@media (min-width: 48rem) {
  .subscriber-portal__card { inline-size: min(100%, 54rem); }
  /* On wider screens, vertically center the focused login card (the dashboard,
     which is taller, stays top-aligned) for a balanced, premium composition. */
  .subscriber-portal__main:has(.subscriber-portal__card--narrow) { place-items: center; }
  .subscriber-portal__card--narrow { inline-size: min(100%, 25rem); }
}

/* ===========================================================================
   RICH DASHBOARD WIDGETS — live speed · consumption · peak · heatmap · daily.
   All token-driven (light/dark + 3 skins inherit). Charts are hand-built SVG.
   =========================================================================== */
.subscriber-portal__kpi--accent {
  background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface));
  border-color: var(--accent-soft-border, var(--accent));
}
.subscriber-portal__kpi--accent .kpi__value { color: var(--accent); }
.kpi__meta { color: var(--text-muted); font-size: var(--text-2xs); font-family: var(--font-mono); }

/* LIVE SPEED PANEL */
.subscriber-portal__live {
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
  border-color: var(--border);
}
.subscriber-portal__live.is-online {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.subscriber-portal__live-dot {
  inline-size: .55rem; block-size: .55rem; border-radius: 50%; flex: none;
  background: var(--text-muted);
}
.subscriber-portal__live-dot.is-online {
  background: var(--ok);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent);
  animation: portal-live-pulse 2s ease-out infinite;
}
@keyframes portal-live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  100% { box-shadow: 0 0 0 .5rem transparent; }
}
@media (prefers-reduced-motion: reduce) { .subscriber-portal__live-dot.is-online { animation: none; } }
.subscriber-portal__live-state { font-size: var(--text-xs); color: var(--text-muted); font-weight: var(--weight-semibold); }
.subscriber-portal__live-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3);
  margin-block-start: var(--space-3);
}
.subscriber-portal__live-metric { display: flex; flex-direction: column; gap: var(--space-1); min-inline-size: 0; }
.subscriber-portal__live-cap {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide);
}
.subscriber-portal__live-row { display: flex; align-items: baseline; gap: var(--space-1); }
.subscriber-portal__live-num {
  font-family: var(--font-display); font-weight: var(--weight-extrabold);
  font-size: var(--text-2xl); line-height: 1; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.subscriber-portal__live-unit { font-size: var(--text-2xs); }
.subscriber-portal__live-track {
  block-size: .4rem; border-radius: 999px; overflow: hidden;
  background: var(--surface-3);
}
.subscriber-portal__live-fill { block-size: 100%; inline-size: 0; border-radius: 999px; transition: inline-size .6s cubic-bezier(.22, .61, .36, 1); }
@media (prefers-reduced-motion: reduce) { .subscriber-portal__live-fill { transition: none; } }
.subscriber-portal__live-fill--down { background: var(--accent); }
.subscriber-portal__live-fill--up { background: var(--c-1, var(--text-muted)); }
/* Fixed-height box; the custom sparkline SVG fills it 100% (viewBox stretched).
   non-scaling-stroke keeps the line crisp despite the non-uniform stretch. */
.subscriber-portal__spark {
  position: relative;
  block-size: 4.5rem;
  margin-block-start: var(--space-3);
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.subscriber-portal__spark-svg { display: block; inline-size: 100%; block-size: 100%; }
/* "Now" marker riding the newest down sample at the right edge — the strongest
   at-a-glance signal that the line is live. JS sets `top`; we pin it to the
   physical right edge (the latest point is always at viewBox x=100). */
.subscriber-portal__spark-pulse {
  position: absolute; inset-inline: auto; right: 3px;
  inline-size: .5rem; block-size: .5rem; transform: translateY(-50%);
  border-radius: 50%; background: var(--accent); pointer-events: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
  animation: portal-spark-pulse 1.6s ease-out infinite;
}
@keyframes portal-spark-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 .5rem transparent; }
}
@media (prefers-reduced-motion: reduce) { .subscriber-portal__spark-pulse { animation: none; } }
.subscriber-portal__spark-area { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: none; }
.subscriber-portal__spark-down {
  fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.subscriber-portal__spark-up {
  fill: none; stroke: var(--c-1, var(--text-muted)); stroke-width: 1.5;
  stroke-dasharray: 3 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: .8;
}
.subscriber-portal__live-avg { margin: var(--space-2) 0 0; font-size: var(--text-xs); }
.subscriber-portal__live-session { margin: var(--space-1) 0 0; font-size: var(--text-xs); }
/* idle = amber dot; active = green pulse */
.subscriber-portal__live-dot.is-online { background: var(--warn); animation: none; }
.subscriber-portal__live-dot.is-online.is-active {
  background: var(--ok);
  animation: portal-live-pulse 2s ease-out infinite;
}

/* CONSUMPTION + FUP DONUT */
.subscriber-portal__consume {
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: center;
}
.subscriber-portal__donut { inline-size: 10.5rem; flex: none; }
.subscriber-portal__donut .chart-wrap--donut { inline-size: 100%; }
.subscriber-portal__consume-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  border: var(--border-width) solid var(--border);
}
.subscriber-portal__consume-ic { display: inline-grid; place-items: center; color: var(--text-muted); }
.subscriber-portal__consume-row--down .subscriber-portal__consume-ic { color: var(--accent); }
.subscriber-portal__consume-row--up .subscriber-portal__consume-ic { color: var(--c-1, var(--text-2)); }
.subscriber-portal__consume-label { font-size: var(--text-xs); min-inline-size: 0; }
.subscriber-portal__consume-val { font-size: var(--text-sm); }
.subscriber-portal__consume-only { margin-block-start: var(--space-1); }

/* PEAK STAT TILES */
.subscriber-portal__stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: var(--space-3);
}
.subscriber-portal__stat {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}
.subscriber-portal__stat-icon {
  display: inline-grid; place-items: center; flex: none;
  inline-size: 2.25rem; block-size: 2.25rem; border-radius: var(--radius-md);
  background: var(--surface-3); color: var(--text-muted);
}
.subscriber-portal__stat--ok .subscriber-portal__stat-icon { background: var(--ok-soft); color: var(--ok); }
.subscriber-portal__stat--info .subscriber-portal__stat-icon { background: var(--accent-soft); color: var(--accent); }
.subscriber-portal__stat-body { display: flex; flex-direction: column; gap: 1px; min-inline-size: 0; }
.subscriber-portal__stat-label { font-size: var(--text-2xs); color: var(--text-muted); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); }
.subscriber-portal__stat-value { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-md); line-height: var(--leading-tight); }
.subscriber-portal__stat-meta { font-size: var(--text-2xs); }

/* Measurements are inherently LTR — isolate so numbers + units (↓ 4.2 Mbps,
   "40 GB", "5h 10m") never get reordered by the bidi algorithm under RTL. */
.subscriber-portal__live-num,
.subscriber-portal__live-session,
.subscriber-portal__consume-val,
.subscriber-portal__stat-value,
.subscriber-portal__stat-meta,
.kpi__meta { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .subscriber-portal__live-session,
html[dir="rtl"] .subscriber-portal__consume-val,
html[dir="rtl"] .subscriber-portal__stat-value,
html[dir="rtl"] .subscriber-portal__stat-meta { text-align: end; }

/* HEATMAP + DAILY BARS */
.subscriber-portal__heatmap { inline-size: 100%; overflow-x: auto; }
.subscriber-portal__heatmap .chart-wrap--heatmap { min-inline-size: 22rem; }
.subscriber-portal__bars { inline-size: 100%; }

@media (max-width: 34rem) {
  .subscriber-portal__live-grid { grid-template-columns: 1fr; }
  .subscriber-portal__consume { grid-template-columns: 1fr; justify-items: center; }
  .subscriber-portal__donut { inline-size: 9rem; }
}

/* SUBSCRIPTIONS + SUPPORT — token-driven; matches invoice/live/stat surfaces. */
.subscriber-portal__section-head { display: flex; flex-direction: column; gap: var(--space-1); min-inline-size: 0; }
.subscriber-portal__section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
html[lang="ar"] .subscriber-portal__section-title { font-family: var(--font-arabic); }
.subscriber-portal__section-lede { margin: 0; font-size: var(--text-sm); }
.subscriber-portal__thread-title { margin: 0; font-size: var(--text-sm); }

/* Five tabs — horizontal scroll strip (overrides generic tab flex-stretch on narrow screens). */
.subscriber-portal__tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  margin-inline: calc(-1 * var(--space-1));
  padding-inline: var(--space-1);
}
.subscriber-portal__tabs::-webkit-scrollbar { display: none; }
.subscriber-portal__tabs .tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  white-space: nowrap;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: color var(--dur-2) var(--ease-standard),
              background var(--dur-2) var(--ease-standard),
              border-color var(--dur-2) var(--ease-standard);
}
/* Active tab stays visually current — hover must not reset to idle/inactive look. */
.subscriber-portal__tabs .tab:is([aria-selected="true"], .is-active) {
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
  font-weight: var(--weight-bold);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}
.subscriber-portal__tabs .tab:is([aria-selected="true"], .is-active):hover,
.subscriber-portal__tabs .tab:is([aria-selected="true"], .is-active):focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}
.subscriber-portal__tabs .tab:not([aria-selected="true"]):not(.is-active):hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
}
@media (max-width: 480px) {
  .subscriber-portal__tabs .tab {
    flex: 0 0 auto;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }
}

/* Subscription cards — same accent rail + hover as invoices. */
.subscriber-portal__svc-card {
  border-inline-start: 3px solid var(--accent);
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
  transition: box-shadow var(--dur-2) var(--ease-standard),
              border-color var(--dur-2) var(--ease-standard);
}
.subscriber-portal__svc-card:hover { box-shadow: var(--shadow-1); }
.subscriber-portal__svc-plan {
  margin: var(--space-2) 0 var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}
html[lang="ar"] .subscriber-portal__svc-plan { font-family: var(--font-arabic); }
.subscriber-portal__svc-kpi { margin-block-start: var(--space-3); }
.subscriber-portal__svc-kpi > .subscriber-portal__kpi:last-child:nth-child(odd) { grid-column: auto; }
.subscriber-portal__svc-details { margin-block-start: var(--space-3); }
.subscriber-portal__svc-flag { align-self: flex-start; margin-block-start: var(--space-2); }

/* Support panels — same surface treatment as live speed card. */
.subscriber-portal__panel {
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
  border-color: var(--border);
}
.subscriber-portal__support-head { align-items: flex-end; }
.subscriber-portal__back {
  align-self: flex-start;
  min-block-size: 2.75rem;
  gap: var(--space-1);
  padding-inline: var(--space-2);
}
html[dir="rtl"] .subscriber-portal__back svg { transform: scaleX(-1); }
.subscriber-portal__form-actions { margin-block-start: var(--space-1); }
.subscriber-portal__closed-hint {
  margin: 0;
  padding: var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  border: var(--border-width) dashed var(--border);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

/* Ticket list rows — invoice-item pattern + chevron affordance. */
.subscriber-portal__ticket-item {
  inline-size: 100%;
  text-align: start;
  cursor: pointer;
  border-inline-start: 3px solid var(--border);
  transition: border-color var(--dur-2) var(--ease-standard),
              box-shadow var(--dur-2) var(--ease-standard),
              background var(--dur-2) var(--ease-standard);
}
.subscriber-portal__ticket-item:hover {
  border-inline-start-color: var(--accent);
  box-shadow: var(--shadow-1);
}
.subscriber-portal__ticket-item:focus-visible {
  outline: var(--ring-width) solid color-mix(in srgb, var(--accent) 68%, transparent);
  outline-offset: 2px;
}
.subscriber-portal__ticket-item-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.subscriber-portal__ticket-item-body { flex: 1; min-inline-size: 0; }
.subscriber-portal__ticket-chevron {
  flex: none;
  color: var(--text-muted);
  opacity: .75;
  transition: transform var(--dur-2) var(--ease-standard), color var(--dur-2) var(--ease-standard);
}
.subscriber-portal__ticket-item:hover .subscriber-portal__ticket-chevron {
  color: var(--accent);
  transform: translateX(2px);
}
html[dir="rtl"] .subscriber-portal__ticket-item:hover .subscriber-portal__ticket-chevron {
  transform: translateX(-2px);
}
.subscriber-portal__ticket-header {
  border-inline-start: 3px solid var(--accent);
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
}
.subscriber-portal__ticket-meta { margin-block-start: var(--space-2); }

/* Message thread */
.subscriber-portal__msg {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  border: var(--border-width) solid var(--border);
}
.subscriber-portal__msg--mine {
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}
.subscriber-portal__msg--support {
  border-inline-start: 3px solid color-mix(in srgb, var(--accent) 55%, var(--border));
}
.subscriber-portal__msg-body {
  margin: var(--space-2) 0 0;
  white-space: pre-wrap;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

/* Numbers, IDs, speeds — LTR isolate under RTL (same as live/KPI panels). */
.subscriber-portal__measure,
.subscriber-portal__ticket-meta .text-muted { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .subscriber-portal__measure { text-align: end; }

@media (max-width: 34rem) {
  .subscriber-portal__dashboard-head { align-items: flex-start; flex-direction: column; }
  .subscriber-portal__support-head { align-items: stretch; }
  .subscriber-portal__support-head .btn { inline-size: 100%; justify-content: center; }
  .subscriber-portal__svc-kpi { grid-template-columns: 1fr; }
}
