/* Bullenhaus · Graphite glass with a warm edge. Shared across the web surfaces. */
:root {
  --bh-glass-radius: 6px;
  --bh-glass-brass: 232 193 117;
  --bh-glass-light: 214 230 255;
  --bh-glass-focus: #ffe2a4;
  --bh-glass-fast: 140ms;
  --bh-card-light: var(--bh-glass-brass);
}

/* Includes the older cards built directly with Tailwind rather than a Card component. */
:root :is(
  [data-bh-card], [data-slot='card'], .bh-card, .glass-card, .glass-panel,
  .card-panel, .card-premium, .card-glass3d, .surface, .table-shell,
  .bh-chart-panel, .chart-grid, [data-bh-order],
  .status-empty, .status-error, .status-loading,
  dialog[open], [data-slot='dialog-content'], [data-slot='alert-dialog-content'],
  [role='dialog'][class*='rounded'],
  :is(section, article, aside, div, li, details, a)[class~='border'][class*='rounded-']:not([class~='rounded-full']):is(
    [class*='bg-panel'], [class*='bg-black/'], [class*='bg-slate-'], [class*='bg-surface-'],
    [class*='bg-card'], [class*='bg-background'], [class*='bg-white/'], [class~='shadow-card'],
    [class~='border-glass-border'], [class*='bg-orange-300/['], [class*='bg-[linear-gradient']
  )
),
:root[data-bh-recovery-entry] main {
  border-radius: var(--bh-glass-radius) !important;
  background-color: rgb(20 25 34 / 70%);
  background-image:
    linear-gradient(121deg, rgb(var(--bh-glass-light) / 10%), transparent 35%, transparent 82%, rgb(var(--bh-card-light) / 8%)),
    linear-gradient(180deg, rgb(93 115 149 / 8%), transparent 72px, rgb(6 9 16 / 24%));
  border-color: rgb(var(--bh-card-light) / 25%);
  box-shadow:
    inset 0 1px 0 rgb(var(--bh-glass-light) / 17%),
    inset 0 0 0 1px rgb(var(--bh-card-light) / 13%),
    inset 0 -2px 0 rgb(3 5 9 / 48%),
    0 3px 0 rgb(3 5 9 / 47%),
    0 11px 24px -17px rgb(0 0 0 / 90%),
    0 0 22px -13px rgb(var(--bh-card-light) / 45%);
}

:root [data-bh-card='stat'] {
  box-shadow: inset 0 1px 0 rgb(var(--bh-glass-light) / 19%),
    inset 0 0 0 1px rgb(var(--bh-glass-brass) / 17%), inset 0 -2px 0 rgb(3 5 9 / 48%),
    0 3px 0 rgb(3 5 9 / 47%), 0 0 22px -13px rgb(var(--bh-glass-brass) / 42%) !important;
}

:root :is([data-bh-card='error'], .status-error, [data-slot='alert-dialog-content']) {
  --bh-card-light: 246 139 150;
}

:root [data-bh-nav] > [data-bh-card] {
  --bh-card-light: 140 161 196;
}

:root :is(.card-premium, .card-glass3d):has(> :is(img, picture)) {
  background-image: linear-gradient(121deg, rgb(var(--bh-glass-light) / 12%), transparent 47%);
}

@supports (backdrop-filter: blur(1px)) {
  @media (min-width: 768px) and (prefers-reduced-transparency: no-preference) {
    :root[data-bh-recovery-entry] main { backdrop-filter: blur(12px) saturate(116%); }
  }
}

/* Geometry, sizing and content of the existing actions are handled by their components. */
:root :is(
  button, input:is([type='button'], [type='submit'], [type='reset']),
  [role='button'], [role='tab'], [data-slot='button'], [data-bh-action],
  [data-bh-nav], .bh-button, .btn-gold, .btn-ghost, .bh-file-picker,
  :where(a[class*='rounded-'][class~='border'][class*='px-']:not([data-bh-card]))
):not(:where([role='switch'], [role='checkbox'])),
:root[data-bh-recovery-entry] a.primary {
  --bh-button-edge: var(--bh-glass-brass);
  --bh-button-fill: 32 40 55;
  --bh-button-text: #f0f3fa;
  border-radius: var(--bh-glass-radius) !important;
  color: var(--bh-button-text);
  border-color: rgb(var(--bh-button-edge) / 35%);
  background-color: rgb(var(--bh-button-fill) / 70%);
  background-image:
    linear-gradient(115deg, rgb(var(--bh-glass-light) / 16%), transparent 48%, rgb(var(--bh-button-edge) / 9%)),
    linear-gradient(180deg, rgb(255 255 255 / 9%), rgb(0 0 0 / 21%));
  box-shadow:
    inset 0 1px 0 rgb(var(--bh-glass-light) / 22%),
    inset 0 0 0 1px rgb(var(--bh-button-edge) / 22%),
    inset 0 -2px 1px rgb(0 0 0 / 42%),
    0 2px 0 rgb(3 5 9 / 66%),
    0 0 13px -6px rgb(var(--bh-button-edge) / 47%);
  transition-property: background-color, border-color, box-shadow, color;
  transition-duration: var(--bh-glass-fast);
}

:root :is(button[role='switch'], button[role='checkbox']) {
  border-radius: var(--bh-glass-radius) !important;
  box-shadow: inset 0 1px 0 rgb(var(--bh-glass-light) / 26%), 0 2px 0 rgb(3 5 9 / 66%);
}

:root :is(
  [data-bh-variant='primary'], [data-bh-variant='default'], .bh-button--primary, .btn-gold,
  button[aria-pressed='true'], button[role='radio'][aria-checked='true'],
  button[aria-expanded='true'], [role='tab'][aria-selected='true'], [data-state='active'],
  [data-bh-nav][data-active='true'], [data-bh-nav][aria-current='page'],
  button[class~='bg-accent-primary'], button[class~='bg-gold'], button[class~='bg-primary'],
  a[class~='bg-accent-primary'], a[class~='bg-gold']
):not([role='switch'], [role='checkbox']),
:root[data-bh-recovery-entry] a.primary {
  --bh-button-edge: 255 217 139;
  --bh-button-fill: 127 89 31;
  --bh-button-text: #fff2cc;
}

:root :is(
  [data-bh-variant='danger'], [data-bh-variant='destructive'], .bh-button--danger,
  button[class*='bg-red-'], button[class~='text-red-400'], button[class~='bg-destructive']
) {
  --bh-button-edge: 249 137 155;
  --bh-button-fill: 91 36 51;
  --bh-button-text: #ffd6de;
}

:root :is(
  [data-bh-variant='success'], .bh-button--success,
  button[class*='bg-emerald-'], button[class*='bg-green-']
) {
  --bh-button-edge: 119 226 183;
  --bh-button-fill: 27 85 66;
  --bh-button-text: #c4f8e2;
}

@media (hover: hover) and (pointer: fine) {
  :root :is(button,input:is([type='button'],[type='submit'],[type='reset']),[role='button'],[role='tab'],[data-slot='button'],[data-bh-action],[data-bh-nav],.bh-button,.btn-gold,.btn-ghost,.bh-file-picker,a[class*='rounded-'][class~='border'][class*='px-']):where(:hover):not(:disabled,[aria-disabled='true'],[role='switch'],[role='checkbox']),
  :root[data-bh-recovery-entry] a.primary:hover {
    background-color: rgb(var(--bh-button-fill) / 84%);
    color: var(--bh-button-text);
    border-color: rgb(var(--bh-button-edge) / 66%);
    box-shadow: inset 0 1px 0 rgb(var(--bh-glass-light) / 29%),
      inset 0 0 0 1px rgb(var(--bh-button-edge) / 42%), inset 0 -2px 1px rgb(0 0 0 / 38%),
      0 2px 0 rgb(3 5 9 / 66%), 0 0 18px -5px rgb(var(--bh-button-edge) / 49%);
  }

  :root :is([data-bh-card='interactive'], a[data-bh-card], a.glass-card, a.card-panel):hover {
    border-color: rgb(var(--bh-card-light) / 72%);
    box-shadow: inset 0 1px 0 rgb(var(--bh-glass-light) / 28%),
      inset 0 0 0 1px rgb(var(--bh-card-light) / 42%), 0 3px 0 rgb(3 5 9 / 66%),
      0 0 22px -8px rgb(var(--bh-card-light) / 47%);
  }
}

:root :is(button,[role='button'],[role='tab'],[data-bh-action],[data-bh-nav],.bh-button,.btn-gold,.btn-ghost):active:not(:disabled,[aria-disabled='true'],[role='switch'],[role='checkbox']),
:root[data-bh-recovery-entry] a.primary:active {
  box-shadow: inset 0 2px 5px rgb(4 6 10 / 76%), inset 0 0 0 1px rgb(var(--bh-button-edge) / 35%);
}

:root :is(button,[role='button'],[role='tab'],[data-bh-action],[data-bh-nav],.bh-button,.btn-gold,.btn-ghost):is(:disabled,[aria-disabled='true']) {
  opacity: .53;
  box-shadow: inset 0 0 0 1px rgb(var(--bh-button-edge, var(--bh-glass-brass)) / 16%);
}

:root :is(button,input:is([type='button'],[type='submit'],[type='reset']),[role='button'],[role='tab'],[data-slot='button'],[data-bh-action],[data-bh-nav],.bh-button,.btn-gold,.btn-ghost,a[data-bh-card]):focus-visible,
:root[data-bh-recovery-entry] a.primary:focus-visible {
  outline: 2px solid var(--bh-glass-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  :root :is(button,[role='button'],[role='tab'],[data-bh-card],[data-bh-action],[data-bh-nav],.glass-card,.card-panel) {
    transition-duration: 0s !important;
  }
}

@media (forced-colors: active) {
  :root :is(button,[role='button'],[role='tab'],[data-bh-action],[data-bh-nav],[data-bh-card],.glass-card,.card-panel),
  :root[data-bh-recovery-entry] :is(main, a.primary) {
    background-image: none;
    box-shadow: none;
    border-color: ButtonText;
  }
}
