/**
 * Glass appearance tokens — light defaults, dark palette, Match device.
 * Scoped to html[data-theme] so the old (non-Glass) interface is untouched.
 */

:root {
  color-scheme: light;
  --surface-2: #f7f8fc;
  --surface-3: #fafbfd;
  --brand-soft-2: #f1efff;
  --brand-soft-3: #f7f6ff;
  --brand-soft-4: #fafaff;
  --overlay-scrim: rgba(15, 17, 23, 0.42);
  --overlay-scrim-soft: rgba(15, 17, 23, 0.32);
  --glass-bg: rgba(255, 255, 255, 0.94);
  --glass-bg-canvas: rgba(243, 244, 248, 0.92);
  --glass-line: rgba(213, 216, 227, 0.8);
  --shadow-lg: 0 12px 32px rgba(15, 17, 23, 0.16);
  --shadow-xl: 0 24px 64px rgba(15, 17, 23, 0.24);
  --shadow-dock: 0 12px 36px rgba(15, 17, 23, 0.16);
  --shadow-fab: 0 8px 20px rgba(91, 79, 232, 0.4);
  --skeleton: linear-gradient(90deg, #eceef4 0%, #f6f7fa 50%, #eceef4 100%);
  --on-brand: #ffffff;
  --scrollbar: rgba(15, 23, 42, 0.24);
  --scrollbar-thumb: rgba(15, 23, 42, 0.32);
  --theme-color-light: #5b4fe8;
  --chip-neutral-bg: #eef0f5;
  --surface-inverse: #1a1d26;
  --on-inverse: #ffffff;
  --inverse-line: transparent;
  --inverse-action: #c7c2ff;
  --theme-color-dark: #1a1d26;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --brand: #8b85f0;
  --brand-hover: #a29df5;
  --brand-soft: #2a2750;
  --brand-ink: #c7c2ff;
  --ink: #f0f1f5;
  --muted: #a0a6b8;
  --muted-2: #8a90a4;
  --line: #2e3344;
  --line-strong: #3d4358;
  --canvas: #0f1117;
  --surface: #1a1d26;
  --success: #4ade80;
  --success-soft: #14301f;
  --warn: #fb923c;
  --warn-soft: #3a2410;
  --danger: #f87171;
  --danger-soft: #3a1515;
  --info: #38bdf8;
  --info-soft: #0e2a3a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.24), 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --wg-brand: var(--brand);
  --wg-brand-soft: var(--brand-soft);
  --wg-ink: var(--ink);
  --wg-muted: var(--muted);
  --wg-border: var(--line);
  --wg-surface: var(--surface);
  --wg-canvas: var(--canvas);
  --wg-shadow: var(--shadow-sm);
  --surface-2: #222632;
  --surface-3: #1e222c;
  --brand-soft-2: #2a2750;
  --brand-soft-3: #232040;
  --brand-soft-4: #1e1c36;
  --overlay-scrim: rgba(0, 0, 0, 0.62);
  --overlay-scrim-soft: rgba(0, 0, 0, 0.48);
  --glass-bg: rgba(26, 29, 38, 0.92);
  --glass-bg-canvas: rgba(15, 17, 23, 0.92);
  --glass-line: rgba(61, 67, 88, 0.85);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow-dock: 0 12px 36px rgba(0, 0, 0, 0.45);
  --shadow-fab: 0 8px 20px rgba(91, 79, 232, 0.5);
  --skeleton: linear-gradient(90deg, #1e222c 0%, #2a2e3a 50%, #1e222c 100%);
  --on-brand: #ffffff;
  --scrollbar: rgba(255, 255, 255, 0.18);
  --scrollbar-thumb: rgba(255, 255, 255, 0.28);
  --btn-close-filter: invert(1) grayscale(1) brightness(2);
  --logo-filter: brightness(1.15) contrast(1.05);
  --chip-neutral-bg: #2a2e3a;
  --surface-inverse: #2a2e3a;
  --on-inverse: #f0f1f5;
  --inverse-line: #3d4358;
  --inverse-action: #c7c2ff;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --brand: #8b85f0;
    --brand-hover: #a29df5;
    --brand-soft: #2a2750;
    --brand-ink: #c7c2ff;
    --ink: #f0f1f5;
    --muted: #a0a6b8;
    --muted-2: #8a90a4;
    --line: #2e3344;
    --line-strong: #3d4358;
    --canvas: #0f1117;
    --surface: #1a1d26;
    --success: #4ade80;
    --success-soft: #14301f;
    --warn: #fb923c;
    --warn-soft: #3a2410;
    --danger: #f87171;
    --danger-soft: #3a1515;
    --info: #38bdf8;
    --info-soft: #0e2a3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.24), 0 8px 24px rgba(0, 0, 0, 0.28);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
    --wg-brand: var(--brand);
    --wg-brand-soft: var(--brand-soft);
    --wg-ink: var(--ink);
    --wg-muted: var(--muted);
    --wg-border: var(--line);
    --wg-surface: var(--surface);
    --wg-canvas: var(--canvas);
    --wg-shadow: var(--shadow-sm);
    --surface-2: #222632;
    --surface-3: #1e222c;
    --brand-soft-2: #2a2750;
    --brand-soft-3: #232040;
    --brand-soft-4: #1e1c36;
    --overlay-scrim: rgba(0, 0, 0, 0.62);
    --overlay-scrim-soft: rgba(0, 0, 0, 0.48);
    --glass-bg: rgba(26, 29, 38, 0.92);
    --glass-bg-canvas: rgba(15, 17, 23, 0.92);
    --glass-line: rgba(61, 67, 88, 0.85);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.5);
    --shadow-dock: 0 12px 36px rgba(0, 0, 0, 0.45);
    --shadow-fab: 0 8px 20px rgba(91, 79, 232, 0.5);
    --skeleton: linear-gradient(90deg, #1e222c 0%, #2a2e3a 50%, #1e222c 100%);
    --on-brand: #ffffff;
    --scrollbar: rgba(255, 255, 255, 0.18);
    --scrollbar-thumb: rgba(255, 255, 255, 0.28);
    --btn-close-filter: invert(1) grayscale(1) brightness(2);
    --logo-filter: brightness(1.15) contrast(1.05);
    --chip-neutral-bg: #2a2e3a;
    --surface-inverse: #2a2e3a;
    --on-inverse: #f0f1f5;
    --inverse-line: #3d4358;
    --inverse-action: #c7c2ff;
  }
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    color-scheme: light;
  }
}

/* Appearance segmented control */
.gl-theme {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.gl-theme__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.gl-theme__seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.gl-theme__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.1rem;
  padding: 0.35rem 0.4rem;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.gl-theme__opt .gl-ic {
  font-size: 1rem;
}

.gl-theme__opt[aria-checked="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.gl-theme__opt:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.gl-more__foot .gl-theme {
  grid-column: 1 / -1;
  margin-bottom: 0.35rem;
}

.gl-more__foot .gl-theme__opt {
  min-height: 44px;
}

/* Document / PDF previews stay light */
html[data-theme] .gl-doc-preview,
html[data-theme] .gl-pdf-frame,
html[data-theme] iframe.gl-doc-frame {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

html[data-theme] .gl-help-figure img,
html[data-theme] .gl-wiki-shot {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

/*
 * Glass system layer on top of the production stylesheets (material-dashboard, filter-improvements, app-ui).
 * Desktop keeps the production look; this file adds the shared building blocks the real app lacks
 * and the tablet (rail) and phone (app bar + dock) postures.
 *
 * Breakpoints (same as the production bulk bar):
 *   phone   : (max-width: 767.98px), (orientation: landscape) and (max-height: 520px)
 *   tablet  : 768–1199.98px wide and taller than 520px
 *   desktop : ≥ 1200px
 */

:root {
  --dock-h: 64px;
  --appbar-h: 56px;
  --rail-w: 76px;
  --sat: max(env(safe-area-inset-top, 0px), var(--lab-sat, 0px));
  --sab: max(env(safe-area-inset-bottom, 0px), var(--lab-sab, 0px));
  --sal: max(env(safe-area-inset-left, 0px), var(--lab-sal, 0px));
  --sar: max(env(safe-area-inset-right, 0px), var(--lab-sar, 0px));
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --overlay-z: 1200;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--canvas, #f3f4f8);
}

body.gl-body {
  font-family: var(--font);
  background: var(--canvas) !important;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

body.gl-has-overlay {
  overflow: hidden;
}

.gl-ic {
  font-size: 1.15em;
  line-height: 1;
  vertical-align: -0.18em;
}

.gl-ic--sm {
  font-size: 1em;
  margin-right: 0.25rem;
}

/* the production theme fills checked boxes with its pink gradient and no tick; use the brand colour with a visible tick */
.form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked,
.form-check-input[type="checkbox"]:not(.form-switch *):checked {
  border-color: var(--brand) !important;
  background-color: var(--brand) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
}

.form-check-input[type="checkbox"]:not(.form-switch *):indeterminate {
  border-color: var(--brand) !important;
  background: var(--brand) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e") center / 100% 100% no-repeat !important;
}

/* the production theme shrinks every `.btn-sm i` to 0.5rem; our symbol icons must stay legible */
.btn.btn-sm > i.gl-ic,
.btn-group-sm > .btn > i.gl-ic {
  font-size: 1.15rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

[hidden] {
  display: none !important;
}

/* ── boot ─────────────────────────────────────────────────────────────── */

.gl-booting {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.gl-splash {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.gl-splash img {
  width: 56px;
  height: auto;
  animation: gl-pulse 1.2s ease-in-out infinite;
}

@keyframes gl-pulse {
  50% { opacity: 0.45; transform: scale(0.96); }
}

/* ── shell: desktop ───────────────────────────────────────────────────── */

.gl-shell .wg-main {
  min-height: 100vh;
}

.gl-sidebar .brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gl-sidebar .nav-item {
  text-decoration: none;
}

.gl-sidebar .nav-item:focus-visible,
.gl-sidebar .nav-label:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.gl-rail-close,
.gl-rail-btn,
.gl-rail-scrim {
  display: none !important;
}

.gl-topbar__row {
  gap: 1rem;
  flex-wrap: nowrap !important;
}

.gl-topbar__titles {
  flex: 1 1 auto;
  min-width: 0;
}

.gl-topbar__titles .page-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-back.wg-nav-back {
  width: auto;
}

.gl-back {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  max-width: 220px;
  height: 36px;
  padding: 0 0.75rem 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  flex: 0 1 auto;
  transition: background 0.15s, border-color 0.15s;
}

/* phone-only back targets (e.g. an open Glass AI chat back to the chat list); wider layouts show the list beside it */
.gl-back.gl-back--phone {
  display: none !important;
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
  .gl-back.gl-back--phone {
    display: inline-flex !important;
  }

  /* phone back is a plain brand arrow (mock appbar); outranks the legacy themed pill (html[data-theme] .wg-nav-back) */
  html[data-theme] .gl-back.wg-nav-back,
  html[data-theme] .gl-back.wg-nav-back:hover,
  .gl-back.wg-nav-back {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--brand) !important;
  }

  /* chat back: arrow only, so the conversation title keeps the room */
  .gl-back.gl-back--phone {
    flex: none;
    width: 40px;
    justify-content: center;
    padding: 0 !important;
    margin-left: -0.35rem;
  }

  .gl-back.gl-back--phone .gl-back__label {
    display: none;
  }
}

.gl-back:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.gl-back .material-icons {
  font-size: 18px;
}

.gl-back__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-topbar__end {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.gl-topbar__primary,
.gl-topbar__more {
  display: none !important;
}

.gl-cmdk {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 38px;
  min-width: 250px;
  padding: 0 0.6rem 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}

.gl-cmdk span {
  flex: 1;
}

.gl-cmdk kbd {
  font: 600 0.7rem var(--font);
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  box-shadow: none;
}

.gl-cmdk:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.gl-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  flex: 0 0 auto;
}

.gl-icon-btn .gl-ic {
  font-size: 22px;
  vertical-align: 0;
}

.gl-icon-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.gl-icon-btn.is-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.gl-bell__dot {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--on-brand);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--canvas);
}

/* notification center drawer */
.gl-notif__pinned {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--ink);
  text-decoration: none;
}

.gl-notif__pinned > .gl-ic:first-child {
  color: var(--warn);
}

.gl-notif__pinned > span {
  display: grid;
  flex: 1;
  min-width: 0;
}

.gl-notif__pinned strong {
  font-size: 0.86rem;
}

.gl-notif__pinned small {
  color: var(--muted);
  font-size: 0.76rem;
}

.gl-notif__list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-notif__item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.gl-notif__item:hover,
.gl-notif__item:focus-visible {
  background: var(--brand-soft);
}

.gl-notif__dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: var(--brand);
}

.gl-notif__item.is-read .gl-notif__dot {
  background: transparent;
}

.gl-notif__body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.gl-notif__body strong {
  font-size: 0.86rem;
}

.gl-notif__item.is-read .gl-notif__body strong {
  font-weight: 500;
}

.gl-notif__body span {
  color: var(--muted);
  font-size: 0.8rem;
}

.gl-notif__body small {
  color: var(--muted-2);
  font-size: 0.72rem;
}

.gl-notif__empty {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.gl-notif__empty .gl-ic {
  font-size: 32px;
}

.gl-notif__empty p {
  margin: 0;
}

/* account button: same height, border and corner radius as the search field and icon buttons */
.gl-topbar .user-chip.gl-user {
  height: 38px;
  gap: 0.5rem;
  padding: 0 0.4rem 0 0.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.gl-topbar .user-chip.gl-user:hover,
.gl-topbar .user-chip.gl-user[aria-expanded="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.gl-topbar .user-chip.gl-user:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.gl-user .user-chip__avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.gl-user .user-chip__meta {
  max-width: 160px;
}

.gl-user .user-chip__name {
  font-size: 0.8rem;
}

.gl-user__chev {
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.15s;
}

.gl-user:hover .gl-user__chev {
  color: var(--brand);
}

.gl-page {
  outline: none;
}

.gl-page-toolbar {
  margin: 0 0 1rem;
}

.gl-page-toolbar .page-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

#gl-view {
  transition: opacity 0.15s;
}

#gl-view.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.gl-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  color: var(--muted-2);
  font-size: 0.72rem;
}

.gl-footer__lab {
  display: inline-flex;
  align-items: center;
}

.gl-footer__release {
  margin-right: auto;
  color: inherit;
  text-decoration: none;
}

.gl-footer__release:hover {
  color: var(--brand);
  text-decoration: underline;
}

body.gl-fill .gl-footer {
  display: none;
}

/* dock & phone-only chrome are hidden until the phone posture */
.gl-dock,
.gl-ptr {
  display: none;
}

/* ── buttons ──────────────────────────────────────────────────────────── */

.gl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.gl-btn .gl-ic {
  font-size: 1.1rem;
  vertical-align: 0;
}

.gl-btn--icon {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}

/* Modals, sheets, tours and tour offers are mounted outside .wg-main, so they need the same button
   system as the page (app-ui.css) instead of the theme's uppercase buttons and maroon focus state. */
:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 38px;
  padding: 0 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap;
}

:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-sm {
  height: 32px;
  padding: 0 0.7rem;
  font-size: 0.78rem;
}

:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-primary,
:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-primary:focus {
  border-color: transparent !important;
  background: var(--brand) !important;
  color: var(--on-brand) !important;
}

:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-primary:hover {
  background: var(--brand-hover, var(--brand)) !important;
}

:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-secondary,
:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-secondary:focus {
  border-color: var(--line-strong) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
}

:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-secondary:hover {
  background: var(--surface-2) !important;
}

:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-danger,
:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-danger:focus {
  border-color: #f3c4c4 !important;
  background: var(--danger-soft) !important;
  background-image: none !important;
  color: var(--danger) !important;
}

:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-link,
:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn.btn-ghost {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--muted) !important;
}

:is(.gl-ov, .gl-tour, .gl-help-nudge) .btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

/* Buttons placed on brand/dark surfaces (quote card, hero panels). */
.btn.gl-btn--light,
.btn.gl-btn--light:focus {
  border: 1px solid transparent;
  background: var(--surface);
  background-image: none;
  color: var(--brand);
  box-shadow: none;
}

.btn.gl-btn--light:hover {
  background: var(--brand-soft-2);
  color: var(--brand);
}

.btn.gl-btn--on-dark,
.btn.gl-btn--on-dark:focus {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
  background-image: none;
  color: var(--on-brand);
  box-shadow: none;
}

.btn.gl-btn--on-dark:hover {
  border-color: var(--on-brand);
  background: rgba(255, 255, 255, 0.22);
  color: var(--on-brand);
}

.btn.gl-btn--light:focus-visible,
.btn.gl-btn--on-dark:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── sections & panels (one card per section, never nested) ───────────── */

.gl-section {
  margin-bottom: 1.25rem;
  overflow: visible;
}

.gl-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem 0.25rem;
}

.gl-section__titles {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.gl-section__ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 34px;
}

.gl-section__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.gl-section__sub {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.gl-section__head {
  flex-wrap: wrap;
}

.gl-section__titles {
  flex: 1 1 auto;
}

.gl-section__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
}

.gl-section__body {
  padding: 1rem 1.25rem 1.25rem;
}

.gl-section--flush > .gl-section__body {
  padding: 0.5rem 0 0.25rem;
}

.gl-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  background: var(--surface);
}

.gl-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.gl-panel__head h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.gl-grid {
  display: grid;
  gap: 1.25rem;
}

.gl-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gl-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gl-grid--side {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.gl-grid > .gl-section {
  margin-bottom: 0;
}

.gl-stack {
  display: grid;
  gap: 1.25rem;
}

.gl-stack > .gl-section {
  margin-bottom: 0;
}

/* definition list */
.gl-dl {
  display: grid;
  gap: 0.9rem 1.25rem;
  margin: 0;
}

.gl-dl--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gl-dl--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gl-dl--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.gl-dl__item {
  min-width: 0;
}

.gl-dl__item.is-wide {
  grid-column: 1 / -1;
}

.gl-dl dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.gl-dl dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: break-word;
  word-break: break-word;
}

.gl-dl dd.is-mono {
  font-family: var(--mono);
  font-size: 0.82rem;
}

/* record links & chips */
.gl-reclink {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed rgba(91, 79, 232, 0.4);
}

.gl-reclink:hover {
  border-bottom-style: solid;
}

.gl-recchip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}

.gl-recchip:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.gl-recchip__ic {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 32px;
}

.gl-recchip.is-warn .gl-recchip__ic { background: var(--warn-soft); color: var(--warn); }
.gl-recchip.is-success .gl-recchip__ic { background: var(--success-soft); color: var(--success); }

.gl-recchip__text {
  display: grid;
  min-width: 0;
  flex: 1;
}

.gl-recchip__text strong,
.gl-recchip__text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-recchip__text strong { font-size: 0.82rem; }
.gl-recchip__text small { font-size: 0.72rem; color: var(--muted); }

.gl-recchip__go {
  color: var(--muted-2);
}

.gl-chips-col {
  display: grid;
  gap: 0.45rem;
}

.gl-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* a page-level chips row (calculator picks) sits above a card: same breathing room as the stepper */
.gl-lw-page > .gl-chips-row {
  margin-bottom: 0.85rem;
}

.gl-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 700;
  flex: 0 0 auto;
}

.gl-avatar--sm { width: 28px; height: 28px; font-size: 0.68rem; }
.gl-avatar--md { width: 36px; height: 36px; font-size: 0.78rem; }
.gl-avatar--lg { width: 48px; height: 48px; font-size: 1rem; }

/* tabs */
.gl-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.gl-tabs::-webkit-scrollbar { display: none; }

.gl-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  margin-bottom: -1px;
}

.gl-tab.is-on {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.gl-tab__count {
  font-size: 0.68rem;
  background: var(--canvas);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}

.gl-tab.is-on .gl-tab__count {
  background: var(--brand-soft);
  color: var(--brand);
}

.gl-seg {
  flex-wrap: wrap;
}

/* every segmented option (button or radio label) centres its text in the 32px pill */
.wg-seg .seg-btn,
.gl-seg .seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  line-height: 1;
  white-space: nowrap;
}

.gl-seg label.seg-btn {
  cursor: pointer;
  margin: 0;
}

/* stepper */
.gl-stepper {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.gl-stepper__step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.gl-stepper__step:not(:last-child)::after {
  content: "";
  flex: 1;
  min-width: 16px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}

.gl-stepper__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  font-size: 0.75rem;
  background: var(--surface);
  flex: 0 0 26px;
}

.gl-stepper__step.is-current { color: var(--ink); }
.gl-stepper__step.is-current .gl-stepper__dot { border-color: var(--brand); color: var(--brand); }
.gl-stepper__step.is-done .gl-stepper__dot { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.gl-stepper__step.is-done::after { background: var(--brand); }

/* meter (width classes instead of inline styles) */
.gl-meter {
  display: inline-block;
  width: 100%;
  min-width: 60px;
  height: 6px;
  border-radius: 999px;
  background: var(--canvas);
  overflow: hidden;
  vertical-align: middle;
}

.gl-meter__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.gl-meter.is-success .gl-meter__fill { background: var(--success); }
.gl-meter.is-warn .gl-meter__fill { background: var(--warn); }
.gl-meter.is-danger .gl-meter__fill { background: var(--danger); }

.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; }
.w-100 { width: 100%; }

/* empty / error / skeleton */
.gl-empty {
  margin: 1.5rem auto;
  max-width: 460px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.5rem 1rem;
}

.gl-empty .wg-empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
}

.gl-empty .wg-empty-state__icon .gl-ic {
  font-size: 28px;
}

.gl-empty .wg-empty-state__body {
  display: grid;
  gap: 0.4rem;
  justify-items: center;
}

.gl-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.gl-skel {
  padding: 1rem 1.25rem;
  display: grid;
  gap: 0.85rem;
}

.gl-skel__row {
  display: flex;
  gap: 1rem;
}

.gl-skel__line,
.gl-skel__block {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--skeleton);
  background-size: 200% 100%;
  animation: gl-shimmer 1.2s linear infinite;
}

.gl-skel__block {
  height: 64px;
  border-radius: 10px;
}

.gl-skel__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.gl-skel .w20 { width: 20%; } .gl-skel .w30 { width: 30%; } .gl-skel .w40 { width: 40%; }
.gl-skel .w60 { width: 60%; } .gl-skel .w70 { width: 70%; }

@keyframes gl-shimmer {
  to { background-position: -200% 0; }
}

/* KPI tiles (production portfolio-stat markup). On a page the tiles are the cards, so the bar itself is
   transparent and spaced like a section; inside a section the bar rules below apply. */
.gl-kpis {
  padding: 1rem 1.25rem 0.75rem;
}

#gl-view > .gl-kpis {
  padding: 0;
  margin-bottom: 1.25rem;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

#gl-view > .gl-kpis + .gl-tabs {
  margin-top: -0.25rem;
}

.gl-kpis .portfolio-stat-card {
  flex: 1 1 180px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.gl-kpis .portfolio-stat-card.is-link {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.gl-kpis .portfolio-stat-card.is-link:hover {
  border-color: var(--brand) !important;
  transform: translateY(-1px);
}

.gl-kpis .portfolio-stat-icon .gl-ic {
  vertical-align: 0;
}

.gl-kpi-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.gl-section .gl-kpis,
.gl-ov .gl-kpis {
  padding: 0 0 1rem;
  background: transparent !important;
  border: 0 !important;
}

/* badges in tables keep one line */
.wg-badge {
  white-space: nowrap;
}

/* ── filters ──────────────────────────────────────────────────────────── */

.gl-filter {
  margin-bottom: 0.75rem;
}

/* filters live in the list card header: one surface, no card-in-card */
.gl-listcard .gl-filter,
.gl-listcard .gl-filter .filters-section__header {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.gl-cell-stack {
  display: grid;
  gap: 0.2rem;
  justify-items: start;
}

.gl-cell-sub {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Insurer number not received yet (policy number cell, table and phone card) */
.gl-cell-sub.is-pending {
  font-style: italic;
}

.gl-card__titles .gl-cell-sub.is-pending {
  white-space: normal;
}

.gl-filter__bar {
  display: flex !important;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.gl-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: 520px;
  height: 38px;
  margin: 0;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  gap: 0.4rem;
  cursor: text;
}

.gl-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.gl-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
}

.gl-search__input::-webkit-search-cancel-button {
  display: none;
}

.gl-search__clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  display: inline-flex;
  cursor: pointer;
}

.gl-search--sm {
  height: 34px;
  max-width: none;
  margin-bottom: 0.5rem;
}

.gl-search--lg {
  height: 48px;
  max-width: none;
  border-radius: 12px;
}

.gl-search--lg .gl-search__input {
  font-size: 1rem;
}

.gl-filter__toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  height: 38px;
  white-space: nowrap;
  margin-left: auto;
}

.gl-filter__toggle.has-active {
  color: var(--brand);
}

.gl-filter__quick {
  padding: 0.75rem 0 0;
}

.gl-filter__presets {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.gl-filter__presets .hint {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.gl-filter__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.75rem;
}

.gl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 28px;
  padding: 0 0.3rem 0 0.7rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.75rem;
  font-weight: 600;
  border: 0;
}

.gl-chip button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 2px;
  border-radius: 999px;
  cursor: pointer;
}

.gl-chip button:hover {
  background: rgba(91, 79, 232, 0.15);
}

.gl-chip--reset {
  background: transparent;
  color: var(--muted);
  padding: 0 0.6rem;
  cursor: pointer;
}

.gl-filter__panel {
  padding: 1rem 0 0.25rem;
}

.gl-filter.is-collapsed .gl-filter__panel {
  display: none;
}

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

.gl-filter__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.gl-filter__foot-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.gl-filter__saved {
  width: auto;
  min-width: 160px;
}

.gl-filter-sheet {
  display: grid;
  gap: 1rem;
}

.gl-filter-sheet .gl-filter__presets {
  align-items: flex-start;
  flex-direction: column;
}

/* ── list card, table, phone cards ────────────────────────────────────── */

.gl-listcard {
  margin-bottom: 1.25rem;
}

.gl-listcard__head {
  padding: 1rem 1.25rem 0.25rem !important;
}

.gl-listcard__body {
  padding-top: 0.25rem !important;
}

.gl-table-wrap {
  overflow-x: auto;
}

.gl-table {
  min-width: 100%;
}

.gl-table thead th {
  white-space: normal !important;
  line-height: 1.25;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

/* drag a header onto another to move the column (js/ui/list.js) */
.gl-th-move {
  position: relative;
  cursor: grab;
}

.gl-th-in {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  white-space: nowrap;
}

.gl-th-grip {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 0.95rem;
  color: var(--muted-2);
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.gl-th-grip .gl-ic {
  font-size: 0.95rem;
}

thead:hover .gl-th-grip {
  opacity: 0.9;
}

.gl-th-move {
  transition: background-color 0.15s ease;
}

.gl-th-move:hover {
  background: var(--brand-soft);
}

.gl-th-move:hover .gl-th-grip {
  color: var(--brand);
  opacity: 1;
}

.gl-th-move:active {
  cursor: grabbing;
}

.gl-th-move.is-dragging {
  opacity: 0.45;
}

/* one-time hint above list tables (dismissed, or after the first move) */
.gl-coltip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1rem 0.6rem;
  padding: 0.45rem 0.5rem 0.45rem 0.75rem;
  border: 1px dashed var(--brand);
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 0.8rem;
}

.gl-coltip > .gl-ic {
  flex: none;
  color: var(--brand);
}

.gl-coltip > span {
  flex: 1 1 auto;
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
  .gl-coltip {
    display: none;
  }
}

.gl-th-move.is-drop-before,
.gl-th-move.is-drop-after {
  background: var(--brand-soft);
}

.gl-th-move.is-drop-before::before,
.gl-th-move.is-drop-after::after {
  content: "";
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 3px;
  border-radius: 2px;
  background: var(--brand);
}

.gl-th-move.is-drop-before::before { left: -1px; }
.gl-th-move.is-drop-after::after { right: -1px; }

.gl-th-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.gl-sort-ic {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: var(--muted-2);
  opacity: 0.5;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.gl-sort-ic .gl-ic {
  font-size: 0.95rem;
}

.gl-th-btn:hover .gl-sort-ic,
.gl-th-btn:focus-visible .gl-sort-ic {
  color: var(--ink);
  opacity: 0.85;
}

.gl-sort-ic.is-on {
  color: var(--brand);
  opacity: 1;
}

.gl-th-sort.is-sorted {
  color: var(--brand) !important;
  opacity: 1 !important;
}

.gl-row.is-link {
  cursor: pointer;
}

.gl-row:hover > td {
  background: var(--brand-soft-4);
}

.gl-row.is-selected > td {
  background: var(--brand-soft);
}

.gl-row:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.gl-row.is-local .gl-cell-title::after,
.gl-card.is-local .gl-card__titles strong::after {
  content: "local";
  margin-left: 0.4rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: var(--info-soft);
  color: var(--info);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: 0.1em;
}

/* text columns wrap so every production column fits on desktop; dates & amounts stay on one line */
.gl-table td:not(.is-fixed):not(.select-col):not(.gl-td-actions) {
  white-space: normal !important;
  min-width: 110px;
  max-width: 240px;
}

.gl-table > tbody > tr > td,
.gl-table > thead > tr > th {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.gl-table .select-col {
  width: 40px;
}

/* status badges never touch the next column, even with the tight 0.3rem cell padding */
.gl-table td .wg-badge {
  margin-inline-end: 0.6rem;
  /*
   * badges clip (overflow: hidden), so without an explicit minimum the auto table layout sizes the column
   * below the badge and it runs into the next cell; long labels (roles) wrap instead of spilling out
   */
  min-width: min-content;
  white-space: normal;
  height: auto;
  min-height: 24px;
  padding-block: 0.2rem;
  line-height: 1.25;
}

@media (min-width: 1200px) and (max-width: 1599.98px) {
  .gl-table > tbody > tr > td,
  .gl-table > thead > tr > th {
    padding-left: 0.3rem !important;
    padding-right: 0.3rem !important;
  }

  .gl-table td:not(.is-fixed):not(.select-col):not(.gl-td-actions) {
    min-width: 76px;
    overflow-wrap: break-word;
  }
}

/* small desktops (13" laptops, non-maximised windows): drop the lowest-priority columns so wide lists fit without scrolling */
@media (min-width: 1200px) and (max-width: 1439.98px) {
  .gl-p3 {
    display: none !important;
  }
}

/* with the full sidebar open, 1200–1279px leaves less room than a landscape tablet */
@media (min-width: 1200px) and (max-width: 1279.98px) {
  .gl-p2 {
    display: none !important;
  }
}

/*
 * Slim, quiet scrollbars app-wide (Safari/Chrome draw classic chunky bars when "always show scroll bars" is on).
 * Scrollers that hide their bar on purpose (tabs, pills, shortcuts) keep their more specific `display: none`.
 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.16);
  background-clip: padding-box;
}

.gl-table-wrap:hover::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb);
}

/* swipe rows (tabs, steppers, chips, pills) show no bar at all, matching their `scrollbar-width: none` */
.gl-tabs::-webkit-scrollbar,
.gl-stepper::-webkit-scrollbar,
.gl-filter__quick::-webkit-scrollbar,
.gl-filter__chips::-webkit-scrollbar,
.gl-dash-filter > .gl-section__body > .gl-chart-tools::-webkit-scrollbar,
.gl-shortcuts::-webkit-scrollbar {
  display: none;
}

/* touch layouts: a hairline indicator like native iOS/Android overlay bars */
@media (max-width: 1199.98px), (pointer: coarse) {
  ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }

  ::-webkit-scrollbar-thumb {
    border: 0;
    background: rgba(15, 23, 42, 0.2);
  }
}

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar) transparent;
  }
}

.gl-table td.is-fixed {
  white-space: nowrap !important;
}

.gl-table td.is-num,
.gl-table td.is-num span {
  font-variant-numeric: tabular-nums;
}

.gl-cell-title {
  color: var(--ink) !important;
}

.gl-td-actions {
  text-align: right;
  white-space: nowrap;
}

.gl-cards {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0 0.75rem;
}

.gl-listcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem 0.25rem;
}

.gl-perpage {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.gl-perpage .form-select,
.gl-perpage .gl-select {
  width: auto;
}

/* ── global dropdown (js/ui/select.js) ─────────────────────────────────── */

.gl-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.gl-select__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.gl-select__trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}

.gl-select__trigger:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.gl-select__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-select__trigger.is-placeholder .gl-select__value {
  color: var(--muted);
}

.gl-select.is-open .gl-select__trigger,
.gl-select__trigger:focus-visible {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px var(--brand-soft) !important;
  outline: 0;
}

.gl-field.has-error .gl-select__trigger {
  border-color: var(--danger) !important;
}

.gl-select__pop {
  /* Portaled to document.body (fixed) so overflow:auto shells like .gl-ov__body do not scroll. */
  position: fixed;
  z-index: calc(var(--overlay-z) + 20);
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  width: max-content;
  max-width: min(440px, 92vw);
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: auto;
  overscroll-behavior: contain;
}

.gl-select__pop .gl-select__list {
  max-height: none;
}

/* ── column filter (header funnel, js/ui/colfilter.js) ── */
.gl-th-filter {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.15rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.gl-th-filter .gl-ic {
  font-size: 0.95rem;
}

thead:hover .gl-th-filter,
.gl-th-filter:focus-visible,
.gl-th-filter[aria-expanded="true"] {
  opacity: 1;
}

.gl-th-filter:hover,
.gl-th-filter[aria-expanded="true"] {
  background: var(--surface);
  color: var(--ink);
}

.gl-th-filter.is-on {
  background: var(--brand);
  color: var(--on-brand);
  opacity: 1;
}

.gl-colfilter {
  position: fixed;
  top: var(--cf-y, 0);
  left: var(--cf-x, 0);
  z-index: calc(var(--overlay-z) + 20);
  display: grid;
  gap: 0.45rem;
  width: 280px;
  max-width: calc(100vw - 16px);
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.gl-colfilter.is-up {
  top: auto;
  bottom: var(--cf-y, 0);
}

.gl-colfilter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-left: 0.2rem;
  color: var(--ink);
  font-size: 0.86rem;
}

.gl-colfilter__list {
  display: grid;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.gl-colfilter__opt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.3;
  cursor: pointer;
}

.gl-colfilter__opt:hover {
  background: var(--brand-soft);
}

.gl-colfilter__opt .form-check-input {
  flex: none;
  margin: 0;
}

.gl-colfilter__opt > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gl-colfilter__opt.is-all {
  font-weight: 650;
}

.gl-colfilter__note {
  padding: 0.4rem 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.gl-colfilter__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.gl-colfilter-sheet .gl-colfilter__head {
  display: none;
}

.gl-colfilter-sheet .gl-ov__body {
  display: grid;
  gap: 0.6rem;
}

.gl-colfilter-sheet .gl-colfilter__list {
  max-height: 50vh;
}

.gl-select__list {
  max-height: 290px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.gl-select__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.3;
  cursor: pointer;
}

.gl-select__opt.is-nested {
  padding-left: 1.1rem;
}

.gl-select__opt.is-active {
  background: var(--brand-soft);
}

.gl-select__opt.is-selected {
  color: var(--brand);
  font-weight: 650;
}

.gl-select__opt.is-placeholder {
  color: var(--muted);
}

.gl-select__opt.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gl-select__opt .gl-ic {
  flex: none;
  color: var(--brand);
}

.gl-select__opt > span {
  display: grid;
  min-width: 0;
}

.gl-select__opt small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-select__group {
  padding: 0.55rem 0.65rem 0.25rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gl-select__empty {
  padding: 0.75rem 0.65rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.gl-select__search {
  width: 100%;
}

/* phone sheet: full-height list, larger touch targets */
.gl-select-sheet .gl-select__list {
  max-height: none;
}

.gl-select-sheet .gl-select__opt {
  min-height: 46px;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
}

.gl-select-sheet .gl-select__search {
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 0.4rem;
  background: var(--surface);
}

/* ── global date picker (js/ui/datepicker.js) ──────────────────────────── */

.gl-date,
.gl-range {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.gl-date__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.gl-date__field {
  position: relative;
}

.gl-date__text {
  padding-right: 2.6rem;
  font-variant-numeric: tabular-nums;
}

.gl-date__btn {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
  cursor: pointer;
}

.gl-date--sm .gl-date__btn {
  width: 1.8rem;
  height: 1.8rem;
}

.gl-date__btn:hover,
.gl-date.is-open .gl-date__btn {
  background: var(--brand-soft);
  color: var(--brand);
}

.gl-date__btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.gl-date.is-open .gl-date__text,
.gl-range.is-open .gl-range__trigger {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.gl-date.is-bad .gl-date__text,
.gl-field.has-error .gl-date__text,
.gl-cp__row.has-error .gl-date__text {
  border-color: var(--danger);
}

.gl-range__trigger {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.gl-range__trigger > .gl-ic {
  flex: none;
  color: var(--muted);
}

.gl-range__value {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.gl-range__value.is-placeholder {
  color: var(--muted);
}

.gl-date__pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: calc(var(--overlay-z) + 20);
  width: max-content;
  max-width: calc(100vw - 1rem);
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.is-up > .gl-date__pop {
  top: auto;
  bottom: calc(100% + 4px);
}

.is-end > .gl-date__pop {
  right: 0;
  left: auto;
}

.is-inline > .gl-date__pop {
  position: static;
  margin-top: 0.4rem;
  box-shadow: none;
}

.gl-cal {
  display: grid;
  gap: 0.5rem;
}

.gl-cal--range {
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: 0.75rem;
}

.gl-cal__presets {
  display: grid;
  align-content: start;
  gap: 0.2rem;
  padding-right: 0.75rem;
  border-right: 1px solid var(--line);
}

.gl-cal__preset {
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
}

.gl-cal__preset:hover {
  background: var(--canvas);
}

.gl-cal__preset.is-active {
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
}

.gl-cal__main {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.gl-cal__months {
  display: flex;
  gap: 1.25rem;
}

.gl-cal__month {
  display: grid;
  gap: 0.35rem;
  width: 16.5rem;
}

.gl-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.gl-cal__title {
  display: flex;
  gap: 0.2rem;
}

.gl-cal__sel {
  padding: 0.25rem 0.35rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.gl-cal__sel:hover,
.gl-cal__sel:focus-visible {
  border-color: var(--line);
  background: var(--canvas);
  outline: 0;
}

.gl-cal__nav,
.gl-cal__gap {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
}

.gl-cal__nav {
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.gl-cal__nav:hover {
  background: var(--canvas);
}

.gl-cal__week,
.gl-cal__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.gl-cal__week span {
  padding: 0.2rem 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.gl-cal__day {
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.gl-cal__day:hover:not(:disabled) {
  background: var(--canvas);
}

.gl-cal__day:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.gl-cal__day.is-out {
  color: var(--muted-2);
}

.gl-cal__day.is-today {
  font-weight: 800;
  box-shadow: inset 0 -2px 0 var(--brand);
}

.gl-cal__day.is-range,
.gl-cal__day.is-preview {
  border-radius: 0;
  background: var(--brand-soft);
}

.gl-cal__day.is-selected {
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  box-shadow: none;
}

.gl-cal__day.is-start:not(.is-end) {
  border-radius: 8px 0 0 8px;
}

.gl-cal__day.is-end:not(.is-start) {
  border-radius: 0 8px 8px 0;
}

.gl-cal__day:disabled {
  cursor: not-allowed;
  opacity: 0.35;
  text-decoration: line-through;
}

.gl-cal__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.gl-cal__summary {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.gl-cal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}

/* phone sheet: one month, presets as chips, full-width days */
.gl-date-sheet .gl-cal--range {
  grid-template-columns: minmax(0, 1fr);
}

.gl-date-sheet .gl-cal__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0 0.75rem;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

.gl-date-sheet .gl-cal__preset {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.gl-date-sheet .gl-cal__month {
  width: 100%;
}

.gl-date-sheet .gl-cal__day {
  height: 2.75rem;
  font-size: 0.95rem;
}

.gl-date-sheet .gl-cal__actions {
  width: 100%;
}

.gl-date-sheet .gl-cal__actions .btn {
  flex: 1 1 auto;
  min-height: 44px;
}

.gl-pager {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.gl-pager__info {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.gl-pager__pages {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.gl-pager__btn {
  min-width: 34px;
  height: 34px;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gl-pager__btn.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.gl-pager__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.gl-pager__gap {
  color: var(--muted);
  padding: 0 0.2rem;
}

/* bulk bar keeps the production look; it clears the dock on phones */
.gl-bulk .bulk-action-btn .badge {
  margin-left: 0.25rem;
}

/* ── forms ─────────────────────────────────────────────────────────────── */

.gl-form {
  display: grid;
  gap: 1.5rem;
}

.gl-form__section {
  min-width: 0;
  margin: 0;
  padding: 0 0 1.5rem;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.gl-form__section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.gl-form__legend {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  float: none;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.gl-form__legend .gl-ic {
  color: var(--brand);
  vertical-align: -0.2em;
}

.gl-form__legend small {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.gl-form__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.gl-field {
  min-width: 0;
  grid-column: span 3;
}

.gl-field--full { grid-column: 1 / -1; }
.gl-field--third { grid-column: span 2; }
.gl-field--half { grid-column: span 3; }

.gl-filter__grid .gl-field,
.gl-filter-sheet .gl-field {
  grid-column: auto;
}

/* material-dashboard ships borderless inputs; lab forms use the production bordered input look */
.gl-field .form-control,
.gl-prompt .form-control,
.gl-field .form-select,
.gl-ai__composer .form-control {
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  padding: 0.55rem 0.75rem !important;
  background-color: var(--surface) !important;
  min-height: 42px;
  font-size: 0.88rem;
  box-shadow: none;
}

.gl-field .form-control-sm,
.gl-field .form-select-sm {
  min-height: 36px;
  padding: 0.4rem 0.6rem !important;
  font-size: 0.82rem;
}

/* every dropdown (native select and GL.select trigger): the arrow sits inside the border and text stops before it.
   Matches the specificity of the production app-ui.css field rule, which pins padding with !important. */
.form-select,
.gl-field .form-select,
.main-content .form-select:not(.selectize-dropdown):not(.selectize-control),
.wg-main .form-select:not(.selectize-dropdown):not(.selectize-control) {
  padding-right: 2.5rem !important;
  background-position: right 0.85rem center !important;
  background-size: 14px 10px !important;
}

.form-select-sm,
.gl-field .form-select-sm,
.main-content .form-select-sm:not(.selectize-dropdown):not(.selectize-control),
.wg-main .form-select-sm:not(.selectize-dropdown):not(.selectize-control) {
  padding-right: 2.1rem !important;
  background-position: right 0.65rem center !important;
  background-size: 12px 9px !important;
}

.gl-field .form-control:focus,
.gl-prompt .form-control:focus,
.gl-field .form-select:focus,
.gl-ai__composer .form-control:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px var(--brand-soft) !important;
  outline: 0;
}

.gl-money .input-group-text {
  border: 1px solid var(--line) !important;
  border-right: 0 !important;
  border-radius: 10px 0 0 10px !important;
  padding: 0 0.7rem !important;
}

.gl-money .form-control {
  border-radius: 0 10px 10px 0 !important;
}

.gl-multi .form-check-input,
.gl-switch .form-check-input,
.gl-perms .form-check-input,
.gl-filelist .form-check-input,
.gl-colfilter__opt .form-check-input,
.gl-card .form-check-input {
  appearance: auto;
  -webkit-appearance: auto;
  position: static;
  opacity: 1;
  width: 18px;
  height: 18px;
  margin: 0;
  float: none;
  accent-color: var(--brand);
  cursor: pointer;
}

.gl-switch .form-check-input {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.gl-field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gl-field .form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.gl-req {
  color: var(--danger);
  margin-left: 0.15rem;
}

.gl-field__addon {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.35rem;
}

.gl-field__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.gl-field__preset {
  margin-bottom: 0.5rem;
}

.gl-field__msg {
  min-height: 0;
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.gl-field__msg:empty {
  display: none;
}

.gl-field__msg.is-error,
.gl-field__error {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.74rem;
  margin: 0.3rem 0 0;
}

.gl-field.has-error .form-control,
.gl-field.has-error .form-select,
.gl-field.has-error .gl-multi,
.gl-field.has-error .gl-drop {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.gl-field--switch {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.gl-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.gl-multi {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  background: var(--surface);
}

.gl-multi__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.25rem 0.75rem;
  max-height: 240px;
  overflow: auto;
}

.gl-multi__opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin: 0;
  cursor: pointer;
}

.gl-multi__opt:hover {
  background: var(--canvas);
}

.gl-multi__opt .form-check-input {
  margin: 0;
  flex: 0 0 auto;
}

.gl-drop {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-3);
  cursor: pointer;
  margin: 0;
  transition: border-color 0.15s, background 0.15s;
}

.gl-drop:hover,
.gl-drop:focus-within,
.gl-drop.is-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.gl-drop__ic {
  display: inline-flex;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--brand);
  flex: 0 0 44px;
  box-shadow: var(--shadow-sm);
}

.gl-drop__text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.gl-drop__text strong { font-size: 0.85rem; }
.gl-drop__text small { font-size: 0.72rem; color: var(--muted); }

.gl-drop__files {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  white-space: pre-line;
  text-align: right;
}

.gl-money .input-group-text {
  background: var(--canvas);
}

.gl-formbar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -1.25rem -1.25rem;
  padding: 0.85rem 1.25rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
}

.gl-formbar__note {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  color: var(--muted);
}

.gl-formbar__actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.gl-formbar__actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.gl-form--compact {
  gap: 1rem;
}

.gl-form--compact .gl-form__section {
  padding-bottom: 1rem;
}

/* ── overlays ─────────────────────────────────────────────────────────── */

.gl-ov {
  position: fixed;
  inset: 0;
  z-index: var(--overlay-z);
  display: flex;
}

.gl-ov__backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-scrim);
  opacity: 0;
  transition: opacity 0.2s;
}

.gl-ov.is-open .gl-ov__backdrop {
  opacity: 1;
}

.gl-ov__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  outline: none;
  max-height: 100%;
  transition: transform 0.24s var(--ease), opacity 0.2s;
}

.gl-ov__panel.is-dragging {
  transition: none;
}

.gl-ov__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.6rem;
}

.gl-ov__titles {
  min-width: 0;
}

.gl-ov__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.gl-ov__sub {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.gl-ov__body {
  flex: 1;
  overflow: auto;
  padding: 0.5rem 1.15rem 1.15rem;
  overscroll-behavior: contain;
}

.gl-ov__foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem calc(0.85rem + var(--sab));
  border-top: 1px solid var(--line);
}

.gl-ov__foot .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* centred modal */
.gl-ov--center {
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gl-ov--center .gl-ov__panel {
  width: 100%;
  border-radius: 16px;
  max-height: min(86vh, 900px);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
}

.gl-ov--center.is-open .gl-ov__panel {
  transform: none;
  opacity: 1;
}

.gl-ov__panel--sm { max-width: 420px; }
.gl-ov__panel--md { max-width: 560px; }
.gl-ov__panel--lg { max-width: 760px; }
.gl-ov__panel--xl { max-width: 1040px; }

/* side sheet */
.gl-ov--side {
  justify-content: flex-end;
}

.gl-ov--side .gl-ov__panel {
  width: min(100%, 460px);
  height: 100%;
  max-width: none;
  border-radius: 16px 0 0 16px;
  padding-top: var(--sat);
  padding-right: var(--sar);
  transform: translateX(100%);
}

.gl-ov--side .gl-ov__panel--sm { width: min(100%, 380px); }
.gl-ov--side .gl-ov__panel--lg { width: min(100%, 560px); }
.gl-ov--side .gl-ov__panel--xl { width: min(100%, 860px); }

.gl-ov--side.is-open .gl-ov__panel {
  transform: none;
}

/* bottom sheet */
.gl-ov--bottom {
  align-items: flex-end;
}

.gl-ov--bottom .gl-ov__panel {
  width: 100%;
  max-width: none;
  max-height: calc(100% - var(--sat) - 24px);
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
}

.gl-ov--bottom.is-open .gl-ov__panel {
  transform: none;
}

.gl-ov__grab {
  display: flex;
  justify-content: center;
  padding: 0.55rem 0 0.1rem;
  cursor: grab;
  touch-action: none;
}

.gl-ov__grab span {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
}

.gl-ov.is-closing .gl-ov__backdrop {
  opacity: 0;
}

.gl-ov--center.is-closing .gl-ov__panel { opacity: 0; transform: translateY(8px) scale(0.98); }
.gl-ov--side.is-closing .gl-ov__panel { transform: translateX(100%); }
.gl-ov--bottom.is-closing .gl-ov__panel { transform: translateY(100%); }

.gl-confirm {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.gl-confirm p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.gl-confirm__ic {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
}

.gl-confirm__ic.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.gl-prompt {
  display: grid;
  gap: 0.25rem;
}

.gl-actionlist {
  display: grid;
  gap: 0.25rem;
}

.gl-actionlist__item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.75rem 0.65rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gl-actionlist__item > .gl-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 20px;
  flex: 0 0 38px;
}

.gl-actionlist__item span {
  display: grid;
  gap: 0.1rem;
}

.gl-actionlist__item strong { font-size: 0.88rem; }
.gl-actionlist__item small { font-size: 0.74rem; color: var(--muted); }

.gl-actionlist__item:hover {
  background: var(--canvas);
}

.gl-actionlist__item.is-danger,
.gl-actionlist__item.is-danger > .gl-ic {
  color: var(--danger);
}

.gl-actionlist__item.is-danger > .gl-ic {
  background: var(--danger-soft);
}

/* toasts */
.gl-toasts {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + var(--sab));
  transform: translateX(-50%);
  z-index: calc(var(--overlay-z) + 10);
  display: grid;
  gap: 0.5rem;
  width: min(92vw, 420px);
  pointer-events: none;
}

.gl-toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--inverse-line);
  background: var(--surface-inverse);
  color: var(--on-inverse);
  font-size: 0.84rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
  pointer-events: auto;
}

.gl-toast.is-in {
  opacity: 1;
  transform: none;
}

.gl-toast.is-success .gl-ic { color: #86efac; }
.gl-toast.is-error .gl-ic { color: #fca5a5; }
.gl-toast.is-warn .gl-ic { color: #fdba74; }
.gl-toast.is-info .gl-ic { color: #93c5fd; }

.gl-toast span {
  flex: 1;
}

.gl-toast button {
  border: 0;
  background: transparent;
  color: var(--inverse-action);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* peek */
.gl-peek .gl-ov__body {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.gl-peek__status {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.gl-peek__h {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.gl-peek .gl-kpis .portfolio-stat-card {
  flex-basis: 120px;
}

.gl-minilist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.gl-minilist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.gl-minilist li:last-child {
  border-bottom: 0;
}

.gl-minilist li > span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* palette */
.gl-palette .gl-ov__panel {
  align-self: flex-start;
  margin-top: 10vh;
}

.gl-palette .gl-ov__head {
  display: none;
}

.gl-palette .gl-ov__body {
  padding-top: 1rem;
}

.gl-palette__results {
  margin-top: 0.75rem;
}

.gl-palette__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 52vh;
  overflow: auto;
}

.gl-palette__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.gl-palette__item.is-on,
.gl-palette__item:hover {
  background: var(--brand-soft);
}

.gl-palette__ic {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  color: var(--brand);
  flex: 0 0 34px;
}

.gl-palette__text {
  display: grid;
  min-width: 0;
  flex: 1;
}

.gl-palette__text strong,
.gl-palette__text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-palette__text strong { font-size: 0.86rem; }
.gl-palette__text small { font-size: 0.74rem; color: var(--muted); }

.gl-palette__kind {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
}

.gl-palette__empty {
  margin: 1rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* "More" sheet */
.gl-more__me {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.25rem 0 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.gl-more__me div {
  display: grid;
}

.gl-more__me span {
  font-size: 0.78rem;
  color: var(--muted);
}

.gl-more__group h3 {
  margin: 0.85rem 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

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

.gl-more__tile {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 0.85rem 0.35rem;
  border-radius: 14px;
  background: var(--canvas);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
}

.gl-more__tile .gl-ic {
  font-size: 24px;
  color: var(--brand);
}

.gl-more__tile.is-on {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.gl-more__foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.gl-more__foot .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.5rem 0.6rem;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
}

.gl-more__foot .btn .gl-ic {
  flex: none;
  font-size: 18px;
}

.gl-more__foot .gl-more__logout {
  grid-column: 1 / -1;
}

/* charts (size classes instead of inline heights) */
.gl-chart {
  position: relative;
  width: 100%;
}

.gl-chart--sm { height: 180px; }
.gl-chart--md { height: 260px; }
.gl-chart--lg { height: 340px; }

.gl-chart__empty {
  display: grid;
  place-items: center;
  height: 100%;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* pull to refresh (phone) */
.gl-ptr {
  position: fixed;
  top: calc(var(--appbar-h) + var(--sat));
  left: 50%;
  z-index: 30;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--brand);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(calc(var(--pull, 0) * 48px - 40px)) rotate(calc(var(--pull, 0) * 270deg));
  pointer-events: none;
}

.gl-ptr.is-pulling,
.gl-ptr.is-refreshing {
  opacity: 1;
}

.gl-ptr.is-armed {
  color: var(--success);
}

.gl-ptr.is-refreshing {
  transform: translateY(12px);
}

.gl-ptr.is-refreshing .gl-ptr__spin {
  animation: gl-spin 0.8s linear infinite;
}

.gl-ptr__spin {
  display: inline-flex;
}

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

.gl-spin {
  animation: gl-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .gl-spin {
    animation-duration: 2.4s;
  }
}

/* ── tablet: icon rail that expands over content ──────────────────────── */

@media (min-width: 768px) and (max-width: 1199.98px) and (min-height: 521px) {
  .gl-shell aside.wg-sidebar#sidenav-main {
    transform: none !important;
    width: var(--rail-w) !important;
    min-width: var(--rail-w) !important;
    max-width: var(--rail-w) !important;
    padding: 0.85rem 0.4rem !important;
    transition: width 0.22s var(--ease), max-width 0.22s var(--ease), min-width 0.22s var(--ease), box-shadow 0.2s;
  }

  .gl-shell .wg-main.main-content {
    margin-left: var(--rail-w) !important;
  }

  body:not(.gl-rail-open) .gl-sidebar .brand {
    justify-content: center;
  }

  body:not(.gl-rail-open) .gl-sidebar .brand-link,
  body:not(.gl-rail-open) .gl-sidebar .nav-label,
  body:not(.gl-rail-open) .gl-sidebar .gl-nav-text {
    display: none !important;
  }

  body:not(.gl-rail-open) .gl-sidebar .nav-section__items.collapsed {
    display: block;
  }

  body:not(.gl-rail-open) .gl-sidebar .nav-item {
    justify-content: center;
    padding: 0.6rem 0.35rem;
  }

  body:not(.gl-rail-open) .gl-sidebar .nav-item svg {
    width: 20px;
    height: 20px;
  }

  body.gl-rail-open .gl-shell aside.wg-sidebar#sidenav-main {
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    max-width: var(--sidebar-w) !important;
    padding: 1rem 0.85rem !important;
    box-shadow: 0 0 48px rgba(15, 17, 23, 0.2) !important;
    z-index: 40;
  }

  body.gl-rail-open .gl-rail-close {
    display: inline-flex !important;
  }

  body.gl-rail-open .gl-rail-scrim {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    background: var(--overlay-scrim-soft);
  }

  .gl-collapse-btn {
    display: none !important;
  }

  .gl-rail-btn {
    display: inline-flex !important;
  }

  .gl-cmdk {
    min-width: 0;
  }

  .gl-cmdk span,
  .gl-cmdk kbd {
    display: none;
  }

  .user-chip__meta {
    display: none !important;
  }

  .gl-p3 {
    display: none !important;
  }

  .gl-filter__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gl-grid--side {
    grid-template-columns: minmax(0, 1fr);
  }

  .gl-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .floating-bulk-action-bar {
    --bulk-bar-left: calc(var(--rail-w) + 1rem);
  }
}

@media (min-width: 768px) and (max-width: 1023.98px) and (min-height: 521px) {
  .gl-p2 {
    display: none !important;
  }

  .gl-table > tbody > tr > td,
  .gl-table > thead > tr > th {
    padding-left: 0.3rem !important;
    padding-right: 0.3rem !important;
  }

  .gl-table td:not(.is-fixed):not(.select-col):not(.gl-td-actions) {
    min-width: 76px;
    overflow-wrap: break-word;
  }

  .gl-table .select-col {
    width: 36px;
  }

  .gl-dl--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── phone: app bar + dock, cards instead of tables ───────────────────── */

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
  body.gl-body {
    padding-bottom: calc(var(--dock-h) + var(--sab) + 16px);
  }

  body.gl-no-dock {
    padding-bottom: var(--sab);
  }

  .gl-shell aside.wg-sidebar#sidenav-main {
    display: none !important;
  }

  .gl-shell .wg-main.main-content {
    margin-left: 0 !important;
  }

  .wg-topbar.navbar-main.gl-topbar {
    min-height: calc(var(--appbar-h) + var(--sat)) !important;
    padding: var(--sat) calc(0.5rem + var(--sar)) 0 calc(0.5rem + var(--sal)) !important;
    align-items: center;
    background: var(--glass-bg-canvas) !important;
    transition: box-shadow 0.2s;
  }

  body.gl-scrolled .gl-topbar {
    border-bottom-color: var(--line) !important;
  }

  .gl-topbar__row {
    min-height: var(--appbar-h);
    gap: 0.25rem;
  }

  .gl-collapse-btn,
  .gl-rail-btn,
  .gl-user,
  .wg-page-sub {
    display: none !important;
  }

  .gl-back {
    border: 0;
    background: transparent;
    padding: 0 0.15rem;
    max-width: 38vw;
    color: var(--brand);
    height: 40px;
  }

  .gl-back .material-icons {
    font-size: 22px;
  }

  .gl-back__label {
    font-size: 0.85rem;
  }

  .gl-back + .gl-topbar__titles .page-title {
    font-size: 1rem !important;
  }

  .gl-topbar__titles .page-title {
    font-size: 1.15rem !important;
  }

  .gl-topbar__end {
    gap: 0.1rem;
  }

  .gl-cmdk {
    min-width: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border: 0;
    background: transparent;
  }

  .gl-cmdk span,
  .gl-cmdk kbd {
    display: none;
  }

  .gl-cmdk .gl-ic {
    font-size: 22px;
  }

  .gl-topbar__primary,
  .gl-topbar__more {
    display: inline-flex !important;
  }

  .gl-page-toolbar {
    display: none;
  }

  .gl-page.container-fluid {
    padding: 0.75rem calc(0.75rem + var(--sar)) 1rem calc(0.75rem + var(--sal)) !important;
  }

  .gl-footer {
    display: none;
  }

  .gl-ptr {
    display: flex;
  }

  /* dock */
  .gl-dock {
    position: fixed;
    left: calc(0.75rem + var(--sal));
    right: calc(0.75rem + var(--sar));
    bottom: calc(0.6rem + var(--sab));
    z-index: 1070;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: var(--dock-h);
    padding: 0 0.35rem;
    border-radius: 22px;
    background: var(--glass-bg);
    backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid var(--glass-line);
    box-shadow: var(--shadow-dock);
    transition: transform 0.28s var(--ease), opacity 0.2s;
  }

  body.gl-scrolled-down .gl-dock {
    transform: translateY(calc(100% + 1rem + var(--sab)));
  }

  /* the phone form bar takes the dock's place (mock: hideDock on every form route) */
  body.gl-body:has(.gl-formbar) .gl-dock,
  body.gl-no-dock .gl-dock,
  body.gl-has-overlay .gl-dock,
  html.bulk-sheet-open .gl-dock {
    transform: translateY(calc(100% + 1rem + var(--sab)));
    opacity: 0;
  }

  .gl-dock__item {
    display: grid;
    justify-items: center;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.66rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
  }

  .gl-dock__item .gl-ic {
    font-size: 24px;
  }

  .gl-dock__item.is-on {
    color: var(--brand);
  }

  .gl-dock__fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0 0.25rem;
    border: 0;
    border-radius: 16px;
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: var(--shadow-fab);
    cursor: pointer;
    flex: 0 0 50px;
  }

  .gl-dock__fab .gl-ic {
    font-size: 28px;
  }

  /* bulk chip clears the dock */
  .gl-bulk .floating-bulk-chip {
    bottom: calc(var(--dock-h) + var(--sab) + 1.25rem) !important;
    transition: bottom 0.28s var(--ease);
  }

  body.gl-scrolled-down .gl-bulk .floating-bulk-chip,
  body.gl-no-dock .gl-bulk .floating-bulk-chip {
    bottom: calc(var(--sab) + 0.85rem) !important;
  }

  .gl-toasts {
    bottom: calc(var(--dock-h) + var(--sab) + 1.25rem);
  }

  body.gl-no-dock .gl-toasts {
    bottom: calc(1rem + var(--sab));
  }

  /* lists */
  .gl-table-wrap {
    display: none;
  }

  .gl-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
    padding: 0.25rem 0.75rem 0;
  }

  .gl-card {
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    -webkit-user-select: none;
    user-select: none;
  }

  .gl-card:active {
    transform: scale(0.99);
  }

  .gl-card.is-selected {
    border-color: var(--brand);
    background: var(--brand-soft-3);
  }

  .gl-card__top {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .gl-card__check {
    display: none;
    margin: 0.15rem 0 0 !important;
    flex: 0 0 auto;
  }

  .gl-cards.is-selecting .gl-card__check {
    display: block;
  }

  .gl-card__titles {
    display: grid;
    min-width: 0;
    flex: 1;
  }

  /* titles carry identifiers (policy numbers, emails): wrap, never cut */
  .gl-card__titles strong {
    font-size: 0.92rem;
    color: var(--ink);
    overflow-wrap: anywhere;
    line-height: 1.3;
  }

  .gl-card__titles span {
    font-size: 0.78rem;
    color: var(--muted);
    overflow-wrap: anywhere;
  }

  .gl-card__badge {
    flex: 0 0 auto;
  }

  .gl-card__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 0.85rem;
    margin: 0.7rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
  }

  .gl-card__grid dt {
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-2);
  }

  .gl-card__grid dd {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
    overflow-wrap: anywhere;
  }

  .gl-card__grid .is-num dd {
    font-variant-numeric: tabular-nums;
  }

  .gl-card__actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.65rem;
  }

  .gl-listcard,
  html[data-theme] .gl-body .card.gl-listcard {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .gl-listcard__head {
    padding: 0 0 0.25rem !important;
    background: transparent !important;
  }

  .gl-listcard__body {
    padding: 0 !important;
  }

  .gl-listcard .gl-cards {
    padding: 0.25rem 0 0;
  }

  .gl-listcard__foot {
    flex-direction: column-reverse;
    align-items: stretch;
    padding: 1rem 0 0;
  }

  .gl-pager {
    justify-content: center;
  }

  .gl-kpis {
    padding: 0.5rem 0 0.75rem;
    background: transparent !important;
    border: 0 !important;
  }

  .gl-kpis .portfolio-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .gl-kpis .portfolio-stat-card {
    min-width: 0;
  }

  .gl-kpis .portfolio-stat-card:first-child:nth-last-child(odd) {
    grid-column: 1 / -1;
  }

  /* filters: search + filter button; advanced fields live in a sheet */
  .gl-filter {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin-bottom: 0.5rem;
  }

  .gl-filter .filters-section__header {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
  }

  .gl-search {
    max-width: none;
    height: 44px;
    border-radius: 12px;
  }

  .gl-filter .gl-filter__bar .btn.gl-filter__toggle {
    height: 44px !important;
    width: 44px;
    min-width: 44px;
    padding: 0 !important;
    justify-content: center;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    background: var(--surface) !important;
    color: var(--ink);
    position: relative;
  }

  .gl-filter .gl-filter__bar .btn.gl-filter__toggle.has-active {
    border-color: var(--brand) !important;
    color: var(--brand);
  }

  .gl-filter .gl-filter__bar .btn.gl-filter__toggle > i.gl-ic {
    font-size: 22px;
  }

  .gl-filter__quick .seg-btn {
    white-space: nowrap;
  }

  .gl-filter__toggle-label,
  .gl-filter__chev {
    display: none;
  }

  .gl-filter__toggle .wg-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    padding: 0.05rem 0.35rem;
    font-size: 0.6rem;
  }

  .gl-filter__panel {
    display: none !important;
  }

  .gl-filter__quick {
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -0.75rem;
    padding: 0.6rem 0.75rem 0;
  }

  .gl-filter__quick::-webkit-scrollbar {
    display: none;
  }

  .gl-filter__quick .gl-filter__presets {
    flex-wrap: nowrap;
  }

  .gl-filter__quick .hint {
    display: none;
  }

  .gl-filter__quick .wg-seg {
    flex-wrap: nowrap;
  }

  .gl-filter__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .gl-filter__chips .gl-chip {
    flex: 0 0 auto;
  }

  /* layout helpers collapse to one column */
  .gl-grid--2,
  .gl-grid--3,
  .gl-grid--side {
    grid-template-columns: minmax(0, 1fr);
  }

  .gl-dl--3,
  .gl-dl--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gl-section__head {
    padding: 0.9rem 1rem 0.15rem;
    flex-wrap: wrap;
    row-gap: 0.65rem;
  }

  .gl-field__addon {
    min-height: 36px;
    padding: 0 0.25rem;
  }

  .gl-ai__suggest button {
    min-height: 36px;
  }

  .gl-section__actions:has(.gl-chart-tools) {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .gl-chart-tools {
    width: 100%;
    flex-wrap: nowrap;
  }

  .gl-chart-tools .form-select {
    flex: 1 1 0;
    max-width: none;
    min-height: 40px;
  }

  .gl-chart-tools .gl-select {
    flex: 1 1 0;
    max-width: none;
  }

  /* 16px text stops iOS zooming (and the flash) when a field or search box is focused */
  html {
    touch-action: manipulation;
  }

  #gl-view .form-control,
  #gl-view .form-select,
  .gl-ov .form-control,
  .gl-ov .form-select,
  .gl-search__input,
  .gl-ov input,
  .gl-ov textarea {
    font-size: 16px;
  }

  .gl-field .form-control,
  .gl-field .form-select,
  .gl-ov .gl-field .form-control,
  .gl-ov .gl-field .form-select {
    min-height: 44px;
  }

  .gl-section__body {
    padding: 0.85rem 1rem 1rem;
  }

  .gl-form__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gl-field,
  .gl-field--third,
  .gl-field--half {
    grid-column: 1 / -1;
  }

  .gl-formbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0.75rem calc(0.85rem + var(--sar)) calc(0.75rem + var(--sab)) calc(0.85rem + var(--sal));
    border-radius: 0;
    z-index: 1060;
  }

  .gl-formbar__note {
    display: none;
  }

  .gl-formbar__actions {
    width: 100%;
  }

  /* grow from the label width so a long submit label ("Create organization") is not squeezed to half the bar */
  .gl-formbar__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .gl-form {
    padding-bottom: 4.5rem;
  }

  .gl-form--compact {
    padding-bottom: 0;
  }

  /* The fixed bar covers the end of the page, not just the form (the calculator's quote card follows its form). */
  body.gl-body:has(.gl-page .gl-formbar) .gl-page {
    padding-bottom: calc(4.5rem + var(--sab)) !important;
  }

  body.gl-body:has(.gl-page .gl-formbar) .gl-page .gl-form:not(.gl-form--compact) {
    padding-bottom: 0;
  }

  .gl-more__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gl-palette .gl-ov__panel {
    margin-top: 0;
  }

  .gl-ov--side .gl-ov__panel {
    border-radius: 0;
    width: 100%;
  }

  .gl-tabs {
    margin: 0 -0.75rem 1rem;
    padding: 0 0.75rem;
  }
}

/* phone held sideways: compact dock and two-column cards */
@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --dock-h: 52px;
    --appbar-h: 48px;
  }

  .gl-dock {
    left: 50% !important;
    right: auto !important;
    width: min(520px, 70vw);
    transform: translateX(-50%);
  }

  body.gl-scrolled-down .gl-dock,
  body.gl-no-dock .gl-dock,
  body.gl-has-overlay .gl-dock {
    transform: translate(-50%, calc(100% + 1rem + var(--sab))) !important;
  }

  .gl-dock__item span {
    display: none;
  }

  .gl-dock__fab {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .gl-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gl-kpis .portfolio-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gl-ov--bottom .gl-ov__panel {
    max-width: 640px;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── print (statements and reports printed from the lab) ──────────────── */

@media print {
  .gl-sidebar,
  .gl-topbar,
  .gl-dock,
  .gl-footer,
  .gl-page-toolbar,
  .gl-filter,
  .floating-bulk-action-bar,
  .gl-formbar,
  .gl-ov {
    display: none !important;
  }

  .gl-shell .wg-main.main-content {
    margin: 0 !important;
  }

  body.gl-body {
    background: var(--surface) !important;
    padding: 0 !important;
  }
}

/* Touch screens (phones in either orientation, tablets): every tap target is at least 40px tall. */
@media (pointer: coarse) {
  .wg-seg .seg-btn,
  .gl-seg .seg-btn,
  #gl-view .btn,
  .gl-ov .btn {
    min-height: 40px;
  }

  .gl-date__text {
    padding-right: 3rem;
  }

  .gl-date__btn {
    width: 2.5rem;
    height: 2.5rem;
  }

  .gl-dock__item {
    min-height: 44px;
  }

  a.wg-badge {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding-inline: 0.75rem;
  }
}

/* Page-level pieces shared by several modules (status strips, file lists, timelines, pickers, chat, calculator). */

.gl-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.gl-badge-link {
  text-decoration: none;
}

.gl-badge-link:hover {
  filter: brightness(0.95);
}

.gl-scope {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.82rem;
}

.gl-scope .btn {
  margin-left: auto;
}

.gl-hint {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.gl-formcard {
  max-width: 1100px;
}

.gl-form-actions {
  margin-top: 1rem;
}

.gl-schedule {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

.gl-schedule h4 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.gl-schedule__total {
  display: flex;
  justify-content: space-between;
  margin: 0.5rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.gl-schedule__total strong {
  color: var(--ink);
}

/* custom payment plan editor (policy form) */
.gl-cp {
  display: grid;
  gap: 1rem;
}

.gl-cp__notice {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--ink);
  font-size: 0.82rem;
}

.gl-cp__notice .gl-ic {
  flex: none;
  color: var(--warn);
}

.gl-cp__down {
  display: grid;
  gap: 0.75rem;
}

.gl-cp__down-grid,
.gl-cp__controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.gl-cp__controls {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.gl-cp__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.gl-cp__actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 40px;
}

.gl-cp__field {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  margin: 0;
}

.gl-cp__field > span:first-child {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.gl-cp__out {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
  font-weight: 700;
}

.gl-cp__hint {
  color: var(--muted);
  font-size: 0.72rem;
}

.gl-cp__err {
  color: var(--danger);
  font-size: 0.72rem;
}

.gl-cp__rows {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-cp__row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.gl-cp__row:first-child {
  border-top: 1px solid var(--line);
}

.gl-cp__row.has-error .form-control {
  border-color: var(--danger);
}

.gl-cp__num {
  padding-top: 1.7rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.gl-cp__remove {
  margin-top: 1.35rem;
  color: var(--danger);
}

.gl-cp__summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: var(--canvas);
}

.gl-cp__summary > div {
  display: grid;
}

.gl-cp__summary small {
  color: var(--muted);
  font-size: 0.72rem;
}

.gl-cp__summary strong {
  font-size: 0.95rem;
}

.gl-cp__status {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.gl-cp__status.is-ok { color: var(--success); }
.gl-cp__status.is-open { color: var(--warn); }
.gl-cp__status.is-over { color: var(--danger); }

@media (max-width: 575.98px) {
  .gl-cp__down-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gl-cp__controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .gl-cp__actions {
    justify-content: stretch;
  }

  .gl-cp__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .gl-cp__row {
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    grid-template-areas:
      "num amount remove"
      "num date remove";
  }

  .gl-cp__num { grid-area: num; }
  .gl-cp__row > .gl-cp__field:nth-of-type(1) { grid-area: amount; }
  .gl-cp__row > .gl-cp__field:nth-of-type(2) { grid-area: date; }
  .gl-cp__remove { grid-area: remove; }
}

/* file list */
.gl-filelist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.gl-filelist li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.gl-filelist li > .gl-ic {
  font-size: 26px;
  color: var(--danger);
  flex: 0 0 auto;
}

.gl-filelist li > span {
  display: grid;
  min-width: 0;
  flex: 1;
}

.gl-filelist li > .gl-filelist__kind {
  display: block;
  flex: 0 0 11rem;
  min-width: 0;
}

.gl-filelist strong,
.gl-filelist small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-filelist strong { font-size: 0.85rem; }
.gl-filelist small { font-size: 0.74rem; color: var(--muted); }

.gl-filelist li.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.gl-filelist .form-check-input {
  margin: 0;
  flex: 0 0 auto;
}

.gl-filelist li.is-company {
  border-color: var(--success);
}

.gl-filelist li.is-company > .gl-ic {
  color: var(--success);
}

@media (max-width: 575.98px) {
  .gl-filelist li.has-kind {
    flex-wrap: wrap;
  }

  .gl-filelist li.has-kind > span {
    flex-basis: calc(100% - 6rem);
  }

  .gl-filelist li > .gl-filelist__kind {
    flex: 1 1 100%;
  }
}

/* company document + insurer number suggestion */
.gl-company-doc {
  display: grid;
  gap: 0.85rem;
}

.gl-company-doc__empty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.gl-company-doc__empty > .gl-ic {
  font-size: 26px;
  color: var(--warn);
}

.gl-company-doc__empty > span {
  flex: 1;
}

.gl-suggest {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.82rem;
}

.gl-suggest p {
  margin: 0;
}

.gl-suggest .gl-ic {
  margin-right: 0.35rem;
  vertical-align: -3px;
  color: var(--brand);
}

.gl-suggest.is-muted {
  color: var(--muted);
}

.gl-suggest.is-muted .gl-ic {
  color: var(--muted);
}

.gl-suggest__spin {
  animation: gl-spin 0.8s linear infinite;
}

.gl-suggest__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
}

.gl-suggest__chip {
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--bs-font-monospace, monospace);
  font-size: 0.78rem;
}

.gl-suggest__chip:hover,
.gl-suggest__chip:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* timeline */
.gl-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.gl-timeline li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0 0 1rem 0;
  font-size: 0.84rem;
}

.gl-timeline li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.gl-timeline li:last-child::before {
  display: none;
}

.gl-timeline__dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
  border: 3px solid var(--brand);
  background: var(--surface);
  flex: 0 0 12px;
  position: relative;
  z-index: 1;
}

.gl-timeline li > div {
  flex: 1;
  display: grid;
}

.gl-timeline small {
  color: var(--muted);
  font-size: 0.74rem;
}

.gl-timeline__go {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

/* record picker */
.gl-picker {
  position: relative;
}

.gl-picker .gl-search {
  max-width: none;
}

.gl-picker__results:empty {
  display: none;
}

.gl-picker__results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 280px;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.gl-picker__opt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gl-picker__opt:hover,
.gl-picker__opt:focus-visible {
  background: var(--brand-soft);
}

.gl-picker__opt span {
  display: grid;
  min-width: 0;
}

.gl-picker__opt strong { font-size: 0.84rem; }
.gl-picker__opt small { font-size: 0.72rem; color: var(--muted); }

.gl-picker__empty {
  margin: 0;
  padding: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* key/value tables used by reports */
.gl-rank {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.gl-rank li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 0.75rem;
  align-items: center;
  font-size: 0.82rem;
}

.gl-rank li .gl-meter {
  grid-column: 1 / -1;
}

.gl-rank strong {
  font-variant-numeric: tabular-nums;
}

.gl-rank span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* permission matrix */
.gl-perms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.gl-perms__group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}

.gl-perms__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.gl-perms__head h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.gl-perms__head small {
  color: var(--muted);
  font-size: 0.72rem;
}

.gl-perms__list {
  display: grid;
  gap: 0.15rem;
}

.gl-perms__item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.3rem 0.2rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.gl-perms__item:hover {
  background: var(--canvas);
}

.gl-perms__item .form-check-input {
  margin: 0.1rem 0 0;
  flex: 0 0 auto;
}

.gl-perms__item code {
  display: block;
  font-size: 0.66rem;
  color: var(--muted-2);
}

.gl-perms-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.gl-perms-toolbar .gl-search {
  flex: 1 1 260px;
}

/* logo upload */
.gl-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.gl-logo__preview {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 96px;
}

.gl-logo__preview img {
  max-width: 84%;
  max-height: 84%;
  object-fit: contain;
}

.gl-logo__body {
  flex: 1 1 260px;
  display: grid;
  gap: 0.5rem;
}

/* diff table (history) */
.gl-diff {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.gl-diff th,
.gl-diff td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

.gl-diff th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.gl-diff .is-old {
  color: var(--danger);
  text-decoration: line-through;
  text-decoration-color: rgba(220, 38, 38, 0.4);
}

.gl-diff .is-new {
  color: var(--success);
  font-weight: 600;
}

/* list intro: a picker beside a short definition list (companies policies-by-type) */
.gl-dims {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 2rem;
  margin-bottom: 1rem;
}

/* same insets as .gl-listcard__head; phones drop the card surface, so the page gutter is enough there */
.gl-listcard > .gl-dims {
  padding: 1rem 1.25rem 0;
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
  .gl-listcard > .gl-dims {
    padding: 0;
  }
}

.gl-dims > .gl-field {
  flex: 1 1 240px;
  max-width: 360px;
  margin: 0;
}

.gl-dims > .gl-dl {
  flex: 1 1 280px;
  margin: 0;
}

.gl-tariff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

/* tariff PDF import */
.gl-ti-note {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--ink);
  font-size: 0.84rem;
}

.gl-section--flush .gl-ti-note {
  margin: 0.85rem 1rem;
}

.gl-ti-progress {
  grid-column: 1 / -1;
  align-items: center;
  margin: 0;
  background: var(--brand-soft);
  color: var(--ink);
}

.gl-ti-progress .gl-ic {
  color: var(--brand);
}

.gl-ti-text {
  margin: 0.85rem 1rem 1rem;
  font-size: 0.82rem;
}

.gl-ti-text summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
}

.gl-ti-text pre {
  max-height: 260px;
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--ink);
  font-size: 0.76rem;
  white-space: pre-wrap;
}

.gl-ti-checks {
  display: grid;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
}

.gl-ti-checks li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.gl-ti-checks .gl-ic {
  color: var(--success);
}

/* Review / Activate actions stay in reach while the draft rows scroll (same as .gl-formbar). */
.gl-ti-bar {
  position: sticky;
  bottom: 0.75rem;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
  .gl-ti-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1060;
    flex-wrap: nowrap;
    padding: 0.75rem calc(0.85rem + var(--sar)) calc(0.75rem + var(--sab)) calc(0.85rem + var(--sal));
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: none;
  }

  .gl-ti-bar .btn {
    flex: 1 1 0;
    justify-content: center;
  }

  :has(> .gl-ti-bar) {
    padding-bottom: calc(4.5rem + var(--sab));
  }
}

.gl-tariff {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gl-tariff:hover,
.gl-tariff.is-on {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.gl-tariff__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.gl-tariff__top strong {
  font-size: 0.9rem;
}

.gl-tariff small {
  color: var(--muted);
  font-size: 0.74rem;
}

/* calculator */
.gl-quote {
  display: grid;
  gap: 0.75rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #5b4fe8 0%, #7c6ff0 100%);
  color: var(--on-brand);
}

.gl-quote__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.gl-quote__value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.gl-quote .gl-minilist li {
  border-bottom-color: rgba(255, 255, 255, 0.2);
  color: var(--on-brand);
}

.gl-quote__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gl-quote__type {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.86);
}

.gl-quote-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.45;
}

.gl-quote-banner > .gl-ic {
  color: var(--brand);
}

.gl-quote--empty {
  background: var(--canvas);
  color: var(--muted);
  border: 1px dashed var(--line-strong);
}

/* AI agent */
.gl-ai {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 0;
  height: calc(100vh - var(--header-h) - 3rem);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

/* Full-height pages fill what the top bar leaves (its height grows with the subtitle), keeping the page's bottom padding. */
@media (min-width: 768px) and (min-height: 521px) {
  body.gl-fill .gl-main {
    height: 100dvh;
  }

  body.gl-fill .gl-body,
  body.gl-fill .gl-page,
  body.gl-fill #gl-view {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  body.gl-fill .gl-ai {
    flex: 1 1 auto;
    height: auto;
  }
}

.gl-ai__side,
.gl-ai__tray {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface-3);
}

.gl-ai__side {
  border-right: 1px solid var(--line);
}

.gl-ai__tray {
  border-left: 1px solid var(--line);
}

.gl-ai__side-head,
.gl-ai__tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem 0.6rem;
}

.gl-ai__side-head h2,
.gl-ai__tray-head h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.gl-ai__side .gl-search {
  flex: 0 0 auto;
  margin: 0 0.9rem 0.5rem;
  max-width: none;
  height: 34px;
}

.gl-ai__chats,
.gl-ai__pending {
  list-style: none;
  margin: 0;
  padding: 0 0.5rem 0.75rem;
  overflow: auto;
  flex: 1;
}

.gl-ai__chat {
  display: grid;
  gap: 0.1rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.gl-ai__chat strong {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-ai__chat small {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-ai__chat:hover {
  background: var(--canvas);
}

.gl-ai__chat.is-on {
  background: var(--brand-soft);
}

.gl-ai__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.gl-ai__thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.gl-ai__thread-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-ai__thread-actions {
  display: flex;
  gap: 0.2rem;
}

.gl-ai__thread {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overscroll-behavior: contain;
}

.gl-msg {
  display: flex;
  gap: 0.6rem;
  max-width: 820px;
}

.gl-msg__bubble {
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: var(--canvas);
  font-size: 0.87rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-width: 0;
}

.gl-msg__bubble p {
  margin: 0;
  white-space: pre-line;
}

.gl-msg__time {
  font-size: 0.68rem;
  color: var(--muted-2);
}

.gl-msg.is-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.gl-msg.is-user .gl-msg__bubble {
  background: var(--brand);
  color: var(--on-brand);
  border-bottom-right-radius: 4px;
}

.gl-msg.is-user .gl-msg__time {
  color: rgba(255, 255, 255, 0.7);
}

.gl-msg.is-assistant .gl-msg__bubble {
  border-bottom-left-radius: 4px;
}

.gl-msg__avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5b4fe8, #8b5cf6);
  color: var(--on-brand);
  flex: 0 0 30px;
}

.gl-msg__records {
  display: grid;
  gap: 0.4rem;
  white-space: normal;
}

.gl-action-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem;
  border: 1px solid var(--warn);
  border-radius: 12px;
  background: var(--warn-soft);
  white-space: normal;
}

.gl-action-card.is-saved {
  border-color: var(--line);
  background: var(--surface);
}

.gl-action-card.is-discarded {
  border-color: var(--line);
  background: var(--canvas);
  opacity: 0.75;
}

.gl-action-card__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.gl-action-card__title {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.gl-action-card__title strong {
  color: var(--ink);
}

.gl-action-card__email {
  max-height: 220px;
  overflow: auto;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.78rem;
  white-space: pre-line;
}

.gl-hint.is-error {
  color: var(--danger);
  font-weight: 600;
}

.gl-action-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gl-ai__composer {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem 1rem calc(0.75rem + var(--sab));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.gl-ai__composer-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.gl-ai__composer textarea,
.main-content .gl-ai__composer textarea.form-control {
  flex: 1;
  min-height: 44px;
  height: auto;
  max-height: 160px;
  resize: none;
  border-radius: 12px;
}

.gl-ai__attach {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gl-ai__suggest {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.gl-ai__empty .gl-ai__suggest,
.gl-ai__suggest--center {
  justify-content: center;
}

.gl-ai__suggest button,
.gl-ai__suggest a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.76rem;
  color: var(--ink);
  cursor: pointer;
}

.gl-ai__suggest a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.gl-ai__suggest button:hover,
.gl-ai__suggest a:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.gl-ai__empty {
  margin: auto;
  max-width: 520px;
  text-align: center;
  display: grid;
  gap: 0.85rem;
  justify-items: center;
  color: var(--muted);
}

.gl-ai__empty h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
}

.gl-pending {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem 0.7rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.gl-pending__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.gl-pending__top a {
  font-weight: 700;
  font-size: 0.82rem;
}

.gl-pending small {
  font-size: 0.72rem;
  color: var(--muted);
}

.gl-pending__actions {
  display: flex;
  gap: 0.35rem;
}

.gl-typing {
  display: inline-flex;
  gap: 4px;
}

.gl-typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted-2);
  animation: gl-typing 1s infinite ease-in-out;
}

.gl-typing span:nth-child(2) { animation-delay: 0.15s; }
.gl-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes gl-typing {
  50% { transform: translateY(-4px); opacity: 0.5; }
}

/* import */
.gl-steps-body {
  display: grid;
  gap: 1rem;
}

.gl-preview-note {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--info-soft);
  color: var(--ink);
  font-size: 0.82rem;
}

.gl-preview-note .gl-ic {
  color: var(--info);
}

/* report toolbar card: segments + inline filter fields on one surface */
.gl-dash-filter {
  margin-bottom: 1.25rem;
}

.gl-dash-filter > .gl-section__body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.25rem;
}

.gl-dash-filter .gl-filter {
  flex: 1 1 auto;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.gl-dash-filter > .gl-section__body > .gl-chart-tools {
  align-self: center;
}

/* inline filters (fields only, no search): one row on tablet/desktop */
.gl-filter--inline .filters-section__header {
  display: none !important;
}

.gl-filter--inline .gl-filter__panel {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0;
}

.gl-filter--inline .gl-filter__grid {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.gl-filter--inline .gl-field {
  flex: 0 1 220px;
  min-width: 160px;
  margin: 0;
}

.gl-filter--inline .gl-field--dates {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 2fr);
  column-gap: 0.5rem;
  flex: 0 1 460px;
}

.gl-filter--inline .gl-field--dates .form-label {
  grid-column: 1 / -1;
}

.gl-filter--inline .gl-field--dates .gl-field__pair,
.gl-filter--inline .gl-field--dates .gl-field__preset {
  margin: 0;
}

.gl-filter--inline .gl-filter__chips {
  display: none;
}

.gl-filter--inline .gl-filter__reset {
  height: 32px;
}

.gl-chart-tools {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.gl-chart-tools .form-select {
  width: auto;
  min-width: 0;
  max-width: 200px;
  min-height: 34px;
}

.gl-chart-tools .gl-select {
  width: auto;
  max-width: 200px;
}

.gl-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.gl-welcome h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gl-welcome p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.gl-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.gl-shortcut {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.gl-shortcut .gl-ic {
  color: var(--brand);
  font-size: 22px;
}

.gl-shortcut:hover {
  border-color: var(--brand);
}

.gl-shortcut .wg-badge {
  margin-left: auto;
  flex: 0 0 auto;
  max-width: none;
  overflow: visible;
}

.gl-shortcut > span:not(.wg-badge) {
  min-width: 0;
}

/* badges carrying data (roles, statuses) show their full text */
.gl-table .wg-badge,
.gl-card .wg-badge,
.gl-status-strip .wg-badge {
  max-width: none;
}

#gl-view > .gl-grid:not(:last-child),
#gl-view > .gl-stack:not(:last-child) {
  margin-bottom: 1.25rem;
}

/* choice tiles with an icon (calculator steps, import) */
.gl-tariff:has(> .gl-tariff__ic) {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.gl-tariff > span:last-child {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.gl-tariff strong {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.gl-tariff__ic {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.gl-tariff.is-on .gl-tariff__ic {
  background: var(--brand);
  color: var(--on-brand);
}

/* quote card on brand gradient */
.gl-quote .gl-dl dt {
  color: rgba(255, 255, 255, 0.72);
}

.gl-quote .gl-dl dd,
.gl-quote .gl-dl dd a {
  color: var(--on-brand);
}

/* calculator members */
.gl-members {
  display: grid;
  gap: 0.7rem;
}

.gl-members__list {
  display: grid;
  gap: 0.5rem;
  width: 100%;
}

.gl-member {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 104px 40px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.4rem 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.gl-member.is-invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.gl-member__role {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--ink);
}

.gl-member__role .gl-ic {
  color: var(--brand);
  font-size: 1.15rem;
}

.gl-member--holder .gl-member__role .gl-ic {
  color: var(--ink);
}

.gl-member__age {
  position: relative;
  margin: 0;
}

.gl-member__age input {
  padding-right: 2.2rem;
  appearance: textfield;
  -moz-appearance: textfield;
}

.gl-member__age input::-webkit-outer-spin-button,
.gl-member__age input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.gl-member__age small {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.72rem;
  pointer-events: none;
}

.gl-member__lock {
  display: inline-flex;
  justify-content: center;
  color: var(--muted);
}

.gl-members__add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.gl-members__summary {
  display: grid;
  gap: 0.4rem;
}

.gl-members__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gl-members__chip {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.gl-members__warn {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.8rem;
}

/* person / organization cells */
.gl-cell-person {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.gl-avatar--img {
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
}

/* logo card */
.gl-logo__placeholder {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--brand);
}

.gl-logo__body small {
  color: var(--muted);
  font-size: 0.78rem;
}

.gl-logo__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* permission matrix extras */
.gl-perms__head label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  cursor: pointer;
}

.gl-perms__item small {
  color: var(--muted);
  font-size: 0.72rem;
}

.gl-perms-toolbar__count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

form.is-readonly .form-control,
form.is-readonly .form-select {
  background: var(--canvas);
}

/* AI: chat groups, tray sheet, file chips */
.gl-ai__group {
  padding: 0.75rem 0.6rem 0.3rem;
  list-style: none;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gl-ai__tray.is-sheet {
  display: flex;
  border: 0;
  background: transparent;
}

.gl-recchip.is-file .gl-recchip__ic {
  background: var(--canvas);
  color: var(--ink);
}

.gl-chips-row .gl-recchip {
  max-width: 100%;
}

@media (min-width: 1200px) {
  .gl-ai__tray-btn {
    display: none;
  }
}

/* ── tablet & phone adjustments ───────────────────────────────────────── */

@media (max-width: 1199.98px) {
  .gl-ai {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .gl-ai__tray {
    display: none;
  }
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
  /* inline filters fold into the Filters sheet on phones */
  .gl-filter--inline .filters-section__header {
    display: flex !important;
  }

  .gl-filter--inline .gl-filter__panel {
    display: none;
  }

  .gl-filter--inline .gl-filter__chips {
    display: flex;
    margin-top: 0.5rem;
  }

  .gl-filter--inline .gl-filter__bar {
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0 !important;
  }

  .gl-filter__summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
  }

  .gl-filter__summary .gl-ic {
    color: var(--brand);
  }

  .gl-filter__summary > span {
    overflow-wrap: anywhere;
  }

  .gl-filter.gl-filter--inline .gl-filter__bar .btn.gl-filter__toggle {
    margin-left: auto;
    flex: 0 0 auto;
    gap: 0.4rem;
    width: auto;
    height: 40px !important;
    padding: 0 0.9rem 0 0.75rem !important;
    border-radius: 999px !important;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 600;
  }

  .gl-filter.gl-filter--inline .gl-filter__bar .btn.gl-filter__toggle > i.gl-ic {
    font-size: 20px;
    color: var(--brand);
  }

  .gl-filter--inline .gl-filter__toggle .gl-filter__toggle-label {
    display: inline !important;
  }

  .gl-dash-filter > .gl-section__body {
    align-items: center;
    padding: 0.75rem 1rem;
  }

  .gl-dash-filter > .gl-section__body > .gl-chart-tools {
    flex: 1 1 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .gl-ai {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--appbar-h) - var(--sat) - 1.5rem);
    min-height: 0;
    border: 0;
    border-radius: 0;
    margin: -0.75rem calc(-0.75rem - var(--sar)) 0 calc(-0.75rem - var(--sal));
    background: var(--canvas);
  }

  .gl-ai__side {
    display: none;
  }

  .gl-ai.is-list .gl-ai__side {
    display: flex;
    flex: 1;
    border: 0;
    background: var(--canvas);
  }

  .gl-ai.is-list .gl-ai__main,
  .gl-ai.is-tray .gl-ai__main,
  .gl-ai.is-tray .gl-ai__side {
    display: none;
  }

  .gl-ai.is-tray .gl-ai__tray {
    display: flex;
    flex: 1;
    border: 0;
    background: var(--canvas);
  }

  .gl-member {
    grid-template-columns: minmax(0, 1fr) 96px 40px;
    grid-template-areas: 'role age act' 'name name name';
  }

  .gl-member__role { grid-area: role; }
  .gl-member__age { grid-area: age; }
  .gl-member__name { grid-area: name; }
  .gl-member > :last-child { grid-area: act; }

  .gl-ai__main {
    flex: 1;
    background: var(--canvas);
  }

  .gl-ai__thread-head {
    display: none;
  }

  .gl-ai__thread {
    padding: 0.75rem;
  }

  .gl-msg {
    max-width: 100%;
  }

  .gl-ai__composer {
    position: sticky;
    bottom: 0;
    padding: 0.6rem calc(0.75rem + var(--sar)) calc(0.6rem + var(--sab)) calc(0.75rem + var(--sal));
  }

  /* the floating dock covers the bottom of the screen until a thread is open */
  body:not(.gl-no-dock) .gl-ai__composer {
    padding-bottom: calc(0.6rem + var(--dock-h) + var(--sab) + 1rem);
  }

  .gl-rank li {
    font-size: 0.8rem;
  }

  .gl-perms {
    grid-template-columns: minmax(0, 1fr);
  }

  .gl-welcome h2 {
    font-size: 1.05rem;
  }

  /* shortcuts become one swipeable row of pills */
  .gl-shortcuts {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 calc(-0.75rem - var(--sar)) 1rem calc(-0.75rem - var(--sal));
    padding: 0.1rem calc(0.75rem + var(--sar)) 0.1rem calc(0.75rem + var(--sal));
    scroll-snap-type: x proximity;
    scroll-padding-inline: calc(0.75rem + var(--sal)) calc(0.75rem + var(--sar));
  }

  .gl-shortcuts::-webkit-scrollbar {
    display: none;
  }

  .gl-shortcut {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .gl-shortcut .gl-ic {
    font-size: 20px;
  }

  .gl-quote__value {
    font-size: 1.6rem;
  }

  .gl-diff thead {
    display: none;
  }

  .gl-diff tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--line);
    padding: 0.4rem 0;
  }

  .gl-diff td {
    border: 0;
    padding: 0.2rem 0.3rem;
  }

  .gl-diff td:first-child {
    grid-column: 1 / -1;
    font-weight: 700;
  }

  .gl-diff td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
  }
}

/* KPI labels are short descriptions: wrap to two lines instead of cutting them */
.gl-kpis .portfolio-stat-label {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}

/* ── list column picker ─────────────────────────────────────────────────── */

.gl-colpick-btn {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  height: 38px;
  margin-left: auto;
  white-space: nowrap;
}

.gl-filter__bar > .gl-filter__toggle:has(+ .gl-colpick-btn) {
  margin-left: auto !important;
}

.gl-filter__bar > .gl-filter__toggle + .gl-colpick-btn {
  margin-left: 0.25rem !important;
}

.gl-colpick-btn.has-active {
  color: var(--brand);
}

.gl-colpick-btn__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.gl-listcard__tools {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem 0;
}

.gl-colpick__hint {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.gl-colpick__list {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-colpick__row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 10px;
  background: var(--surface);
}

.gl-colpick__row.is-dragging {
  position: relative;
  z-index: 1;
  box-shadow: 0 6px 18px rgba(20, 22, 50, 0.16);
  outline: 1px solid var(--brand);
}

.gl-colpick__grip {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2rem;
  min-height: 44px;
  color: var(--muted-2);
  cursor: grab;
  touch-action: none;
}

.gl-colpick__row.is-dragging .gl-colpick__grip {
  cursor: grabbing;
  color: var(--brand);
}

.gl-colpick__move {
  display: flex;
  flex: none;
  gap: 0.1rem;
}

.gl-colpick__row:first-child [data-col-move="-1"],
.gl-colpick__row:last-child [data-col-move="1"] {
  visibility: hidden;
}

.gl-colpick__item {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.gl-colpick__item:hover {
  background: var(--brand-soft);
}

.gl-colpick__item .form-check-input {
  flex: 0 0 auto;
  margin: 0;
}

.gl-colpick__item small {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}

.gl-colpick__item.is-locked {
  cursor: default;
  opacity: 0.75;
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
  .gl-colpick-btn,
  .gl-listcard__tools {
    display: none !important;
  }
}

/* Glass AI side panel (calculator "Add to Glass", policy helper).
   Wide desktops (≥1440) dock it and push the page left, stacking side-by-side grids for the narrower page;
   smaller desktops and tablets get a side sheet over a scrim; phones a bottom sheet.
   Sits above the dock / form bar (1060–1070) and below GL.overlay (1200) so its dialogs stay on top. */
:root {
  --gl-aipanel-w: 400px;
}

.gl-aipanel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  width: var(--gl-aipanel-w);
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(15, 17, 23, 0.14);
  animation: gl-aipanel-in 0.22s ease-out;
}

.gl-aipanel__scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1099;
  border: 0;
  padding: 0;
  background: var(--overlay-scrim-soft);
}

.gl-aipanel__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: calc(0.75rem + var(--sat)) 0.75rem 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.gl-aipanel__mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
}

.gl-aipanel__title {
  flex: 1;
  min-width: 0;
}

.gl-aipanel__title h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.gl-aipanel__title small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-aipanel__pin {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem 1rem 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

.gl-aipanel__pin > .gl-ic {
  color: var(--brand);
}

.gl-aipanel__pin div {
  min-width: 0;
}

.gl-aipanel__pin strong,
.gl-aipanel__pin small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-aipanel__pin small {
  color: var(--muted);
  font-size: 0.76rem;
}

.gl-aipanel__thread {
  min-height: 0;
}

.gl-aipanel__suggest {
  margin-top: auto;
}

@media (min-width: 1440px) {
  body.gl-aipanel-open .gl-main {
    margin-right: var(--gl-aipanel-w);
    transition: margin-right 0.22s ease-out;
  }

  body.gl-aipanel-open .gl-grid--side {
    grid-template-columns: minmax(0, 1fr);
  }

  body.gl-aipanel-open .gl-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* The tablet top bar: icon-only search and account chip, so the page title keeps its room. */
  body.gl-aipanel-open .gl-cmdk {
    min-width: 0;
  }

  body.gl-aipanel-open .gl-cmdk span,
  body.gl-aipanel-open .gl-cmdk kbd,
  body.gl-aipanel-open .user-chip__meta {
    display: none !important;
  }
}

@media (max-width: 1439.98px) {
  .gl-aipanel__scrim {
    display: block;
  }
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
  /* Phones reach Glass AI from the dock (and record pages from their actions menu); keep the app bar for the title. */
  .gl-ask-glass {
    display: none;
  }

  .gl-aipanel {
    top: auto;
    left: 0;
    width: auto;
    height: min(88dvh, 680px);
    border-left: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 48px rgba(15, 17, 23, 0.2);
    animation-name: gl-aipanel-up;
  }

  .gl-aipanel__head {
    padding-top: 0.75rem;
  }

  .gl-aipanel .gl-ai__composer {
    padding-bottom: calc(0.75rem + var(--sab));
  }
}

@keyframes gl-aipanel-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}

@keyframes gl-aipanel-up {
  from {
    transform: translateY(32px);
    opacity: 0;
  }
}

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

  body.gl-aipanel-open .gl-main {
    transition: none;
  }
}

/* Glass helper on the policy page (PolicyInsights). */
.gl-helper {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.gl-helper__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.gl-helper__head h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.gl-helper__mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
}

.gl-helper__mark .gl-ic {
  font-size: 16px;
}

.gl-helper__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-helper__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

.gl-helper__icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--info);
  background: var(--info-soft);
}

.gl-helper__item.is-warn .gl-helper__icon {
  color: var(--warn);
  background: var(--warn-soft);
}

.gl-helper__item.is-danger .gl-helper__icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.gl-helper__body {
  flex: 1;
  min-width: 0;
}

.gl-helper__body strong,
.gl-helper__body small {
  display: block;
}

.gl-helper__body small {
  color: var(--muted);
  font-size: 0.78rem;
}

.gl-helper__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

@media (max-width: 767.98px) {
  .gl-helper__item {
    flex-wrap: wrap;
  }

  .gl-helper__actions {
    flex-basis: 100%;
    justify-content: flex-start;
    padding-left: calc(32px + 0.75rem);
  }
}

/* Glass AI Refraction G (synced with resources/css/glass/live.css) */
.gl-ai-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  line-height: 0;
  vertical-align: middle;
}
.sidebar a .gl-ai-mark svg,
.gl-ai-mark svg {
  width: 100%;
  height: 100%;
  flex: none;
  display: block;
  overflow: visible;
  fill: none;
  stroke: none;
  stroke-width: 0;
}
.gl-ai-mark__line {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.85 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gl-ai-mark__slash { stroke-width: 1.65 !important; opacity: 0.9; }
.gl-ai-mark__fill { fill: currentColor !important; opacity: 0.16; stroke: none !important; }
.gl-ai-mark--sm { width: 16px; height: 16px; }
.gl-ai-mark--md { width: 20px; height: 20px; }
.gl-ai-mark--lg { width: 28px; height: 28px; }
.gl-ai-mark--brand { color: var(--brand); }
.gl-ai-mark--on-brand { color: #fff; }
.gl-ai-mark--on-brand .gl-ai-mark__fill { opacity: 0.32; }
.gl-ai-mark--inherit { color: inherit; }
.gl-ai-mark--nav { width: 18px; height: 18px; color: inherit; }
.gl-ai-beta {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid #c9cdfb;
  background: #fff;
  color: var(--brand);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
}
.sidebar a .gl-ai-beta,
.gl-sidebar .nav-item .gl-ai-beta { margin-left: auto; }
.gl-dock__item .gl-ai-mark--nav { width: 22px; height: 22px; }
html[data-theme="dark"] .gl-ai-mark--brand,
html[data-theme="dark"] .gl-ai-beta {
  color: #c5c0ff;
}
html[data-theme="dark"] .gl-ai-beta {
  border-color: rgba(139, 133, 240, 0.45);
  background: rgba(139, 133, 240, 0.18);
}
@media (max-width: 767px) {
  .gl-dock__item .gl-ai-mark--nav { width: 24px; height: 24px; }
}

/*
 * Help center: ⓘ button, help drawer, wiki pages, sample-data figures with markers, guided tours,
 * first-visit tour offers and the sample-mode indicator. Uses the shell tokens from pwa.css.
 */

/* ── ⓘ next to the page title ─────────────────────────────────────────── */

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

.gl-topbar__title-row .page-title {
  min-width: 0;
}

.gl-help-btn {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.gl-help-btn .gl-ic {
  font-size: 20px;
}

.gl-help-btn:hover,
.gl-help-btn:focus-visible {
  background: var(--brand-soft);
  color: var(--brand);
}

/* ── shared bits ──────────────────────────────────────────────────────── */

.gl-help-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.gl-help-pill.is-detailed {
  background: var(--success-soft);
  color: var(--success);
}

.gl-help-pill.is-reference {
  background: var(--canvas);
  color: var(--muted);
}

/* About Glass: release number and "What's new" (resources/release/releases.json) */
.gl-help-about-anchor {
  scroll-margin-top: calc(var(--header-h, 64px) + 12px);
}

.gl-help-about {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.85rem;
}

.gl-help-about dt {
  color: var(--muted);
  font-weight: 600;
}

.gl-help-about dd {
  margin: 0;
  font-weight: 600;
}

.gl-help-about__title {
  margin: 1rem 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.gl-help-releases {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.gl-help-releases ul {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink);
}

.gl-help-muted {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.gl-help-lead {
  color: var(--ink);
  line-height: 1.55;
}

.gl-help-h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.gl-help-result,
.gl-help-note {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
}

.gl-help-result {
  color: var(--success);
}

.gl-help-note {
  color: var(--muted);
}

.gl-help-result .gl-ic,
.gl-help-note .gl-ic {
  margin-top: 0.1rem;
}

/* ── drawer ───────────────────────────────────────────────────────────── */

.gl-help-drawer__top {
  margin-bottom: 0.6rem;
}

.gl-help-showme {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0 1rem;
}

.gl-help-procs {
  display: grid;
  gap: 0.5rem;
}

.gl-help-proc,
.gl-help-faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.gl-help-proc summary,
.gl-help-faq summary {
  padding: 0.75rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.gl-help-proc ol {
  margin: 0;
  padding: 0 0.9rem 0.25rem 2.1rem;
  line-height: 1.55;
}

.gl-help-proc .gl-help-result {
  padding: 0 0.9rem 0.8rem;
}

.gl-help-faq {
  display: grid;
  gap: 0.5rem;
}

.gl-help-faq p {
  margin: 0;
  padding: 0 0.9rem 0.8rem;
  color: var(--muted);
}

/* ── help home ────────────────────────────────────────────────────────── */

.gl-help-search {
  max-width: 640px;
  margin-bottom: 1.25rem;
}

.gl-help-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.6rem;
}

.gl-help-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.gl-help-tile:hover,
.gl-help-tile:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--ink);
}

.gl-help-tile__ic,
.gl-help-tour__ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.gl-help-tile__text,
.gl-help-tour__text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.gl-help-tile__text span,
.gl-help-tour__text span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.gl-help-tours {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-help-tour {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "ic text badge" "ic text cta";
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.gl-help-tour:last-child {
  border-bottom: 0;
}

.gl-help-tour__ic { grid-area: ic; }
.gl-help-tour__text { grid-area: text; }
.gl-help-tour > .wg-badge,
.gl-help-tour > .badge { grid-area: badge; justify-self: end; }
.gl-help-tour > .btn { grid-area: cta; justify-self: end; }

/* ── article ──────────────────────────────────────────────────────────── */

.gl-help-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gl-help-article__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: start;
  gap: 2rem;
}

.gl-help-article__body {
  max-width: 860px;
}

.gl-help-sec {
  scroll-margin-top: calc(var(--appbar-h) + 1rem);
  margin-bottom: 2rem;
}

.gl-help-sec > h2 {
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.15rem;
  font-weight: 700;
}

.gl-help-sec > p {
  max-width: 70ch;
  line-height: 1.6;
}

.gl-help-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.6;
}

.gl-help-toc {
  position: sticky;
  top: calc(var(--appbar-h) + 1.5rem);
  display: grid;
  gap: 0.15rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
  font-size: 0.875rem;
}

.gl-help-toc strong {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gl-help-toc a {
  padding: 0.25rem 0;
  color: var(--ink);
  text-decoration: none;
}

.gl-help-toc a:hover {
  color: var(--brand);
}

.gl-help-perms {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-help-perms li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.gl-help-perms li.is-yes .gl-ic { color: var(--success); }
.gl-help-perms li.is-no .gl-ic { color: var(--danger); }
.gl-help-perms li span { color: var(--muted); }

.gl-help-proc-list {
  display: grid;
  gap: 1rem;
}

.gl-help-proc-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.gl-help-proc-card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 700;
}

.gl-help-proc-card.is-locked {
  background: var(--canvas);
}

.gl-help-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.gl-help-steps {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.gl-help-steps li {
  position: relative;
  padding: 0.3rem 0 0.3rem 2.1rem;
  line-height: 1.5;
  counter-increment: step;
}

.gl-help-steps li::before {
  position: absolute;
  top: 0.3rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  content: counter(step);
}

.gl-help-related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gl-help-related .gl-chip {
  padding-right: 0.8rem;
  text-decoration: none;
}

/* ── figures ──────────────────────────────────────────────────────────── */

.gl-fig {
  margin: 1rem 0 1.25rem;
}

.gl-fig__frame {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

button.gl-fig__frame {
  cursor: zoom-in;
}

.gl-fig--phone .gl-fig__frame {
  max-width: 320px;
}

.gl-fig__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 30px;
  padding: 0 0.7rem;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  font-size: 0.72rem;
}

.gl-fig__dots {
  display: inline-flex;
  gap: 4px;
}

.gl-fig__dots i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-strong);
}

.gl-fig__route {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-fig__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  height: 20px;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
}

.gl-fig__media {
  position: relative;
  line-height: 0;
}

.gl-fig__media img {
  display: block;
  width: 100%;
  height: auto;
}

.gl-fig__marks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.gl-fig__box {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}

.gl-fig__mark circle {
  fill: var(--brand);
  stroke: #fff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.gl-fig__mark text {
  fill: #fff;
  font-family: var(--font);
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
}

.gl-fig__zoom {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--overlay-scrim);
  color: var(--on-brand);
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

button.gl-fig__frame:hover .gl-fig__zoom,
button.gl-fig__frame:focus-visible .gl-fig__zoom {
  opacity: 1;
}

.gl-fig__missing {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
}

.gl-fig__missing .gl-ic {
  font-size: 32px;
}

.gl-fig figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.gl-fig__legend {
  display: grid;
  gap: 0.35rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.45;
}

.gl-fig__legend li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.gl-fig__legend li.is-missing {
  opacity: 0.55;
}

.gl-fig__num {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.72rem;
  font-weight: 800;
}

.gl-ov--center .gl-ov__panel.gl-fig-modal {
  width: min(96vw, 1200px);
  max-width: none;
}

.gl-fig-modal .gl-fig {
  margin: 0;
}

.gl-fig-modal .gl-fig--phone .gl-fig__frame {
  max-width: 420px;
  margin: 0 auto;
}

/* ── tours ────────────────────────────────────────────────────────────── */

.gl-tour {
  position: fixed;
  inset: 0;
  z-index: calc(var(--overlay-z) + 20);
}

.gl-tour__shade {
  position: absolute;
  inset: 0;
}

.gl-tour__dim {
  fill: rgba(15, 23, 42, 0.55);
}

.gl-tour__hole {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3;
  animation: gl-tour-pulse 1.8s var(--ease) infinite;
}

@keyframes gl-tour-pulse {
  0%, 100% { stroke-opacity: 1; }
  50% { stroke-opacity: 0.35; }
}

.gl-tour__pop {
  position: absolute;
  width: min(360px, calc(100vw - 2rem));
  padding: 1rem 1.1rem 0.85rem;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  animation: gl-tour-in 0.18s var(--ease);
}

@keyframes gl-tour-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.gl-tour__pop.is-top { top: calc(var(--appbar-h) + 1rem + var(--sat, 0px)); }
.gl-tour__pop.is-bottom { bottom: calc(1.5rem + var(--sab, 0px)); }
.gl-tour__pop.is-middle { top: 50%; translate: 0 -50%; }
.gl-tour__pop.is-left { left: calc(var(--sidebar-w, 0px) + 1.5rem); }
.gl-tour__pop.is-right { right: 1.5rem; }
.gl-tour__pop.is-center { left: 50%; margin-left: max(-180px, calc(-50vw + 1rem)); }

.gl-tour__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -0.35rem -0.5rem 0.25rem 0;
}

.gl-tour__count {
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gl-tour__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.gl-tour__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.gl-tour__dots {
  display: flex;
  gap: 5px;
  margin: 0.85rem 0 0.6rem;
}

.gl-tour__dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-strong);
}

.gl-tour__dots span.is-on {
  width: 16px;
  background: var(--brand);
}

.gl-tour__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gl-tour__nav {
  display: inline-flex;
  gap: 0.4rem;
}

.gl-tour__skip {
  padding-left: 0;
  color: var(--muted);
}

/* ── automatic offers ─────────────────────────────────────────────────── */

.gl-help-nudge {
  position: fixed;
  right: 1.5rem;
  bottom: calc(1.5rem + var(--sab, 0px));
  z-index: calc(var(--overlay-z) - 10);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.6rem 0.75rem;
  width: min(360px, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: gl-tour-in 0.2s var(--ease);
}

.gl-help-nudge__ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.gl-help-nudge__text {
  display: grid;
  gap: 0.15rem;
}

.gl-help-nudge__text span {
  color: var(--muted);
  font-size: 0.85rem;
}

.gl-help-nudge__actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 0.4rem;
}

.gl-help-welcome__ic {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.75rem;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
}

.gl-help-welcome__ic .gl-ic {
  font-size: 28px;
}

/* ── "Meet Glass AI" intro (resources/js/glass/help/intro.js) ─────────── */

.gl-intro {
  display: grid;
  gap: 0.75rem;
  text-align: center;
}

.gl-intro__stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 120px;
}

.gl-intro__halo {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--brand-soft) 0%, transparent 70%);
  animation: gl-intro-pulse 2.4s ease-in-out infinite;
}

.gl-intro__orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  box-shadow: 0 12px 32px rgba(91, 76, 240, 0.35);
  animation: gl-intro-pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.gl-intro__orb .gl-ic {
  font-size: 34px;
}

.gl-intro__spark {
  position: absolute;
  color: var(--brand);
  opacity: 0;
  animation: gl-intro-spark 2.4s ease-in-out infinite;
}

.gl-intro__spark .gl-ic {
  font-size: 16px;
}

.gl-intro__spark.is-1 {
  top: 14px;
  left: calc(50% - 64px);
  animation-delay: 0.3s;
}

.gl-intro__spark.is-2 {
  top: 8px;
  right: calc(50% - 60px);
  animation-delay: 0.9s;
}

.gl-intro__spark.is-3 {
  bottom: 12px;
  right: calc(50% - 72px);
  animation-delay: 1.5s;
}

.gl-intro__slide {
  display: none;
}

.gl-intro__slide.is-on {
  display: grid;
  gap: 0.5rem;
  animation: gl-intro-in 0.35s ease-out both;
}

.gl-intro__slide h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.gl-intro__slide p {
  margin: 0;
  color: var(--muted);
}

.gl-intro__demo {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  text-align: left;
}

.gl-intro__demo .gl-intro__bubble {
  max-width: 85%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
  color: var(--ink);
  font-size: 0.85rem;
}

.gl-intro__bubble.is-user {
  justify-self: end;
  color: #fff;
  background: var(--brand);
  animation: gl-intro-in 0.3s ease-out both;
}

.gl-intro__bubble.is-ai {
  display: grid;
  justify-self: start;
  border: 1px solid var(--line);
  background: var(--surface);
  animation: gl-intro-in 0.3s 0.5s ease-out both;
}

/* Typing dots and reply share one cell, so the bubble keeps the reply's size while the dots fade out. */
.gl-intro__dots,
.gl-intro__reply {
  grid-area: 1 / 1;
}

.gl-intro__dots {
  display: inline-flex;
  align-self: center;
  gap: 4px;
  animation: gl-intro-out 0.2s 1.8s ease-in forwards;
}

.gl-intro__dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: gl-typing 1s infinite;
}

.gl-intro__dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.gl-intro__dots i:nth-child(3) {
  animation-delay: 0.3s;
}

.gl-intro__reply {
  animation: gl-intro-in 0.3s 1.9s ease-out both;
}

.gl-intro__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.gl-intro__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  font-size: 0.85rem;
}

.gl-intro__list .gl-ic {
  flex: none;
  color: var(--brand);
}

.gl-intro__steps {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.gl-intro__steps i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.gl-intro__steps i.is-on {
  width: 18px;
  background: var(--brand);
}

.gl-intro-modal .gl-intro__go {
  display: none;
}

.gl-intro-modal.is-last .gl-intro__go {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.gl-intro-modal.is-last [data-intro-next] {
  display: none;
}

@keyframes gl-intro-pop {
  from {
    transform: scale(0.4) rotate(-20deg);
    opacity: 0;
  }
}

@keyframes gl-intro-pulse {
  50% {
    transform: scale(1.18);
    opacity: 0.6;
  }
}

@keyframes gl-intro-spark {
  0%,
  100% {
    transform: scale(0.4);
    opacity: 0;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes gl-intro-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

@keyframes gl-intro-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gl-intro *,
  .gl-intro__steps i {
    animation: none !important;
    transition: none !important;
  }

  .gl-intro__spark,
  .gl-intro__dots {
    display: none;
  }
}

/* ── capture mode: stable screenshots ─────────────────────────────────── */

.gl-capture *,
.gl-capture *::before,
.gl-capture *::after {
  animation: none !important;
  transition: none !important;
  caret-color: transparent !important;
}

.gl-capture .gl-toasts,
.gl-capture .gl-help-nudge {
  display: none !important;
}

/* Lab-only notes never appear in help screenshots (production has no lab). */
.gl-capture .gl-lab-only,
.gl-capture .gl-footer__lab {
  visibility: hidden;
}

/* ── tablet & phone ───────────────────────────────────────────────────── */

@media (max-width: 1199.98px) {
  .gl-help-article__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .gl-help-toc {
    display: none;
  }

  .gl-tour__pop.is-left { left: 1rem; }
  .gl-tour__pop.is-right { right: 1rem; }
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
  .gl-help-btn {
    width: 36px;
    height: 36px;
  }

  .gl-help-tiles {
    grid-template-columns: minmax(0, 1fr);
  }

  .gl-tour__pop {
    width: auto;
  }

  .gl-tour__pop.is-center,
  .gl-tour__pop.is-left,
  .gl-tour__pop.is-right {
    right: 0.75rem;
    left: 0.75rem;
    margin-left: 0;
  }

  .gl-tour__pop.is-bottom {
    bottom: calc(0.75rem + var(--sab, 0px));
  }

  .gl-tour__pop.is-top {
    top: calc(var(--appbar-h) + 0.5rem + var(--sat, 0px));
  }

  .gl-help-nudge {
    right: 0.75rem;
    bottom: calc(var(--dock-h) + 0.75rem + var(--sab, 0px));
    left: 0.75rem;
    width: auto;
  }

  .gl-fig--phone .gl-fig__frame {
    max-width: 260px;
    margin: 0 auto;
  }
}

/*
 * Live-app additions on top of the UX-lab mock stylesheets (design-mocks/glass-pwa/css).
 * Keep this file small: anything visual belongs in the mock CSS so both stay identical.
 */

[x-cloak] {
    display: none !important;
}

/* Livewire needs one root element per page; it must not add a layout box between #gl-page and the mock blocks. */
.gl-lw-page {
    display: contents;
}

/* Alpine scope for the topbar Back link; must not take a flex gap slot when empty. */
.gl-back-slot {
    display: contents;
}

/* Alpine scope for the phone page-action icons in the topbar (mock .gl-topbar__primary / __more). */
.gl-topbar__page-actions {
    display: contents;
}

/* Toolbars that exist only to feed the phone topbar actions (mock pages set them via ctx.header on phones). */
.gl-page-toolbar--phone {
    display: none;
}

/* Material Dashboard underlines every link; the mock record link is a dashed brand underline. */
a.gl-reclink {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none !important;
    border-bottom: 1px dashed rgba(91, 79, 232, 0.4);
}

a.gl-reclink:hover {
    border-bottom-style: solid;
}

/*
 * Full-height tool pages (Glass AI): the live page wrapper has Bootstrap py-4 which the mock
 * #gl-page does not, so the composer was clipped by the footer / dock.
 */
body.gl-fill .gl-page {
    padding-top: 0;
    padding-bottom: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

body.gl-fill .gl-body,
body.gl-fill .wg-main-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

body.gl-fill .gl-footer,
body.gl-fill .wg-footer {
    display: none;
}

body.gl-fill .gl-ai {
    height: 100%;
    min-height: 0;
}

/* page loader: the mock boot splash (.gl-splash) as an overlay while a page navigation is slow */
.gl-page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: var(--glass-bg-canvas);
    backdrop-filter: blur(2px);
    animation: gl-page-loader-in 0.15s ease-out;
}

.gl-page-loader[hidden] {
    display: none;
}

.gl-page-loader .gl-splash img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
}

@keyframes gl-page-loader-in {
    from { opacity: 0; }
}

/* vendor credit (components/glass/vendor-credit): quiet text, the company name is the only link */
.gl-credit a {
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

.gl-credit a:hover,
.gl-credit a:focus-visible {
    color: var(--brand);
    text-decoration: underline;
}

.gl-strong {
    font-weight: 700;
}

/* Glass AI Refraction G mark + Beta chip (chat, sidebar, dock, buttons). */
.gl-ai-mark {
    display: inline-grid;
    place-items: center;
    flex: none;
    line-height: 0;
    vertical-align: middle;
}

/* Beat .sidebar a svg { fill:none; stroke:... } so the G keeps its own strokes. */
.sidebar a .gl-ai-mark svg,
.drawer a .gl-ai-mark svg,
.gl-sidebar .nav-item .gl-ai-mark svg,
.gl-dock__item .gl-ai-mark svg,
.gl-more__tile .gl-ai-mark svg,
.gl-ai-mark svg {
    width: 100%;
    height: 100%;
    flex: none;
    display: block;
    overflow: visible;
    fill: none;
    stroke: none;
    stroke-width: 0;
}

.gl-ai-mark__line {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.85 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gl-ai-mark__slash {
    stroke-width: 1.65 !important;
    opacity: 0.9;
}

.gl-ai-mark__fill {
    fill: currentColor !important;
    opacity: 0.16;
    stroke: none !important;
}

.gl-ai-mark--sm { width: 16px; height: 16px; }
.gl-ai-mark--md { width: 20px; height: 20px; }
.gl-ai-mark--lg { width: 28px; height: 28px; }

.gl-ai-mark--brand { color: var(--brand); }
.gl-ai-mark--on-brand { color: #fff; }
.gl-ai-mark--on-brand .gl-ai-mark__fill { opacity: 0.32; }
.gl-ai-mark--inherit { color: inherit; }

.gl-ai-mark--nav {
    width: 18px;
    height: 18px;
    color: inherit;
}

/* Nav/dock: letter only — soft disc muddies the G on brand-soft rows */
.sidebar .gl-ai-mark--nav .gl-ai-mark__fill,
.gl-sidebar .gl-ai-mark--nav .gl-ai-mark__fill,
.gl-dock__item .gl-ai-mark--nav .gl-ai-mark__fill,
.gl-more__tile .gl-ai-mark--nav .gl-ai-mark__fill {
    opacity: 0;
}

.gl-ai-mark--btn {
    margin-inline-end: 0.15rem;
}

.gl-ai__empty .gl-ai__suggest,
.gl-ai__suggest--center {
    justify-content: center;
}

.gl-ai__empty h3 {
    text-wrap: balance;
    max-width: 22ch;
}

.gl-ai-beta {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    border: 1px solid #c9cdfb;
    background: #fff;
    color: var(--brand);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
    vertical-align: middle;
}

.gl-ai__brand-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
}

.gl-ai__brand-title h2,
.gl-aipanel__title h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.gl-aipanel__title .gl-ai-beta,
.gl-ai__brand-title .gl-ai-beta {
    border-color: #c9cdfb;
    background: var(--brand-soft);
    color: var(--brand);
}

.gl-msg__avatar .gl-ai-mark,
.gl-empty__ai .gl-ai-mark,
.gl-helper__mark .gl-ai-mark,
.gl-intro__orb .gl-ai-mark {
    color: #fff;
}

.gl-msg__avatar .gl-ai-mark__fill,
.gl-empty__ai .gl-ai-mark__fill,
.gl-helper__mark .gl-ai-mark__fill,
.gl-intro__orb .gl-ai-mark__fill {
    opacity: 0.32;
}

.gl-empty__ai {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-hover));
    color: #fff;
}

.gl-help-tour__ic--ai {
    background: linear-gradient(135deg, var(--brand), var(--brand-hover)) !important;
    color: #fff !important;
}

.gl-ask-glass .gl-ai-mark {
    width: 18px;
    height: 18px;
}

.sidebar a .gl-ai-beta,
.gl-sidebar .nav-item .gl-ai-beta {
    margin-left: auto;
}

/* the collapsed rail only has room for icons */
.sidebar.is-collapsed .gl-ai-beta {
    display: none;
}

@media (min-width: 1200px) {
    body.wg-sidebar-collapsed .wg-sidebar .gl-ai-beta {
        display: none;
    }
}

/* tablet icon rail (pwa.css): the badge returns once the rail is expanded */
@media (min-width: 768px) and (max-width: 1199.98px) and (min-height: 521px) {
    body:not(.gl-rail-open) .gl-sidebar .gl-ai-beta {
        display: none;
    }
}

/* lists that keep growing: cap the height and scroll inside; the sticky thead stays visible */
.gl-section--scroll > .gl-section__body > .gl-table-wrap,
.gl-section--scroll > .gl-section__body > .gl-cards {
    max-height: var(--gl-section-scroll-h, 26rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.gl-more__tile .gl-ai-beta {
    margin-left: 0.35rem;
}

.gl-dock__item .gl-ai-mark--nav {
    width: 22px;
    height: 22px;
}

/* Dark mode: brighter mark + softer Beta chip */
html[data-theme="dark"] .gl-ai-mark--brand,
body.dark .gl-ai-mark--brand {
    color: #c5c0ff;
}

html[data-theme="dark"] .gl-ai-beta,
body.dark .gl-ai-beta,
[data-theme="dark"] .gl-ai-beta {
    border-color: rgba(139, 133, 240, 0.45);
    background: rgba(139, 133, 240, 0.18);
    color: #c5c0ff;
}

html[data-theme="dark"] .gl-aipanel__title .gl-ai-beta,
html[data-theme="dark"] .gl-ai__brand-title .gl-ai-beta,
body.dark .gl-aipanel__title .gl-ai-beta,
body.dark .gl-ai__brand-title .gl-ai-beta {
    border-color: rgba(139, 133, 240, 0.45);
    background: rgba(139, 133, 240, 0.18);
    color: #c5c0ff;
}

/* Create and search sheets are .gl-ov overlays. On a phone they drop to the bottom
   instead of a full-height side sheet or a centred card. */
a.gl-actionlist__item {
    text-decoration: none;
    color: inherit;
}

.gl-palette__bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.gl-palette__bar .gl-search {
    flex: 1 1 auto;
    min-width: 0;
}

.gl-palette .gl-ov__grab {
    display: none;
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
    .gl-create.gl-ov--side,
    .gl-palette.gl-ov--center {
        align-items: flex-end;
        justify-content: stretch;
        padding: 0;
    }

    .gl-create.gl-ov--side .gl-ov__panel,
    .gl-palette.gl-ov--center .gl-ov__panel {
        align-self: flex-end;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: calc(100% - var(--sat) - 24px);
        margin-top: 0;
        border-radius: 20px 20px 0 0;
        padding-bottom: var(--sab);
        transform: translateY(110%);
        opacity: 1;
    }

    .gl-create.gl-ov--side.is-open .gl-ov__panel,
    .gl-palette.gl-ov--center.is-open .gl-ov__panel {
        transform: none;
        opacity: 1;
    }

    .gl-palette .gl-ov__grab {
        display: flex;
    }
}

/* Background-alert hint. Sits above the phone dock instead of covering it. */
.wg-push-hint {
    position: fixed;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 1080;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 14px;
    background: #111827;
    color: #fff;
    font: 600 13px/1.35 var(--font, system-ui, sans-serif);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.wg-push-hint__text {
    flex: 1;
}

.wg-push-hint__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.wg-push-hint__action {
    border: 0;
    border-radius: 10px;
    padding: 8px 12px;
    background: var(--brand, #5b4fe8);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.wg-push-hint__close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
    body:not(.gl-no-dock):not(.gl-has-overlay) .wg-push-hint {
        bottom: calc(var(--dock-h) + var(--sab) + 12px);
    }
}

/* Phone dock: keep the G crisp; hide Beta (too tight). */
@media (max-width: 767px) {
    .gl-dock__item .gl-ai-mark--nav {
        width: 24px;
        height: 24px;
    }

    .gl-sidebar .nav-item .gl-ai-beta {
        font-size: 0.55rem;
        padding: 0.08rem 0.32rem;
    }
}

/* ── Guest pages: sign in, password reset (components/layouts/glass-auth) ─────────────────────── */

.gl-auth {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
}

.gl-auth__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: calc(2rem + env(safe-area-inset-top, 0px)) 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.gl-auth__panel {
  width: 100%;
  max-width: 400px;
  margin-top: auto;
}

.gl-auth__brand {
  display: inline-flex;
  margin-bottom: 2rem;
}

.gl-auth__brand img {
  height: 34px;
  width: auto;
}

.gl-auth__card {
  display: grid;
  gap: 1.25rem;
}

.gl-auth__head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.gl-auth__head p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}

.gl-auth__head strong {
  color: var(--ink);
  word-break: break-all;
}

.gl-auth__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

/* shared form rules give .gl-field a 3-column span; here every row is full width */
.gl-auth__form > * {
  grid-column: 1 / -1;
}

.gl-auth .gl-field .form-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.gl-auth .gl-field .form-control {
  min-height: 46px;
  font-size: 0.92rem;
}

.gl-auth .gl-field .form-control:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px var(--brand-soft) !important;
}

.gl-auth .gl-field .form-control.is-invalid {
  border-color: var(--danger) !important;
}

.gl-auth__pw {
  position: relative;
}

.gl-auth__pw .form-control {
  padding-right: 3rem !important;
}

.gl-auth__eye {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.gl-auth__eye:hover,
.gl-auth__eye:focus-visible {
  background: var(--canvas);
  color: var(--ink);
}

.gl-auth__eye .material-icons-round {
  font-size: 20px;
}

.gl-auth__otp {
  font-family: var(--mono);
  font-size: 1.35rem !important;
  letter-spacing: 0.5em;
  text-align: center;
}

.gl-auth__otp::placeholder {
  color: var(--muted-2);
}

.gl-auth__hint {
  margin: 0.35rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.gl-auth__gap {
  margin-top: 1rem;
}

.gl-auth__error {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--danger);
}

.gl-auth__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.gl-auth__check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink);
  cursor: pointer;
}

.gl-auth__check .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  border: 1px solid var(--muted-2);
  border-radius: 4px;
  background-color: var(--surface);
  flex-shrink: 0;
}

.gl-auth__check .form-check-input:checked {
  border-color: var(--brand);
  background-color: var(--brand);
}

.gl-auth__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  cursor: pointer;
}

.gl-auth__link:hover,
.gl-auth__link:focus-visible {
  color: var(--brand-hover);
  text-decoration: underline;
}

.gl-auth__link .material-icons-round {
  font-size: 18px;
}

.gl-auth__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  text-transform: none;
}

.gl-auth__busy {
  align-items: center;
  gap: 0.5rem;
}

.gl-auth__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gl-spin 0.7s linear infinite;
}

.gl-auth__alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.45;
}

.gl-auth__alert.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.gl-auth__alert .material-icons-round {
  font-size: 18px;
}

.gl-auth__alt {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-2);
}

.gl-auth__back {
  margin: 0.5rem 0 0;
  text-align: center;
}

.gl-auth__alert.is-error {
  background: var(--danger-soft, rgba(220, 38, 38, 0.1));
  color: var(--danger);
}

.gl-auth__row--center {
  justify-content: center;
}

/* sign-in: demo + trial entry points */
.gl-auth__new {
  display: grid;
  gap: 0.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.gl-auth__new-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.gl-auth__new-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

.gl-auth__new-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.gl-auth__new-link:hover,
.gl-auth__new-link:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft, rgba(91, 79, 232, 0.06));
  color: var(--ink);
}

.gl-auth__new-link .material-icons-round {
  font-size: 22px;
  color: var(--brand);
}

.gl-auth__new-link span {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.gl-auth__new-link strong {
  font-size: 0.86rem;
  font-weight: 700;
}

.gl-auth__new-link small {
  font-size: 0.74rem;
  color: var(--muted);
}

/* try-demo facts list */
.gl-auth__facts {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-auth__facts li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.86rem;
  color: var(--ink);
}

.gl-auth__facts .material-icons-round {
  font-size: 19px;
  color: var(--brand);
}

.gl-auth__captcha {
  min-height: 65px;
}

/* guest-page modal (walkthrough request) */
.gl-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.gl-auth-modal__scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(16, 24, 40, 0.5);
  cursor: default;
}

.gl-auth-modal__panel {
  position: relative;
  display: grid;
  gap: 1rem;
  width: min(440px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 20px 48px rgba(16, 24, 40, 0.22);
}

.gl-auth-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.gl-auth-modal__head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.gl-auth-modal__head .gl-auth__eye {
  position: static;
  transform: none;
}

.gl-auth-modal__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.gl-auth-modal__foot-link {
  margin-right: auto;
}

.gl-auth-modal__panel--wide {
  width: min(680px, 100%);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.gl-auth-modal__scroll {
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
  overscroll-behavior: contain;
}

.gl-auth-modal__scroll:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* terms checkbox row and fine print */
.gl-auth__terms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.84rem;
  color: var(--ink);
}

.gl-auth__terms label {
  margin: 0;
  cursor: pointer;
}

.gl-auth__terms .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  border: 1px solid var(--muted-2);
  border-radius: 4px;
  background-color: var(--surface);
  flex-shrink: 0;
}

.gl-auth__terms .form-check-input:checked {
  border-color: var(--brand);
  background-color: var(--brand);
}

.gl-auth__fine {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
}

.gl-auth__fine .gl-auth__link {
  font-size: inherit;
}

/* legal text (terms page and modal) */
.gl-legal {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink);
}

.gl-legal__meta {
  margin: 0 0 0.75rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.gl-legal h3 {
  margin: 1.1rem 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.gl-legal p,
.gl-legal ul {
  margin: 0 0 0.6rem;
}

.gl-legal ul {
  padding-left: 1.1rem;
}

.gl-legal li + li {
  margin-top: 0.3rem;
}

.gl-legal a {
  color: var(--brand);
  font-weight: 600;
}

.gl-auth__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
  margin-top: auto;
  font-size: 0.76rem;
  color: var(--muted);
}

/* brand panel */
.gl-auth__aside {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 1rem 1rem 0;
  padding: 3rem;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(150deg, #7b6ff2 0%, var(--brand) 45%, #3d33b8 100%);
  color: #fff;
}

.gl-auth__aside::after {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -18%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.gl-auth__pitch {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.gl-auth__mark {
  width: 56px;
  height: 56px;
  margin-bottom: 1.75rem;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 12px 32px rgba(20, 12, 90, 0.35);
}

.gl-auth__pitch h2 {
  margin: 0 0 1.5rem;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
}

.gl-auth__pitch ul {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-auth__pitch li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.gl-auth__pitch .material-icons-round {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 19px;
}

@media (max-width: 991.98px) {
  .gl-auth {
    grid-template-columns: 1fr;
    background: var(--surface);
  }

  .gl-auth__aside {
    display: none;
  }
}

/* ── Install WorkGlass: info banner, top bar button, how-to modal (components/glass/pwa) ─────────── */

.gl-install {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.gl-install[hidden] {
  display: none;
}

.gl-install__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.gl-install__copy {
  display: grid;
  gap: 0.1rem;
  flex: 1 1 16rem;
  min-width: 0;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.gl-install__copy strong {
  font-size: 0.88rem;
  color: var(--ink);
}

.gl-install__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.gl-install__actions .btn {
  text-transform: none;
  letter-spacing: 0;
}

.gl-install__later {
  color: var(--muted) !important;
}

/* sign-in page: below the form, a lighter card */
.gl-auth__panel .gl-install {
  margin: 1.75rem 0 0;
  box-shadow: none;
  background: var(--canvas);
  border-color: transparent;
}

.gl-install-btn[hidden] {
  display: none;
}

.gl-install-btn.is-ready {
  color: var(--brand);
}

@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
  .gl-install {
    margin-bottom: 0.85rem;
    padding: 0.7rem 0.8rem;
  }

  .gl-install__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* how-to modal */
.gl-howto {
  display: grid;
  gap: 0.85rem;
}

.gl-howto__lead {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

.gl-howto__now {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: none;
}

.gl-howto__item {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.gl-howto__item.is-current {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.gl-howto__ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--canvas);
  color: var(--brand);
  flex-shrink: 0;
}

.gl-howto__item.is-current .gl-howto__ic {
  background: var(--surface);
}

.gl-howto__ic .material-icons-round {
  font-size: 20px;
}

.gl-howto__item h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.gl-howto__item h3 small {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.gl-howto__here {
  display: none;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gl-howto__item.is-current .gl-howto__here {
  display: inline-block;
}

.gl-howto__item ol {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink);
}

.gl-howto__inline {
  font-size: 16px;
  vertical-align: -3px;
  color: var(--brand);
}

.gl-howto__note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/*
 * Platform console, organization settings and the support banner.
 * Colours come only from the Glass theme tokens (theme.css), so light, dark and system modes all follow
 * html[data-theme]. Do not add literal colours here; add a token instead.
 */

.sx-platform {
  --sx-radius: var(--radius, 12px);
  display: grid;
  gap: 1rem;
  align-content: start;
  color: var(--ink);
}

/* KPIs */
.sx-platform .sx-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.sx-platform .sx-kpi {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--sx-radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.sx-platform .sx-kpi--link {
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.sx-platform .sx-kpi--link:hover,
.sx-platform .sx-kpi--link:focus-visible {
  border-color: var(--brand);
}

.sx-platform .sx-list-row a {
  font-weight: 700;
  color: var(--brand-ink);
  text-decoration: none;
}

.sx-platform .sx-list-row a:hover {
  text-decoration: underline;
}

.sx-platform .sx-kpi > .material-icons-round {
  padding: 0.45rem;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 20px;
}

.sx-platform .sx-kpi div {
  display: grid;
  min-width: 0;
}

.sx-platform .sx-kpi span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.sx-platform .sx-kpi strong {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
}

.sx-platform .sx-kpi small {
  font-size: 0.75rem;
  color: var(--muted);
}

/* cards */
.sx-platform .sx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

.sx-platform .sx-card {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--sx-radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.sx-platform .sx-card--flush {
  padding: 0;
  overflow: hidden;
}

.sx-platform .sx-card h1,
.sx-platform .sx-card h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.sx-platform .sx-card h2 .material-icons-round {
  font-size: 20px;
  color: var(--brand);
}

.sx-platform .sx-help {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/*
 * Keep primary actions off the help copy (Change requests / Request mailbox).
 * app-ui.css sets `.btn { margin: 0 !important; }`, so margin on the button alone loses —
 * space the action row (or force margin-top) instead.
 */
.sx-platform .sx-card__action {
  margin-top: 0.75rem;
}

.sx-platform .sx-help + .btn.gl-btn,
.sx-platform .sx-help + .btn {
  margin-top: 0.75rem !important;
}

.sx-platform .sx-list-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.sx-platform .sx-list-row:last-child {
  border-bottom: 0;
}

.sx-platform .sx-list-row small {
  color: var(--muted);
}

.sx-platform .sx-review {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  margin: 0 0 0.75rem;
}

.sx-platform .sx-review dt {
  font-weight: 600;
  color: var(--muted);
}

.sx-platform .sx-review dd {
  margin: 0;
  color: var(--ink);
}

/* tables */
.sx-platform .sx-table-wrap {
  overflow-x: auto;
}

.sx-platform .sx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  color: var(--ink);
}

.sx-platform .sx-table th {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
}

.sx-platform .sx-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.sx-platform .sx-table tr:last-child td {
  border-bottom: 0;
}

.sx-platform .sx-table a {
  font-weight: 700;
  color: var(--brand-ink);
  text-decoration: none;
}

.sx-platform .sx-table a:hover,
.sx-platform .sx-table a:focus-visible {
  text-decoration: underline;
}

.sx-platform .sx-table small {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.sx-platform .sx-table__actions {
  text-align: right;
  white-space: nowrap;
}

.sx-platform .sx-table__actions .btn + .btn {
  margin-left: 0.4rem;
}

/* Material .btn padding is asymmetric; keep Glass buttons evenly padded. */
.sx-platform .btn.gl-btn,
.sx-platform button.btn.gl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.55rem 1.1rem;
  line-height: 1.25;
  box-sizing: border-box;
}

/* status badges: organization statuses (Organization::STATUSES) and change request statuses */
.sx-platform .sx-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.sx-platform .sx-badge--active,
.sx-platform .sx-badge--done,
.sx-platform .sx-badge--included { background: var(--success-soft); color: var(--success); }
.sx-platform .sx-badge--trial,
.sx-platform .sx-badge--new,
.sx-platform .sx-badge--quote { background: var(--info-soft); color: var(--info); }
.sx-platform .sx-badge--in_progress,
.sx-platform .sx-badge--overdue,
.sx-platform .sx-badge--read_only { background: var(--warn-soft); color: var(--warn); }
.sx-platform .sx-badge--suspended,
.sx-platform .sx-badge--declined { background: var(--danger-soft); color: var(--danger); }
.sx-platform .sx-badge--demo { background: var(--brand-soft); color: var(--brand-ink); }

/* form fields (plain inputs inside .sx-field) */
.sx-field {
  display: block;
  margin: 0 0 0.75rem;
  border: 0;
  padding: 0;
}

.sx-field > span,
.sx-field > legend {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.sx-field input:not([type='checkbox']):not([type='radio']),
.sx-field select,
.sx-field textarea {
  width: 100%;
  max-width: 28rem;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
}

.sx-field input::placeholder,
.sx-field textarea::placeholder {
  color: var(--muted);
}

.sx-field input:focus,
.sx-field select:focus,
.sx-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.sx-field > label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 1rem;
  color: var(--ink);
}

.sx-field-error {
  margin: -0.4rem 0 0.75rem;
  font-size: 0.8rem;
  color: var(--danger);
}

.sx-check,
.sx-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  color: var(--ink);
  cursor: pointer;
}

.sx-platform .sx-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.sx-grow {
  flex: 1;
}

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

/* flash notice and card actions (organization page, dashboard) */
.sx-platform .sx-notice {
  margin: 0;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: var(--info-soft);
  color: var(--info);
  font-size: 0.85rem;
}

.sx-platform .sx-muted {
  color: var(--muted);
}

.sx-platform .sx-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.sx-platform .sx-card__title-pad {
  padding: 1.1rem 1.25rem 0;
}

.sx-platform .sx-help.sx-help--top {
  margin: 0 0 0.75rem;
}

/* support session banner (app shell) */
.sx-banner-slot:empty {
  display: none;
}

.sx-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: var(--warn-soft);
  color: var(--warn);
}

.sx-banner--write {
  background: var(--danger-soft);
  color: var(--danger);
}

.sx-banner strong {
  color: inherit;
}

/* platform dashboard (platform/console.blade.php) */
.sx-dash {
  gap: 1.25rem;
}

.sx-dash .sx-dash__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

/* Paired dashboard cards share a row height (empty + chart sit side by side). */
.sx-dash .sx-dash__grid > .gl-section {
  margin-bottom: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 18rem;
}

.sx-dash .sx-dash__grid > .gl-section > .gl-section__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sx-dash .sx-dash__grid > .gl-section > .gl-section__body > .wg-empty-state,
.sx-dash .sx-dash__grid > .gl-section > .gl-section__body > .gl-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sx-dash .sx-dash__grid > .gl-section > .gl-section__body > .gl-chart {
  flex: 0 0 auto;
}

.sx-dash .sx-dash__grid > .gl-section > .gl-section__body > .sx-help,
.sx-dash .sx-dash__grid > .gl-section > .gl-section__body > .sx-dash__meter {
  margin-top: auto;
}

.sx-dash .sx-dash__stat {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.sx-dash .sx-dash__stat strong {
  color: var(--ink);
}

.sx-dash .sx-dash__stack {
  display: grid;
  min-width: 0;
}

.sx-dash .sx-dash__stack > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sx-dash .sx-dash__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.sx-dash .sx-dash__meter {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.sx-dash .sx-dash__meter small,
.sx-dash .sx-dash__usage small {
  font-size: 0.75rem;
  color: var(--muted);
}

.sx-dash .sx-dash__usage {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.sx-dash .sx-dash__usage:last-child {
  border-bottom: 0;
}

.sx-dash .sx-dash__usage-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
}

.sx-dash .sx-dash__usage-head a,
.sx-dash .sx-attn__body a,
.sx-dash .sx-dash__stack a {
  font-weight: 700;
  color: var(--brand-ink);
  text-decoration: none;
}

.sx-dash .sx-dash__usage-head a:hover,
.sx-dash .sx-dash__usage-head a:focus-visible,
.sx-dash .sx-attn__body a:hover,
.sx-dash .sx-attn__body a:focus-visible,
.sx-dash .sx-dash__stack a:hover,
.sx-dash .sx-dash__stack a:focus-visible {
  text-decoration: underline;
}

.sx-dash .sx-dash__pairs {
  display: grid;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.sx-dash .sx-dash__pairs li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: baseline;
}

.sx-dash .sx-dash__pairs small {
  color: var(--muted);
}

/* needs-attention list: severity 0 danger, 1 warning, 2 info (AttentionList constants) */
.sx-dash .sx-attn {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sx-dash .sx-attn__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.sx-dash .sx-attn__row:last-child {
  border-bottom: 0;
}

.sx-dash .sx-attn__dot {
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--info);
  box-shadow: 0 0 0 3px var(--info-soft);
}

.sx-dash .sx-attn__row--0 .sx-attn__dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.sx-dash .sx-attn__row--1 .sx-attn__dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}

.sx-dash .sx-attn__body {
  display: grid;
  flex: 1;
  min-width: 0;
}

.sx-dash .sx-attn__body small {
  font-size: 0.78rem;
  color: var(--muted);
}

.sx-mailbox .sx-mailbox__test {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.sx-mailbox .sx-mailbox__test .sx-field {
  flex: 1 1 12rem;
  margin: 0;
}

/* Guided Glass policy wizard + manual send */
.gl-msg__bubble--card {
  white-space: normal;
  padding: 0;
  background: transparent;
  flex: 0 1 26rem;
  width: auto;
  min-width: 0;
  max-width: 26rem;
}

.gl-guided {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm, 0 4px 14px rgba(15, 17, 23, 0.08));
}

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

.gl-guided__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.gl-guided__title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

.gl-guided__title .gl-ic {
  color: var(--brand);
  font-size: 1.15rem;
}

.gl-guided__title strong {
  font-weight: 700;
}

.gl-guided__cancel {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
  color: var(--muted);
  cursor: pointer;
}

.gl-guided__cancel:hover {
  color: var(--ink);
  border-color: var(--brand);
  background: var(--brand-soft);
}

.gl-guided__back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  align-self: flex-start;
  margin: 0;
  padding: 0.35rem 0.15rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  min-height: 40px;
  font-size: 0.85rem;
}

.gl-guided__back:hover {
  color: var(--brand);
}

.gl-guided__error,
.gl-guided__hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--danger, #b42318);
}

.gl-guided__hint {
  color: var(--muted);
}

.gl-guided__search {
  position: relative;
  display: block;
}

.gl-guided__search-ic {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--muted);
  pointer-events: none;
}

.gl-guided__search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.75rem 0.55rem 2.35rem;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
}

.gl-guided__search input:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
  border-color: var(--brand);
}

.gl-guided__options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gl-guided__options--choice {
  flex-direction: row;
  gap: 0.6rem;
}

.gl-guided__options--list {
  max-height: 16rem;
  overflow: auto;
  padding-right: 0.15rem;
}

.gl-guided__option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.gl-guided__option--choice {
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 700;
}

.gl-guided__option:hover,
.gl-guided__option:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
  outline: none;
}

.gl-guided__option.is-warn {
  border-color: color-mix(in srgb, var(--warn, #b54708) 45%, var(--line));
}

.gl-guided__option-label {
  font-weight: 600;
  font-size: 0.92rem;
}

.gl-guided__option--choice .gl-guided__option-label {
  font-size: 1rem;
}

.gl-guided__option-meta {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.gl-guided__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.gl-guided__fields label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.gl-guided__fields input,
.gl-guided__fields textarea {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

.gl-guided__fields--full,
.gl-guided__fields-actions {
  grid-column: 1 / -1;
}

.gl-guided__premium {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.35rem 0.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 12px;
  background: var(--brand-soft, color-mix(in srgb, var(--brand) 10%, transparent));
}

.gl-guided__premium-ic {
  display: inline-flex;
  color: var(--brand);
  font-size: 1.15rem;
  line-height: 1.3;
}

.gl-guided__premium-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink);
}

.gl-guided__premium-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
}

.gl-guided__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.gl-guided__link .gl-ic {
  font-size: 1rem;
}

.gl-guided__link:hover,
.gl-guided__link:focus-visible {
  text-decoration: underline;
}

.gl-guided__link:disabled {
  opacity: 0.6;
  cursor: progress;
}

.gl-guided__fields-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.15rem;
}

.gl-guided__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.gl-guided__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 40px;
}

.gl-guided--share .gl-guided__actions {
  margin-top: 0.15rem;
}

.gl-action-card__email-toggle {
  margin: 0.35rem 0;
  font-size: 0.85rem;
}

.gl-action-card__email-toggle summary {
  cursor: pointer;
  color: var(--brand);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 639.98px) {
  .gl-msg__bubble--card {
    flex: 1 1 auto;
    max-width: none;
  }

  .gl-guided {
    padding: 0.85rem;
    border-radius: 16px;
  }

  .gl-guided__fields {
    grid-template-columns: 1fr;
  }

  .gl-guided__link {
    min-height: 44px;
  }

  .gl-guided__fields-actions {
    justify-content: stretch;
  }

  .gl-guided__fields-actions .btn,
  .gl-guided__actions .btn,
  .gl-action-card__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .gl-guided__actions,
  .gl-action-card__actions {
    flex-direction: column;
  }

  .gl-guided__options--choice {
    flex-wrap: wrap;
  }

  .gl-guided__option--choice {
    flex: 1 1 7rem;
    min-height: 48px;
  }

  .gl-action-card .gl-dl {
    grid-template-columns: 1fr !important;
  }
}

/* Calculator ↔ guided Glass policy handoff */
.gl-handoff {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: 14px;
  background: var(--brand-soft, color-mix(in srgb, var(--brand) 10%, transparent));
}

.gl-handoff__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: var(--brand);
}

.gl-handoff__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
  font-size: 0.85rem;
  color: var(--ink);
}

.gl-handoff__body span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-handoff__back {
  flex: 0 0 auto;
}

.gl-handoff__error {
  margin: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger, #b42318) 14%, transparent);
  color: inherit;
  font-size: 0.82rem;
}

@media (max-width: 639.98px) {
  .gl-handoff {
    flex-wrap: wrap;
  }

  .gl-handoff__body span {
    white-space: normal;
  }

  .gl-handoff__back {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
}

/**
 * Bootstrap / material-dashboard / filter-improvements pieces used inside Glass pages, mapped to the
 * Glass tokens. Light tokens equal the original hard-coded colors, so light mode is unchanged and
 * dark / device follow theme.css. Scoped to html[data-theme] so the legacy shell is untouched.
 */

/* Surfaces */
html[data-theme] .gl-body .card,
html[data-theme] .gl-body .modal-content,
html[data-theme] .gl-body .dropdown-menu,
html[data-theme] .gl-body .portfolio-stat-card,
html[data-theme] .gl-body .list-group-item,
html[data-theme] .gl-body .accordion-item,
html[data-theme] .gl-body .accordion-button,
html[data-theme] .gl-body .nav-tabs .nav-link.active,
html[data-theme] .gl-body .page-item .page-link,
html[data-theme] .gl-body .flatpickr-calendar,
html[data-theme] .gl-body .choices__list--dropdown {
  background-color: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

html[data-theme] .gl-body .card-header,
html[data-theme] .gl-body .card-footer,
html[data-theme] .gl-body .modal-header,
html[data-theme] .gl-body .modal-footer {
  background-color: transparent !important;
  border-color: var(--line) !important;
}

html[data-theme] .gl-body .bg-white,
html[data-theme] .gl-body .bg-light {
  background-color: var(--surface) !important;
}

html[data-theme] .gl-body .bg-gray-100,
html[data-theme] .gl-body .bg-gray-200 {
  background-color: var(--canvas) !important;
}

/* Text */
html[data-theme] .gl-body .portfolio-stat-value,
html[data-theme] .gl-body .text-dark,
html[data-theme] .gl-body .text-body,
html[data-theme] .gl-body .dropdown-item,
html[data-theme] .gl-body .modal-title {
  color: var(--ink) !important;
}

html[data-theme] .gl-body .portfolio-stat-value small,
html[data-theme] .gl-body .text-secondary,
html[data-theme] .gl-body .text-muted,
html[data-theme] .gl-body .form-text {
  color: var(--muted) !important;
}

/* Forms */
html[data-theme] .gl-body .form-control,
html[data-theme] .gl-body .form-select,
html[data-theme] .gl-auth .form-control,
html[data-theme] .gl-auth .form-select,
html[data-theme] .gl-body .input-group-text,
html[data-theme] .gl-body .choices__inner {
  background-color: var(--surface) !important;
  border-color: var(--line-strong) !important;
  color: var(--ink) !important;
}

html[data-theme] .gl-body .form-control::placeholder,
html[data-theme] .gl-auth .form-control::placeholder {
  color: var(--muted-2) !important;
}

html[data-theme] .gl-body .form-control:disabled,
html[data-theme] .gl-body .form-control[readonly],
html[data-theme] .gl-body .form-select:disabled {
  background-color: var(--surface-2) !important;
  color: var(--muted) !important;
}

/* Browser autofill paints its own text and fill colors; the inset shadow covers the fill. */
html[data-theme] .gl-body .form-control:autofill,
html[data-theme] .gl-auth .form-control:autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: inset 0 0 0 100px var(--surface) !important;
  transition: background-color 600000s 0s;
}

html[data-theme] .gl-body .form-control:-webkit-autofill,
html[data-theme] .gl-auth .form-control:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: inset 0 0 0 100px var(--surface) !important;
  transition: background-color 600000s 0s;
}

html[data-theme] .gl-auth .gl-field .form-control:autofill:focus {
  box-shadow: inset 0 0 0 100px var(--surface), 0 0 0 3px var(--brand-soft) !important;
}

html[data-theme] .gl-auth .gl-field .form-control:-webkit-autofill:focus {
  box-shadow: inset 0 0 0 100px var(--surface), 0 0 0 3px var(--brand-soft) !important;
}

html[data-theme] .gl-auth .form-control::-webkit-credentials-auto-fill-button {
  background-color: var(--muted);
}

/* Tables */
html[data-theme] .gl-body .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  --bs-table-striped-bg: var(--surface-2);
  --bs-table-striped-color: var(--ink);
  --bs-table-hover-bg: var(--brand-soft);
  --bs-table-hover-color: var(--ink);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme] .gl-body .table > :not(caption) > * > * {
  border-bottom-color: var(--line);
}

html[data-theme] .gl-body .table thead th {
  color: var(--muted) !important;
}

/* Interactive */
html[data-theme] .gl-body .dropdown-item:hover,
html[data-theme] .gl-body .dropdown-item:focus {
  background-color: var(--brand-soft) !important;
  color: var(--ink) !important;
}

html[data-theme] .gl-body .page-item.active .page-link {
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  color: var(--on-brand) !important;
}

html[data-theme] .gl-body .btn-close {
  filter: var(--btn-close-filter, none);
}

/* Logo on the sign-in page stays readable on a dark canvas */
html[data-theme] .gl-brand-logo {
  filter: var(--logo-filter, none);
}

/* ── app-ui.css hard-coded light colors (shared with the old UI, so overridden here) ── */

html[data-theme] .wg-topbar.navbar-main {
  background: var(--glass-bg-canvas) !important;
}

/* white surfaces */
html[data-theme] .main-content .selectize-dropdown,
html[data-theme] .wg-main .selectize-dropdown,
html[data-theme] .main-content .selectize-dropdown-content,
html[data-theme] .wg-main .selectize-dropdown-content,
html[data-theme] .glass-chat-root .panel,
html[data-theme] .glass-chat-search:focus,
html[data-theme] .glass-chat-back-btn,
html[data-theme] .glass-chat-menu-btn,
html[data-theme] .glass-chat-chip,
html[data-theme] .wg-nav-back,
html[data-theme] .glass-chat-issued-card,
html[data-theme] .glass-chat-issued-filechip__action,
html[data-theme] .glass-chat-composer-box,
html[data-theme] .premium-calculator-wizard .pc-company-card,
html[data-theme] .premium-calculator-wizard .pc-line-tile,
html[data-theme] .premium-calculator-wizard .pc-stage .form-control,
html[data-theme] .premium-calculator-wizard .pc-stage .form-select,
html[data-theme] .premium-calculator-wizard .pc-plan-row,
html[data-theme] .premium-calculator-wizard .pc-choice-chip,
html[data-theme] .premium-calculator-wizard .pc-member-card.is-primary,
html[data-theme] .premium-calculator-wizard .pc-age-stepper,
html[data-theme] .premium-tariff-admin .ta-stage .form-control,
html[data-theme] .premium-tariff-admin .ta-stage .form-select,
html[data-theme] .premium-tariff-admin .ta-library-filters,
html[data-theme] .premium-tariff-admin .ta-library-foot,
html[data-theme] .premium-tariff-admin .ta-lib-row,
html[data-theme] .wg-notif__bell,
html[data-theme] .wg-notif__panel,
html[data-theme] .wg-notif__close,
html[data-theme] .wg-notif__toast,
html[data-theme] .policy-view-details .modern-table tbody tr {
  background-color: var(--surface) !important;
}

/* raised / muted surfaces */
html[data-theme] .file-system-sidebar .tree-node:hover,
html[data-theme] .main-content .btn.btn-outline-primary:hover,
html[data-theme] .main-content .btn.btn-outline-secondary:hover,
html[data-theme] .main-content .btn.btn-secondary:hover,
html[data-theme] .wg-main .btn.btn-outline-primary:hover,
html[data-theme] .wg-main .btn.btn-outline-secondary:hover,
html[data-theme] .wg-main .btn.btn-secondary:hover,
html[data-theme] .main-content .btn.btn-link:hover,
html[data-theme] .main-content .btn.btn-ghost:hover,
html[data-theme] .wg-main .btn.btn-link:hover,
html[data-theme] .wg-main .btn.btn-ghost:hover,
html[data-theme] .main-content .selectize-dropdown .option.active,
html[data-theme] .main-content .selectize-dropdown .option:hover,
html[data-theme] .wg-main .selectize-dropdown .option.active,
html[data-theme] .wg-main .selectize-dropdown .option:hover,
html[data-theme] .wg-seg,
html[data-theme] .seg,
html[data-theme] .main-content .table thead th,
html[data-theme] .main-content .pagination,
html[data-theme] .wg-main .pagination,
html[data-theme] .report-stat,
html[data-theme] .audit-summary,
html[data-theme] .wg-sidebar .nav-item:hover,
html[data-theme] .role-perm-toolbar,
html[data-theme] .role-group-bar,
html[data-theme] .role-perm-table tbody tr:hover,
html[data-theme] .glass-chat-search,
html[data-theme] .glass-chat-list-item:hover,
html[data-theme] .glass-chat-icon-action:hover,
html[data-theme] .glass-chat-back-btn:hover,
html[data-theme] .glass-chat-menu-btn:hover,
html[data-theme] .glass-chat-bubble--assistant,
html[data-theme] .wg-nav-back:hover,
html[data-theme] .glass-chat-issued-upload,
html[data-theme] .premium-calculator-wizard .pc-company-mark,
html[data-theme] .premium-calculator-wizard .pc-line-icon,
html[data-theme] .premium-calculator-wizard .pc-plan-row__mark,
html[data-theme] .premium-calculator-wizard .pc-age-stepper button,
html[data-theme] .premium-calculator-wizard .pc-matched-list li,
html[data-theme] .wg-notif__close:hover,
html[data-theme] .wg-notif__item:hover,
html[data-theme] .ta-price-modal__table thead th {
  background-color: var(--surface-2) !important;
}

/* subtle tints */
html[data-theme] .main-content .table tbody tr:hover,
html[data-theme] .attachments-dropzone,
html[data-theme] .wg-dropzone,
html[data-theme] .org-logo-dropzone,
html[data-theme] .dropzone,
html[data-theme] .role-perm-table thead th,
html[data-theme] .role-perm-table tbody tr:nth-child(even),
html[data-theme] .glass-chat-issued-empty,
html[data-theme] .glass-chat-composer,
html[data-theme] .premium-tariff-admin .ta-rail,
html[data-theme] .premium-tariff-admin .ta-draft-panel,
html[data-theme] .premium-tariff-admin .ta-library-scroll,
html[data-theme] .premium-calculator-wizard .pc-choice-chip:hover,
html[data-theme] .premium-calculator-wizard .pc-member-card,
html[data-theme] .premium-calculator-wizard .pc-add-member-bar {
  background-color: var(--surface-3) !important;
}

/* neutral chips */
html[data-theme] .badge-neutral,
html[data-theme] .wg-badge.badge-neutral,
html[data-theme] .badge.badge-neutral,
html[data-theme] .premium-tariff-admin .ta-status-archived,
html[data-theme] .premium-tariff-admin .ta-status-draft,
html[data-theme] .premium-tariff-admin .ta-chip,
html[data-theme] .premium-tariff-admin .ta-chip--archived,
html[data-theme] .ta-price-modal__meta .ta-chip,
html[data-theme] .ta-price-modal__meta .ta-chip--archived,
html[data-theme] .premium-calculator-wizard .pc-role-chip,
html[data-theme] .premium-calculator-wizard .pc-chip {
  background-color: var(--chip-neutral-bg) !important;
}

/* brand tints */
html[data-theme] .glass-chat-issued-filechip,
html[data-theme] .glass-chat-issued-filechip:hover,
html[data-theme] .premium-calculator-wizard .pc-choice-chip.is-selected,
html[data-theme] .premium-calculator-wizard .pc-family-pill,
html[data-theme] .premium-calculator-wizard .pc-band-pill,
html[data-theme] .premium-calculator-wizard .pc-age-stepper button:hover:not(:disabled),
html[data-theme] .glass-chat-tariff-chip,
html[data-theme] .glass-chat-quote-chip,
html[data-theme] .wg-notif__item.is-unread,
html[data-theme] .wg-notif__item.is-unread:hover {
  background-color: var(--brand-soft) !important;
}

/* status tints */
html[data-theme] .premium-tariff-admin .ta-chip--draft,
html[data-theme] .ta-price-modal__meta .ta-chip--draft,
html[data-theme] .premium-calculator-wizard .pc-role-chip--warn {
  background-color: var(--warn-soft) !important;
}

html[data-theme] .glass-chat-icon-action.is-danger:hover,
html[data-theme] .file-system-sidebar .logout-btn:hover,
html[data-theme] .premium-calculator-wizard .pc-member-remove:hover:not(:disabled) {
  background-color: var(--danger-soft) !important;
}

/* row separators */
html[data-theme] .main-content .table tbody td,
html[data-theme] .role-perm-table tbody tr {
  border-color: var(--line) !important;
}

/* text colors the old stylesheets fix to slate (#344767): dark only, light stays as-is */
html[data-theme="dark"] .glass-chat-search,
html[data-theme="dark"] .glass-chat-list-btn,
html[data-theme="dark"] .glass-chat-back-btn,
html[data-theme="dark"] .glass-chat-menu-btn,
html[data-theme="dark"] .glass-chat-bubble--assistant,
html[data-theme="dark"] .glass-pending-email__row dd,
html[data-theme="dark"] .glass-pending-card__row dd,
html[data-theme="dark"] .glass-chat-chip,
html[data-theme="dark"] .wg-nav-back,
html[data-theme="dark"] .glass-chat-issued-filechip__text,
html[data-theme="dark"] .wg-notif__title,
html[data-theme="dark"] .wg-notif__close:hover,
html[data-theme="dark"] .wg-notif__toast-copy strong,
html[data-theme="dark"] .badge-neutral,
html[data-theme="dark"] .premium-tariff-admin .ta-chip,
html[data-theme="dark"] .premium-calculator-wizard .pc-chip,
html[data-theme="dark"] .premium-calculator-wizard .pc-role-chip {
  color: var(--ink) !important;
}

html[data-theme="dark"] .glass-chat-empty {
  color: var(--muted) !important;
}

/* Bare headings and links take material's slate; :where keeps any component rule in charge. */
:where(html[data-theme="dark"] .gl-body) :is(h1, h2, h3, h4, h5, h6, a) {
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .glass-chat-search,
  html[data-theme="system"] .glass-chat-list-btn,
  html[data-theme="system"] .glass-chat-back-btn,
  html[data-theme="system"] .glass-chat-menu-btn,
  html[data-theme="system"] .glass-chat-bubble--assistant,
  html[data-theme="system"] .glass-pending-email__row dd,
  html[data-theme="system"] .glass-pending-card__row dd,
  html[data-theme="system"] .glass-chat-chip,
  html[data-theme="system"] .wg-nav-back,
  html[data-theme="system"] .glass-chat-issued-filechip__text,
  html[data-theme="system"] .wg-notif__title,
  html[data-theme="system"] .wg-notif__close:hover,
  html[data-theme="system"] .wg-notif__toast-copy strong,
  html[data-theme="system"] .badge-neutral,
  html[data-theme="system"] .premium-tariff-admin .ta-chip,
  html[data-theme="system"] .premium-calculator-wizard .pc-chip,
  html[data-theme="system"] .premium-calculator-wizard .pc-role-chip {
    color: var(--ink) !important;
  }

  html[data-theme="system"] .glass-chat-empty {
    color: var(--muted) !important;
  }

  :where(html[data-theme="system"] .gl-body) :is(h1, h2, h3, h4, h5, h6, a) {
    color: var(--ink);
  }
}

/*
 * Notification center (Livewire .wg-notif) — app-ui.css hard-codes light surfaces.
 * Map every chrome piece to Glass tokens so dark / system modes do not flash white.
 */
html[data-theme] .wg-notif__panel {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow-lg) !important;
}

html[data-theme] .wg-notif__head {
  background: var(--surface-2) !important;
  border-bottom-color: var(--line) !important;
}

html[data-theme] .wg-notif__title,
html[data-theme] .wg-notif__item-title,
html[data-theme] .wg-notif__toast-copy strong {
  color: var(--ink) !important;
}

html[data-theme] .wg-notif__sub,
html[data-theme] .wg-notif__empty,
html[data-theme] .wg-notif__item-text,
html[data-theme] .wg-notif__item-time,
html[data-theme] .wg-notif__toast-copy small {
  color: var(--muted) !important;
}

html[data-theme] .wg-notif__item.is-read .wg-notif__item-title {
  color: var(--muted) !important;
}

html[data-theme] .wg-notif__item {
  border-bottom-color: var(--line) !important;
}

html[data-theme] .wg-notif__bell {
  border-color: var(--line) !important;
  color: var(--muted) !important;
}

html[data-theme] .wg-notif__bell:hover {
  border-color: var(--brand) !important;
  color: var(--brand) !important;
  box-shadow: 0 0 0 3px var(--brand-soft) !important;
}

html[data-theme] .wg-notif__close {
  border-color: var(--line) !important;
  color: var(--muted) !important;
}

html[data-theme] .wg-notif__mark {
  color: var(--brand) !important;
}

html[data-theme] .wg-notif__badge {
  border-color: var(--surface) !important;
}

html[data-theme] .wg-notif__toast {
  border-color: var(--glass-line) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* Topbar: match other Glass icon buttons (transparent, not a light chip). */
html[data-theme] .gl-bell-slot .wg-notif__bell {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

html[data-theme] .gl-bell-slot .wg-notif__bell:hover {
  background: var(--brand-soft) !important;
  color: var(--brand) !important;
  box-shadow: none !important;
}
