/* GENERATED by scripts/build_css.py — do not edit.
   Edit the _*.css partials, then re-run the script (the deploy does it
   for you). Concatenated rather than @import-ed so the whole bundle
   inherits one content hash and loads in one request. */

/* ---- _base.css ---- */
/* Fonts load via <link> in base.html — do NOT @import here.
   A blocked/slow fonts.googleapis.com @import can prevent the rest of this
   file from applying (unstyled mobile offcanvas on production networks). */

:root {
  --ink: #14201b;
  --muted: #5c6b63;
  --paper: #f3f6f4;
  --panel: #ffffff;
  --line: #d7e0db;
  --brand: #0b6e4f;
  --brand-ink: #083b2c;

  /* Spacing — matches subs-page / card rhythms */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Radius — cards, panels, pills */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.15rem;
  --radius-pill: 999px;

  /* Elevation — entity cards (rest / hover / emphasis) */
  --shadow-sm: 0 1px 2px rgba(20, 32, 27, 0.04), 0 8px 24px rgba(20, 32, 27, 0.04);
  --shadow-md: 0 14px 36px rgba(20, 32, 27, 0.12);
  --shadow-lg: 0 24px 48px rgba(20, 32, 27, 0.16);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(11, 110, 79, 0.12), transparent 36%),
    linear-gradient(180deg, #e8f0eb 0%, var(--paper) 42%, #eef3f0 100%);
  min-height: 100vh;
}

h1, h2, .brand-mark {
  font-family: "Fraunces", Georgia, serif;
}

.admin-nav {
  background: linear-gradient(120deg, #0b6e4f, #0f513f);
}

.admin-nav__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.admin-nav__toggler {
  border-color: rgba(255, 255, 255, 0.35);
  padding: 0.35rem 0.5rem;
}

.admin-nav__toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
}

.admin-nav__brand {
  margin-right: 0;
}

.admin-nav__mobile-utils {
  margin-left: auto;
  gap: var(--space-1);
}

.admin-nav__icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-pill);
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.05rem;
  line-height: 1;
}

.admin-nav__icon-btn:hover,
.admin-nav__icon-btn:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

.nav-link--icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link--icon svg {
  opacity: 0.85;
}

.btn-nav-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.28rem 0.7rem 0.28rem 0.35rem;
}

.btn-nav-profile--compact {
  padding: 0.2rem;
  gap: 0;
}

.btn-nav-profile--compact::after {
  display: none;
}

.btn-nav-profile:hover,
.btn-nav-profile:focus,
.btn-nav-profile.show {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-nav-profile__avatar {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
}

.btn-nav-profile::after {
  margin-left: 0.15rem;
}


/* ---- _nav.css ---- */
/* Mobile left offcanvas — same AppPage tree as desktop nav.
   Explicit layout (not only --bs-* vars) so the drawer still looks correct
   if Bootstrap CDN CSS is delayed or blocked. */
.admin-nav-drawer.offcanvas,
.admin-nav-drawer {
  --bs-offcanvas-width: 300px;
  --bs-offcanvas-bg: var(--panel);
  --bs-offcanvas-color: var(--ink);
  --bs-offcanvas-border-color: var(--line);
  box-sizing: border-box;
  width: 300px;
  max-width: min(300px, 100vw);
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--ink);
  background-color: var(--panel);
  border-right: 1px solid var(--line);
}

.admin-nav-drawer__header {
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(11, 110, 79, 0.1), transparent 55%),
    var(--panel);
}

.admin-nav-drawer__brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.admin-nav-drawer__brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--brand-ink);
  text-decoration: none;
}

.admin-nav-drawer__brand:link,
.admin-nav-drawer__brand:visited,
.admin-nav-drawer__brand:hover,
.admin-nav-drawer__brand:active {
  text-decoration: none;
}

.admin-nav-drawer__brand:hover {
  color: var(--brand);
}

.admin-nav-drawer__user {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.admin-nav-drawer__user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.admin-nav-drawer__user-meta {
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-word;
}

.admin-nav-drawer__body {
  flex: 1 1 auto;
  padding: var(--space-3) var(--space-3) var(--space-4);
  overflow-y: auto;
}

.admin-nav-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.admin-nav-drawer__link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.admin-nav-drawer__link:link,
.admin-nav-drawer__link:visited,
.admin-nav-drawer__link:hover,
.admin-nav-drawer__link:active {
  color: var(--ink);
  text-decoration: none;
}

.admin-nav-drawer__link:hover {
  background: rgba(11, 110, 79, 0.08);
  color: var(--brand-ink);
}

.admin-nav-drawer__link.is-active {
  background: rgba(11, 110, 79, 0.14);
  color: var(--brand-ink);
  font-weight: 600;
}

.admin-nav-drawer__link--top {
  font-weight: 600;
}

.admin-nav-drawer__group {
  border-radius: var(--radius-sm);
}

.admin-nav-drawer__group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.admin-nav-drawer__group-toggle:hover {
  background: rgba(11, 110, 79, 0.08);
  color: var(--brand-ink);
}

.admin-nav-drawer__group.is-open > .admin-nav-drawer__group-toggle,
.admin-nav-drawer__group-toggle[aria-expanded="true"] {
  color: var(--brand-ink);
}

.admin-nav-drawer__chevron {
  font-size: 0.85rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.admin-nav-drawer__group-toggle[aria-expanded="true"] .admin-nav-drawer__chevron {
  transform: rotate(180deg);
}

.admin-nav-drawer__sublist {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-2) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.admin-nav-drawer__sublist .admin-nav-drawer__link {
  font-weight: 500;
  font-size: 0.9rem;
  padding-left: var(--space-4);
}

.admin-nav-drawer__footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.admin-nav-drawer__footer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.admin-nav-drawer__footer-link:link,
.admin-nav-drawer__footer-link:visited,
.admin-nav-drawer__footer-link:hover,
.admin-nav-drawer__footer-link:active {
  color: var(--ink);
  text-decoration: none;
}

.admin-nav-drawer__footer-link:hover {
  background: rgba(11, 110, 79, 0.08);
  color: var(--brand-ink);
}

.admin-nav-drawer__footer-link .bi {
  color: var(--muted);
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin-bottom: 0.25rem;
  font-size: 2rem;
}

.stat-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-tile span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-tile strong {
  font-size: 1.8rem;
  font-family: "Fraunces", Georgia, serif;
}

.auth-page,
.customer-page {
  min-height: 100vh;
}

.auth-shell,
.customer-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.customer-shell--auth {
  min-height: calc(100vh - 3rem);
  padding: 1rem 1.25rem 2rem;
  align-content: center;
}

.customer-card--auth {
  width: min(100%, 400px);
  padding: 1.5rem;
}

.customer-auth-header {
  text-align: center;
}

.customer-auth-header .customer-logo {
  max-height: 44px;
  margin-bottom: 0.75rem;
}

.auth-card,
.customer-card {
  width: min(100%, 440px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 18px 50px rgba(20, 32, 27, 0.08);
}

.customer-card {
  width: min(100%, 480px);
}

.brand-mark {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--brand);
}

.btn-primary,
.btn-brand {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-ink);
  --bs-btn-hover-border-color: var(--brand-ink);
  background: var(--brand);
  border-color: var(--brand);
}

.btn-brand:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
}

.detail-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.25rem 0 1.5rem;
}

.detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.65rem;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 500;
}

.detail-list dd {
  margin: 0;
  text-align: right;
}

.detail-list--compact {
  margin-bottom: 0.75rem;
}

.plan-option {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  cursor: pointer;
  background: #fff;
}

.plan-option span {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.plan-option em {
  font-style: normal;
  color: var(--muted);
}

.plan-option:has(input:checked) {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}


/* ---- _operations-forms.css ---- */

/* Growing form panels (e.g. Operations Compare) — scroll the card, not the page */
.settings-layout .settings-panel.settings-panel--scroll:not(:has(> .table-responsive)):not(:has(> .table-scroll-panel)) {
  max-height: min(40rem, calc(100vh - 12rem));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  min-width: 0;
}

.settings-layout .settings-panel.settings-panel--scroll:not(:has(> .table-responsive)):not(:has(> .table-scroll-panel)) .table-responsive {
  max-height: none;
  overflow: visible;
}

.table-scroll-panel,
.settings-layout .settings-panel .table-responsive {
  max-height: min(32rem, calc(100vh - 14rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.table-scroll-panel thead th,
.settings-layout .settings-panel .table-responsive thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7f5;
  box-shadow: 0 1px 0 var(--line);
}

.ops-sql-cell {
  max-width: 0;
  width: 55%;
}

.ops-sql-query,
.ops-cell-truncate {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-mikrotik-panel {
  max-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ops-trace-panel {
  max-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ops-trace-panel > .form-panel__header {
  flex-shrink: 0;
}

.ops-trace-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-bottom: 1rem;
}

.ops-mikrotik-panel > .form-panel__header,
.ops-mikrotik-summary,
.ops-mikrotik-commands,
.ops-mikrotik-log .ops-filter-tabs {
  flex-shrink: 0;
}

.ops-mikrotik-log {
  flex: 1 1 auto;
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-scroll-panel.table-scroll-panel--compact,
.settings-layout .settings-panel .table-responsive.table-scroll-panel--compact {
  max-height: 10rem;
}

.settings-layout .settings-panel .table-responsive.table-scroll-panel--fill,
.ops-mikrotik-log .table-scroll-panel.table-scroll-panel--fill {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.ops-mikrotik-cmd {
  max-width: 0;
  width: 22%;
}

.ops-mikrotik-detail {
  max-width: 0;
  width: 28%;
}

.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.env-badge--live {
  background: rgba(11, 110, 79, 0.14);
  color: #0B6E4F;
}

.env-badge--sandbox {
  background: rgba(180, 110, 20, 0.16);
  color: #9a4b00;
}

.env-badge--sm {
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
}

.env-badge--live::before,
.env-badge--sandbox::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.gw-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5c6b64;
  background: #e8ecea;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.gw-webhook-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.gw-copy {
  flex-shrink: 0;
  padding: 0.2rem 0.35rem;
  color: var(--muted);
}

.gw-copy:hover,
.gw-copy.is-copied {
  color: var(--brand);
}

.connection-status {
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.connection-status.is-ok {
  border-color: rgba(11, 110, 79, 0.28);
  background: rgba(11, 110, 79, 0.06);
}

.connection-status.is-bad {
  border-color: rgba(176, 50, 50, 0.25);
  background: rgba(176, 50, 50, 0.05);
}

.connection-status__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.connection-status__label {
  color: var(--muted);
}

.secret-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #f7faf8;
}

.secret-display code {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.pay-wait-pulse {
  width: 3rem;
  height: 3rem;
  margin: 1.25rem auto;
  border-radius: 50%;
  border: 3px solid rgba(11, 110, 79, 0.2);
  border-top-color: var(--brand, #0B6E4F);
  animation: pay-spin 0.9s linear infinite;
}

@keyframes pay-spin {
  to { transform: rotate(360deg); }
}

.app-footer {
  margin-top: 2.5rem;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

.license-banner {
  background: #9a4b00;
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
}

.license-banner--grace {
  background: #7a5a00;
}

.license-banner--expired {
  background: #8b1e1e;
}

.license-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.license-tabs__link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm, 6px);
}

.license-tabs__link:hover {
  color: var(--text);
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
}

.license-tabs__link.is-active {
  color: var(--text);
  background: var(--surface-2, rgba(0, 0, 0, 0.06));
}

.connection-status.is-warn {
  border-color: #c48a00;
}

body.customer-page .app-footer {
  margin-top: 1.5rem;
}

.auth-logo {
  display: block;
  max-height: 48px;
  max-width: 160px;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.branding-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 991.98px) {
.branding-grid {
    grid-template-columns: 1fr;
  }
}

.branding-preview {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #f7faf8;
}

.branding-preview__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.branding-preview__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

/* After all branding base rules so mobile wins the cascade. */
@media (max-width: 767.98px) {
.settings-layout--branding {
    grid-template-columns: 1fr;
  }
.branding-preview {
    position: static;
    top: auto;
  }
.branding-preview__tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
.branding-preview__tabs::-webkit-scrollbar {
    display: none;
  }
}

/* ---- _loader.css ---- */
/* Staff / Roles / Tenants — shared entity admin surfaces */
.form-panel__body {
  padding: var(--space-5) var(--space-6);
}

.form-panel__body--flush {
  padding: 0;
}

.form-panel__body--flush .table {
  margin-bottom: 0;
}

.form-panel__body--flush .dash-table thead th {
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.form-panel__body--flush .dash-table tbody td {
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.admin-toolbar {
  margin-bottom: var(--space-6);
}

.admin-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-end;
  margin-left: auto;
}

.admin-toolbar .btn-create {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.admin-role-list {
  display: grid;
  gap: var(--space-4);
}

.admin-perm-scroll {
  max-height: min(34rem, 65vh);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: var(--space-2);
}

.admin-perm-scroll--edit {
  max-height: min(30rem, 60vh);
}

.admin-perm-group {
  margin-bottom: var(--space-3);
}

.admin-perm-group__title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.staff-overflow,
.dash-table .sub-overflow {
  margin-left: 0;
  display: inline-flex;
  justify-content: flex-end;
}

@media (max-width: 575.98px) {
.admin-toolbar__actions {
    width: 100%;
  }
.admin-toolbar__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ?? ISP Loader — branded MikroTik / navigation overlay + skeletons ?? */
.isp-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.isp-loader.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.isp-loader__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 32, 27, 0.28);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  cursor: default;
}

.isp-loader__card {
  position: relative;
  z-index: 1;
  width: min(100%, 22.5rem);
  padding: var(--space-6) var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.isp-loader__brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-ink);
  margin-bottom: var(--space-4);
}

.isp-loader__orb {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto var(--space-4);
  display: grid;
  place-items: center;
  color: var(--brand);
}

.isp-loader__globe {
  position: relative;
  z-index: 1;
}

.isp-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(11, 110, 79, 0.18);
  border-top-color: var(--brand);
  animation: isp-loader-spin 0.85s linear infinite;
}

@keyframes isp-loader-spin {
  to { transform: rotate(360deg); }
}

.isp-loader__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.35;
}

.isp-loader__sub {
  margin: var(--space-2) 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.isp-loader__bar {
  margin-top: var(--space-4);
  height: 0.28rem;
  border-radius: var(--radius-pill);
  background: rgba(11, 110, 79, 0.12);
  overflow: hidden;
}

.isp-loader__bar-fill {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(11, 110, 79, 0.35), var(--brand));
  animation: isp-loader-bar 1.35s ease-in-out infinite;
}

@keyframes isp-loader-bar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.isp-loader__timer {
  margin: var(--space-3) 0 0;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.isp-loader__slow {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  text-align: center;
}

.isp-loader__slow-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink);
}

.isp-loader__slow-copy {
  margin: var(--space-2) 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.isp-loader__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

html.isp-loader-active,
body.isp-loader-active {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
.isp-loader__ring,
  .isp-loader__bar-fill {
    animation: none;
  }
.isp-loader__bar-fill {
    width: 70%;
    transform: none;
  }
}


/* ---- _ai-chat.css ---- */
/* Support assistant widget — floating bubble + panel.
   Shared by the admin panel, customer portals and the public site. */

.ai-chat {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1050;
  display: flex;
  /* Bubble stays anchored at the bottom and the panel grows upward from it.
     The markup lists the bubble first (it is the control, and should come
     first for keyboard order), so the visual order is reversed here rather
     than moving the panel above it in the DOM. */
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.6rem;
  /* Host pages set their own alignment; the widget must not inherit it. */
  text-align: left;
}

.ai-chat__bubble {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(20, 32, 27, 0.22);
  transition: transform 0.15s ease, background 0.15s ease;
}

.ai-chat__bubble:hover {
  background: var(--brand-ink);
  transform: translateY(-2px);
}

.ai-chat__panel {
  width: min(23rem, calc(100vw - 2rem));
  /* A set height, not just a cap: with only the greeting in it the panel would
     otherwise shrink-wrap to a few lines and feel cramped. The log scrolls
     inside. Still never taller than the viewport. */
  height: min(34rem, calc(100vh - 7rem));
  max-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(20, 32, 27, 0.2);
}

.ai-chat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 8%, #fff);
}

.ai-chat__title {
  display: block;
  font-size: 0.95rem;
}

.ai-chat__sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.ai-chat__close {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.15rem;
  line-height: 1;
}

.ai-chat__close:hover {
  color: var(--ink);
}

.ai-chat__log {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ai-chat__msg {
  max-width: 85%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
  /* Model replies arrive as plain text with newlines; keep them readable
     without ever interpreting the content as markup. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-chat__msg--bot {
  align-self: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}

.ai-chat__msg--user {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
}

.ai-chat__escalate {
  padding: 0 0.85rem 0.6rem;
}

.ai-chat__form {
  display: flex;
  gap: 0.4rem;
  padding: 0.7rem 0.85rem 0.85rem;
  border-top: 1px solid var(--line);
}

.ai-chat__form .form-control {
  border-radius: var(--radius-pill);
}

.ai-chat__form .btn {
  border-radius: var(--radius-pill);
  padding-inline: 0.9rem;
}

@media (max-width: 575.98px) {
  .ai-chat {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .ai-chat__panel {
    height: min(30rem, calc(100vh - 6rem));
    max-height: calc(100vh - 6rem);
  }
}
