/*
 * Horizon V10 — system theme + layout precision layer.
 * Source of truth: horizon-builderkit-full-clone/src/app/globals.css
 * Loaded last. Keep this file intentionally neutral: light = high-contrast dark text,
 * dark = high-contrast light text. Brand/status colours remain semantic only.
 */

/* 1) Exact Horizon BuilderKit system tokens. */
:root,
html[data-theme="light"] {
  --hz-bg: oklch(1 0 0);
  --hz-text: oklch(0.145 0 0);
  --hz-surface: oklch(1 0 0);
  --hz-surface-text: oklch(0.145 0 0);
  --hz-card: oklch(0.97 0 0);
  --hz-card-text: oklch(0.205 0 0);
  --hz-muted: oklch(0.556 0 0);
  --hz-faint: oklch(0.556 0 0 / .78);
  --hz-primary: var(--ui-accent, #2563eb);
  --hz-primary-foreground: var(--ui-accent-foreground, #fff);
  --hz-secondary: oklch(0.97 0 0);
  --hz-secondary-foreground: oklch(0.205 0 0);
  --hz-accent: oklch(0.97 0 0);
  --hz-accent-foreground: oklch(0.205 0 0);
  --hz-border: oklch(0.922 0 0);
  --hz-input: oklch(0.922 0 0);
  --hz-ring: oklch(0.708 0 0);
  --hz-destructive: oklch(0.577 0.245 27.325);
  --hz-success: oklch(0.59 0.14 160);
  --hz-warning: oklch(0.67 0.15 70);
  --hz-shadow: oklch(0.145 0 0 / .08);
  --hz-scroll: oklch(0.145 0 0 / .18);
  --hz-scroll-hover: oklch(0.145 0 0 / .30);
  color-scheme: light;
}
html.dark,
html[data-theme="dark"] {
  --hz-bg: oklch(0.145 0 0);
  --hz-text: oklch(0.985 0 0);
  --hz-surface: oklch(0.205 0 0);
  --hz-surface-text: oklch(0.985 0 0);
  --hz-card: oklch(0.269 0 0);
  --hz-card-text: oklch(0.985 0 0);
  --hz-muted: oklch(0.708 0 0);
  --hz-faint: oklch(0.708 0 0 / .80);
  --hz-primary: var(--ui-accent, #2563eb);
  --hz-primary-foreground: var(--ui-accent-foreground, #fff);
  --hz-secondary: oklch(0.269 0 0);
  --hz-secondary-foreground: oklch(0.985 0 0);
  --hz-accent: oklch(0.269 0 0);
  --hz-accent-foreground: oklch(0.985 0 0);
  --hz-border: oklch(1 0 0 / 10%);
  --hz-input: oklch(1 0 0 / 15%);
  --hz-ring: oklch(0.556 0 0);
  --hz-destructive: oklch(0.704 0.191 22.216);
  --hz-success: oklch(0.72 0.15 160);
  --hz-warning: oklch(0.79 0.14 80);
  --hz-shadow: oklch(0 0 0 / .32);
  --hz-scroll: oklch(1 0 0 / .18);
  --hz-scroll-hover: oklch(1 0 0 / .32);
  color-scheme: dark;
}

body.horizon {
  --ui-bg: var(--hz-bg) !important;
  --ui-surface: var(--hz-surface) !important;
  --ui-surface-soft: var(--hz-card) !important;
  --ui-card: var(--hz-surface) !important;
  --ui-text: var(--hz-text) !important;
  --ui-text-soft: var(--hz-muted) !important;
  --ui-text-faint: var(--hz-faint) !important;
  --ui-border: var(--hz-border) !important;
  --admin-canvas: var(--hz-bg) !important;
  --admin-paper: var(--hz-surface) !important;
  --admin-paper-2: var(--hz-card) !important;
  --admin-ink: var(--hz-text) !important;
  --admin-ink-2: var(--hz-text) !important;
  --admin-muted: var(--hz-muted) !important;
  --admin-faint: var(--hz-faint) !important;
  --admin-line: var(--hz-border) !important;
  background: var(--hz-bg) !important;
  color: var(--hz-text) !important;
}

/* 2) Text must stay readable in both modes, including legacy AdminLTE pages. */
body.horizon :is(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6,.card-title,.modal-title,.page-title,.dashboard-title,.admin-page-title,.form-label,label,strong,b,.fw-bold,.font-weight-bold) {
  color: var(--hz-text) !important;
}
body.horizon :is(p,.text-muted,.small,small,.form-text,.help-block,.description,.subtitle,.dashboard-subtitle,.admin-page-subtitle) {
  color: var(--hz-muted) !important;
}
body.horizon :is(.text-dark,.text-body,.text-secondary) { color: var(--hz-text) !important; }
body.horizon a:not(.btn):not(.hz-button):not(.profile-btn-v3) { color: var(--hz-text); }
body.horizon a:not(.btn):not(.hz-button):not(.profile-btn-v3):hover { color: var(--hz-text); opacity: .78; }

/* Legacy hard-coded surfaces become token based. */
body.horizon :is(.card,.card-body,.card-header,.card-footer,.modal-content,.modal-header,.modal-body,.modal-footer,.dropdown-menu,.popover,.list-group-item,.info-box,.small-box,.modern-card,.custom-card,.admin-panel,.admin-card,.glass-card,.profile-side-v3,.profile-panel-v3,.profile-hero-v3) {
  border-color: var(--hz-border) !important;
  background-color: var(--hz-surface) !important;
  color: var(--hz-text) !important;
}
body.horizon :is(.card-header,.card-footer,.modal-header,.modal-footer,.modern-table thead th,.table thead th,.table-light,.bg-light,.bg-white) {
  background-color: var(--hz-card) !important;
  color: var(--hz-text) !important;
  border-color: var(--hz-border) !important;
}
body.horizon :is(.modern-table td,.modern-table th,.table td,.table th,.admin-clean-table td,.admin-clean-table th) {
  color: var(--hz-text) !important;
  border-color: var(--hz-border) !important;
}
body.horizon :is(.modern-table tbody tr,.table tbody tr,.admin-clean-table tbody tr) { background: transparent !important; }
body.horizon :is(.modern-table tbody tr:hover,.table tbody tr:hover,.admin-clean-table tbody tr:hover) { background: var(--hz-card) !important; }

/* 3) Action buttons follow Horizon's system theme pair, not hard-coded orange/blue. */
body.horizon :is(
  .btn-primary,.btn-info,.btn-warning,
  .btn-gradient,.btn-gradient-sm,.btn-save,.btn-login,.login-do-btn,
  .hz-primary-button,.profile-btn-v3--primary,.tcb-btn-primary,.captcha-btn--primary,
  .captcha-primary-action,.filter-btn,.btn-edit,.btn-edit-sm,
  .admin-overview__button--primary,.renew-pay-button,.submit-btn,.save-btn,.add-btn
) {
  background: var(--hz-primary) !important;
  background-image: none !important;
  border-color: var(--hz-primary) !important;
  color: var(--hz-primary-foreground) !important;
  -webkit-text-fill-color: var(--hz-primary-foreground) !important;
  box-shadow: none !important;
}
body.horizon :is(
  .btn-primary,.btn-info,.btn-warning,.btn-gradient,.btn-gradient-sm,.btn-save,.btn-login,.login-do-btn,
  .hz-primary-button,.profile-btn-v3--primary,.tcb-btn-primary,.captcha-btn--primary,.captcha-primary-action,
  .filter-btn,.btn-edit,.btn-edit-sm,.admin-overview__button--primary,.renew-pay-button,.submit-btn,.save-btn,.add-btn
):is(:hover,:focus-visible,:active) {
  background: color-mix(in srgb,var(--hz-primary) 88%,var(--hz-bg)) !important;
  border-color: var(--hz-primary) !important;
  color: var(--hz-primary-foreground) !important;
  -webkit-text-fill-color: var(--hz-primary-foreground) !important;
}
body.horizon :is(
  .btn-secondary,.btn-light,.btn-outline-secondary,.btn-default,.btn-outline-dark,
  .profile-btn-v3:not(.profile-btn-v3--primary),.hz-button,.hz-small-button,.btn-outline-glass,
  .btn-cancel-edit,.btn-back,.captcha-btn--secondary,.tcb-btn-soft,.tcb-icon-btn,.btn-copy,.copy-btn,
  .captcha-copy-btn,.admin-overview__button:not(.admin-overview__button--primary)
) {
  background: var(--hz-surface) !important;
  border-color: var(--hz-border) !important;
  color: var(--hz-text) !important;
  -webkit-text-fill-color: var(--hz-text) !important;
  box-shadow: none !important;
}
body.horizon :is(.btn-secondary,.btn-light,.btn-outline-secondary,.btn-default,.btn-outline-dark,.hz-button,.hz-small-button,.btn-outline-glass,.profile-btn-v3:not(.profile-btn-v3--primary)):is(:hover,:focus-visible) {
  background: var(--hz-card) !important;
  color: var(--hz-text) !important;
}
/* Status/destructive actions remain semantic but adapt contrast to mode. */
body.horizon :is(.btn-danger,.btn-delete,.delete-btn,.danger-btn) { background: var(--hz-destructive) !important; border-color: var(--hz-destructive) !important; color: #fff !important; -webkit-text-fill-color:#fff !important; }
body.horizon :is(.btn-success,.success-btn) { background: var(--hz-success) !important; border-color: var(--hz-success) !important; color: #fff !important; -webkit-text-fill-color:#fff !important; }
body.horizon :is(button,.btn,.hz-button,.hz-small-button,.profile-btn-v3) { min-width: 0; max-width: 100%; }
body.horizon :is(.btn,.hz-button,.hz-small-button,.hz-primary-button,.profile-btn-v3,.tcb-btn,.captcha-btn,.action-btn,.admin-action-btn,.table-action-btn):not(.btn-icon):not(.hz-icon-button):not(.action-icon) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}
body.horizon :is(.btn,.hz-button,.hz-small-button,.hz-primary-button,.profile-btn-v3,.tcb-btn,.captcha-btn,.action-btn,.admin-action-btn,.table-action-btn):not(.btn-icon):not(.hz-icon-button):not(.action-icon) > :is(i,svg) {
  position: static !important;
  inset: auto !important;
  flex: 0 0 16px !important;
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  transform: none !important;
  line-height: 16px !important;
  color: currentColor !important;
}

/* 4) Balanced forms: one field boundary only; no visual form-inside-form. */
body.horizon form { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
body.horizon form :is(.form-group,.form-field,.admin-form-group,.hz-auth-field,.profile-form-field-v3,.tcb-field) {
  min-width: 0 !important;
  max-width: 100% !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.horizon form :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),select,textarea,.form-control,.form-select,.custom-select,.dataTable-input,.dataTable-selector) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border: 1px solid var(--hz-input) !important;
  border-radius: 9px !important;
  background: var(--hz-surface) !important;
  background-image: none;
  color: var(--hz-text) !important;
  -webkit-text-fill-color: currentColor !important;
  box-shadow: 0 1px 2px var(--hz-shadow) !important;
}
body.horizon form :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),select,.form-control,.form-select,.custom-select,.dataTable-input,.dataTable-selector) {
  height: 40px !important;
  min-height: 40px !important;
  padding: 8px 11px !important;
  line-height: 22px !important;
}
body.horizon form textarea,body.horizon textarea.form-control { min-height: 92px !important; height: auto !important; padding: 9px 11px !important; }
body.horizon form :is(input,textarea)::placeholder { color: var(--hz-faint) !important; opacity: 1 !important; }
body.horizon form :is(input,select,textarea,.form-control,.form-select):focus {
  outline: 0 !important;
  border-color: var(--hz-ring) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--hz-ring) 20%,transparent) !important;
}
body.horizon form :is(input,select,textarea,.form-control,.form-select):disabled,
body.horizon form :is(input,textarea,.form-control)[readonly] {
  background: var(--hz-card) !important;
  color: var(--hz-muted) !important;
  -webkit-text-fill-color: var(--hz-muted) !important;
  opacity: 1 !important;
}

/* Input groups become a single continuous control, never overlapping. */
body.horizon .input-group {
  display: flex !important;
  align-items: stretch !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.horizon .input-group > * { position: static !important; transform: none !important; }
body.horizon .input-group > :is(.input-group-text,.btn) {
  flex: 0 0 auto !important;
  min-height: 40px !important;
  height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 8px 11px !important;
  border: 1px solid var(--hz-input) !important;
  background: var(--hz-card) !important;
  color: var(--hz-muted) !important;
}
body.horizon .input-group > :is(input,.form-control,.form-select,select) { flex: 1 1 0% !important; min-width: 0 !important; margin: 0 !important; }
body.horizon .input-group > :first-child { border-radius: 9px 0 0 9px !important; }
body.horizon .input-group > :last-child { border-radius: 0 9px 9px 0 !important; }
body.horizon .input-group > :not(:first-child) { margin-left: -1px !important; }

/* Profile fields: explicit grid cells mean icons can never be painted over the value. */
body.client-app.horizon .profile-page-v3 .profile-input-v3 {
  display: grid !important;
  grid-template-columns: 38px minmax(0,1fr) auto !important;
  align-items: stretch !important;
  min-width: 0 !important;
  min-height: 40px !important;
  overflow: hidden !important;
  border: 1px solid var(--hz-input) !important;
  border-radius: 9px !important;
  background: var(--hz-surface) !important;
  box-shadow: 0 1px 2px var(--hz-shadow) !important;
}
body.client-app.horizon .profile-page-v3 .profile-input-v3:focus-within { border-color: var(--hz-ring) !important; box-shadow: 0 0 0 3px color-mix(in srgb,var(--hz-ring) 20%,transparent) !important; }
body.client-app.horizon .profile-page-v3 .profile-input-v3 > i:first-child {
  position: static !important;
  inset: auto !important;
  grid-column: 1 !important;
  width: 38px !important;
  min-width: 38px !important;
  height: 40px !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
  transform: none !important;
  border-right: 1px solid var(--hz-input) !important;
  background: var(--hz-card) !important;
  color: var(--hz-muted) !important;
  pointer-events: none !important;
  z-index: auto !important;
}
body.client-app.horizon .profile-page-v3 .profile-input-v3 > input.profile-control-v3 {
  position: static !important;
  grid-column: 2 !important;
  min-width: 0 !important;
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 8px 11px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
}
body.client-app.horizon .profile-page-v3 .profile-password-toggle-v3 {
  position: static !important;
  inset: auto !important;
  grid-column: 3 !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  border: 0 !important;
  border-left: 1px solid var(--hz-input) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--hz-muted) !important;
  box-shadow: none !important;
}
body.client-app.horizon .profile-page-v3 .profile-password-toggle-v3:hover { background: var(--hz-card) !important; color: var(--hz-text) !important; }
body.client-app.horizon .profile-page-v3 .profile-form-field-v3 { padding: 0 !important; }
body.client-app.horizon .profile-page-v3 .profile-form-v3__body { padding: 20px !important; background: transparent !important; border: 0 !important; }
body.client-app.horizon .profile-page-v3 .profile-form-grid-v3 { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:18px !important; }
body.client-app.horizon .profile-page-v3 .profile-form-v3__footer {
  position: static !important;
  inset: auto !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  flex-wrap:wrap !important;
  gap:12px 18px !important;
  margin:0 !important;
  padding:16px 20px !important;
  border-top:1px solid var(--hz-border) !important;
  background:var(--hz-surface) !important;
  transform:none !important;
  z-index:auto !important;
}

/* Common nested visual shells: keep only the outer card boundary. */
body.horizon :is(.card,.admin-panel,.profile-panel-v3) form > :is(.card,.panel,.box,.well,.form-card,.form-panel):only-child {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* 5) Footer is always after content in normal document flow. */
body.horizon .hz-main { min-height:100vh !important; height:auto !important; overflow:visible !important; }
body.horizon .hz-panel { display:flex !important; flex-direction:column !important; min-height:100vh !important; height:auto !important; overflow:visible !important; }
body.horizon .hz-app-content {
  position:relative !important;
  flex:1 0 auto !important;
  display:block !important;
  width:100% !important;
  min-width:0 !important;
  max-width:1280px !important;
  min-height:0 !important;
  height:auto !important;
  margin:0 auto !important;
  overflow:visible !important;
  padding-bottom:0 !important;
}
body.horizon .hz-site-footer {
  position:static !important;
  inset:auto !important;
  float:none !important;
  clear:both !important;
  flex:0 0 auto !important;
  width:calc(100% - 80px) !important;
  max-width:1200px !important;
  min-height:0 !important;
  height:auto !important;
  margin:32px auto 0 !important;
  padding:0 0 24px !important;
  transform:none !important;
  z-index:auto !important;
  background:transparent !important;
}
body.horizon .hz-site-footer__row { position:static !important; min-height:52px !important; padding-top:16px !important; border-top:1px solid var(--hz-border) !important; }
body.client-app.horizon .profile-page-v3 { height:auto !important; min-height:0 !important; margin-bottom:0 !important; padding-bottom:16px !important; overflow:visible !important; }
body.horizon .api-floating-support { z-index:30 !important; }
body.horizon .api-floating-support.is-footer-visible { transform:translateY(-72px) !important; }

/* 6) Money/stat numbers: compact and resistant to long balances. */
body.horizon :is(.fs-2xl,.money-current,.profile-metric-v3 strong,.admin-stat-card strong,.admin-summary-card strong,.info-box-number,.small-box h3,.stat-card h3,.stats-card h3,.admin-kpi strong) {
  font-size: clamp(1rem,1.8vw,1.45rem) !important;
  line-height: 1.18 !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -.02em !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}
body.horizon .profile-metric-v3 strong { white-space: normal !important; text-overflow: clip !important; overflow: visible !important; }
body.horizon :is(.badge-money,.admin-money,.amount-success) { font-variant-numeric:tabular-nums; white-space:nowrap; }

/* 7) Modern subtle scrollbar on every genuine scroll surface. */
html,body.horizon,body.horizon * {
  scrollbar-width: thin;
  scrollbar-color: var(--hz-scroll) transparent;
}
html::-webkit-scrollbar,body.horizon::-webkit-scrollbar,body.horizon *::-webkit-scrollbar { width:5px; height:5px; }
html::-webkit-scrollbar-track,body.horizon::-webkit-scrollbar-track,body.horizon *::-webkit-scrollbar-track { background:transparent; }
html::-webkit-scrollbar-thumb,body.horizon::-webkit-scrollbar-thumb,body.horizon *::-webkit-scrollbar-thumb {
  background:var(--hz-scroll);
  border:1px solid transparent;
  border-radius:999px;
  background-clip:padding-box;
  min-height:28px;
}
html::-webkit-scrollbar-thumb:hover,body.horizon::-webkit-scrollbar-thumb:hover,body.horizon *::-webkit-scrollbar-thumb:hover { background:var(--hz-scroll-hover); background-clip:padding-box; }
body.horizon .simplebar-track { width:6px !important; background:transparent !important; }
body.horizon .simplebar-scrollbar:before { background:var(--hz-scroll-hover) !important; border-radius:999px !important; opacity:.45 !important; }
body.horizon .simplebar-scrollbar.simplebar-visible:before { opacity:.62 !important; }
body.horizon :is(.ps__rail-y,.ps__rail-x) { background:transparent !important; opacity:.65 !important; }
body.horizon .ps__thumb-y { width:4px !important; right:1px !important; border-radius:999px !important; background:var(--hz-scroll) !important; }
body.horizon .ps__thumb-x { height:4px !important; bottom:1px !important; border-radius:999px !important; background:var(--hz-scroll) !important; }
body.horizon :is(.table-responsive,.dataTables_scrollBody,.modal-body,pre,code,.hz-sidebar-body,.hz-subnav) { overscroll-behavior:contain; }

/* 8) SweetAlert/menus/popovers must follow current system theme. */
body.horizon .swal2-popup { background:var(--hz-surface) !important; color:var(--hz-text) !important; border:1px solid var(--hz-border) !important; }
body.horizon :is(.swal2-title,.swal2-html-container,.swal2-content) { color:var(--hz-text) !important; }
body.horizon .swal2-confirm { background:var(--hz-primary) !important; color:var(--hz-primary-foreground) !important; }
body.horizon .swal2-cancel { background:var(--hz-secondary) !important; color:var(--hz-secondary-foreground) !important; }
body.horizon :is(.dropdown-menu,.select2-dropdown,.choices__list--dropdown,.note-editor.note-frame,.note-toolbar,.note-editable) { background:var(--hz-surface) !important; color:var(--hz-text) !important; border-color:var(--hz-border) !important; }
body.horizon :is(.dropdown-item,.select2-results__option,.choices__item--choice) { color:var(--hz-text) !important; }
body.horizon :is(.dropdown-item,.select2-results__option,.choices__item--choice):is(:hover,:focus,.is-highlighted) { background:var(--hz-card) !important; color:var(--hz-text) !important; }
html[data-theme="dark"] body.horizon .btn-close { filter:invert(1) grayscale(1) brightness(1.8); }

/* Keep action layers clickable; decorative overlays may not intercept controls. */
body.horizon :is(.card,.admin-panel,.profile-panel-v3,.glass-card,.modern-card)::before,
body.horizon :is(.card,.admin-panel,.profile-panel-v3,.glass-card,.modern-card)::after { pointer-events:none; }
body.horizon :is(button,a,input,select,textarea,[role="button"],[tabindex]) { position:relative; }

/* 9) Responsive balancing. */
@media (max-width:820px) {
  body.client-app.horizon .profile-layout-v3 { grid-template-columns:1fr !important; gap:16px !important; }
  body.client-app.horizon .profile-side-v3 { position:static !important; top:auto !important; }
  body.horizon .hz-site-footer { width:calc(100% - 28px) !important; margin-top:24px !important; padding-bottom:20px !important; }
}
@media (max-width:680px) {
  body.client-app.horizon .profile-page-v3 .profile-form-grid-v3 { grid-template-columns:1fr !important; gap:14px !important; }
  body.client-app.horizon .profile-page-v3 .profile-form-field-v3--full { grid-column:auto !important; }
  body.client-app.horizon .profile-page-v3 .profile-form-v3__body { padding:16px !important; }
  body.client-app.horizon .profile-page-v3 .profile-form-v3__footer { align-items:stretch !important; flex-direction:column !important; padding:14px 16px !important; }
  body.client-app.horizon .profile-page-v3 .profile-form-actions-v3 { width:100% !important; display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  body.client-app.horizon .profile-page-v3 .profile-btn-v3 { width:100% !important; white-space:normal !important; }
  body.horizon .hz-site-footer__row { align-items:flex-start !important; flex-direction:column !important; gap:10px !important; }
}
@media (max-width:440px) {
  body.client-app.horizon .profile-page-v3 .profile-form-actions-v3 { grid-template-columns:1fr !important; }
  body.horizon :is(.fs-2xl,.money-current,.profile-metric-v3 strong,.admin-stat-card strong,.admin-summary-card strong,.info-box-number,.small-box h3,.stat-card h3,.stats-card h3,.admin-kpi strong) { font-size:1rem !important; }
}

@media (prefers-reduced-motion:reduce) {
  body.horizon *,body.horizon *::before,body.horizon *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}

/* 10) Unified non-blocking notifications. No generic .toast-container class. */
.hz-toast-stack {
  position:fixed;
  z-index:2147483000;
  top:max(16px,env(safe-area-inset-top));
  right:max(16px,env(safe-area-inset-right));
  width:min(360px,calc(100vw - 32px));
  display:grid;
  gap:8px;
  pointer-events:none;
}
.hz-system-toast {
  --hz-toast-status:var(--hz-primary);
  position:relative;
  width:100%;
  min-height:58px;
  display:grid;
  grid-template-columns:30px minmax(0,1fr) 30px;
  align-items:center;
  gap:10px;
  padding:11px 10px 10px 12px;
  overflow:hidden;
  border:1px solid var(--hz-border);
  border-radius:12px;
  background:var(--hz-surface);
  color:var(--hz-text);
  box-shadow:0 14px 36px var(--hz-shadow);
  pointer-events:auto;
  animation:hz-toast-enter .18s ease-out both;
}
.hz-system-toast::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:var(--hz-toast-status); }
.hz-system-toast.is-success { --hz-toast-status:var(--hz-success); }
.hz-system-toast.is-error { --hz-toast-status:var(--hz-destructive); }
.hz-system-toast.is-warning { --hz-toast-status:var(--hz-warning); }
.hz-system-toast__icon { width:20px; height:auto; display:inline-flex; align-items:center; justify-content:center; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; color:var(--hz-toast-status); font-size:18px; font-weight:800; line-height:1; }
.hz-system-toast__text { min-width:0; color:var(--hz-text); font-size:13px; font-weight:600; line-height:1.4; overflow-wrap:anywhere; }
.hz-system-toast__close { position:static !important; width:28px !important; height:28px !important; min-height:28px !important; display:grid !important; place-items:center !important; padding:0 !important; border:0 !important; border-radius:7px !important; background:transparent !important; color:var(--hz-muted) !important; font:700 18px/1 system-ui,sans-serif !important; cursor:pointer; }
.hz-system-toast__close:hover { background:var(--hz-card) !important; color:var(--hz-text) !important; }
.hz-system-toast__progress { position:absolute; left:3px; right:0; bottom:0; height:2px; transform-origin:left; background:var(--hz-toast-status); opacity:.55; animation:hz-toast-progress var(--hz-toast-duration,3200ms) linear forwards; }
.hz-system-toast.is-leaving { animation:hz-toast-leave .16s ease-in forwards; }
@keyframes hz-toast-enter { from { opacity:0; transform:translateY(-8px) scale(.985) } to { opacity:1; transform:none } }
@keyframes hz-toast-leave { to { opacity:0; transform:translateY(-6px) scale(.985) } }
@keyframes hz-toast-progress { from { transform:scaleX(1) } to { transform:scaleX(0) } }
@media (max-width:520px) { .hz-toast-stack { left:12px; right:12px; top:max(12px,env(safe-area-inset-top)); width:auto; } }

/* V10 token authority on <body>: override legacy body-scoped token declarations. */
html[data-theme="light"] body.horizon,
body.horizon[data-theme="light"] {
  --hz-bg:oklch(1 0 0);--hz-text:oklch(0.145 0 0);--hz-surface:oklch(1 0 0);--hz-card:oklch(0.97 0 0);
  --hz-muted:oklch(0.556 0 0);--hz-faint:oklch(0.556 0 0 / .78);--hz-primary:var(--ui-accent,#2563eb);
  --hz-primary-foreground:var(--ui-accent-foreground,#fff);--hz-secondary:oklch(0.97 0 0);--hz-secondary-foreground:oklch(0.205 0 0);
  --hz-border:oklch(0.922 0 0);--hz-input:oklch(0.922 0 0);--hz-ring:oklch(0.708 0 0);--hz-shadow:oklch(0.145 0 0 / .08);
}
html[data-theme="dark"] body.horizon,
body.horizon[data-theme="dark"] {
  --hz-bg:oklch(0.145 0 0);--hz-text:oklch(0.985 0 0);--hz-surface:oklch(0.205 0 0);--hz-card:oklch(0.269 0 0);
  --hz-muted:oklch(0.708 0 0);--hz-faint:oklch(0.708 0 0 / .80);--hz-primary:var(--ui-accent,#2563eb);
  --hz-primary-foreground:var(--ui-accent-foreground,#fff);--hz-secondary:oklch(0.269 0 0);--hz-secondary-foreground:oklch(0.985 0 0);
  --hz-border:oklch(1 0 0 / 10%);--hz-input:oklch(1 0 0 / 15%);--hz-ring:oklch(0.556 0 0);--hz-shadow:oklch(0 0 0 / .32);
}

/* Adjacent input-group cells share seams without geometric overlap. */
body.horizon .input-group > :not(:first-child) { margin-left:0 !important; border-left-width:0 !important; }

/* Legacy action utilities and pagination also follow the active Horizon theme. */
body.horizon :is(.btn.bg-primary,.btn.bg-info,.btn.bg-warning,.action-icon.bg-primary,.action-icon.bg-dark,.action-view-token,.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover) {
  background:var(--hz-primary) !important;
  background-image:none !important;
  border-color:var(--hz-primary) !important;
  color:var(--hz-primary-foreground) !important;
  -webkit-text-fill-color:var(--hz-primary-foreground) !important;
}
body.horizon :is(.btn.bg-danger,.action-icon.bg-danger) { background:var(--hz-destructive) !important; color:#fff !important; -webkit-text-fill-color:#fff !important; }
body.horizon :is(.btn.bg-success,.action-icon.bg-success) { background:var(--hz-success) !important; color:#fff !important; -webkit-text-fill-color:#fff !important; }
body.horizon .dataTables_wrapper .dataTables_paginate .paginate_button:not(.current) { color:var(--hz-muted) !important; border-color:transparent !important; }
body.horizon .dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):hover { background:var(--hz-card) !important; color:var(--hz-text) !important; border-color:var(--hz-border) !important; }
