/**
 * Agent Dashboard — visual shell adapted from
 * Kiranism/next-shadcn-dashboard-starter (Vercel theme + shadcn sidebar layout).
 * Fully isolated from the public Kawenter storefront styles.
 */

/* Kawenter Arabic font (same as storefront) */
@font-face {
  font-family: 'GM';
  src: url('../fonts/gm-book.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GM';
  src: url('../fonts/gm-medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GM';
  src: url('../fonts/gm-medium.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GM';
  src: url('../fonts/gm-medium.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Geist (self-hosted — CSP blocks cdn.jsdelivr.net styles on production) */
@font-face {
  font-family: 'Geist Sans';
  src: url('../fonts/geist/geist-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Sans';
  src: url('../fonts/geist/geist-sans-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Sans';
  src: url('../fonts/geist/geist-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Sans';
  src: url('../fonts/geist/geist-sans-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/geist/geist-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/geist/geist-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/geist/geist-mono-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/*
 * Use overflow-x: clip (not hidden) on the root — in RTL, hidden still allows
 * panning into empty space when any descendant widens scrollWidth.
 */
html:has(body.agent-dashboard) {
  overflow-x: clip;
  max-width: 100%;
  overscroll-behavior-x: none;
}

body.agent-dashboard {
  margin: 0;
  min-height: 100svh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  overscroll-behavior: none;
  overscroll-behavior-x: none;
  /* Page pans vertically only; tables/sheets keep their own overflow. */
  touch-action: pan-y;
  -webkit-font-smoothing: antialiased;
}

[data-theme='vercel'] {
  --background: oklch(0.99 0 0);
  --foreground: oklch(0 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0 0 0);
  --popover: oklch(0.99 0 0);
  --popover-foreground: oklch(0 0 0);
  --primary: oklch(0 0 0);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.94 0 0);
  --secondary-foreground: oklch(0 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.44 0 0);
  --accent: oklch(0.94 0 0);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.63 0.19 23.03);
  --border: oklch(0.92 0 0);
  --input: oklch(0.94 0 0);
  --ring: oklch(0 0 0);
  --sidebar: oklch(0.99 0 0);
  --sidebar-foreground: oklch(0 0 0);
  --sidebar-primary: oklch(0 0 0);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.94 0 0);
  --sidebar-accent-foreground: oklch(0 0 0);
  --sidebar-border: oklch(0.94 0 0);
  --sidebar-ring: oklch(0 0 0);
  --font-sans: 'Geist Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --radius: 0.5rem;
  --spacing: 0.25rem;
  --header-height: calc(var(--spacing) * 12 + 1px);
  --sidebar-width: 16rem;
  --sidebar-width-icon: 3rem;
  --sidebar-width-mobile: 18rem;
  /* Shared Kawenter Dashboard motion — popovers (select/date/menus) + overlays (sheet/modal) */
  --ahq-motion-pop: 180ms;
  --ahq-motion-overlay: 280ms;
  --ahq-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/*
 * Arabic (RTL): put Kawenter GM first in the shared token so every
 * var(--font-sans) / inherit path uses it — cards, catalog, chips, sheets, etc.
 */
html[dir='rtl'][data-theme='vercel'],
html[dir='rtl'] body.agent-dashboard {
  --font-sans: 'GM', 'Geist Sans', ui-sans-serif, system-ui, sans-serif;
  font-family: var(--font-sans);
}

/* Buttons/inputs do not inherit font by default — force GM UI text everywhere in RTL. */
html[dir='rtl'] body.agent-dashboard :where(
  button,
  input,
  select,
  textarea,
  optgroup,
  option,
  label,
  a,
  p,
  span,
  div,
  h1, h2, h3, h4, h5, h6,
  li,
  dt, dd,
  th, td,
  strong, em, small, b, i
) {
  font-family: var(--font-sans);
}

/* Keep monospace for codes / IDs / keys (not Arabic UI copy). */
html[dir='rtl'] body.agent-dashboard :where(
  code,
  kbd,
  samp,
  pre,
  .ahq-mono,
  .ahq-keys-prefix,
  .ahq-keys-sheet-prefix,
  .ahq-chip__code,
  .ahq-pick-row__code,
  .ahq-input--mono,
  [class*='ahq-input--mono'],
  .ahq-embed-code,
  .ahq-slug-row .ahq-input-affix__prefix
) {
  font-family: var(--font-mono);
}

/*
 * Popover enter/exit — use on select menus, datepickers, lang/user menus.
 * JS: remove [hidden] → rAF/reflow → add .is-open; reverse on close then set [hidden].
 * Prefer window.KawenterAgentDashboard.openPop / closePop.
 */
.ahq-pop {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-0.35rem) scale(0.98);
  transform-origin: top center;
  transition:
    opacity var(--ahq-motion-pop) ease,
    transform var(--ahq-motion-pop) var(--ahq-ease-out),
    visibility var(--ahq-motion-pop) ease;
}

.ahq-pop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ahq-pop.is-flip-end {
  transform-origin: top right;
}

[dir='rtl'] .ahq-pop.is-flip-end {
  transform-origin: top left;
}

@media (prefers-reduced-motion: reduce) {
  .ahq-pop,
  .ahq-sheet__backdrop,
  .ahq-sheet__panel,
  .ahq-modal__backdrop,
  .ahq-modal__panel,
  .ahq-user-menu__panel {
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/*
 * Never park skip links with left:-9999px — in RTL that widens scrollWidth
 * by ~10kpx and lets users pan into empty space beside the dashboard.
 */
.ahq-skip {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  z-index: 100;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  background: var(--primary);
  color: var(--primary-foreground);
  text-decoration: none;
  border-radius: var(--radius);
}

.ahq-skip:focus,
.ahq-skip:focus-visible {
  position: fixed;
  inset-inline-start: 0.75rem;
  top: 0.75rem;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.5rem 0.75rem;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
}

/* —— Shell —— */
.ahq-shell {
  display: flex;
  min-height: 100svh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

/* Desktop: portal is layout-transparent. Mobile: fixed clip root for the drawer. */
.ahq-sidebar-portal {
  display: contents;
}

.ahq-sidebar-gap {
  display: none;
  width: var(--sidebar-width);
  flex-shrink: 0;
  transition: width 0.2s linear;
}

.ahq-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 30;
  display: none;
  width: var(--sidebar-width);
  flex-direction: column;
  color: var(--sidebar-foreground);
  background: var(--sidebar);
  border-inline-end: 1px solid var(--sidebar-border);
  transition: width 0.2s linear, transform 0.2s linear;
}

.ahq-sidebar__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.ahq-sidebar__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.75rem 0.5rem;
  min-height: 3.5rem;
}

.ahq-user-menu {
  position: relative;
  width: 100%;
}

.ahq-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid color-mix(in oklab, var(--sidebar-border) 85%, transparent);
  border-radius: calc(var(--radius) - 2px);
  background:
    linear-gradient(
      155deg,
      color-mix(in oklab, var(--muted) 72%, #eef2ff) 0%,
      color-mix(in oklab, var(--sidebar) 55%, #f8fafc) 48%,
      var(--sidebar) 100%
    );
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ahq-user:hover,
.ahq-user[aria-expanded='true'] {
  border-color: color-mix(in oklab, var(--sidebar-border) 70%, #c7d2fe);
  background:
    linear-gradient(
      155deg,
      color-mix(in oklab, var(--sidebar-accent) 40%, #e0e7ff) 0%,
      color-mix(in oklab, var(--sidebar-accent) 70%, #f1f5f9) 52%,
      var(--sidebar-accent) 100%
    );
  color: var(--sidebar-accent-foreground);
}

.ahq-user:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 45%, transparent);
}

.ahq-user.is-loading .ahq-user__name,
.ahq-user.is-loading .ahq-user__email {
  opacity: 0.55;
}

.ahq-user__chevron {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  margin-inline-start: auto;
  color: var(--muted-foreground);
  opacity: 0.85;
  transition: transform 0.15s ease;
}

.ahq-user[aria-expanded='true'] .ahq-user__chevron {
  transform: rotate(180deg);
}

.ahq-user-menu__panel {
  position: absolute;
  z-index: 30;
  inset-inline: 0;
  top: calc(100% + 0.25rem);
  padding: 0.25rem;
  border: 1px solid color-mix(in oklab, var(--sidebar-border) 80%, #c7d2fe);
  border-radius: calc(var(--radius) - 2px);
  background:
    linear-gradient(
      165deg,
      color-mix(in oklab, var(--popover) 35%, #eef2ff) 0%,
      var(--popover) 42%,
      color-mix(in oklab, var(--popover) 92%, #f8fafc) 100%
    );
  color: var(--popover-foreground);
  /* Motion via .ahq-pop */
}

.ahq-user-menu__panel[hidden] {
  display: none !important;
}

.ahq-user-menu__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

a.ahq-user-menu__item {
  color: inherit;
}

.ahq-user-menu__item:hover,
.ahq-user-menu__item:focus-visible {
  background: var(--muted);
  outline: none;
}

.ahq-user-menu__item.is-active {
  background: var(--muted);
}

.ahq-user-menu__item--danger {
  color: var(--destructive);
}

.ahq-user-menu__item--danger:hover,
.ahq-user-menu__item--danger:focus-visible {
  background: color-mix(in oklab, var(--destructive) 12%, transparent);
  color: var(--destructive);
}

.ahq-user-menu__item svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.ahq-user__avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  background: var(--sidebar-primary);
  color: var(--sidebar-primary-foreground);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.ahq-user__avatar.has-photo {
  background: var(--muted);
}

.ahq-user__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ahq-user__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.ahq-user__name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.ahq-user__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
}

.ahq-user__agent-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  border-radius: calc(var(--radius) - 4px);
  background: color-mix(in oklab, var(--muted) 70%, transparent);
  color: var(--muted-foreground);
}

.ahq-user__agent-badge[hidden] {
  display: none !important;
}

.ahq-user__agent-badge svg {
  width: 0.75rem;
  height: 0.75rem;
}

.ahq-user__email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--muted-foreground);
}

.ahq-sidebar__content {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.5rem 0.75rem;
}

.ahq-sidebar__footer {
  margin-top: auto;
  flex-shrink: 0;
  padding: 0.5rem;
  border-top: 1px solid var(--sidebar-border);
}

.ahq-sidebar__site-link {
  color: var(--muted-foreground);
}

.ahq-sidebar__site-link:hover {
  color: var(--sidebar-accent-foreground);
}

.ahq-nav-group {
  margin-bottom: 0.75rem;
}

.ahq-nav-group__label {
  display: block;
  padding: 0.5rem 0.625rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.ahq-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.ahq-nav__link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--sidebar-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border: 0;
  background: transparent;
  width: 100%;
  cursor: pointer;
  text-align: start;
}

.ahq-nav__link:hover {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}

.ahq-nav__link.is-active {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
  font-weight: 600;
}

.ahq-nav__link svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.ahq-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  margin-inline-start: auto;
  border-radius: 999px;
  background: var(--foreground);
  color: var(--background);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  box-shadow: none;
}

.ahq-nav__badge[hidden] {
  display: none !important;
}

.ahq-nav__link.is-active .ahq-nav__badge {
  background: var(--foreground);
  color: var(--background);
}

.ahq-modal__panel--confirm {
  width: min(22rem, 100%);
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.ahq-confirm {
  padding: 1rem 1rem 0.85rem;
}

.ahq-confirm__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ahq-confirm__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.ahq-confirm__desc {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--foreground);
}

.ahq-confirm__note {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.ahq-confirm__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 40%, var(--popover));
}

.ahq-btn--danger {
  background: var(--destructive);
  border-color: var(--destructive);
  color: oklch(0.99 0 0);
}

.ahq-btn--danger:hover {
  opacity: 0.92;
}

.ahq-btn--danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 35%, transparent);
}

.ahq-btn--ghost.ahq-btn--danger {
  background: transparent;
  border-color: transparent;
  color: var(--destructive);
}

.ahq-btn--ghost.ahq-btn--danger:hover {
  opacity: 1;
  background: color-mix(in oklab, var(--destructive) 10%, transparent);
}

.ahq-inset {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  background: var(--background);
}

.ahq-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 3.5rem;
  height: calc(3.5rem + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: color-mix(in oklab, var(--background) 60%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* Soft-nav route progress — thin top line (not a full-page overlay) */
.ahq-route-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 80;
  height: 2px;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  background: transparent;
  padding-top: env(safe-area-inset-top, 0px);
  transition: opacity 160ms ease;
}

.ahq-route-progress.is-active {
  opacity: 1;
}

.ahq-route-progress.is-done {
  opacity: 0;
  transition: opacity 220ms ease 80ms;
}

.ahq-route-progress__bar {
  display: block;
  height: 2px;
  width: 0;
  max-width: 100%;
  background: var(--foreground);
  border-radius: 0 1px 1px 0;
  transition: width 280ms var(--ahq-ease-out, ease);
  box-shadow: none;
}

html[dir='rtl'] .ahq-route-progress__bar {
  margin-inline-start: auto;
  border-radius: 1px 0 0 1px;
}

.ahq-route-progress.is-active .ahq-route-progress__bar {
  transition: width 420ms var(--ahq-ease-out, ease);
}

.ahq-route-progress.is-done .ahq-route-progress__bar {
  width: 100% !important;
  transition: width 140ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .ahq-route-progress,
  .ahq-route-progress__bar,
  .ahq-route-progress.is-done {
    transition: none;
  }
}

.ahq-header__start,
.ahq-header__end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-inline: 0.75rem;
  min-width: 0;
}

.ahq-header__start {
  flex: 1 1 auto;
}

.ahq-header__end {
  flex: 0 0 auto;
}

.ahq-header__tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

/* Mobile: tools live in the slide menu — hide empty header cluster */
.ahq-shell--tools-in-sidebar .ahq-header__end {
  display: none;
}

.ahq-sidebar__tools {
  display: none;
  flex-shrink: 0;
  padding: 0.15rem 0.75rem 0.85rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.ahq-sidebar__tools:not([hidden]) {
  display: block;
}

.ahq-sidebar__tools .ahq-header__tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.ahq-sidebar__tools .ahq-points-chip {
  max-width: none;
  width: 100%;
  min-height: 2.5rem;
  justify-content: flex-start;
  padding-inline: 0.65rem;
  background: var(--background);
}

.ahq-sidebar__tools .ahq-points-chip__label {
  display: inline;
}

.ahq-sidebar__tools .ahq-lang {
  width: 100%;
  min-width: 0;
}

.ahq-sidebar__tools .ahq-lang__trigger {
  width: 100%;
  height: 2.5rem;
  justify-content: flex-start;
  padding-inline: 0.65rem;
  background: var(--background);
}

.ahq-sidebar__tools .ahq-lang__code {
  flex: 1 1 auto;
  min-width: 0;
}

.ahq-sidebar__tools .ahq-lang__chevron {
  margin-inline-start: auto;
}

.ahq-sidebar__tools .ahq-lang__menu {
  inset-inline: 0;
  inset-inline-end: 0;
  min-width: 0;
  width: 100%;
  transform-origin: top center;
}

[dir='rtl'] .ahq-sidebar__tools .ahq-lang__menu {
  transform-origin: top center;
}

@media (min-width: 768px) {
  .ahq-header__start,
  .ahq-header__end {
    padding-inline: 1rem;
  }
}

.ahq-sep {
  width: 1px;
  height: 1rem;
  background: var(--border);
  flex-shrink: 0;
}

.ahq-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

.ahq-icon-btn:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.ahq-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-icon-btn svg {
  width: 1rem;
  height: 1rem;
}

.ahq-points-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 11.5rem;
  min-height: 2rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--foreground);
  text-decoration: none;
  font: inherit;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: none;
  flex-shrink: 0;
}

.ahq-points-chip:hover,
.ahq-points-chip[aria-expanded='true'] {
  background: var(--muted);
}

.ahq-points-chip.ahq-header-support.is-active {
  background: var(--muted);
  border-color: color-mix(in oklab, var(--foreground) 18%, var(--border));
}

.ahq-points-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-points-chip svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.ahq-points-chip__value {
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-points-chip__label {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .ahq-points-chip__label {
    display: none;
  }
}

.ahq-points__head-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ahq-points__balance {
  margin: 0.2rem 0 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.ahq-points__balance strong {
  color: var(--foreground);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ahq-points__choose {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.ahq-points__packages {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ahq-points__packages[data-ahq-loading='true'] {
  gap: 0.5rem;
  padding: 0.15rem 0;
}

.ahq-points__pkg {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: inherit;
  font: inherit;
  font-family: var(--font-sans);
  text-align: start;
  cursor: pointer;
  box-shadow: none;
}

.ahq-points__pkg:hover {
  background: var(--muted);
}

.ahq-points__pkg.is-selected {
  border-color: var(--foreground);
  background: color-mix(in oklab, var(--muted) 65%, var(--background));
}

.ahq-points__pkg:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-points__pkg-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ahq-points__pkg-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.ahq-points__pkg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.ahq-points__pkg-badge {
  display: inline-flex;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--foreground);
  background: var(--muted);
}

.ahq-points__pkg-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.ahq-points__pkg-price-now {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
}

.ahq-points__pkg-price-was {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-decoration: line-through;
}

.ahq-points__error {
  margin: 0;
  font-size: 0.75rem;
  color: var(--destructive, #dc2626);
}

.ahq-points__link {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-decoration: none;
}

.ahq-points__link:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ahq-lang {
  position: relative;
}

.ahq-lang__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2rem;
  padding: 0 0.5rem 0 0.45rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ahq-lang__trigger:hover {
  background: var(--accent);
}

.ahq-lang__trigger:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

.ahq-lang__flag {
  width: 1.25rem;
  height: 0.9375rem;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  outline: 1px solid color-mix(in oklab, var(--foreground) 12%, transparent);
  outline-offset: -1px;
}

.ahq-lang__trigger svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.ahq-lang__chevron {
  width: 0.75rem !important;
  height: 0.75rem !important;
  transition: transform 0.15s ease;
}

.ahq-lang.is-open .ahq-lang__chevron {
  transform: rotate(180deg);
}

.ahq-lang__code {
  line-height: 1;
}

.ahq-lang__option-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.ahq-lang__menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  inset-inline-end: 0;
  z-index: 40;
  min-width: 10.5rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--popover);
  color: var(--popover-foreground);
  outline: 1px solid color-mix(in oklab, var(--foreground) 6%, transparent);
  transform-origin: top right;
}

.ahq-lang__menu--currency {
  min-width: 14.5rem;
  max-height: min(22rem, 70vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

[dir='rtl'] .ahq-lang__menu {
  transform-origin: top left;
}

.ahq-lang__menu[hidden] {
  display: none !important;
}

.ahq-lang__option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  text-align: start;
  cursor: pointer;
}

.ahq-lang__option:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.ahq-lang__option.is-active {
  background: var(--accent);
  font-weight: 600;
}

.ahq-lang__option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-lang__meta {
  color: var(--muted-foreground);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ahq-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  overflow: hidden;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.ahq-breadcrumbs__current {
  display: block;
  color: var(--foreground);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  /* Extra bottom guard for home-indicator / gesture bars on phones. */
  padding: 0.5rem 0.75rem calc(1.75rem + env(safe-area-inset-bottom, 0px));
  position: relative;
}

@media (min-width: 768px) {
  .ahq-main {
    padding: 1rem 1.5rem 1.5rem;
  }
}

/* Edge-swipe drag only — page swaps are instant (no leave/enter lag). */
.ahq-main.ahq-main--edge-drag {
  transition: none;
  touch-action: pan-y;
  will-change: transform, opacity;
}

.ahq-page-header {
  margin-bottom: 1rem;
}

.ahq-page-header--split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ahq-page-header__text {
  min-width: 0;
  flex: 1 1 auto;
}

.ahq-page-header--split > .ahq-icon-btn,
.ahq-page-header__actions {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.ahq-page-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ahq-page-header__actions .ahq-btn,
.ahq-page-header__actions .ahq-btn--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.7rem;
  min-height: 2.7rem;
  max-height: 2.7rem;
  padding: 0 0.875rem;
  box-sizing: border-box;
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
  flex: 0 0 auto;
}

.ahq-page-header__actions .ahq-btn svg {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.ahq-page-header__actions .ahq-btn.is-disabled,
.ahq-page-header__actions .ahq-btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
}

.ahq-page-header__actions [hidden] {
  display: none !important;
}

.ahq-page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.ahq-page-desc {
  margin: 0.2rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.4;
}

.ahq-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 18rem;
  padding: 1.5rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: calc(var(--radius) + 4px);
  color: var(--muted-foreground);
}

.ahq-empty[hidden] {
  display: none !important;
}

.ahq-empty__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: var(--muted);
  color: var(--foreground);
}

.ahq-empty__media svg {
  width: 1rem;
  height: 1rem;
}

.ahq-empty__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.ahq-empty__desc {
  margin: 0;
  max-width: 22rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

/* —— Desktop expanded —— */
@media (min-width: 768px) {
  .ahq-sidebar-gap {
    display: block;
  }

  .ahq-sidebar {
    display: flex;
  }

  .ahq-shell[data-sidebar='collapsed'] .ahq-sidebar-gap {
    width: var(--sidebar-width-icon);
  }

  .ahq-shell[data-sidebar='collapsed'] .ahq-sidebar {
    width: var(--sidebar-width-icon);
  }

  .ahq-shell[data-sidebar='collapsed'] .ahq-user__text,
  .ahq-shell[data-sidebar='collapsed'] .ahq-user__chevron,
  .ahq-shell[data-sidebar='collapsed'] .ahq-nav-group__label,
  .ahq-shell[data-sidebar='collapsed'] .ahq-nav__link > span:not(.ahq-nav__badge) {
    display: none;
  }

  .ahq-shell[data-sidebar='collapsed'] .ahq-nav__link {
    position: relative;
    justify-content: center;
    padding-inline: 0.5rem;
  }

  .ahq-shell[data-sidebar='collapsed'] .ahq-nav__badge {
    position: absolute;
    top: 0.2rem;
    inset-inline-end: 0.2rem;
    margin: 0;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    font-size: 0.625rem;
  }

  .ahq-shell[data-sidebar='collapsed'] .ahq-user {
    justify-content: center;
    padding-inline: 0.25rem;
  }

  .ahq-shell[data-sidebar='collapsed'] .ahq-user-menu__panel {
    inset-inline: auto;
    inset-inline-start: 0;
    min-width: 11rem;
  }
}

/* —— Mobile drawer —— */
.ahq-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: oklch(0 0 0 / 0.4);
  touch-action: none;
}

.ahq-shell[data-mobile-open='true'] .ahq-overlay {
  display: block;
}

@media (max-width: 767.98px) {
  /*
   * Clip the off-canvas drawer inside a fixed viewport portal so translateX
   * cannot widen scrollWidth (which made mobile browsers shrink-to-fit the
   * whole shell into a tiny top strip with empty space below — worse in RTL).
   */
  .ahq-sidebar-portal {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    overflow: hidden;
    pointer-events: none;
  }

  .ahq-shell[data-mobile-open='true'] .ahq-sidebar-portal {
    pointer-events: auto;
  }

  .ahq-sidebar {
    display: flex;
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    inset-inline-end: auto;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateX(-100%);
    border-inline-end: 0;
    pointer-events: none;
    visibility: visible;
  }

  .ahq-sidebar__header .ahq-user-menu {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .ahq-shell[data-mobile-open='true'] .ahq-sidebar {
    transform: translateX(0);
    pointer-events: auto;
  }

  html[dir='rtl'] .ahq-sidebar {
    transform: translateX(100%);
  }

  html[dir='rtl'] .ahq-shell[data-mobile-open='true'] .ahq-sidebar {
    transform: translateX(0);
  }
}

/* —— Template-style cards / badges / table (Billing) —— */
.ahq-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .ahq-stats:not(.ahq-stats--single) {
    grid-template-columns: 1fr 1.4fr;
  }

  .ahq-stats--single {
    grid-template-columns: minmax(0, 28rem);
  }
}

.ahq-wallet-sheet__hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.35rem 0 0.15rem;
}

.ahq-wallet-sheet__amount {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--foreground);
}

.ahq-wallet-auto {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Author display:flex overrides UA [hidden]; keep agent-only gate reliable. */
.ahq-wallet-auto[hidden] {
  display: none !important;
}

.ahq-wallet-auto__toggle {
  appearance: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  box-shadow: none;
}

.ahq-wallet-auto__toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
  border-radius: calc(var(--radius) - 2px);
}

.ahq-wallet-auto__toggle-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 auto;
}

.ahq-wallet-auto__toggle-desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.ahq-wallet-auto__toggle-end {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.ahq-wallet-auto__chevron {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
  transition: transform var(--ahq-motion-pop, 180ms) var(--ahq-ease-out, ease);
}

.ahq-wallet-auto.is-open .ahq-wallet-auto__chevron {
  transform: rotate(180deg);
}

.ahq-wallet-auto__spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border: 2px solid color-mix(in oklab, var(--foreground) 18%, transparent);
  border-top-color: var(--foreground);
  border-radius: 50%;
  animation: ahq-btn-spin 0.7s linear infinite;
}

.ahq-wallet-auto__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.ahq-wallet-auto__panel {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.ahq-wallet-auto__panel[hidden] {
  display: none !important;
}

/* Collapsed header loading: badge skeleton + spinner; keep title/desc readable. */
.ahq-wallet-auto[data-ahq-loading='true'] {
  cursor: wait;
}

.ahq-wallet-auto[data-ahq-loading='true'] .ahq-wallet-auto__toggle {
  pointer-events: none;
}

.ahq-wallet-auto[data-ahq-loading='true'] .ahq-wallet-auto__spinner,
.ahq-wallet-auto__spinner.is-on {
  display: inline-block;
}

.ahq-wallet-auto[data-ahq-loading='true'] .ahq-wallet-auto__chevron {
  display: none;
}

.ahq-wallet-auto[data-ahq-loading='true'] .ahq-wallet-auto__panel .ahq-field,
.ahq-wallet-auto[data-ahq-loading='true'] .ahq-wallet-auto__panel .ahq-switch,
.ahq-wallet-auto[data-ahq-loading='true'] .ahq-wallet-auto__panel .ahq-banner {
  opacity: 0.55;
  pointer-events: none;
}

/* Lightweight placeholder while agent auth + settings fetch (before real section mounts). */
.ahq-wallet-auto--pending {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.ahq-wallet-auto--pending__main {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
}

.ahq-wallet-auto--pending__end {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

@media (prefers-reduced-motion: reduce) {
  .ahq-wallet-auto__chevron {
    transition: none;
  }

  .ahq-wallet-auto__spinner {
    animation: none;
    border-top-color: inherit;
    opacity: 0.7;
  }
}

.ahq-sheet__foot .ahq-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

/* Missing docs panel (order detail — on-hold / incomplete documents) */
.ahq-missing-docs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ahq-missing-docs__alert {
  padding: 0.75rem 0.85rem;
  border: 1px solid color-mix(in oklab, oklch(0.75 0.14 75) 45%, var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklab, oklch(0.75 0.14 75) 12%, var(--card));
}

.ahq-missing-docs__alert-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: color-mix(in oklab, oklch(0.55 0.12 75) 80%, var(--foreground));
}

.ahq-missing-docs__alert-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--foreground);
  white-space: pre-wrap;
}

.ahq-missing-docs__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.ahq-missing-docs__list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--muted-foreground);
}

.ahq-missing-docs__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ahq-missing-docs__item {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
}

.ahq-missing-docs__item.is-ok {
  border-color: color-mix(in oklab, oklch(0.55 0.14 145) 35%, var(--border));
}

.ahq-missing-docs__item.is-fail {
  border-color: color-mix(in oklab, var(--destructive) 35%, var(--border));
}

.ahq-missing-docs__name {
  font-size: 0.8125rem;
  font-weight: 550;
  word-break: break-word;
}

.ahq-missing-docs__meta {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.ahq-missing-docs__bar {
  margin-top: 0.45rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}

.ahq-missing-docs__bar > span {
  display: block;
  height: 100%;
  background: oklch(0.55 0.14 250);
}

.ahq-missing-docs__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.ahq-missing-docs__error {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--destructive);
}

.ahq-missing-docs__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ahq-missing-docs__notes {
  margin: 0;
  gap: 0.4rem;
}

.ahq-missing-docs__textarea {
  display: block;
  width: 100%;
  min-height: 4.5rem;
  max-height: 14rem;
  resize: none;
  overflow-y: auto;
  line-height: 1.45;
  field-sizing: content;
}

/* KPI strip — one bordered panel, shadcn-style metric cells (no card chrome / shadow) */
.ahq-kpi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  color: var(--card-foreground);
  overflow: hidden;
  box-shadow: none;
}

@media (min-width: 768px) {
  .ahq-kpi {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ahq-kpi--orders {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.ahq-kpi__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0.9rem 1rem;
  border: 0;
  border-inline-end: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font: inherit;
  font-family: var(--font-sans);
  text-align: start;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.ahq-kpi__item:nth-child(2n) {
  border-inline-end: 0;
}

.ahq-kpi__item:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.ahq-kpi--orders .ahq-kpi__item:nth-last-child(-n + 2) {
  border-bottom: 1px solid var(--border);
}

.ahq-kpi--orders .ahq-kpi__item:last-child {
  border-bottom: 0;
  border-inline-end: 0;
}

@media (min-width: 768px) {
  .ahq-kpi__item {
    border-bottom: 0;
    border-inline-end: 1px solid var(--border);
  }

  .ahq-kpi__item:nth-child(2n) {
    border-inline-end: 1px solid var(--border);
  }

  .ahq-kpi__item:last-child {
    border-inline-end: 0;
  }

  .ahq-kpi--orders .ahq-kpi__item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

.ahq-kpi__item:hover {
  background: color-mix(in oklab, var(--muted) 45%, transparent);
}

div.ahq-kpi__item {
  cursor: default;
}

div.ahq-kpi__item:hover {
  background: transparent;
}

.ahq-kpi__item.is-active {
  background: color-mix(in oklab, var(--muted) 70%, transparent);
}

.ahq-kpi__item:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--ring) 45%, transparent);
  z-index: 1;
}

.ahq-kpi__label {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted-foreground);
}

.ahq-kpi__value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

/* —— Dashboard home charts —— */
.ahq-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .ahq-charts {
    grid-template-columns: 1fr 1fr;
  }
}

.ahq-charts > .ahq-card {
  min-height: 100%;
}

.ahq-card__body--chart {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 14.5rem;
}

.ahq-chart__empty {
  margin: auto 0;
  font-size: 0.875rem;
  line-height: 1.45;
}

.ahq-chart--bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 0.45rem;
  width: 100%;
  min-height: 11.5rem;
}

.ahq-chart__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.ahq-chart__track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 9.5rem;
  padding-top: 1.1rem;
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklab, var(--muted) 40%, transparent);
}

.ahq-chart__bar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 56%;
  min-width: 0.65rem;
  max-width: 1.65rem;
  border-radius: calc(var(--radius) - 4px) calc(var(--radius) - 4px) 2px 2px;
  background: color-mix(in oklab, var(--foreground) 78%, transparent);
  transition: height var(--ahq-motion-overlay, 280ms) var(--ahq-ease-out, ease);
}

.ahq-chart__bar-val {
  position: absolute;
  top: -1.05rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  white-space: nowrap;
  pointer-events: none;
}

[dir='rtl'] .ahq-chart__bar-val {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

.ahq-chart__label {
  max-width: 100%;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--muted-foreground);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-chart__skel-bar {
  display: block;
  width: 56%;
  max-width: 1.65rem;
  height: 45%;
  margin-inline: auto;
  border-radius: calc(var(--radius) - 4px);
}

.ahq-chart__skel-label {
  width: 2.25rem;
}

.ahq-chart--rank {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 11.5rem;
}

.ahq-chart__rank-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.ahq-chart__rank-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.ahq-chart__rank-name {
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-chart__rank-count {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

.ahq-chart__hbar-track {
  width: 100%;
  height: 0.45rem;
  border-radius: 999px;
  background: color-mix(in oklab, var(--muted) 70%, transparent);
  overflow: hidden;
}

.ahq-chart__hbar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in oklab, var(--foreground) 78%, transparent);
  transition: width var(--ahq-motion-overlay, 280ms) var(--ahq-ease-out, ease);
}

.ahq-chart__skel-hbar {
  display: block;
  width: 100%;
  height: 0.45rem;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .ahq-chart__bar,
  .ahq-chart__hbar {
    transition: none;
  }
}

.ahq-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: none;
  outline: 1px solid color-mix(in oklab, var(--foreground) 10%, transparent);
}

a.ahq-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: outline-color var(--ahq-motion-pop, 180ms) var(--ahq-ease-out, ease);
}

a.ahq-card:hover {
  outline-color: color-mix(in oklab, var(--foreground) 22%, transparent);
}

a.ahq-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring, #2563eb) 45%, transparent);
}

/* .ahq-card { display:flex } otherwise overrides the HTML hidden attribute */
.ahq-card[hidden] {
  display: none !important;
}

.ahq-card__header,
.ahq-card__body,
.ahq-card__footer {
  padding-inline: 1rem;
}

.ahq-card__header {
  padding-block: 0.85rem;
  background: color-mix(in oklab, var(--muted) 55%, transparent);
  border-bottom: 1px solid var(--border);
}

.ahq-card__body {
  padding-block: 1rem;
  min-width: 0;
  max-width: 100%;
}

/* Vertically center primary value; keep it start-aligned (left EN / right AR). */
.ahq-card__body--center {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-start;
  text-align: start;
  min-height: 4.5rem;
}

.ahq-card__body--center .ahq-card__value {
  margin-top: 0;
}

/* Match top spacing when the card ends on body (no footer strip). */
.ahq-card__body:last-child {
  padding-bottom: 1rem;
}

.ahq-card__header--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ahq-card__header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 0 1 auto;
}

.ahq-card__header-actions .ahq-btn svg {
  width: 1rem;
  height: 1rem;
}

.ahq-card__heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.ahq-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklab, var(--muted) 55%, transparent);
  color: var(--muted-foreground);
}

.ahq-card__icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.ahq-card__heading-text {
  min-width: 0;
  flex: 1 1 auto;
}

.ahq-card__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 70%, transparent);
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  box-sizing: border-box;
}

.ahq-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
}

.ahq-card__desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.ahq-card__value {
  margin: 0.35rem 0 0;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.ahq-card__value--sm {
  font-size: 1.25rem;
}

.ahq-card__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.75rem;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 50%, transparent);
  margin-top: auto;
}

.ahq-card__footer--split {
  justify-content: space-between;
  gap: 1rem;
}

.ahq-card__footer--split .ahq-muted {
  flex: 1;
  min-width: 0;
}

.ahq-card__footer--split .ahq-btn {
  flex-shrink: 0;
  text-decoration: none;
}

.ahq-card__footer--actions {
  justify-content: flex-start;
  background: transparent;
  border-top: 1px solid var(--border);
  padding-block: 0.75rem;
}

.ahq-card__footer--pager {
  justify-content: space-between;
  gap: 0.75rem;
}

.ahq-card__footer--pager[hidden],
.ahq-card__footer--actions[hidden],
#blinkRetryBar[hidden],
#ahqPtsRetryBar[hidden] {
  display: none !important;
}

.ahq-pager__meta {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.ahq-pager__pages {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.ahq-pager__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.4rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.ahq-pager__page:hover:not(:disabled):not(.is-active) {
  background: var(--muted);
}

.ahq-pager__page.is-active {
  background: var(--foreground);
  border-color: var(--foreground);
  color: var(--background);
  cursor: default;
}

.ahq-pager__page:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ahq-pager__page:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 45%, transparent);
}

.ahq-pager__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 2rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  user-select: none;
}

@media (max-width: 640px) {
  .ahq-card__footer--pager {
    flex-wrap: wrap;
  }

  .ahq-pager__pages {
    order: -1;
    flex: 1 1 100%;
  }
}

.ahq-card--table {
  gap: 0.75rem;
  /* Let filter select/datepicker pops extend over the table (card overflow
     would otherwise clip them at the table edge). */
  overflow: visible;
}

.ahq-card--table > .ahq-card__header:first-child {
  border-start-start-radius: calc(var(--radius) + 4px);
  border-start-end-radius: calc(var(--radius) + 4px);
}

.ahq-card--table > .ahq-card__footer:last-child {
  border-end-start-radius: calc(var(--radius) + 4px);
  border-end-end-radius: calc(var(--radius) + 4px);
}

.ahq-card--table > .ahq-table-wrap:last-child {
  border-end-start-radius: calc(var(--radius) + 4px);
  border-end-end-radius: calc(var(--radius) + 4px);
  overflow: hidden;
}

.ahq-filters {
  /* Stack above .ahq-table-wrap (overflow creates a later stacking context)
     so select/datepicker menus are not covered by table borders. */
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 0 1rem 0.75rem;
}

@media (min-width: 768px) {
  .ahq-filters {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
  }
}

.ahq-filters--modal {
  padding: 0;
  grid-template-columns: 1fr 1fr;
}

.ahq-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.ahq-field__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.ahq-field__label-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow: visible;
}

.ahq-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in oklab, var(--foreground) 12%, transparent);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  cursor: help;
  flex-shrink: 0;
  box-shadow: none;
}

.ahq-tip svg {
  display: block;
  width: 0.72rem;
  height: 0.72rem;
}

.ahq-tip:hover,
.ahq-tip:focus-visible {
  color: var(--foreground);
  border-color: color-mix(in oklab, var(--foreground) 22%, transparent);
  background: var(--muted);
}

.ahq-tip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

/* Anchor to the tip’s inline-start so the panel grows into the card
   (LTR → right, RTL → left). Avoid translateX centering — it breaks in RTL
   with inset-inline and gets clipped by .ahq-card overflow. */
.ahq-tip__tooltip {
  position: absolute;
  z-index: 30;
  inset-inline-start: 0;
  inset-inline-end: auto;
  bottom: calc(100% + 0.5rem);
  transform: translateY(0.15rem);
  width: max-content;
  max-width: min(17.5rem, calc(100dvw - 2.5rem));
  padding: 0.5rem 0.65rem;
  border: 1px solid color-mix(in oklab, var(--foreground) 14%, transparent);
  border-radius: calc(var(--radius) + 2px);
  background: var(--foreground);
  color: var(--background);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: start;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  box-shadow: none;
}

.ahq-tip__tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  inset-inline-start: 0.35rem;
  inset-inline-end: auto;
  border: 6px solid transparent;
  border-top-color: var(--foreground);
}

.ahq-tip:hover .ahq-tip__tooltip,
.ahq-tip:focus-visible .ahq-tip__tooltip,
.ahq-tip:focus-within .ahq-tip__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Let tip popovers escape the card edge without breaking footer radius. */
.ahq-card:has(.ahq-tip:hover),
.ahq-card:has(.ahq-tip:focus-visible),
.ahq-card:has(.ahq-tip:focus-within) {
  overflow: visible;
}

/*
 * Form controls — shadcn/ui SelectTrigger + Input look
 * (native select/date, since Radix Select/Calendar aren’t in this PHP shell).
 */
.ahq-control {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.ahq-control__icon {
  position: absolute;
  inset-inline-end: 0.75rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  opacity: 0.72;
  pointer-events: none;
  z-index: 1;
}

.ahq-control__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ahq-input {
  width: 100%;
  height: 2.7rem; /* ~h-9 + 20% — inputs, selects, date triggers */
  padding-inline: 0.75rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px); /* rounded-md */
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Leading icon inside an input (mail, phone, search, …) */
.ahq-input-icon {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.ahq-input-icon__glyph {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0.75rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  pointer-events: none;
  color: var(--muted-foreground);
}

.ahq-input-icon__glyph svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.ahq-input.ahq-input--icon {
  padding-inline-start: 2.35rem;
}

.ahq-input-icon:focus-within .ahq-input-icon__glyph {
  color: var(--foreground);
}

.ahq-input::placeholder {
  color: var(--muted-foreground);
  opacity: 1;
}

.ahq-input:hover:not(:disabled):not(:focus-visible) {
  background: color-mix(in oklab, var(--muted) 40%, transparent);
}

.ahq-input:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

.ahq-input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ahq-input[aria-invalid='true'] {
  border-color: var(--destructive);
}

.ahq-input[aria-invalid='true']:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent);
}

/* Native <select> fallback before custom mount */
select.ahq-input,
.ahq-input--select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-inline-end: 2.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-image: none;
}

select.ahq-input:not(.ahq-input--select) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem 1rem;
}

[dir='rtl'] select.ahq-input:not(.ahq-input--select) {
  background-position: left 0.75rem center;
}

/* shadcn-style Select (custom menu — native popup can’t be themed) */
.ahq-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.ahq-select > select.ahq-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.ahq-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: start;
  cursor: pointer;
}

.ahq-select__value {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-select__flag {
  width: 1.15rem;
  height: 0.85rem;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--muted);
}

.ahq-select__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-select__option-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.ahq-select__value.is-placeholder {
  color: var(--muted-foreground);
}

.ahq-select__chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
  opacity: 0.72;
  transition: transform 0.15s ease;
}

.ahq-select.is-open .ahq-select__chevron {
  transform: rotate(180deg);
}

.ahq-select.is-locked .ahq-select__trigger {
  pointer-events: none;
  cursor: default;
  opacity: 0.92;
}

.ahq-select.is-locked .ahq-select__chevron {
  display: none;
}

.ahq-select.is-open {
  z-index: 6;
}

.ahq-select__menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  inset-inline-start: 0;
  z-index: 95;
  width: 100%;
  min-width: 100%;
  max-width: none;
  max-height: 16rem;
  overflow: auto;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--popover);
  color: var(--popover-foreground);
  outline: 1px solid color-mix(in oklab, var(--foreground) 6%, transparent);
  box-sizing: border-box;
}

.ahq-select--search .ahq-select__menu {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  max-height: min(20rem, 70vh);
}

.ahq-select__search {
  position: sticky;
  top: 0;
  z-index: 1;
  flex-shrink: 0;
  padding: 0.375rem;
  border-bottom: 1px solid var(--border);
  background: var(--popover);
}

.ahq-select__search-input {
  width: 100%;
  min-height: 2rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
}

.ahq-select__options {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.25rem;
}

.ahq-select__empty {
  padding: 0.75rem 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  text-align: center;
}

.ahq-select__menu[hidden] {
  display: none !important;
}

.ahq-select__menu.is-flip-end {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

.ahq-select__option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2rem;
  padding: 0.375rem 0.5rem;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  text-align: start;
  cursor: pointer;
}

.ahq-select__option:hover,
.ahq-select__option.is-active {
  background: var(--accent);
  color: var(--accent-foreground);
}

.ahq-select__option.is-selected {
  font-weight: 500;
}

.ahq-select__option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

.ahq-select__check {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--foreground);
  opacity: 0;
}

.ahq-select__option.is-selected .ahq-select__check {
  opacity: 1;
}

.ahq-select__check svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Native date / datetime — Input + calendar affordance */
input.ahq-input[type='date'],
input.ahq-input[type='datetime-local'],
input.ahq-input[type='month'],
input.ahq-input[type='week'],
input.ahq-input[type='time'],
.ahq-input--date {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: light;
  padding-inline-end: 2.25rem;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

input.ahq-input[type='date']:not(.ahq-input--date),
input.ahq-input[type='datetime-local']:not(.ahq-input--date),
input.ahq-input[type='month']:not(.ahq-input--date),
input.ahq-input[type='week']:not(.ahq-input--date) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem 1rem;
}

[dir='rtl'] input.ahq-input[type='date']:not(.ahq-input--date),
[dir='rtl'] input.ahq-input[type='datetime-local']:not(.ahq-input--date),
[dir='rtl'] input.ahq-input[type='month']:not(.ahq-input--date),
[dir='rtl'] input.ahq-input[type='week']:not(.ahq-input--date) {
  background-position: left 0.75rem center;
}

.ahq-control--date .ahq-input--date {
  cursor: pointer;
  caret-color: transparent;
}

/* shadcn-style calendar popover (global dashboard datepicker) */
.ahq-datepicker {
  position: relative;
}

.ahq-datepicker__popover {
  position: absolute;
  top: calc(100% + 0.375rem);
  inset-inline-start: 0;
  z-index: 90;
  width: 17.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--popover);
  color: var(--popover-foreground);
  outline: 1px solid color-mix(in oklab, var(--foreground) 6%, transparent);
}

.ahq-datepicker__popover[hidden] {
  display: none !important;
}

.ahq-datepicker__popover.is-flip-end {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

.ahq-datepicker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ahq-datepicker__head--dob {
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
}

.ahq-datepicker__caption {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

/* DOB: month + year dropdowns (jump without 300 month clicks) */
.ahq-datepicker__selectors {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 auto;
}

.ahq-datepicker__select-wrap {
  display: block;
  min-width: 0;
  margin: 0;
}

.ahq-datepicker__select-wrap:first-child {
  flex: 1 1 7.5rem;
}

.ahq-datepicker__select-wrap:last-child {
  flex: 0 0 5.25rem;
}

.ahq-datepicker__select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 2rem;
  padding: 0 1.75rem 0 0.55rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background-color: var(--background);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  background-size: 0.9rem 0.9rem;
  color: var(--foreground);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

html[dir='rtl'] .ahq-datepicker__select {
  padding: 0 0.55rem 0 1.75rem;
  background-position: left 0.4rem center;
}

.ahq-datepicker__select:hover {
  background-color: color-mix(in oklab, var(--muted) 45%, var(--background));
}

.ahq-datepicker__select:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

/* Keep month nav LTR so prev/next chevrons stay on physical left/right
   (RTL flex would reverse the buttons and leave arrows pointing inward). */
.ahq-datepicker__nav {
  direction: ltr;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.ahq-datepicker__nav-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

.ahq-datepicker__nav-btn:hover {
  background: var(--accent);
}

.ahq-datepicker__nav-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

.ahq-datepicker__nav-btn svg {
  width: 1rem;
  height: 1rem;
}

.ahq-datepicker__weekdays,
.ahq-datepicker__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.125rem;
}

.ahq-datepicker__weekdays {
  margin-bottom: 0.25rem;
}

.ahq-datepicker__weekday {
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.ahq-datepicker__day {
  appearance: none;
  height: 2rem;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.ahq-datepicker__day:hover:not(:disabled):not(.is-selected) {
  background: var(--accent);
}

.ahq-datepicker__day:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

.ahq-datepicker__day.is-outside {
  color: var(--muted-foreground);
  opacity: 0.45;
}

.ahq-datepicker__day.is-today:not(.is-selected) {
  background: var(--accent);
  font-weight: 600;
}

.ahq-datepicker__day.is-selected {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
}

.ahq-datepicker__day.is-range-start,
.ahq-datepicker__day.is-range-end {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
}

.ahq-datepicker__day.is-in-range:not(.is-range-start):not(.is-range-end) {
  background: color-mix(in oklab, var(--foreground) 8%, transparent);
  border-radius: 0;
}

.ahq-datepicker__day.is-range-start:not(.is-range-end) {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.ahq-datepicker__day.is-range-end:not(.is-range-start) {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.ahq-datepicker__day:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Flight-style from → to control */
.ahq-daterange {
  position: relative;
  width: 100%;
  min-width: 0;
}

.ahq-daterange__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: start;
  cursor: pointer;
}

.ahq-daterange__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ahq-daterange__text--placeholder {
  color: var(--muted-foreground);
  font-weight: 400;
}

.ahq-daterange__sep {
  color: var(--muted-foreground);
  padding-inline: 0.15rem;
}

.ahq-daterange__icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
  opacity: 0.72;
}

.ahq-daterange__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ahq-datepicker__popover--range {
  width: 17.5rem;
}

.ahq-datepicker__hint {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.ahq-datepicker__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.ahq-datepicker__foot-btn {
  appearance: none;
  height: 2.4rem; /* +20% from 2rem */
  min-height: 2.4rem;
  padding: 0 0.8125rem; /* ~10% wider overall vs 0.625rem */
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.ahq-datepicker__foot-btn:hover {
  background: var(--accent);
}

.ahq-datepicker__foot-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

.ahq-datepicker__foot-btn--primary {
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-foreground);
}

.ahq-datepicker__foot-btn--primary:hover {
  opacity: 0.92;
  background: var(--primary);
}

.ahq-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  align-self: end;
}

.ahq-filters__actions .ahq-btn {
  height: 2.7rem;
  min-height: 2.7rem;
  padding: 0 0.875rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.ahq-modal[hidden] {
  display: none !important;
}

.ahq-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.ahq-modal[hidden] {
  display: none !important;
}

.ahq-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: oklch(0 0 0 / 0.4);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--ahq-motion-overlay) ease;
}

.ahq-modal.is-open .ahq-modal__backdrop {
  opacity: 1;
}

.ahq-modal__panel {
  position: relative;
  z-index: 1;
  width: min(28rem, 100%);
  padding: 1rem;
  border-radius: calc(var(--radius) + 4px);
  background: var(--popover);
  color: var(--popover-foreground);
  outline: 1px solid color-mix(in oklab, var(--foreground) 10%, transparent);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  opacity: 0;
  transform: translateY(0.45rem) scale(0.98);
  transition:
    opacity var(--ahq-motion-overlay) ease,
    transform var(--ahq-motion-overlay) var(--ahq-ease-out);
}

.ahq-modal.is-open .ahq-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ahq-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ahq-modal__head--ruled {
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--popover);
}

.ahq-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.ahq-modal__head p,
.ahq-modal__desc {
  margin: 0.2rem 0 0;
  line-height: 1.35;
}

/* Hide empty / hidden descs so title-only heads can center cleanly */
.ahq-modal__head .ahq-muted:empty,
.ahq-modal__head .ahq-modal__desc:empty,
.ahq-modal__head .ahq-muted[hidden],
.ahq-modal__head .ahq-modal__desc[hidden] {
  display: none;
}

/* Title-only: center title, keep close on the end edge */
.ahq-modal__head:not(:has(.ahq-muted:not([hidden]):not(:empty))):not(:has(.ahq-modal__desc:not([hidden]):not(:empty))) {
  position: relative;
  align-items: center;
  justify-content: flex-end;
}

.ahq-modal__head:not(:has(.ahq-muted:not([hidden]):not(:empty))):not(:has(.ahq-modal__desc:not([hidden]):not(:empty))) > :first-child {
  position: absolute;
  inset-inline: 2.75rem;
  inset-block: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  min-width: 0;
}

.ahq-modal__head:not(:has(.ahq-muted:not([hidden]):not(:empty))):not(:has(.ahq-modal__desc:not([hidden]):not(:empty))) .ahq-modal__title {
  width: 100%;
  text-align: center;
}

.ahq-modal__head:not(:has(.ahq-muted:not([hidden]):not(:empty))):not(:has(.ahq-modal__desc:not([hidden]):not(:empty))) .ahq-icon-btn {
  position: relative;
  z-index: 1;
}

.ahq-modal__body {
  display: grid;
  gap: 0.75rem;
}

.ahq-modal__body--topup {
  padding: 1rem;
  gap: 1rem;
  background: var(--background);
}

.ahq-modal__foot {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 0.875rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 45%, var(--popover));
}

.ahq-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ahq-modal__actions--end {
  justify-content: flex-end;
}

.ahq-modal__msg {
  margin: 0;
  font-size: 0.8125rem;
}

.ahq-modal__panel--topup {
  width: min(26rem, 100%);
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.ahq-amount-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.ahq-amount-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: var(--popover);
  color: var(--foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ahq-amount-chip__value {
  line-height: 1.2;
}

.ahq-amount-chip__batch {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

.ahq-amount-chip--batch {
  min-height: 2.75rem;
  border-color: color-mix(in oklab, var(--foreground) 28%, var(--input));
  background: color-mix(in oklab, var(--muted) 55%, var(--popover));
}

.ahq-amount-chip:hover {
  background: color-mix(in oklab, var(--muted) 55%, transparent);
}

.ahq-amount-chip.is-selected {
  border-color: var(--foreground);
  background: color-mix(in oklab, var(--foreground) 6%, var(--popover));
}

.ahq-amount-chip.is-selected .ahq-amount-chip__batch {
  color: var(--foreground);
}

.ahq-amount-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-input-affix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ahq-input-affix:hover:not(:focus-within) {
  background: color-mix(in oklab, var(--muted) 40%, transparent);
}

.ahq-input-affix:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

.ahq-input-affix__prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  border-inline-end: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: color-mix(in oklab, var(--muted) 40%, transparent);
}

.ahq-input.ahq-input--affix {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ahq-input.ahq-input--affix:focus-visible {
  box-shadow: none;
}

.ahq-topup-msg--error {
  color: var(--destructive);
  font-size: 0.8125rem;
}

.ahq-topup-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  font-variant-numeric: tabular-nums;
}

.ahq-topup-summary strong {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Side sheet: docks to inline-end (right in EN, left in AR) */
.ahq-sheet[hidden] {
  display: none !important;
}

.ahq-sheet {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: block;
  /* Clip off-canvas panel translateX so RTL pages cannot grow scrollWidth. */
  overflow: hidden;
}

.ahq-sheet.ahq-sheet--stack {
  z-index: 92;
}

.ahq-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: oklch(0 0 0 / 0.4);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--ahq-motion-overlay) ease;
}

.ahq-sheet.is-open .ahq-sheet__backdrop {
  opacity: 1;
}

.ahq-sheet__panel {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(26rem, 100%);
  background: var(--popover);
  color: var(--popover-foreground);
  border-inline-start: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform var(--ahq-motion-overlay) var(--ahq-ease-out);
  overflow: hidden;
}

[dir='rtl'] .ahq-sheet__panel {
  transform: translateX(-100%);
}

.ahq-sheet.is-open .ahq-sheet__panel {
  transform: translateX(0);
}

.ahq-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 55%, transparent);
  flex-shrink: 0;
}

/* Hide empty / hidden descs so title-only heads can center cleanly */
.ahq-sheet__head .ahq-muted:empty,
.ahq-sheet__head .ahq-muted[hidden] {
  display: none;
}

/* Title-only: center title, keep close on the end edge */
.ahq-sheet__head:not(:has(.ahq-muted:not([hidden]):not(:empty))) {
  position: relative;
  align-items: center;
  justify-content: flex-end;
}

.ahq-sheet__head:not(:has(.ahq-muted:not([hidden]):not(:empty))) > :first-child {
  position: absolute;
  inset-inline: 2.75rem;
  inset-block: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  min-width: 0;
}

.ahq-sheet__head:not(:has(.ahq-muted:not([hidden]):not(:empty))) .ahq-sheet__title {
  width: 100%;
  text-align: center;
}

.ahq-sheet__head:not(:has(.ahq-muted:not([hidden]):not(:empty))) .ahq-icon-btn {
  position: relative;
  z-index: 1;
}

.ahq-sheet__head--in {
  background: color-mix(in oklab, oklch(0.65 0.15 145) 14%, var(--muted));
  border-bottom-color: color-mix(in oklab, oklch(0.55 0.12 145) 28%, var(--border));
}

.ahq-sheet__head--out {
  background: color-mix(in oklab, var(--muted) 70%, transparent);
}

.ahq-sheet__head--success {
  background: color-mix(in oklab, oklch(0.65 0.15 145) 14%, var(--muted));
  border-bottom-color: color-mix(in oklab, oklch(0.55 0.12 145) 28%, var(--border));
}

.ahq-sheet__head--warning {
  background: color-mix(in oklab, oklch(0.78 0.14 75) 16%, var(--muted));
  border-bottom-color: color-mix(in oklab, oklch(0.7 0.14 75) 30%, var(--border));
}

.ahq-sheet__head--info {
  background: color-mix(in oklab, oklch(0.65 0.12 250) 14%, var(--muted));
  border-bottom-color: color-mix(in oklab, oklch(0.55 0.12 250) 28%, var(--border));
}

.ahq-sheet__head--destructive {
  background: color-mix(in oklab, oklch(0.6 0.18 25) 12%, var(--muted));
  border-bottom-color: color-mix(in oklab, oklch(0.55 0.18 25) 28%, var(--border));
}

.ahq-sheet__head--outline,
.ahq-sheet__head--secondary {
  background: color-mix(in oklab, var(--muted) 70%, transparent);
}

.ahq-sheet__msg {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.ahq-ord-esim {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ahq-ord-esim__usage {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ahq-ord-esim__bar {
  height: 0.375rem;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}

.ahq-ord-esim__bar > span {
  display: block;
  height: 100%;
  background: var(--foreground);
  border-radius: inherit;
}

.ahq-ord-esim__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ahq-ord-topup-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ahq-ord-topup-pkg {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-family: var(--font-sans);
  text-align: start;
  cursor: pointer;
  box-shadow: none;
}

.ahq-ord-topup-pkg:hover {
  border-color: color-mix(in oklab, var(--foreground) 25%, var(--border));
}

.ahq-ord-topup-pkg.is-selected {
  border-color: var(--foreground);
  background: color-mix(in oklab, var(--muted) 45%, var(--card));
}

.ahq-ord-topup-pkg--more {
  display: none;
}

.ahq-ord-topup-list.is-expanded .ahq-ord-topup-pkg--more {
  display: grid;
}

.ahq-ord-topup-pkg--skel {
  pointer-events: none;
  min-height: 3.25rem;
}

.ahq-ord-topup-pkg__radio {
  width: 1rem;
  height: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  flex-shrink: 0;
  position: relative;
}

.ahq-ord-topup-pkg.is-selected .ahq-ord-topup-pkg__radio {
  border-color: var(--foreground);
}

.ahq-ord-topup-pkg.is-selected .ahq-ord-topup-pkg__radio::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: var(--foreground);
}

.ahq-ord-topup-pkg__mid {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ahq-ord-topup-pkg__data {
  font-size: 0.875rem;
  font-weight: 600;
}

.ahq-ord-topup-pkg__dur {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.ahq-ord-topup-pkg__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  min-width: 3.5rem;
}

.ahq-ord-topup-pkg__was {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-decoration: line-through;
}

.ahq-ord-topup-pkg__amount {
  font-size: 0.9375rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.ahq-ord-topup-pkg__cur {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}

.ahq-ord-topup-more {
  width: 100%;
  margin-top: 0.15rem;
}

#ahqOrdTopupAlert.payment-alert {
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid color-mix(in oklab, var(--destructive) 35%, var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklab, var(--destructive) 8%, var(--card));
  color: var(--destructive);
  font-size: 0.8125rem;
  box-shadow: none;
}

#ahqOrdTopupAlert .payment-alert-message {
  margin: 0;
}

.ahq-ord-esim__share {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
}

.ahq-ord-esim__share-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.ahq-ord-esim__share-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.ahq-ord-esim__share-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ahq-ord-esim__share-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}

.ahq-ord-esim__share-label .ahq-dl__icon {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--muted-foreground);
}

.ahq-ord-esim__share-label .ahq-dl__icon svg {
  width: 100%;
  height: 100%;
}

.ahq-ord-esim__share-value {
  min-width: 0;
}

.ahq-ord-esim__share-link,
.ahq-ord-esim__share-code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  text-decoration: none;
}

.ahq-ord-esim__share-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ahq-ord-esim__copy {
  flex: 0 0 auto;
  min-height: 2rem;
  padding-inline: 0.65rem;
  font-size: 0.75rem;
}

.ahq-ord-esim__copy.is-copied {
  font-weight: 600;
}

.ahq-ord-esim__email {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.ahq-ord-esim__email-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ahq-ord-esim__email-field {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
}

.ahq-ord-esim__email-row .ahq-btn {
  flex: 0 0 auto;
  min-height: 3rem;
}

.ahq-ord-esim__email-status {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.ahq-ord-esim__email-status[data-variant='ok'] {
  color: var(--foreground);
}

.ahq-ord-esim__email-status[data-variant='error'] {
  color: var(--destructive, #dc2626);
}

.ahq-ord-esim__qr {
  display: block;
  width: 8.5rem;
  height: 8.5rem;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius, 0.5rem);
  background: #fff;
}

.ahq-dl dd a {
  color: var(--foreground);
  text-decoration: none;
}

.ahq-dl dd a:hover {
  opacity: 0.85;
}

/* Order detail — issued document download */
.ahq-ord-doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  color: inherit;
  text-decoration: none;
  background: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ahq-ord-doc:hover {
  background: color-mix(in oklab, var(--muted) 40%, transparent);
}

.ahq-ord-doc:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

.ahq-ord-doc__lead {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.ahq-ord-doc__icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.ahq-ord-doc__icon svg,
.ahq-ord-doc__action-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ahq-ord-doc__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-ord-doc__action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.ahq-ord-doc__action-icon {
  display: inline-flex;
  width: 0.875rem;
  height: 0.875rem;
}

.ahq-ord-doc:hover .ahq-ord-doc__action {
  color: var(--foreground);
}

.ahq-sheet__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.ahq-sheet__head .ahq-muted {
  margin: 0.2rem 0 0;
  line-height: 1.35;
}

.ahq-sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ahq-sheet__body--catalog {
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.875rem;
  /* Keep search pinned; list fills the rest of the sheet. */
  overflow: hidden;
}

.ahq-sheet__body--catalog > .ahq-field,
.ahq-sheet__body--catalog > .ahq-muted {
  flex-shrink: 0;
}

.ahq-sheet__foot {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.875rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 45%, var(--popover));
  flex-shrink: 0;
}

.ahq-sheet__foot--stack {
  align-items: stretch;
}

.ahq-sheet__foot .ahq-muted {
  margin: 0;
  font-size: 0.8125rem;
}

.ahq-sheet__alert {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid color-mix(in oklab, var(--destructive) 40%, var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklab, var(--destructive) 8%, var(--card));
  color: var(--destructive);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}

.ahq-sheet__alert[data-kind='success'] {
  border-color: color-mix(in oklab, oklch(0.45 0.12 145) 40%, var(--border));
  background: color-mix(in oklab, oklch(0.45 0.12 145) 8%, var(--card));
  color: oklch(0.45 0.12 145);
}

.ahq-sheet__alert[hidden] {
  display: none !important;
}

.ahq-catalog-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 22rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-family: var(--font-sans);
  text-align: start;
  cursor: pointer;
  box-shadow: none;
}

.ahq-catalog-trigger--block {
  max-width: none;
}

.ahq-catalog-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ahq-phone-row__dial.ahq-catalog-trigger {
  max-width: none;
  min-width: 0;
  padding-inline: 0.55rem;
  gap: 0.35rem;
}

.ahq-phone-row__dial .ahq-catalog-trigger__text {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8125rem;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}

.ahq-catalog-trigger:hover {
  background: var(--muted);
}

.ahq-catalog-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-catalog-trigger__text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-catalog-trigger__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

[dir='rtl'] .ahq-catalog-trigger__icon {
  transform: scaleX(-1);
}

/*
 * Phone row stays LTR for +966, but put the mirrored chevron on the outer
 * edge so it points startward (←) like other RTL catalog triggers — not into the code.
 */
[dir='rtl'] .ahq-phone-row__dial.ahq-catalog-trigger {
  flex-direction: row-reverse;
}

.ahq-pick-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  overflow: auto;
  max-height: min(28rem, calc(100dvh - 14rem));
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}

/* Dial / nationality / agent-apply catalogs: grow to full sheet height. */
.ahq-sheet__body--catalog > .ahq-pick-list {
  flex: 1 1 0;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  max-height: none;
}

.ahq-pick-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-family: var(--font-sans);
  text-align: start;
  cursor: pointer;
  box-shadow: none;
}

.ahq-pick-row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--ring) 45%, transparent);
}

.ahq-pick-row:last-child {
  border-bottom: 0;
}

.ahq-pick-row:hover {
  background: var(--muted);
}

.ahq-pick-row.is-selected {
  background: color-mix(in oklab, var(--muted) 70%, transparent);
}

.ahq-pick-row input {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--foreground);
}

.ahq-pick-row__flag {
  width: 1.35rem;
  height: 1rem;
  flex-shrink: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 2px;
  line-height: 0;
}

.ahq-pick-row__flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ahq-pick-row__body {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.ahq-pick-row__title {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

.ahq-pick-row__code {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--muted-foreground);
  direction: ltr;
  unicode-bidi: isolate;
}

.ahq-sheet__hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.ahq-sheet__hero .ahq-sheet__amount {
  flex: 1 1 auto;
  min-width: 0;
}

.ahq-sheet__hero .ahq-sheet__badge {
  flex: 0 0 auto;
  margin-inline-start: auto;
}

.ahq-sheet__badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 0.35rem;
  height: auto;
  min-height: 1.5rem;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.ahq-sheet__badge .ahq-sheet__badge-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.ahq-sheet__badge .ahq-sheet__badge-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ahq-sheet__amount {
  font-size: 1.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.ahq-sheet__amount.is-in {
  color: color-mix(in oklab, oklch(0.45 0.14 145) 85%, var(--foreground));
}

.ahq-sheet__amount.is-out {
  color: var(--foreground);
}

.ahq-sheet__section {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.ahq-sheet__section + .ahq-sheet__section {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.ahq-sheet__section-label {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.ahq-dl {
  display: grid;
  grid-template-columns: minmax(8.5rem, 42%) 1fr;
  gap: 0.7rem 0.75rem;
  margin: 0;
}

.ahq-dl > div {
  display: contents;
}

/* display:contents ignores UA [hidden]; keep agent-only rows actually hidden. */
.ahq-dl > div[hidden] {
  display: none !important;
}

.ahq-dl dt {
  margin: 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  align-self: start;
  padding-top: 0.1rem;
}

.ahq-dl__icon {
  display: inline-flex;
  width: 0.875rem;
  height: 0.875rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
  opacity: 0.9;
}

.ahq-dl__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ahq-dl dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.ahq-dl dd.ahq-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 400;
}

.ahq-dl__row--muted dt {
  color: color-mix(in oklab, var(--muted-foreground) 78%, transparent);
  font-weight: 400;
}

.ahq-dl__row--muted .ahq-dl__icon {
  opacity: 0.55;
}

.ahq-dl__row--muted dd {
  color: color-mix(in oklab, var(--muted-foreground) 92%, var(--foreground));
  font-weight: 400;
  font-size: 0.8125rem;
}

.ahq-dl__row--emphasis dd {
  font-weight: 600;
  color: var(--foreground);
}

.ahq-table tbody tr.ahq-table__row--clickable {
  cursor: pointer;
}

.ahq-table tbody tr.ahq-table__row--clickable:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--ring) 55%, transparent);
}

.ahq-muted {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.ahq-auto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.ahq-auto-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ahq-auto-grid strong {
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-auto-error {
  margin: 0 1rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
  font-size: 0.8125rem;
}

.ahq-auto-card-status {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--muted) 40%, var(--card));
}

/* display:flex above otherwise beats the HTML hidden attribute */
.ahq-auto-card-status[hidden] {
  display: none;
}

.ahq-auto-card-status strong {
  font-size: 0.9375rem;
  font-weight: 600;
}

.ahq-auto-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ahq-auto-card-actions .ahq-btn {
  flex: 1 1 auto;
}

#ahqWalletAutoStripeWrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#ahqWalletAutoStripeWrap[hidden] {
  display: none;
}

#ahqWalletAutoStripeWrap #ahqWalletAutoPrivacy {
  margin: 0;
}

.ahq-auto-stripe {
  min-height: 3rem;
  padding: 0.25rem 0;
}

.ahq-auto-stripe[data-ahq-loading="true"] {
  display: flex;
  align-items: center;
}

.ahq-auto-stripe .ahq-skel--lg {
  width: 100%;
  height: 2.75rem;
}

.ahq-auto-mandate {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

#ahqWalletAutoStripeWrap .ahq-btn {
  width: 100%;
}

/* Link/replace card is the primary action while the Stripe form is open */
#ahqWalletAutoLink {
  font-weight: 600;
}

#ahqWalletSheet .ahq-sheet__foot #ahqWalletAutoSave.ahq-btn--ghost {
  order: 1;
}

#ahqWalletSheet .ahq-sheet__foot #ahqWalletGoBilling {
  order: 2;
}

#ahqWalletAutoMsg.ahq-auto-msg--error {
  color: var(--destructive);
}

#ahqWalletAutoMsg.ahq-auto-msg--ok {
  color: var(--foreground);
}

#ahqWalletAutoPrivacy {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  line-height: 1.45;
}

#ahqWalletAutoPrivacy strong {
  font-size: 0.8125rem;
  font-weight: 600;
}

#ahqWalletAutoPrivacy span {
  color: var(--muted-foreground);
}

.ahq-badge {
  display: inline-flex;
  align-items: center;
  height: 1.25rem;
  padding: 0 0.5rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--primary);
  color: var(--primary-foreground);
}

/* display:inline-flex above beats UA [hidden] without !important */
.ahq-badge[hidden] {
  display: none !important;
}

.ahq-badge[data-variant='outline'] {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}

.ahq-badge[data-variant='secondary'] {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.ahq-badge[data-variant='success'] {
  background: color-mix(in oklab, oklch(0.65 0.15 145) 18%, transparent);
  color: oklch(0.4 0.12 145);
  border-color: transparent;
}

.ahq-badge[data-variant='warning'] {
  background: color-mix(in oklab, oklch(0.75 0.14 75) 20%, transparent);
  color: oklch(0.42 0.11 55);
  border-color: transparent;
}

.ahq-badge[data-variant='info'] {
  background: color-mix(in oklab, oklch(0.62 0.12 250) 16%, transparent);
  color: oklch(0.4 0.1 250);
  border-color: transparent;
}

.ahq-badge[data-variant='destructive'] {
  background: color-mix(in oklab, var(--destructive) 12%, transparent);
  color: var(--destructive);
}

.ahq-seg {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  flex-shrink: 0;
}

.ahq-seg__btn {
  appearance: none;
  height: 1.75rem;
  padding: 0 0.625rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.ahq-seg__btn:hover {
  color: var(--foreground);
  background: var(--accent);
}

.ahq-seg__btn.is-active {
  background: var(--primary);
  color: var(--primary-foreground);
}

.ahq-seg__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-seg--stretch {
  display: flex;
  width: 100%;
}

.ahq-seg--stretch .ahq-seg__btn {
  flex: 1 1 0;
  height: 2.25rem;
  font-size: 0.8125rem;
}

.ahq-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.ahq-table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}

/* Side sheets are narrower — fit columns instead of forcing a horizontal scroll. */
.ahq-sheet .ahq-table {
  min-width: 0;
  table-layout: fixed;
}

.ahq-sheet .ahq-table th,
.ahq-sheet .ahq-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.ahq-sheet .ahq-table__num {
  white-space: nowrap;
  width: 5.75rem;
}

.ahq-table th,
.ahq-table td {
  padding: 0.625rem 1rem;
  text-align: start;
  vertical-align: middle;
  white-space: nowrap;
}

/* Table cells ignore UA [hidden] in some engines — keep agent-only cols hidden. */
.ahq-table th[hidden],
.ahq-table td[hidden] {
  display: none !important;
}

.ahq-table thead tr {
  border-bottom: 1px solid var(--border);
}

.ahq-table th {
  height: 2.5rem;
  font-weight: 500;
  color: var(--foreground);
}

.ahq-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.ahq-table tbody tr:last-child {
  border-bottom: 0;
}

.ahq-table tbody tr:hover {
  background: color-mix(in oklab, var(--muted) 50%, transparent);
}

.ahq-table__num {
  text-align: end !important;
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
}

/* Withdraw sheet: amount is the first column (inline-start in RTL) — keep $ flush to that edge */
html[dir='rtl'] .ahq-sheet .ahq-table th.ahq-table__num:first-child,
html[dir='rtl'] .ahq-sheet .ahq-table td.ahq-table__num:first-child {
  text-align: start !important;
}

.ahq-table__sub {
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.ahq-table__loading td,
.ahq-table__empty td,
.ahq-table__error td {
  text-align: center !important;
  color: var(--muted-foreground);
  padding: 2rem 1rem;
  white-space: normal;
}

.ahq-amount--in {
  color: oklch(0.45 0.14 145);
  font-weight: 600;
}

.ahq-amount--out {
  color: var(--destructive);
  font-weight: 600;
}

.ahq-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-sizing: border-box;
  height: 2.7rem; /* ~20% taller than 2.25rem */
  min-height: 2.7rem;
  max-height: 2.7rem;
  padding: 0 0.875rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

a.ahq-btn:hover,
a.ahq-btn:focus,
a.ahq-btn:active {
  text-decoration: none;
}

.ahq-btn > svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.ahq-btn[hidden],
.ahq-card__footer--actions > [hidden] {
  display: none !important;
}

.ahq-skel {
  display: inline-block;
  height: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  animation: ahq-skel-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}

.ahq-skel--sm {
  width: 4.5rem;
}

.ahq-skel--md {
  width: 8rem;
}

.ahq-skel--lg {
  width: 12rem;
  max-width: 100%;
}

.ahq-skel--badge {
  width: 3.5rem;
  height: 1.25rem;
  border-radius: 9999px;
}

.ahq-skel--value {
  width: 7.5rem;
  height: 1.5rem;
  display: block;
  margin-top: 0.2rem;
}

.ahq-skel--value-sm {
  width: 5rem;
  height: 1.1rem;
  display: block;
  margin-top: 0.2rem;
}

.ahq-card[data-ahq-loading='true'] .ahq-btn:disabled {
  opacity: 0.55;
}

.ahq-badge:has(> .ahq-skel) {
  border-color: transparent;
  background: transparent;
  padding-inline: 0;
  min-width: 0;
  height: auto;
}

.ahq-skel-row td {
  padding-block: 0.875rem;
}

.ahq-table__num .ahq-skel {
  margin-inline-start: auto;
}

@keyframes ahq-skel-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ahq-skel {
    animation: none;
  }
}

.ahq-btn:hover {
  opacity: 0.92;
}

.ahq-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ahq-btn[aria-busy='true'] {
  position: relative;
  cursor: wait;
  opacity: 0.88;
  pointer-events: none;
  color: transparent !important;
}

.ahq-btn[aria-busy='true'] > * {
  visibility: hidden;
}

.ahq-btn[aria-busy='true']::after {
  content: '';
  position: absolute;
  /* Physical centering — logical inset + physical margin shifted RTL spinners off-center. */
  inset: 0;
  width: 1rem;
  height: 1rem;
  margin: auto;
  border: 2px solid color-mix(in oklab, var(--primary-foreground) 35%, transparent);
  border-top-color: var(--primary-foreground);
  border-radius: 50%;
  animation: ahq-btn-spin 0.7s linear infinite;
}

.ahq-btn--ghost[aria-busy='true']::after {
  border-color: color-mix(in oklab, var(--foreground) 25%, transparent);
  border-top-color: var(--foreground);
}

@keyframes ahq-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ahq-btn[aria-busy='true']::after {
    animation: none;
    border-top-color: inherit;
    opacity: 0.7;
  }
}

.ahq-btn--ghost {
  /* Filled secondary surface so height reads the same as solid primary
     (transparent ghost + hairline border looks shorter beside black). */
  background: var(--secondary);
  border-color: var(--border);
  color: var(--foreground);
}

.ahq-btn--ghost:hover {
  background: color-mix(in oklab, var(--secondary) 72%, var(--foreground) 8%);
  opacity: 1;
}

.ahq-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

@media (max-width: 767.98px) {
  .ahq-card__header--row {
    flex-direction: column;
    align-items: flex-start;
  }

  .ahq-card__header-actions {
    width: 100%;
  }

  .ahq-card__header-actions .ahq-btn {
    flex: 1 1 auto;
  }

  .ahq-auto-grid {
    grid-template-columns: 1fr;
  }
}

/* —— White-label / shared form helpers —— */
.ahq-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ahq-stack--sm {
  gap: 0.75rem;
}

#ahqWlForm.ahq-wl-form--locked [data-ahq-wl-lock] {
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

#ahqWlForm.ahq-wl-form--locked [data-ahq-wl-lock] .ahq-input,
#ahqWlForm.ahq-wl-form--locked [data-ahq-wl-lock] .ahq-btn,
#ahqWlForm.ahq-wl-form--locked [data-ahq-wl-lock] .ahq-tip,
#ahqWlForm.ahq-wl-form--locked [data-ahq-wl-lock] .ahq-input-affix,
#ahqWlForm.ahq-wl-form--locked [data-ahq-wl-lock] .ahq-color {
  cursor: not-allowed;
}

#ahqWlDisabledGate:not([hidden]) {
  margin: 0;
}

.ahq-sticky-save {
  position: fixed;
  z-index: 40;
  bottom: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  padding-bottom: calc(1.15rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 88%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: none;
}

.ahq-sticky-save[hidden] {
  display: none !important;
}

.ahq-sticky-save .ahq-form-msg {
  flex: 1 1 auto;
  min-width: 0;
}

.ahq-sticky-save .ahq-btn {
  flex-shrink: 0;
  margin-inline-start: auto;
}

body.ahq-wl-has-sticky-save .ahq-main,
body.ahq-has-sticky-save .ahq-main {
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .ahq-sticky-save {
    inset-inline-start: var(--sidebar-width);
    padding-inline: 1.5rem;
  }

  .ahq-shell[data-sidebar='collapsed'] .ahq-sticky-save {
    inset-inline-start: var(--sidebar-width-icon);
  }
}

/* Keep sticky CTAs on the inline end: right in LTR, left in RTL. */

#ahqWlForm.ahq-wl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

#ahqWlForm.ahq-wl-grid > .ahq-card {
  height: 100%;
  min-height: 0;
}

#ahqWlForm.ahq-wl-grid > .ahq-card > .ahq-card__body {
  flex: 1 1 auto;
}

#ahqWlForm[hidden] {
  display: none !important;
}

@media (min-width: 960px) {
  #ahqWlForm.ahq-wl-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  /* Publish / save stays full width; Pricing + Catalog share a row. */
  #ahqWlForm .ahq-card--wide {
    grid-column: 1 / -1;
  }
}

/*
 * Constrain the whole field (label + control), not just the input.
 * Otherwise labels span the card while inputs stay 22rem and look orphaned in RTL.
 */
#ahqWlForm .ahq-field:has(> .ahq-input),
#ahqWlForm .ahq-field:has(> .ahq-input-affix),
#ahqWlForm .ahq-field:has(> .ahq-slug-row),
#ahqWlForm .ahq-field:has(> .ahq-suggest-wrap),
#ahqWlForm .ahq-field:has(> .ahq-color),
#ahqWlForm .ahq-field:has(> .ahq-logo-row),
#ahqWlForm .ahq-exclude-bar {
  max-width: 22rem;
  width: 100%;
}

#ahqWlForm .ahq-field > .ahq-input,
#ahqWlForm .ahq-field > .ahq-input-affix,
#ahqWlForm .ahq-field > .ahq-slug-row,
#ahqWlForm .ahq-field > .ahq-suggest-wrap,
#ahqWlForm .ahq-field > .ahq-color,
#ahqWlForm .ahq-field > .ahq-logo-row {
  max-width: none;
  width: 100%;
}

/* Support email/phone share a row — fill each grid cell, don’t re-cap at 22rem. */
#ahqWlForm .ahq-form-grid {
  width: 100%;
  max-width: 45rem;
}

#ahqWlForm .ahq-form-grid > .ahq-field {
  max-width: none;
  width: 100%;
  min-width: 0;
}

#ahqWlForm .ahq-form-grid > .ahq-field > .ahq-input,
#ahqWlForm .ahq-form-grid > .ahq-field > .ahq-input-icon {
  width: 100%;
  max-width: none;
}

/* Slug needs room for host + /a/ + value; markup matches that width. */
#ahqWlForm .ahq-field:has(> .ahq-slug-row),
#ahqWlForm .ahq-field:has(> #ahqWlMarkupPercent) {
  max-width: 28rem;
}

#ahqWlForm .ahq-input--code,
#ahqWlForm .ahq-exclude-list,
#ahqWlForm .ahq-chips {
  max-width: 36rem;
}

#ahqWlForm .ahq-codeblock {
  max-width: none;
  width: 100%;
}

.ahq-slug-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.ahq-slug-row .ahq-input-affix--slug {
  flex: 1 1 auto;
  min-width: 0;
}

.ahq-slug-row .ahq-btn {
  flex-shrink: 0;
}

.ahq-btn--sm {
  height: 2.4rem; /* ~20% taller than 2rem */
  padding-inline: 0.65rem;
  font-size: 0.8125rem;
}

.ahq-input-affix--slug {
  min-width: 0;
}

.ahq-input-affix--slug .ahq-input-affix__prefix {
  flex: 0 0 auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.ahq-input-affix--slug .ahq-input--affix {
  min-width: 0;
  flex: 1 1 auto;
  padding-inline-end: 0.35rem;
}

.ahq-input-affix--slug .ahq-input--affix:disabled {
  opacity: 0.9;
  cursor: default;
  color: var(--foreground);
}

.ahq-input-affix__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0.2rem 0.25rem 0.2rem 0;
  flex-shrink: 0;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.ahq-input-affix__action:hover {
  background: var(--muted);
  color: var(--foreground);
}

.ahq-input-affix__action[hidden] {
  display: none !important;
}

.ahq-input-affix__action svg {
  width: 0.95rem;
  height: 0.95rem;
}

.ahq-field[data-status='ok'] .ahq-input-affix {
  border-color: color-mix(in oklab, oklch(0.55 0.12 145) 55%, var(--input));
}

.ahq-field[data-status='error'] .ahq-input-affix {
  border-color: var(--destructive);
}

.ahq-link {
  color: var(--foreground);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.ahq-link:hover {
  opacity: 0.85;
}

.ahq-field__hint,
.ahq-field__status {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.ahq-field__status[data-kind='ok'] {
  color: oklch(0.5 0.12 145);
}

/*
 * Applied-slug status sits under an LTR slug control.
 * Stretch full field width so Arabic labels use text-align:start (RTL)
 * while the URL stays left-aligned like the input above — not packed
 * to the inline-start edge as a shrink-wrapped column.
 */
#ahqWlSlugStatus .ahq-slug-status {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  line-height: 1.45;
  width: 100%;
}

/* Structured stack is informational — don’t wash every line green/red. */
#ahqWlSlugStatus:has(.ahq-slug-status)[data-kind='ok'],
#ahqWlSlugStatus:has(.ahq-slug-status)[data-kind='error'],
#ahqWlSlugStatus:has(.ahq-slug-status)[data-kind='pending'] {
  color: inherit;
}

#ahqWlSlugStatus .ahq-slug-status__label {
  color: var(--muted-foreground);
}

#ahqWlSlugStatus .ahq-slug-status__url {
  display: block;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--foreground);
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  overflow-wrap: anywhere;
}

#ahqWlSlugStatus .ahq-slug-status__meta {
  display: block;
  color: var(--muted-foreground);
}

#ahqWlSlugStatus:has(.ahq-slug-status)[data-kind='error'] .ahq-slug-status__meta {
  color: var(--destructive);
}

.ahq-field__status[data-kind='error'],
.ahq-field__status[data-kind='pending'] {
  color: var(--muted-foreground);
}

.ahq-field__status[data-kind='error'] {
  color: var(--destructive);
}

.ahq-field[data-status='error'] .ahq-input {
  border-color: var(--destructive);
}

.ahq-switch {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.ahq-switch__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.ahq-switch__label {
  font-size: 0.875rem;
  font-weight: 500;
}

.ahq-switch__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ahq-switch__track {
  position: relative;
  width: 2.5rem;
  height: 1.4rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  border-radius: 999px;
  background: var(--muted);
  border: 1px solid var(--border);
  transition: background 0.15s ease;
}

.ahq-switch__thumb {
  position: absolute;
  top: 0.15rem;
  inset-inline-start: 0.15rem;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: var(--background);
  border: 1px solid var(--border);
  transition: transform 0.15s ease;
}

.ahq-switch__input:checked + .ahq-switch__track {
  background: var(--foreground);
  border-color: var(--foreground);
}

.ahq-switch__input:checked + .ahq-switch__track .ahq-switch__thumb {
  transform: translateX(1.05rem);
  background: var(--background);
}

html[dir='rtl'] .ahq-switch__input:checked + .ahq-switch__track .ahq-switch__thumb {
  transform: translateX(-1.05rem);
}

.ahq-switch__input:focus-visible + .ahq-switch__track {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

/* Withdraw payout method radios (billing sheet) */
.ahq-wd-methods {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.ahq-wd-methods > .ahq-field__label,
.ahq-wd-methods > legend.ahq-field__label {
  padding: 0;
  margin: 0 0 0.35rem;
}

.ahq-wd-method {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  cursor: pointer;
  box-sizing: border-box;
}

.ahq-wd-method:hover {
  background: color-mix(in oklab, var(--muted) 55%, var(--background));
}

.ahq-wd-method:has(input:checked) {
  border-color: var(--foreground);
  background: color-mix(in oklab, var(--muted) 70%, transparent);
}

.ahq-wd-method:has(input:focus-visible) {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-wd-method input {
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--foreground);
}

.ahq-wd-method__copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.ahq-wd-method__title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--foreground);
}

.ahq-wd-method__meta {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted-foreground);
}

.ahq-wd-method__logo {
  width: 2.5rem;
  height: 2.5rem;
  margin-inline-start: auto;
  flex-shrink: 0;
  border-radius: calc(var(--radius) - 4px);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--background);
}

/* Refund / protect option tile — soft selected state (match pick-row / chips) */
.ahq-protect {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ahq-protect:hover {
  background: color-mix(in oklab, var(--muted) 55%, var(--background));
}

.ahq-protect:has(.ahq-switch__input:checked) {
  border-color: var(--border);
  background: color-mix(in oklab, var(--muted) 70%, transparent);
}

.ahq-protect:has(.ahq-switch__input:focus-visible) {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-protect__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklab, var(--muted) 55%, transparent);
  color: var(--muted-foreground);
}

.ahq-protect:has(.ahq-switch__input:checked) .ahq-protect__icon {
  color: var(--foreground);
}

.ahq-protect__icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.ahq-protect__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.ahq-protect__label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--foreground);
}

.ahq-protect__meta {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted-foreground);
}

.ahq-protect__price {
  flex-shrink: 0;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in oklab, var(--muted) 55%, transparent);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.ahq-protect:has(.ahq-switch__input:checked) .ahq-protect__price {
  background: var(--background);
  color: var(--foreground);
}

.ahq-protect .ahq-switch__track {
  margin-top: 0;
}

.ahq-protect .ahq-switch__input:checked + .ahq-switch__track {
  background: #000;
  border-color: #000;
}

.ahq-protect .ahq-switch__input:checked + .ahq-switch__track .ahq-switch__thumb {
  background: #fff;
  border-color: #fff;
}

.ahq-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8125rem;
}

.ahq-banner[hidden] {
  display: none !important;
}

.ahq-banner--warn {
  background: color-mix(in oklab, oklch(0.85 0.12 85) 22%, transparent);
  border-color: color-mix(in oklab, oklch(0.75 0.12 85) 40%, var(--border));
}

.ahq-logo-row {
  display: flex;
  gap: 0.875rem;
  align-items: center;
}

.ahq-logo-preview {
  position: relative;
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
}

.ahq-logo-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ahq-logo-preview img[hidden] {
  display: none !important;
}

.ahq-logo-preview__fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.ahq-logo-preview__fallback[hidden] {
  display: none !important;
}

.ahq-logo-preview__fallback svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.ahq-logo-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
}

.ahq-logo-actions > .ahq-muted {
  margin: 0;
  line-height: 1.35;
}

.ahq-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Brand color — unified picker control (swatch + HEX), not a plain text input */
.ahq-color {
  --ahq-color: #4361EE;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.75rem;
  padding-block: 0.35rem;
  padding-inline: 0.35rem 0.55rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklab, var(--ahq-color) 6%, var(--background));
  box-shadow: none;
  cursor: text;
  /* Hex is LTR (#AABBCC) even on Arabic pages — avoid # flipping after digits. */
  direction: ltr;
  unicode-bidi: isolate;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ahq-color:hover {
  border-color: color-mix(in oklab, var(--foreground) 22%, var(--input));
}

.ahq-color:focus-within {
  border-color: color-mix(in oklab, var(--ahq-color) 55%, var(--ring));
  background: color-mix(in oklab, var(--ahq-color) 10%, var(--background));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ahq-color) 22%, transparent);
}

.ahq-color__swatch {
  position: relative;
  width: 2.05rem;
  height: 2.05rem;
  flex-shrink: 0;
  border: 1px solid color-mix(in oklab, var(--foreground) 12%, transparent);
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  cursor: pointer;
  background:
    linear-gradient(45deg, #e5e5e5 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(-45deg, #e5e5e5 25%, transparent 25%) 0 4px / 8px 8px,
    linear-gradient(45deg, transparent 75%, #e5e5e5 75%) 4px -4px / 8px 8px,
    linear-gradient(-45deg, transparent 75%, #e5e5e5 75%) 4px 0 / 8px 8px,
    #fff;
}

.ahq-color__chip {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ahq-color);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, #000 14%, transparent);
}

.ahq-color__swatch input[type='color'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}

.ahq-color__meta {
  display: flex;
  align-items: center;
  gap: 0.05rem;
  min-width: 0;
  flex: 1 1 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ahq-color__hash {
  color: var(--muted-foreground);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  user-select: none;
}

.ahq-color__hex {
  width: 5.5ch;
  min-width: 0;
  max-width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  outline: none;
  box-shadow: none;
}

.ahq-color__hex::placeholder {
  color: var(--muted-foreground);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.ahq-color__hint {
  flex-shrink: 0;
  margin-inline-start: auto;
  padding: 0.22rem 0.42rem;
  border: 1px solid color-mix(in oklab, var(--foreground) 10%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--muted) 70%, transparent);
  color: var(--muted-foreground);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  user-select: none;
}

.ahq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0;
  min-height: 0.25rem;
}

.ahq-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.35rem 0.25rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: color-mix(in oklab, var(--muted) 55%, transparent);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
}

.ahq-chip img {
  border-radius: 2px;
}

.ahq-chip__code {
  color: var(--muted-foreground);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.68rem;
}

.ahq-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 0;
  border-radius: calc(var(--radius) - 6px);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.ahq-chip__remove:hover {
  background: var(--muted);
  color: var(--foreground);
}

.ahq-suggest-wrap {
  position: relative;
}

.ahq-suggest {
  position: absolute;
  z-index: 20;
  inset-inline: 0;
  top: calc(100% + 0.25rem);
  max-height: 14rem;
  overflow: auto;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--popover);
  color: var(--popover-foreground);
}

.ahq-suggest[hidden] {
  display: none !important;
}

.ahq-suggest button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  text-align: start;
  cursor: pointer;
}

.ahq-suggest button:hover,
.ahq-suggest button:focus-visible {
  background: var(--muted);
  outline: none;
}

.ahq-exclude-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
}

.ahq-exclude-bar .ahq-input,
.ahq-exclude-bar .ahq-select {
  flex: 1 1 12rem;
  min-width: 0;
}

.ahq-exclude-list {
  margin-top: 0.65rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
}

.ahq-exclude-list--sheet {
  margin-top: 0;
  max-height: min(28rem, calc(100vh - 16rem));
  overflow: auto;
}

#ahqWlExcludeSheet .ahq-field > .ahq-input,
#ahqWlExcludeSheet .ahq-field > select.ahq-input {
  max-width: none;
  width: 100%;
}

.ahq-exclude-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 45%, transparent);
}

.ahq-exclude-list__count {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.ahq-exclude-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.ahq-exclude-row:last-child {
  border-bottom: 0;
}

.ahq-exclude-row.is-hidden-evisa {
  opacity: 0.55;
}

.ahq-exclude-row__flag {
  flex-shrink: 0;
  width: 1.5rem;
  display: flex;
  justify-content: center;
}

.ahq-exclude-row__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ahq-exclude-row__title {
  font-size: 0.8125rem;
  font-weight: 500;
}

.ahq-exclude-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 0.7rem;
  color: var(--muted-foreground);
}

.ahq-preview-line {
  margin: 0;
  font-size: 0.875rem;
}

.ahq-embed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.ahq-embed-head .ahq-muted {
  margin: 0.2rem 0 0;
}

.ahq-codeblock {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--foreground) 14%, transparent);
  border-radius: calc(var(--radius) + 2px);
  background: oklch(0.22 0.01 260);
  color: oklch(0.93 0.01 260);
  box-shadow: none;
}

.ahq-codeblock__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid color-mix(in oklab, #fff 10%, transparent);
  background: color-mix(in oklab, #000 28%, oklch(0.22 0.01 260));
}

.ahq-codeblock__lang {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in oklab, #fff 62%, transparent);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.ahq-codeblock__bar .ahq-btn {
  color: color-mix(in oklab, #fff 88%, transparent);
  border-color: color-mix(in oklab, #fff 16%, transparent);
  background: color-mix(in oklab, #fff 6%, transparent);
}

.ahq-codeblock__bar .ahq-btn:hover {
  color: #fff;
  background: color-mix(in oklab, #fff 12%, transparent);
  border-color: color-mix(in oklab, #fff 24%, transparent);
}

.ahq-codeblock__code {
  display: block;
  width: 100%;
  min-height: 9.5rem;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: oklch(0.9 0.02 145);
  caret-color: #fff;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: 0.78rem;
  line-height: 1.55;
  letter-spacing: 0;
  white-space: pre;
  overflow: auto;
  resize: vertical;
  tab-size: 2;
  box-shadow: none;
  outline: none;
}

.ahq-codeblock__code:focus,
.ahq-codeblock__code:focus-visible {
  outline: none;
  box-shadow: none;
}

.ahq-codeblock__code::selection {
  background: color-mix(in oklab, oklch(0.7 0.14 145) 45%, transparent);
  color: #fff;
}

/* Legacy alias if used elsewhere */
.ahq-input--code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  line-height: 1.45;
  resize: vertical;
}

.ahq-form-msg {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.ahq-form-msg[data-kind='success'] {
  color: oklch(0.45 0.12 145);
}

.ahq-form-msg[data-kind='error'] {
  color: var(--destructive);
}

/* Floating snackbar (save / action feedback) */
.ahq-snack {
  position: fixed;
  /* Above sheets/modals (85–92) so errors remain visible while overlays are open. */
  z-index: 110;
  top: calc(3.75rem + env(safe-area-inset-top, 0px));
  inset-inline-end: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  max-width: min(22rem, calc(100dvw - 2rem));
  padding: 0.75rem 0.75rem 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--foreground);
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.4rem);
  transition:
    opacity var(--ahq-motion-pop) ease,
    transform var(--ahq-motion-pop) var(--ahq-ease-out),
    visibility var(--ahq-motion-pop) ease;
}

.ahq-snack.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ahq-snack[hidden] {
  display: none !important;
}

.ahq-snack[data-kind='success'] {
  border-color: color-mix(in oklab, oklch(0.55 0.14 145) 45%, var(--border));
  background: color-mix(in oklab, oklch(0.55 0.14 145) 8%, var(--background));
}

.ahq-snack[data-kind='error'] {
  border-color: color-mix(in oklab, var(--destructive) 40%, var(--border));
  background: color-mix(in oklab, var(--destructive) 8%, var(--background));
}

.ahq-snack__text {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
}

.ahq-snack[data-kind='success'] .ahq-snack__text {
  color: oklch(0.38 0.11 145);
}

.ahq-snack[data-kind='error'] .ahq-snack__text {
  color: var(--destructive);
}

.ahq-snack__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.15rem -0.15rem 0 0;
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.ahq-snack__close:hover {
  background: color-mix(in oklab, var(--foreground) 6%, transparent);
  color: var(--foreground);
}

.ahq-snack__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-snack__close svg {
  width: 0.9rem;
  height: 0.9rem;
}

@media (min-width: 768px) {
  .ahq-snack {
    inset-inline-end: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ahq-snack {
    transition: none;
    transform: none;
  }
}

.ahq-skel-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ahq-skel-block.ahq-wl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 960px) {
  .ahq-skel-block.ahq-wl-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.ahq-skel-block .ahq-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-block: 1rem;
}

.ahq-skel-block[hidden] {
  display: none !important;
}

/* —— Apply for travel agent (profile) —— */
.ahq-agent-apply {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem 1rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
}

.ahq-agent-apply[hidden] {
  display: none !important;
}

.ahq-agent-apply__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--foreground);
}

.ahq-agent-apply__icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.ahq-agent-apply__copy {
  flex: 1 1 12rem;
  min-width: 0;
}

.ahq-agent-apply__copy strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.ahq-agent-apply__copy p {
  margin: 0.2rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.ahq-agent-apply .ahq-btn,
.ahq-agent-apply .ahq-badge {
  flex-shrink: 0;
  height: 2.7rem;
  min-height: 2.7rem;
  box-sizing: border-box;
}

/*
 * Review CTA only when .is-review (pending / on_hold).
 * Author display:flex/inline-flex overrides UA [hidden], so gate by class.
 * Rejected keeps Apply again visible (is-pending alone must not hide it).
 */
.ahq-agent-apply:not(.is-review) #ahqAgentApplyPending,
.ahq-agent-apply .ahq-btn[hidden],
.ahq-agent-apply .ahq-badge[hidden],
.ahq-agent-apply.is-review #ahqAgentApplyOpen {
  display: none !important;
}

.ahq-agent-status-skel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* display:flex above overrides UA [hidden] */
.ahq-agent-status-skel[hidden],
#ahqAgentApplyStatusContent[hidden],
.ahq-agent-status-msg[hidden] {
  display: none !important;
}

#ahqAgentApplyStatusContent {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.ahq-agent-status-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem 0.75rem;
}

.ahq-agent-status-head .ahq-muted {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.ahq-apply-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
}

.ahq-apply-steps__item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-block-end: 1px solid var(--border);
  background: var(--card);
}

.ahq-apply-steps__item:last-child {
  border-block-end: 0;
}

.ahq-apply-steps__marker {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
}

.ahq-apply-steps__label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--foreground);
  text-align: start;
}

.ahq-apply-steps__item.is-done .ahq-apply-steps__marker {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--background);
}

.ahq-apply-steps__item.is-current {
  background: var(--muted);
}

.ahq-apply-steps__item.is-current .ahq-apply-steps__marker {
  border-color: var(--foreground);
  background: var(--background);
  color: var(--foreground);
}

.ahq-apply-steps__item.is-upcoming .ahq-apply-steps__label {
  color: var(--muted-foreground);
  font-weight: 400;
}

.ahq-agent-status-dl {
  margin: 0;
  display: grid;
  gap: 0.875rem;
}

.ahq-agent-status-dl > div {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.ahq-agent-status-dl dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-align: start;
}

.ahq-agent-status-dl dd {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  word-break: break-word;
  text-align: start;
  color: var(--foreground);
}

/* Keep phone/email LTR glyphs, but align the value to the sheet start (right in AR). */
.ahq-agent-status-dl .ahq-ltr {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}

.ahq-agent-status-dl a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.ahq-agent-status-msg {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
}

.ahq-agent-status-msg strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  text-align: start;
}

.ahq-agent-status-msg p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--foreground);
  white-space: pre-wrap;
  text-align: start;
}

.ahq-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
  align-items: start;
}

@media (min-width: 768px) {
  .ahq-form-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* —— User profile —— */
.ahq-profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 900px) {
  .ahq-profile-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: stretch;
  }

  .ahq-profile-grid > .ahq-card {
    height: 100%;
  }
}

.ahq-profile-photo {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
}

.ahq-profile-photo__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 10rem;
}

.ahq-profile-photo__meta strong {
  font-size: 1rem;
  font-weight: 600;
}

.ahq-profile-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 55%, transparent);
  color: var(--muted-foreground);
  font-size: 1.15rem;
  font-weight: 600;
  overflow: hidden;
}

.ahq-profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ahq-profile-avatar.has-photo .ahq-profile-avatar__initials {
  display: none;
}

.ahq-profile-photo__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  min-width: 0;
}

.ahq-profile-photo__actions .ahq-tip {
  align-self: center;
}

#ahqProfilePreviewEmail {
  /* Keep address glyphs LTR, but sit on the inline-start edge (right in RTL). */
  direction: ltr;
  unicode-bidi: isolate;
  word-break: break-word;
  align-self: start;
  max-width: 100%;
}

.ahq-phone-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 7.5rem) minmax(0, 1fr);
  gap: 0.5rem;
  /* Phone codes/numbers stay LTR in Arabic UI (+964, not 964+). */
  direction: ltr;
}

.ahq-phone-row__dial.ahq-catalog-trigger {
  justify-content: space-between;
  flex-direction: row;
}

.ahq-phone-row__dial .ahq-catalog-trigger__text,
.ahq-phone-row__local {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

.ahq-dl--profile {
  width: 100%;
  grid-template-columns: minmax(7rem, 40%) 1fr;
}

/* —— API keys (integration) —— */
.ahq-keys-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ahq-keys-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--muted) 30%, transparent);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color var(--ahq-motion-pop, 180ms) var(--ahq-ease-out, ease);
}

.ahq-keys-row:hover {
  background: color-mix(in oklab, var(--muted) 55%, transparent);
}

.ahq-keys-row:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 45%, transparent);
}

.ahq-keys-row.is-revoked {
  opacity: 0.72;
}

.ahq-keys-row--skel {
  pointer-events: none;
  cursor: default;
}

.ahq-keys-prefix {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-keys-sheet-prefix {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  word-break: break-all;
}

.ahq-keys-empty {
  padding: 0.5rem 0.25rem;
}

.ahq-keys-empty .ahq-empty__title {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.ahq-keys-generate__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.ahq-keys-generate__row .ahq-input {
  flex: 1 1 12rem;
  min-width: 0;
}

.ahq-input--mono {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
}

.ahq-keys-generate.is-at-limit .ahq-keys-generate__row {
  opacity: 0.85;
}

.ahq-keys-mode-hint {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
}

.ahq-modal__msg.is-error {
  color: var(--destructive);
}

.ahq-modal__msg.is-ok {
  color: oklch(0.4 0.12 145);
}

.ahq-keys-status {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 45%, transparent);
  font-size: 0.875rem;
}

.ahq-keys-status.is-ok {
  border-color: color-mix(in oklab, oklch(0.65 0.15 145) 35%, var(--border));
  background: color-mix(in oklab, oklch(0.65 0.15 145) 10%, transparent);
  color: oklch(0.4 0.12 145);
}

.ahq-keys-status.is-error {
  border-color: color-mix(in oklab, var(--destructive) 35%, var(--border));
  background: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
}

/* —— Kawenter Dashboard eVisa catalog —— */
.ahq-ev-group > td {
  padding: 0.55rem 0.85rem;
  background: color-mix(in oklab, var(--muted) 55%, var(--background));
  border-bottom: 1px solid var(--border);
}

.ahq-ev-group__inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.ahq-ev-group__label {
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--foreground);
  min-width: 0;
}

.ahq-ev-group__count {
  margin-inline-start: auto;
  flex-shrink: 0;
}

.ahq-ev-row--grouped > td:first-child {
  padding-inline-start: 1.35rem;
}

.ahq-ev-row--group-end > td {
  border-bottom-width: 2px;
}

.ahq-ev-dest-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.ahq-ev-flag {
  width: 1.35rem;
  height: 1rem;
  margin-top: 0.15rem;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--muted);
}

.ahq-ev-flag--empty {
  display: inline-block;
}

.ahq-ev-dest-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.ahq-ev-dest {
  font-weight: 550;
  line-height: 1.3;
}

.ahq-ev-dest-desc {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted-foreground);
}

.ahq-ev-price-was {
  text-decoration: line-through;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.ahq-ev-price-agent {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.ahq-ev-panel {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklab, var(--muted) 55%, var(--card));
  box-shadow: none;
}

.ahq-ev-panel__item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.55rem 0.6rem;
  border-radius: calc(var(--radius) - 4px);
  color: var(--foreground);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.ahq-ev-panel__item:hover {
  background: color-mix(in oklab, var(--accent) 70%, transparent);
}

.ahq-ev-panel__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.ahq-ev-panel--requirements .ahq-ev-panel__mark {
  color: color-mix(in oklab, oklch(0.55 0.12 145) 80%, var(--foreground));
}

.ahq-ev-panel--notes .ahq-ev-panel__mark {
  color: color-mix(in oklab, oklch(0.58 0.12 250) 75%, var(--foreground));
}

.ahq-ev-panel__mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ahq-ev-panel__text {
  min-width: 0;
  flex: 1;
}

#ahqEvDetailBody .ahq-dl dd {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: wrap;
}

#ahqEvTable td .ahq-badge {
  margin-inline-start: 0.35rem;
  vertical-align: middle;
}

/* eVisa apply — shadcn/GitHub-style horizontal stepper */
.ahq-steps {
  width: 100%;
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-sizing: border-box;
}

.ahq-steps__list {
  display: flex;
  align-items: flex-start;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ahq-steps__item {
  display: flex;
  align-items: flex-start;
  flex: 1 1 0;
  min-width: 0;
  color: var(--muted-foreground);
}

.ahq-steps__item:last-child {
  flex: 0 0 auto;
}

.ahq-steps__item:not(:last-child)::after {
  content: '';
  flex: 1 1 auto;
  align-self: flex-start;
  height: 1px;
  margin-block-start: 0.875rem; /* center on 1.75rem index */
  margin-inline: 0.625rem;
  background: var(--border);
}

.ahq-steps__item.is-done:not(:last-child)::after {
  background: var(--foreground);
}

.ahq-steps__marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  max-width: 7.5rem;
  text-align: center;
}

.ahq-steps__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  box-sizing: border-box;
}

.ahq-steps__label {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ahq-steps__item.is-active {
  color: var(--foreground);
}

.ahq-steps__item.is-active .ahq-steps__index {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--background);
}

.ahq-steps__item.is-done {
  color: var(--foreground);
}

.ahq-steps__item.is-done .ahq-steps__index {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--background);
  font-size: 0;
}

.ahq-steps__item.is-done .ahq-steps__index::before {
  content: '';
  width: 0.7rem;
  height: 0.7rem;
  background: currentColor;
  /* checkmark */
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 480px) {
  .ahq-steps__item:not(:last-child)::after {
    margin-inline: 0.4rem;
  }

  .ahq-steps__marker {
    max-width: 5.5rem;
  }

  .ahq-steps__label {
    font-size: 0.75rem;
  }
}

.ahq-apply-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ahq-apply-grid .ahq-field--full,
.ahq-apply-grid .ahq-more-docs-note {
  grid-column: 1 / -1;
}

.ahq-occupation-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  grid-column: 1 / -1;
}

.ahq-occupation-panel[hidden] {
  display: none !important;
}

.ahq-apply-phone-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  grid-column: 1 / -1;
  min-width: 0;
  /* Keep dial + local number in LTR order under RTL pages. */
  direction: ltr;
}

.ahq-apply-phone-row .ahq-field__label {
  /* Labels still follow page direction (Arabic on the right). */
  direction: rtl;
  text-align: start;
}

html[dir='ltr'] .ahq-apply-phone-row .ahq-field__label {
  direction: ltr;
}

.ahq-apply-phone-row .ahq-select__value,
.ahq-apply-phone-row .ahq-input {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

.ahq-apply-phone-row .ahq-field--dial {
  flex: 0 0 auto;
  width: auto;
  max-width: 9.5rem;
}

.ahq-apply-phone-row .ahq-field--phone {
  flex: 1 1 auto;
  min-width: 0;
}

.ahq-select--compact {
  width: max-content;
  max-width: 100%;
}

.ahq-select--compact .ahq-select__trigger {
  width: auto;
  min-width: 4.75rem;
  padding-inline: 0.625rem 0.5rem;
}

.ahq-select--compact .ahq-select__value {
  flex: 0 1 auto;
}

.ahq-datepicker-sheet .ahq-sheet__panel {
  display: flex;
  flex-direction: column;
  max-width: min(22rem, 100dvw);
}

@media (max-width: 767.98px) {
  .ahq-datepicker-sheet .ahq-sheet__panel,
  .ahq-datepicker-sheet--range .ahq-sheet__panel {
    width: 100%;
    max-width: none;
  }
}

.ahq-datepicker-sheet .ahq-sheet__body,
.ahq-datepicker-sheet__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  padding: 1rem 1.125rem 1.25rem;
}

.ahq-datepicker-sheet--range .ahq-sheet__body,
.ahq-datepicker-sheet--range .ahq-datepicker-sheet__body {
  padding: 0;
}

.ahq-datepicker-sheet .ahq-datepicker__hint {
  margin-bottom: 0.75rem;
}

.ahq-datepicker-sheet .ahq-datepicker__foot {
  margin-top: 1rem;
}

.ahq-datepicker-sheet--range .ahq-datepicker__chrome {
  flex-shrink: 0;
  padding: 0.85rem 1.125rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--popover);
}

.ahq-datepicker-sheet--range .ahq-datepicker__hint {
  margin-bottom: 0.55rem;
}

.ahq-datepicker-sheet--range .ahq-datepicker__weekdays {
  margin-bottom: 0;
}

.ahq-datepicker-sheet--range .ahq-datepicker__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem 1.125rem 1rem;
}

.ahq-datepicker-sheet--range .ahq-datepicker__month + .ahq-datepicker__month {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.ahq-datepicker-sheet--range .ahq-datepicker__month-title {
  margin: 0 0 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ahq-datepicker-sheet--range .ahq-datepicker__day-spacer {
  display: block;
  height: 2rem;
  width: 100%;
  pointer-events: none;
}

.ahq-datepicker-sheet--range .ahq-datepicker__foot {
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.75rem 1.125rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--popover);
}

.ahq-datepicker-sheet--range .ahq-datepicker__foot-spacer {
  display: inline-block;
  min-width: 1px;
  min-height: 1px;
}

.ahq-select-sheet .ahq-sheet__panel {
  display: flex;
  flex-direction: column;
  max-width: min(24rem, 100dvw);
}

.ahq-select-sheet--cards .ahq-sheet__panel {
  max-width: min(28rem, 100dvw);
}

.ahq-select-sheet .ahq-sheet__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-height: 0;
  flex: 1;
}

.ahq-select-sheet .ahq-select__search {
  position: sticky;
  top: 0;
  z-index: 1;
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.ahq-select-sheet .ahq-select__options {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.375rem;
}

.ahq-select-sheet--cards .ahq-select__options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem 1rem 1.25rem;
}

.ahq-select-sheet .ahq-select__empty {
  padding: 1.25rem 1rem;
}

.ahq-select-sheet .ahq-select__option {
  width: 100%;
  /* ~30% taller than default pop options — easier tap targets in country sheets */
  min-height: 2.6rem;
  padding: 0.5rem 0.625rem;
}

.ahq-select-sheet--cards .ahq-select__option--rich {
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 0;
  padding: 0.875rem 0.9rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) + 2px);
  background: var(--muted);
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ahq-select-sheet--cards .ahq-select__option--rich:hover,
.ahq-select-sheet--cards .ahq-select__option--rich:focus-visible {
  background: color-mix(in oklab, var(--muted) 70%, var(--background));
  border-color: color-mix(in oklab, var(--foreground) 18%, transparent);
  outline: none;
}

.ahq-select-sheet--cards .ahq-select__option--rich.is-selected {
  background: var(--background);
  border-color: var(--foreground);
}

.ahq-select-sheet--cards .ahq-select__option--rich .ahq-select__option-main {
  display: block;
  flex: 1;
  min-width: 0;
}

.ahq-select-sheet--cards .ahq-select__check {
  margin-top: 0.1rem;
  opacity: 0;
}

.ahq-select-sheet--cards .ahq-select__option--rich.is-selected .ahq-select__check {
  opacity: 1;
}

.ahq-select__option--rich {
  align-items: flex-start;
  min-height: 3rem;
  padding-block: 0.625rem;
}

.ahq-select__option--rich .ahq-select__option-main {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  flex: 1;
  min-width: 0;
}

.ahq-select__option-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.ahq-select__option-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.ahq-select__option-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.35;
}

.ahq-select__option-desc {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.45;
  white-space: normal;
}

.ahq-select__option-price {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--foreground);
  white-space: nowrap;
  line-height: 1.35;
}

.ahq-select__option--rich .ahq-select__check {
  margin-top: 0.15rem;
}

@media (max-width: 640px) {
  .ahq-apply-grid {
    grid-template-columns: 1fr;
  }

  .ahq-apply-phone-row {
    flex-wrap: nowrap;
  }

  .ahq-apply-phone-row .ahq-field--dial {
    max-width: 7.5rem;
  }
}

#ahqEvApplyForm > .ahq-card,
#ahqEvApplyReview > .ahq-card,
#ahqInsForm > .ahq-card,
#ahqInsReview > .ahq-card {
  margin-bottom: 1rem;
}

/*
 * Apply flows (eVisa + insurance): one vertical column like storefront
 * new-application / new-insurance — not a two-column laptop split.
 */
.ahq-apply-split {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

.ahq-apply-split__main,
.ahq-apply-split__side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ahq-apply-split .ahq-card {
  margin-bottom: 0;
}

#ahqEvApplyReview > .ahq-review-shell,
#ahqInsReview > .ahq-review-shell {
  margin-bottom: 1rem;
}

/*
 * Phone-width column centered in the main pane on laptop
 * (matches storefront .application-form ~600px).
 */
body[data-ahq-active='evisa-apply'] .ahq-main > .ahq-page-header,
body[data-ahq-active='evisa-apply'] .ahq-main > .ahq-steps,
body[data-ahq-active='evisa-apply'] .ahq-main > #ahqEvApplyBoot,
body[data-ahq-active='evisa-apply'] .ahq-main > #ahqEvApplyError,
body[data-ahq-active='evisa-apply'] .ahq-main > #ahqEvApplyForm,
body[data-ahq-active='evisa-apply'] .ahq-main > #ahqEvApplyReview,
body[data-ahq-active='insurance'] .ahq-main > .ahq-page-header,
body[data-ahq-active='insurance'] .ahq-main > .ahq-steps,
body[data-ahq-active='insurance'] .ahq-main > #ahqInsForm,
body[data-ahq-active='insurance'] .ahq-main > #ahqInsReview {
  width: 100%;
  max-width: 37.5rem;
  margin-inline: auto;
}

/* Profile: wider than the insurance/eVisa apply column (37.5rem → +30% → +20%). */
body[data-ahq-active='user-profile'] .ahq-main > .ahq-page-header,
body[data-ahq-active='user-profile'] .ahq-main > .ahq-agent-apply,
body[data-ahq-active='user-profile'] .ahq-main > #ahqProfileLoadError,
body[data-ahq-active='user-profile'] .ahq-main > #ahqProfileForm {
  width: 100%;
  max-width: 58.5rem;
  margin-inline: auto;
}

#ahqEvApplySticky,
#ahqInsSticky,
#ahqProfileSaveBar {
  flex-wrap: wrap;
}

#ahqEvApplySticky .ahq-sticky-save__total,
#ahqInsSticky .ahq-sticky-save__total,
#ahqProfileSaveBar .ahq-sticky-save__total {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 auto;
}

#ahqEvApplySticky .ahq-sticky-save__total-label,
#ahqInsSticky .ahq-sticky-save__total-label,
#ahqProfileSaveBar .ahq-sticky-save__total-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  line-height: 1.2;
}

#ahqEvApplySticky .ahq-sticky-save__total-value,
#ahqInsSticky .ahq-sticky-save__total-value,
#ahqProfileSaveBar .ahq-sticky-save__total-value {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--foreground);
}

#ahqEvApplySticky .ahq-sticky-save__total-hint,
#ahqInsSticky .ahq-sticky-save__total-hint {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.3;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ahqEvApplySticky .ahq-sticky-save__total-hint[hidden],
#ahqInsSticky .ahq-sticky-save__total-hint[hidden] {
  display: none !important;
}

#ahqEvApplySticky .ahq-sticky-save__actions,
#ahqInsSticky .ahq-sticky-save__actions,
#ahqProfileSaveBar .ahq-sticky-save__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 0 0 auto;
  width: auto;
  margin-inline-start: auto;
}

#ahqProfileSaveBar .ahq-sticky-save__actions .ahq-btn {
  margin-inline-start: 0;
}

#ahqProfileSaveBar .ahq-sticky-save__total-value {
  font-size: 0.9375rem;
  font-weight: 600;
}

#ahqProfileSaveBar .ahq-form-msg {
  margin: 0;
  max-width: 14rem;
}

/* Card-style sticky bar — matches page card body width (apply 37.5rem / profile 58.5rem). */
.ahq-sticky-save--card {
  justify-content: center;
  background: transparent;
  border-top: none;
  backdrop-filter: none;
  padding-block: 0;
  padding-inline: 0.75rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  pointer-events: none;
}

.ahq-sticky-save--card .ahq-sticky-save__inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  width: 100%;
  max-width: 37.5rem;
  margin-inline: auto;
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
  background: color-mix(in oklab, var(--background) 88%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: none;
}

.ahq-sticky-save--card.ahq-sticky-save--wide .ahq-sticky-save__inner,
#ahqProfileSaveBar .ahq-sticky-save__inner {
  max-width: 58.5rem;
}

@media (min-width: 768px) {
  .ahq-sticky-save--card {
    padding-inline: 1.5rem;
  }
}

#ahqEvApplySticky .ahq-sticky-save__actions--split,
#ahqInsSticky .ahq-sticky-save__actions--split {
  justify-content: flex-end;
}

/* Override sticky-save’s single-CTA auto margin so Edit stays start-side
   and Continue stays end-side (LTR left/right, RTL right/left). */
#ahqEvApplySticky .ahq-sticky-save__actions--split .ahq-btn,
#ahqInsSticky .ahq-sticky-save__actions--split .ahq-btn {
  margin-inline-start: 0;
  margin-inline-end: 0;
}

#ahqEvApplySticky .ahq-sticky-save__actions .ahq-btn,
#ahqInsSticky .ahq-sticky-save__actions .ahq-btn {
  margin-inline-start: 0;
}

#ahqEvApplySticky .ahq-sticky-save__actions[hidden],
#ahqInsSticky .ahq-sticky-save__actions[hidden] {
  display: none !important;
}

.ahq-addon-desc {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.ahq-addon-desc[hidden] {
  display: none !important;
}

.ahq-page-header--compact {
  margin-bottom: 1rem;
}

.ahq-page-header--compact .ahq-page-title {
  font-size: 1.125rem;
}

.ahq-review-shell > .ahq-card__body {
  background: color-mix(in oklab, var(--muted) 28%, var(--background));
}

.ahq-review-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
  min-width: 0;
}

.ahq-review-stack > .ahq-review-stack {
  gap: 0.85rem;
}

.ahq-review-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: none;
}

.ahq-review-panel__head {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 45%, transparent);
}

.ahq-review-panel__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-align: center;
}

.ahq-review-panel__icon {
  position: absolute;
  inset-inline-end: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.ahq-review-panel__icon svg {
  width: 1rem;
  height: 1rem;
}

.ahq-review-panel__body {
  padding: 1rem;
}

.ahq-review-notes {
  padding: 0;
}

.ahq-review-notes__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 0;
  border-bottom: 1px solid transparent;
  background: color-mix(in oklab, var(--muted) 45%, transparent);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.ahq-review-notes__toggle:hover {
  background: color-mix(in oklab, var(--muted) 60%, transparent);
}

.ahq-review-notes__toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 35%, transparent);
}

.ahq-review-notes:not(.is-collapsed) .ahq-review-notes__toggle {
  border-bottom-color: var(--border);
}

.ahq-review-notes__label {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.ahq-review-notes__chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
  transition: transform var(--ahq-motion-pop, 180ms) var(--ahq-ease-out, ease);
}

.ahq-review-notes:not(.is-collapsed) .ahq-review-notes__chevron {
  transform: rotate(180deg);
}

html[dir='rtl'] .ahq-review-notes:not(.is-collapsed) .ahq-review-notes__chevron {
  transform: rotate(-180deg);
}

.ahq-review-notes__body {
  height: 0;
  opacity: 0;
  overflow: hidden;
  padding-inline: 1rem;
  transition:
    height var(--ahq-motion-overlay, 280ms) var(--ahq-ease-out, ease),
    opacity var(--ahq-motion-pop, 180ms) var(--ahq-ease-out, ease);
}

.ahq-review-notes:not(.is-collapsed) .ahq-review-notes__body {
  padding-block: 1rem 1.15rem;
}

.ahq-review-notes__hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.ahq-review-notes__textarea.ahq-input,
.ahq-review-notes__textarea {
  height: auto;
  min-height: 5.5rem;
  padding-block: 0.75rem;
  padding-inline: 0.85rem;
  line-height: 1.45;
  resize: vertical;
  field-sizing: content;
}

@media (prefers-reduced-motion: reduce) {
  .ahq-review-notes__chevron,
  .ahq-review-notes__body {
    transition: none;
  }
}

.ahq-review-stack .ahq-dl {
  margin: 0;
}

.ahq-review-doc {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ahq-review-doc a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ahq-applicants {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ahq-applicants-empty {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.15rem 0 0.35rem;
}

.ahq-applicants-empty[hidden] {
  display: none !important;
}

.ahq-applicants-empty p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--foreground);
}

.ahq-applicants-empty .ahq-muted {
  font-weight: 500;
}

.ahq-applicant-card--summary .ahq-applicant-card__head {
  border-bottom: 0;
}

.ahq-applicants__add {
  margin-top: 0.85rem;
  width: 100%;
  justify-content: center;
  gap: 0.4rem;
}

.ahq-applicants__add svg {
  width: 1rem;
  height: 1rem;
}

.ahq-applicant-card {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--background);
  overflow: hidden;
}

.ahq-applicant-card.is-collapsed .ahq-applicant-card__body {
  display: none;
}

.ahq-applicant-card__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.55rem 0.55rem 0.65rem;
  background: color-mix(in oklab, var(--muted) 55%, transparent);
  border-bottom: 1px solid var(--border);
}

.ahq-applicant-card.is-collapsed .ahq-applicant-card__head {
  border-bottom: 0;
}

.ahq-applicant-card__toggle {
  appearance: none;
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.25rem 0.35rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}

.ahq-applicant-card__toggle:hover {
  background: color-mix(in oklab, var(--foreground) 5%, transparent);
}

.ahq-applicant-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ahq-applicant-card.is-ready .ahq-applicant-card__num {
  border-color: color-mix(in oklab, oklch(0.55 0.14 145) 45%, var(--border));
  background: color-mix(in oklab, oklch(0.55 0.14 145) 14%, var(--card));
  color: oklch(0.42 0.12 145);
}

.ahq-applicant-card__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}

.ahq-applicant-card__remove {
  flex-shrink: 0;
}

.ahq-applicant-card__body {
  padding: 0.9rem 1rem 1rem;
}

.ahq-badge.is-complete {
  border-color: color-mix(in oklab, oklch(0.55 0.14 145) 40%, var(--border));
  color: oklch(0.42 0.12 145);
}

/* Additional-docs note (eVisa more_doc / need_document) */
.ahq-more-docs-note {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--card);
}

.ahq-more-docs-note[hidden] {
  display: none !important;
}

.ahq-more-docs-note__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: color-mix(in oklab, oklch(0.62 0.14 290) 16%, var(--card));
  color: oklch(0.48 0.16 290);
}

.ahq-more-docs-note__icon svg {
  width: 1rem;
  height: 1rem;
}

.ahq-more-docs-note__body {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.ahq-more-docs-note__body strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.35;
}

.ahq-more-docs-note__body p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.ahq-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.ahq-upload__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.ahq-upload__actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.ahq-upload__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.ahq-upload__btn svg {
  width: 1rem;
  height: 1rem;
}

.ahq-upload__actions .ahq-tip {
  flex: 0 0 auto;
  align-self: center;
}

.ahq-upload.is-busy .ahq-upload__actions,
.ahq-upload.is-ready .ahq-upload__actions,
.ahq-upload.is-busy .ahq-upload__hint,
.ahq-upload.is-ready .ahq-upload__hint,
.ahq-upload.is-busy .ahq-upload__tip-row,
.ahq-upload.is-ready .ahq-upload__tip-row {
  display: none;
}

.ahq-upload__hint {
  margin: 0;
  font-size: 0.8125rem;
}

.ahq-upload__tip-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 0.15rem;
}

.ahq-upload__tip-row .ahq-tip {
  align-self: center;
}

.ahq-upload__panel {
  display: none;
  width: 100%;
}

.ahq-upload__panel.is-visible {
  display: block;
}

.ahq-upload-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--card);
}

.ahq-upload-card.is-success {
  border-color: color-mix(in oklab, oklch(0.72 0.17 145) 45%, var(--border));
  background: color-mix(in oklab, oklch(0.96 0.03 145) 70%, var(--card));
}

.ahq-upload-card.is-error {
  border-color: color-mix(in oklab, oklch(0.63 0.2 25) 40%, var(--border));
  background: color-mix(in oklab, oklch(0.97 0.02 25) 65%, var(--card));
}

.ahq-upload-card__media {
  position: relative;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  background: var(--muted);
  overflow: hidden;
  color: var(--muted-foreground);
}

.ahq-upload-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ahq-upload-card__media svg {
  width: 1.25rem;
  height: 1.25rem;
}

.ahq-upload-card__check {
  position: absolute;
  inset-inline-end: -0.2rem;
  bottom: -0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: oklch(0.55 0.14 145);
  color: #fff;
  border: 2px solid var(--card);
}

.ahq-upload-card__check svg {
  width: 0.65rem;
  height: 0.65rem;
}

.ahq-upload-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ahq-upload-card__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahq-upload-card__meta {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.ahq-upload-card__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.ahq-upload-card__pct {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  min-width: 2.25rem;
  text-align: end;
}

.ahq-upload-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
}

.ahq-upload-progress__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ahq-upload-progress__bar {
  width: 100%;
  height: 0.375rem;
  border-radius: 999px;
  background: color-mix(in oklab, var(--foreground) 10%, transparent);
  overflow: hidden;
}

.ahq-upload-progress__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--foreground);
  transition: width 120ms linear;
}

.ahq-review-fees {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  font-size: 0.875rem;
}

.ahq-review-fees__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.ahq-review-fees__row--total {
  padding-top: 0.625rem;
  margin-top: 0.125rem;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.ahq-review-fees__was {
  margin-inline-start: 0.35rem;
  color: var(--muted-foreground);
  text-decoration: line-through;
  font-weight: 400;
}

/* —— Mobile foundation (shared; future pages inherit) —— */
@media (max-width: 767.98px) {
  html:has(body.agent-dashboard),
  body.agent-dashboard {
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
    overscroll-behavior-x: none;
  }

  .ahq-shell,
  .ahq-inset,
  .ahq-main {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .ahq-header {
    height: auto;
    min-height: calc(3.5rem + env(safe-area-inset-top, 0px));
    flex-wrap: wrap;
  }

  .ahq-header__end {
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
  }

  .ahq-page-title {
    font-size: 1.25rem;
  }

  .ahq-page-header--split {
    flex-direction: column;
    align-items: stretch;
  }

  .ahq-page-header--split > .ahq-icon-btn,
  .ahq-page-header__actions {
    margin-top: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .ahq-page-header__actions .ahq-btn,
  .ahq-page-header__actions .ahq-btn--ghost {
    flex: 1 1 auto;
    height: 2.7rem;
    min-height: 2.7rem;
    max-height: 2.7rem;
    justify-content: center;
  }

  .ahq-card__footer--split {
    flex-wrap: wrap;
  }

  .ahq-card__footer--split .ahq-btn {
    width: 100%;
    justify-content: center;
  }

  .ahq-filters__actions {
    width: 100%;
  }

  .ahq-filters__actions .ahq-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .ahq-filters--modal {
    grid-template-columns: 1fr;
  }

  .ahq-icon-btn {
    width: 2.75rem;
    height: 2.75rem;
  }

  .ahq-icon-btn svg {
    width: 1.125rem;
    height: 1.125rem;
  }

  .ahq-points-chip {
    flex-shrink: 1;
    min-width: 0;
    max-width: min(11.5rem, 42dvw);
    min-height: 2.75rem;
    padding-inline: 0.65rem;
  }

  .ahq-lang__trigger {
    flex-shrink: 1;
    min-width: 0;
    height: 2.75rem;
    min-height: 2.75rem;
  }

  .ahq-kpi--orders .ahq-kpi__item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-inline-end: 0;
  }

  .ahq-amount-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ahq-modal {
    align-items: flex-end;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .ahq-modal__panel {
    width: 100%;
    max-height: min(92svh, 100%);
    border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
    overflow: auto;
  }

  .ahq-modal__foot {
    padding-bottom: calc(1.35rem + env(safe-area-inset-bottom, 0px));
  }

  .ahq-modal__panel--confirm,
  .ahq-modal__panel--topup {
    width: 100%;
    max-width: none;
  }

  .ahq-sheet__panel {
    width: 100%;
    max-width: none;
    inset: 0;
    border-inline-start: none;
  }

  .ahq-sheet__head > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  /* Larger touch close btn — keep title clear of it when centered */
  .ahq-sheet__head:not(:has(.ahq-muted:not([hidden]):not(:empty))) > :first-child,
  .ahq-modal__head:not(:has(.ahq-muted:not([hidden]):not(:empty))):not(:has(.ahq-modal__desc:not([hidden]):not(:empty))) > :first-child {
    inset-inline: 3.5rem;
  }

  .ahq-sheet__title {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .ahq-sheet__foot {
    padding-bottom: calc(1.35rem + env(safe-area-inset-bottom, 0px));
  }

  .ahq-main {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }

  .ahq-sticky-save {
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .ahq-sticky-save--card {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .ahq-sticky-save--card .ahq-sticky-save__inner {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }

  body.ahq-wl-has-sticky-save .ahq-main,
  body.ahq-has-sticky-save .ahq-main {
    padding-bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px));
  }

  .ahq-sticky-save .ahq-btn {
    margin-inline-start: 0;
  }

  .ahq-sticky-save__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  #ahqEvApplySticky .ahq-sticky-save__actions,
  #ahqInsSticky .ahq-sticky-save__actions,
  #ahqProfileSaveBar .ahq-sticky-save__actions {
    width: 100%;
    margin-inline-start: 0;
  }

  #ahqEvApplySticky .ahq-sticky-save__total,
  #ahqInsSticky .ahq-sticky-save__total,
  #ahqProfileSaveBar .ahq-sticky-save__total {
    width: 100%;
    flex: 1 1 100%;
  }

  .ahq-sticky-save__actions .ahq-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .ahq-keys-generate__row .ahq-btn {
    width: 100%;
    justify-content: center;
  }

  .ahq-keys-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ahq-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ahq-table th,
  .ahq-table td {
    padding: 0.625rem 0.75rem;
  }

  .ahq-confirm__actions {
    flex-direction: column-reverse;
  }

  .ahq-confirm__actions .ahq-btn {
    width: 100%;
    justify-content: center;
  }

  .ahq-modal__actions {
    flex-direction: column-reverse;
  }

  .ahq-modal__actions .ahq-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .ahq-header__end {
    gap: 0.35rem;
  }

  .ahq-lang__code {
    display: none;
  }

  .ahq-amount-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Support ticket thread (dashboard /support) */
.ahq-ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ahq-ticket-msg {
  border: 1px solid var(--ahq-border, #e5e5e5);
  background: var(--ahq-surface, #fff);
  padding: 12px 14px;
}

.ahq-ticket-msg--staff {
  background: var(--ahq-muted-bg, #f8fafc);
}

.ahq-ticket-msg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ahq-ticket-msg__who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ahq-ticket-msg__avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ahq-muted-bg, #e2e8f0);
  color: var(--ahq-fg, #111);
  font-size: 0.7rem;
  font-weight: 650;
}

.ahq-ticket-msg__avatar.has-photo {
  background: var(--ahq-muted-bg, #f1f5f9);
}

.ahq-ticket-msg--staff .ahq-ticket-msg__avatar {
  background: #1e1b4b;
  border: 1px solid color-mix(in oklab, var(--border) 70%, #4361EE);
}

.ahq-ticket-msg__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ahq-ticket-msg--staff .ahq-ticket-msg__photo {
  object-fit: cover;
}

.ahq-ticket-msg__initials {
  line-height: 1;
}

.ahq-ticket-msg__avatar.has-photo .ahq-ticket-msg__initials {
  display: none;
}

.ahq-ticket-msg__identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
  gap: 2px;
}

.ahq-ticket-msg__author {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ahq-fg, #111);
}

.ahq-ticket-msg__name {
  font-size: 0.75rem;
  color: var(--ahq-muted, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14rem;
}

/* Keep order numbers / IDs in Western digits under Arabic UI */
.ahq-ltr-num {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: lining-nums tabular-nums;
}

.ahq-ticket-msg__time {
  font-size: 0.75rem;
  color: var(--ahq-muted, #64748b);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.ahq-ticket-msg__body {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ahq-fg, #222);
  word-break: break-word;
}

.ahq-ticket-msg__body p {
  margin: 0 0 0.5em;
}

.ahq-ticket-msg__body p:last-child {
  margin-bottom: 0;
}

.ahq-ticket-msg__body ul,
.ahq-ticket-msg__body ol {
  margin: 0.35em 0;
  padding-inline-start: 1.25rem;
}

.ahq-ticket-msg__body a {
  color: var(--ahq-accent, #1d4ed8);
  text-decoration: underline;
}

.ahq-ticket-atts {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ahq-ticket-atts a {
  color: var(--ahq-accent, #1d4ed8);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.ahq-ticket-atts a:hover {
  text-decoration: underline;
}

/* Support rich-text editor */
.ahq-rich {
  border: 1px solid var(--ahq-border, #e5e5e5);
  background: var(--ahq-surface, #fff);
  overflow: hidden;
}

.ahq-rich__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--ahq-border, #e5e5e5);
  background: var(--ahq-muted-bg, #f8fafc);
}

.ahq-rich__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ahq-fg, #111);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.ahq-rich__btn:hover {
  background: var(--ahq-surface, #fff);
  border-color: var(--ahq-border, #e5e5e5);
}

.ahq-rich__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ahq-accent, #1d4ed8) 28%, transparent);
}

.ahq-rich__btn svg {
  width: 16px;
  height: 16px;
}

.ahq-rich__sep {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--ahq-border, #e5e5e5);
}

.ahq-rich__editor {
  height: auto !important;
  min-height: 140px;
  max-height: 280px;
  overflow: auto;
  padding: 12px 14px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  white-space: pre-wrap;
  word-break: break-word;
}

.ahq-rich__editor:empty::before {
  content: attr(data-placeholder);
  color: var(--ahq-muted, #94a3b8);
  pointer-events: none;
  display: block;
  padding: 0;
}

.ahq-rich__editor:focus-visible {
  outline: none;
}

#ahqSupportCreateUpload .ahq-upload__panel.is-visible,
#ahqSupportReplyUpload .ahq-upload__panel.is-visible {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
