/* =====================================================================
   Clearance Wallet: the app-wide native shell and component theme.
   Chrome stays neutral (ink on mist). Colour means one thing only:
   sensitivity, deepening from General to Board Confidential.
   Loaded after Bootstrap and site.css, before tenant overrides.
   ===================================================================== */

:root {
  /* ground & ink */
  --ground: #EEF0F3;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --ink: #14161B;
  --ink-2: #2E323B;
  --muted: #565D6B;
  --faint: #8A909C;
  --line: rgba(20, 22, 27, .10);
  --line-strong: rgba(20, 22, 27, .16);

  /* sensitivity axis, pale to deep */
  --sens-general: #8FB3AC;
  --sens-general-ink: #14302B;
  --sens-operational: #2F7D78;
  --sens-management: #2B3F8C;
  --sens-board: #2A0F1E;
  --brass: #C9A24A;
  --brass-soft: #E7D3A2;

  /* semantic states */
  --ok: #1F7A4D;
  --warn: #9A6700;
  --bad: #B3261E;
  --info: #1F5E8C;

  /* one elevation scale, one light source above */
  --depth-0: 0 0 0 1px var(--line);
  --depth-1: 0 0 0 1px var(--line), 0 1px 2px rgba(20, 22, 27, .06), 0 2px 6px rgba(20, 22, 27, .04);
  --depth-2: 0 0 0 1px var(--line), 0 2px 4px rgba(20, 22, 27, .06), 0 8px 20px rgba(20, 22, 27, .08);
  --depth-3: 0 0 0 1px var(--line), 0 6px 12px rgba(20, 22, 27, .08), 0 20px 44px rgba(20, 22, 27, .14);

  /* shape & rhythm */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --rail-w: 272px;
  --appbar-h: 56px;
  --tabbar-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);

  --font-ui: system-ui, -apple-system, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;

  /* Bootstrap remap */
  --bs-body-font-family: var(--font-ui);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.5;
  --bs-body-bg: var(--ground);
  --bs-body-color: var(--ink);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--line-strong);
  --bs-border-color-translucent: var(--line);
  --bs-border-radius: var(--r-sm);
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: var(--r-md);
  --bs-border-radius-xl: var(--r-lg);
  --bs-primary: var(--ink);
  --bs-primary-rgb: 20, 22, 27;
  --bs-secondary-rgb: 86, 93, 107;
  --bs-success: var(--ok);
  --bs-success-rgb: 31, 122, 77;
  --bs-info: var(--info);
  --bs-info-rgb: 31, 94, 140;
  --bs-warning-rgb: 214, 158, 46;
  --bs-danger: var(--bad);
  --bs-danger-rgb: 179, 38, 30;
  --bs-dark-rgb: 20, 22, 27;
  --bs-light-rgb: 238, 240, 243;
  --bs-primary-text-emphasis: var(--ink);
  --bs-primary-bg-subtle: #E4E6EB;
  --bs-primary-border-subtle: #C9CDD5;
  --bs-success-text-emphasis: #145233;
  --bs-success-bg-subtle: #E1F0E8;
  --bs-danger-text-emphasis: #7E1B15;
  --bs-danger-bg-subtle: #F8E3E1;
  --bs-warning-text-emphasis: #6B4800;
  --bs-warning-bg-subtle: #F7ECD2;
  --bs-info-text-emphasis: #154268;
  --bs-info-bg-subtle: #E0ECF5;
  --bs-link-color: var(--ink);
  --bs-link-color-rgb: 20, 22, 27;
  --bs-link-hover-color: var(--sens-management);
  --bs-link-hover-color-rgb: 43, 63, 140;
  --bs-focus-ring-color: rgba(20, 22, 27, .35);

  /* legacy tokens still read by feature rules in site.css */
  --devops-primary: var(--ink);
  --devops-secondary: var(--sens-management);
  --devops-accent: var(--sens-operational);
  --devops-light: var(--surface-2);
  --devops-dark: var(--ink);
  --devops-gray: var(--muted);
  --devops-success: var(--ok);
  --devops-warning: var(--warn);
  --devops-danger: var(--bad);
}

/* ---------------------------------------------------------------------
   Base & browser surfaces
   --------------------------------------------------------------------- */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--brass-soft); color: var(--ink); }
input, textarea { caret-color: var(--sens-management); }
a { text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.card):not(.list-group-item):not(.tab):not(.pass) { color: var(--ink); }
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.card):not(.list-group-item):not(.tab):not(.pass):hover { color: var(--sens-management); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink) !important;
  outline: 0;
}
* { scrollbar-width: thin; scrollbar-color: rgba(20, 22, 27, .22) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(20, 22, 27, .2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
table, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6, .pass-count, .badge { font-variant-numeric: tabular-nums; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.012em;
  text-wrap: balance;
}
h1, .h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.125rem); letter-spacing: -.022em; }
h2, .h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.75rem); letter-spacing: -.02em; }
h3, .h3 { font-size: 1.375rem; }
h4, .h4 { font-size: 1.1875rem; }
h5, .h5 { font-size: 1.0625rem; }
h6, .h6 { font-size: .9375rem; }
/* The page's first heading is its large title (set by app-native.js). */
.large-title { font-size: clamp(1.875rem, 1.35rem + 1.8vw, 2.125rem) !important; font-weight: 750; letter-spacing: -.024em; line-height: 1.12; margin-bottom: .25rem; }
.large-title > .bi { color: var(--faint) !important; font-size: .8em; margin-inline-end: .35rem !important; }
.text-muted, .text-secondary { color: var(--muted) !important; }
small, .small { font-size: .875rem; }
hr { border-color: var(--line-strong); opacity: 1; }
code { color: var(--sens-management); }

/* ---------------------------------------------------------------------
   Shell: layout frame
   --------------------------------------------------------------------- */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.content-wrap { flex: 1 1 auto; min-width: 0; }
main.container, main.container-fluid { padding-top: 8px; padding-bottom: 32px; }
footer.app-footer { color: var(--faint); font-size: .8125rem; background: transparent; border: 0 !important; }

/* ---------------------------------------------------------------------
   Shell: navigation (left rail on desktop, More sheet on phones)
   --------------------------------------------------------------------- */
.app-nav .navbar {
  background: var(--surface) !important;
  backdrop-filter: none;
  box-shadow: none !important;
  border: 0;
}
.app-nav .navbar-brand { color: var(--ink) !important; transform: none !important; filter: none !important; }
.app-nav .navbar-brand img { max-height: 36px; width: auto; }
.app-nav .navbar-nav .nav-link {
  color: var(--ink-2) !important;
  font-weight: 550;
  font-size: .9375rem !important;
  border-radius: var(--r-sm);
  margin: 0 !important;
  padding: 10px 12px !important;
  transform: none !important;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  white-space: normal !important;
  transition: background-color .18s var(--ease-out), color .18s var(--ease-out);
}
.app-nav .navbar-nav .nav-link > .bi {
  display: inline-block !important;
  width: 20px;
  flex: 0 0 20px;
  text-align: center;
  font-size: 1.05rem;
  margin: 0 !important;
  color: var(--muted);
}
.app-nav .navbar-nav .nav-link:hover { background: var(--surface-2); color: var(--ink) !important; }
.app-nav .navbar-nav .nav-link.active,
.app-nav .navbar-nav .nav-link.is-current { background: var(--ink); color: #fff !important; }
.app-nav .navbar-nav .nav-link.active > .bi,
.app-nav .navbar-nav .nav-link.is-current > .bi { color: var(--brass); }
.app-nav .dropdown-toggle::after { margin-inline-start: auto; border-top-color: var(--faint); transition: transform .2s var(--ease-out); }
.app-nav .dropdown.show > .dropdown-toggle::after { transform: rotate(180deg); }
.app-nav .nav-trunc { max-width: none !important; }
.app-nav .nav-hide-compact { display: inline !important; }

/* In-nav dropdowns and mega menus expand inline like disclosure groups. */
.app-nav .navbar-nav .dropdown-menu,
.app-nav .navbar .dropdown-menu.mega-menu {
  position: static !important;
  transform: none !important;
  inset: auto !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 2px 0 8px !important;
  padding: 4px 0 4px 0 !important;
  padding-inline-start: 22px !important;
  border: 0 !important;
  border-inline-start: 1px solid var(--line-strong) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  margin-inline-start: 21px !important;
}
.app-nav .navbar .dropdown-menu.mega-menu > .row { flex-wrap: wrap !important; margin: 0; }
.app-nav .navbar .dropdown-menu.mega-menu > .row > [class*="col"] { flex: 0 0 100%; max-width: 100%; padding: 0; }
.app-nav .mega-menu .mega-col-title {
  font-size: .75rem; font-weight: 650; letter-spacing: .02em; text-transform: none;
  color: var(--faint); border: 0; margin: 10px 0 2px; padding: 0 10px;
}
.app-nav .dropdown-menu .dropdown-item,
.app-nav .mega-menu .dropdown-item {
  font-size: .9063rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 8px 10px !important;
  border-radius: 8px;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: normal;
  transform: none !important;
}
.app-nav .dropdown-menu .dropdown-item .bi { color: var(--faint) !important; }
.app-nav .dropdown-menu .dropdown-item:hover { background: var(--surface-2); color: var(--ink); }
.app-nav .dropdown-menu .dropdown-item.active { background: var(--ink); color: #fff; }
.app-nav .dropdown-header { color: var(--faint); font-size: .75rem; font-weight: 650; padding: 10px 10px 4px; }
.app-nav .dropdown-submenu > .dropdown-menu { display: block; }
.app-nav .dropdown-submenu > a::after { display: none; }

.nav-group-label {
  display: block;
  font-size: .75rem;
  font-weight: 650;
  color: var(--faint);
  padding: 16px 12px 6px;
  letter-spacing: .01em;
}
.sheet-head { display: none; }

@media (min-width: 992px) {
  .is-authed .app-nav {
    position: fixed;
    top: 0; bottom: 0;
    inset-inline-start: 0;
    width: var(--rail-w);
    z-index: 1030;
    border-inline-end: 1px solid var(--line);
    background: var(--surface);
  }
  .is-authed .app-nav .navbar { height: 100%; padding: 0; align-items: stretch; }
  .is-authed .app-nav .navbar > .container-fluid {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap !important;
    height: 100%;
    padding: 18px 14px 14px;
    gap: 10px;
  }
  .is-authed .app-nav .navbar-brand { margin: 0 0 6px; padding: 4px 8px; }
  .is-authed .app-nav .navbar-collapse {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    gap: 6px;
    margin-inline: -4px;
    padding-inline: 4px;
  }
  .is-authed .app-nav .navbar-nav { flex-direction: column !important; flex-wrap: nowrap !important; gap: 2px; margin: 0 !important; }
  .is-authed .app-nav .navbar-nav.me-auto { flex: 0 0 auto; }
  .is-authed .app-nav .navbar-nav.nav-utility { margin-top: auto !important; padding-top: 10px; border-top: 1px solid var(--line); }
  .is-authed .app-nav .nav-item { margin: 0 !important; }
  .is-authed .content-wrap, .is-authed footer.app-footer { margin-inline-start: var(--rail-w); }
  .is-authed .tabbar, .is-authed .sheet-scrim { display: none !important; }
}

@media (max-width: 991.98px) {
  .is-authed .app-nav { position: static; height: 0; }
  .is-authed .app-nav .navbar { padding: 0; min-height: 0; }
  .is-authed .app-nav .navbar-brand,
  .is-authed .app-nav .navbar-toggler { display: none !important; }
  .is-authed .app-nav .navbar-collapse {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1046;
    max-height: calc(100dvh - var(--safe-top) - 40px);
    height: auto !important;
    background: var(--surface);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: var(--depth-3);
    padding: 0 12px calc(16px + var(--safe-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateY(105%);
    visibility: hidden;
    transition: transform .42s var(--ease-sheet), visibility 0s linear .42s;
  }
  .sheet-open .app-nav .navbar-collapse {
    transform: translateY(0);
    visibility: visible;
    transition: transform .42s var(--ease-sheet), visibility 0s;
  }
  .is-authed .sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface);
    padding: 10px 4px 8px;
    margin: 0 -4px;
  }
  .sheet-head::before {
    content: "";
    position: absolute;
    top: 6px; left: 50%;
    width: 38px; height: 5px;
    margin-left: -19px;
    border-radius: 3px;
    background: rgba(20, 22, 27, .18);
  }
  .sheet-title { font-size: 1.25rem; font-weight: 750; letter-spacing: -.015em; margin: 14px 8px 0; }
  .sheet-close {
    margin-top: 12px;
    border: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--ink);
    display: grid; place-items: center;
  }
  .is-authed .app-nav .navbar-nav { flex-direction: column; gap: 2px; margin: 0 !important; }
  .is-authed .app-nav .navbar-nav.me-auto {
    background: var(--surface-2);
    border-radius: var(--r-md);
    padding: 6px;
    margin-bottom: 12px !important;
  }
  .is-authed .app-nav .navbar-nav.nav-utility { background: var(--surface-2); border-radius: var(--r-md); padding: 6px; }
  .is-authed .app-nav .navbar-nav .nav-link { min-height: 48px; }
  body.sheet-open { overflow: hidden; }
}

/* scrim behind sheets */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 1045;
  background: rgba(20, 22, 27, .32);
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease-out), visibility 0s linear .3s;
}
.sheet-open .sheet-scrim { opacity: 1; visibility: visible; transition: opacity .3s var(--ease-out), visibility 0s; }

/* ---------------------------------------------------------------------
   Shell: app bar
   --------------------------------------------------------------------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  height: calc(var(--appbar-h) + var(--safe-top));
  padding: var(--safe-top) 12px 0;
  background: var(--ground);
  transition: box-shadow .25s var(--ease-out), background-color .25s var(--ease-out);
}
.appbar.is-scrolled { background: rgba(238, 240, 243, .96); box-shadow: 0 1px 0 var(--line); }
.appbar-lead { display: flex; align-items: center; min-width: 0; }
.appbar-brand img { height: 30px; width: auto; display: block; }
.appbar-title {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
}
.appbar.show-title .appbar-title { opacity: 1; transform: none; }
.appbar-actions { display: flex; flex-direction: row !important; align-items: center; justify-content: flex-end; gap: 4px; margin: 0; padding: 0; list-style: none; }
.appbar-actions .nav-item { margin: 0 !important; }
.appbar-actions .nav-link {
  width: 44px; height: 44px;
  padding: 0 !important;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink) !important;
  transform: none !important;
}
.appbar-actions .nav-link:hover { background: rgba(20, 22, 27, .06); }
.appbar-actions .nav-link .bi { font-size: 1.25rem !important; }
.appbar-actions .nav-link .badge { top: 8px !important; font-size: .625rem !important; padding: 3px 5px; border: 2px solid var(--ground); }
.appbar-actions .dropdown-menu { margin-top: 6px !important; }
@media (min-width: 992px) {
  .appbar { padding-inline: 28px; height: 64px; }
  .appbar-brand { display: none; }
}
@media (max-width: 575.98px) {
  .appbar-actions .dropdown-menu {
    position: fixed !important;
    inset: auto 8px calc(8px + var(--safe-bottom)) 8px !important;
    transform: none !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: 70dvh;
    overflow-y: auto;
    border-radius: var(--r-lg) !important;
  }
  .appbar-actions .dropdown-menu .text-truncate { max-width: calc(100vw - 64px) !important; }
}

/* ---------------------------------------------------------------------
   Shell: bottom tab bar (phones and tablets)
   --------------------------------------------------------------------- */
.tabbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1030;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: stretch;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 6px 8px var(--safe-bottom);
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--line);
}
.tabbar .tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px !important;
  gap: 3px;
  min-height: 48px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  transition: color .2s var(--ease-out), transform .12s var(--ease-out);
}
.tabbar .tab .bi { font-size: 1.375rem; line-height: 1; }
.tabbar .tab[aria-current="page"], .tabbar .tab.is-open { color: var(--ink); }
.tabbar .tab:active { transform: scale(.94); }
.tabbar .tab-primary .tab-disc {
  width: 44px; height: 34px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--brass);
  box-shadow: var(--depth-1);
}
.tabbar .tab-primary .tab-disc .bi { font-size: 1.25rem; }
.tabbar .tab-primary { color: var(--ink); }
.tab-indicator {
  position: absolute;
  top: 0;
  height: 3px;
  width: 28px;
  border-radius: 0 0 3px 3px;
  background: var(--ink);
  left: 0;
  transform: translateX(var(--ind-x, -100px));
  transition: transform .5s var(--ease-out);
}
[dir="rtl"] .tab-indicator { left: auto; right: 0; transform: translateX(calc(var(--ind-x, -100px) * -1)); }
@media (max-width: 991.98px) {
  .is-authed .content-wrap { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); }
  .is-authed footer.app-footer { display: none !important; }
}

/* ---------------------------------------------------------------------
   Components
   --------------------------------------------------------------------- */
/* cards: white passes with honest edges */
.card {
  --bs-card-border-width: 0;
  --bs-card-border-radius: var(--r-md);
  --bs-card-inner-border-radius: var(--r-md);
  --bs-card-cap-bg: transparent;
  --bs-card-bg: var(--surface);
  border: 0 !important;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--depth-1) !important;
  transition: box-shadow .2s var(--ease-out), transform .15s var(--ease-out);
  transform: none;
}
.card:hover { transform: none; }
a.card:hover { box-shadow: var(--depth-2) !important; }
a.card:active { transform: scale(.985); }
.card .card { box-shadow: var(--depth-0) !important; }
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: var(--r-md) var(--r-md) 0 0 !important;
  color: var(--ink);
  font-weight: 650;
  padding: 14px 18px;
}
.card-header.bg-primary, .card-header.bg-dark { background: var(--ink) !important; color: #fff; }
.card-header.bg-success { background: var(--ok) !important; color: #fff; }
.card-header.bg-danger { background: var(--bad) !important; color: #fff; }
.card-header.bg-info { background: var(--info) !important; color: #fff; }
.card-header.bg-warning { background: #F2DDA6 !important; color: var(--ink); }
.card-body { padding: 18px; }
.card-footer { background: transparent; border-top: 1px solid var(--line); padding: 12px 18px; }
.shadow, .shadow-sm, .shadow-lg { box-shadow: var(--depth-1) !important; }

/* buttons */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 12px;
  --bs-btn-padding-x: 1.1rem;
  --bs-btn-padding-y: .5625rem;
  --bs-btn-font-size: .9375rem;
  --bs-btn-border-radius-sm: 9px;
  --bs-btn-border-radius-lg: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  letter-spacing: -.003em;
  box-shadow: none;
  transform: none;
  filter: none;
  transition: background-color .18s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out), transform .12s var(--ease-out);
}
.btn .bi { margin: 0 !important; }
.btn:hover { transform: none; filter: none; }
.btn:active { transform: scale(.97); }
.btn-sm { --bs-btn-padding-y: .375rem; --bs-btn-padding-x: .75rem; --bs-btn-font-size: .8438rem; }
.btn-lg { --bs-btn-padding-y: .8125rem; --bs-btn-font-size: 1.0313rem; }
.btn-link { --bs-btn-color: var(--ink); --bs-btn-hover-color: var(--sens-management); }
.btn-primary, .btn-dark {
  --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-color: #fff;
  --bs-btn-hover-bg: #2A2E37; --bs-btn-hover-border-color: #2A2E37; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #000; --bs-btn-active-border-color: #000;
  --bs-btn-disabled-bg: #6B707B; --bs-btn-disabled-border-color: #6B707B;
  background: var(--bs-btn-bg); border: 1px solid var(--bs-btn-border-color); box-shadow: none;
}
.btn-primary:hover, .btn-dark:hover { background: var(--bs-btn-hover-bg); box-shadow: none; }
.btn-secondary {
  --bs-btn-bg: #E3E5EA; --bs-btn-border-color: #E3E5EA; --bs-btn-color: var(--ink);
  --bs-btn-hover-bg: #D7DAE0; --bs-btn-hover-border-color: #D7DAE0; --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: #CBCFD6; --bs-btn-active-color: var(--ink);
  background: var(--bs-btn-bg); color: var(--ink); border: 1px solid var(--bs-btn-border-color);
}
.btn-secondary:hover { background: var(--bs-btn-hover-bg); color: var(--ink); }
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--surface-2); --bs-btn-color: var(--ink); }
.btn-success { --bs-btn-bg: var(--ok); --bs-btn-border-color: var(--ok); --bs-btn-hover-bg: #186340; --bs-btn-hover-border-color: #186340; --bs-btn-active-bg: #124E32; }
.btn-danger { --bs-btn-bg: var(--bad); --bs-btn-border-color: var(--bad); --bs-btn-hover-bg: #951F18; --bs-btn-hover-border-color: #951F18; --bs-btn-active-bg: #7E1B15; }
.btn-info { --bs-btn-bg: var(--info); --bs-btn-border-color: var(--info); --bs-btn-color: #fff; --bs-btn-hover-bg: #174C73; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #174C73; }
.btn-warning { --bs-btn-bg: #E3B341; --bs-btn-border-color: #E3B341; --bs-btn-color: var(--ink); --bs-btn-hover-bg: #D6A22B; --bs-btn-hover-border-color: #D6A22B; }
.btn-outline-primary, .btn-outline-dark, .btn-outline-secondary {
  --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #000; --bs-btn-active-border-color: #000;
  background: var(--surface);
}
.btn-outline-primary:hover, .btn-outline-dark:hover, .btn-outline-secondary:hover { background: var(--ink); }
.btn-outline-success { --bs-btn-color: var(--ok); --bs-btn-border-color: rgba(31, 122, 77, .45); --bs-btn-hover-bg: var(--ok); --bs-btn-hover-border-color: var(--ok); background: var(--surface); }
.btn-outline-danger { --bs-btn-color: var(--bad); --bs-btn-border-color: rgba(179, 38, 30, .4); --bs-btn-hover-bg: var(--bad); --bs-btn-hover-border-color: var(--bad); background: var(--surface); }
.btn-outline-info { --bs-btn-color: var(--info); --bs-btn-border-color: rgba(31, 94, 140, .4); --bs-btn-hover-bg: var(--info); --bs-btn-hover-border-color: var(--info); --bs-btn-hover-color: #fff; background: var(--surface); }
.btn-outline-warning { --bs-btn-color: var(--warn); --bs-btn-border-color: rgba(154, 103, 0, .45); --bs-btn-hover-bg: #E3B341; --bs-btn-hover-border-color: #E3B341; --bs-btn-hover-color: var(--ink); background: var(--surface); }
.btn-outline-light { --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--ink); }
.btn-close { border-radius: 50%; }
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .btn-group-sm > .btn, .table .btn-sm { min-height: 34px; }
}

/* forms */
.form-control, .form-select {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: .625rem .875rem;
  background-color: var(--surface);
  color: var(--ink);
  font-weight: 450;
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.form-select { padding-inline-end: 2.25rem; }
.form-control:focus, .form-select:focus { border-color: var(--ink); background-color: var(--surface); }
.form-control::placeholder { color: var(--faint); opacity: 1; }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--surface-2); color: var(--muted); }
.form-control-sm, .form-select-sm { border-radius: 9px; padding: .375rem .625rem; }
.form-label, label { font-weight: 600; font-size: .875rem; color: var(--ink-2); margin-bottom: 6px; }
.form-text { color: var(--muted); font-size: .8125rem; }
.form-check-input { border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.form-switch .form-check-input { width: 2.6em; height: 1.5em; margin-top: 0; }
.form-switch .form-check-input:checked { background-color: var(--ok); border-color: var(--ok); }
.input-group-text { background: var(--surface-2); border-color: var(--line-strong); border-radius: 12px; color: var(--muted); }
.is-invalid, .form-control.is-invalid { border-color: var(--bad) !important; }
.invalid-feedback, .field-validation-error, .text-danger { color: var(--bad) !important; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 1.1rem; }
@media (max-width: 767.98px) {
  .form-control, .form-select { font-size: 16px; min-height: 48px; }
  .form-control-sm, .form-select-sm { min-height: 40px; font-size: 15px; }
  textarea.form-control { min-height: 96px; }
}

/* tables: inset lists on a card */
.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(20, 22, 27, .025);
  --bs-table-striped-bg: rgba(20, 22, 27, .02);
  --bs-table-border-color: var(--line);
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  margin-bottom: 0;
  color: var(--ink);
}
.table > :not(caption) > * > * { padding: 12px 14px; border-bottom-color: var(--line); }
.table.table-sm > :not(caption) > * > * { padding: 9px 12px; }
.table thead th, .table > thead > tr > th, .table .table-light th, .table .table-dark th {
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .02em;
  text-transform: none;
  border-bottom: 1px solid var(--line) !important;
  border-top: 0;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}
.table tbody tr { transition: background-color .15s var(--ease-out); transform: none !important; }
.table tbody tr:hover { transform: none; }
.table tbody tr:last-child > * { border-bottom: 0; }
main > .table, main .col > .table, main .row > [class*="col"] > .table,
main > .table-responsive, main .tab-pane > .table-responsive, main .tab-pane > .table {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--depth-1);
  overflow: hidden;
}
.table-responsive { border-radius: inherit; }

/* Stacked tables on phones (class added by app-native.js). */
@media (max-width: 767.98px) {
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack thead { display: none; }
  .table-stack tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack > tbody > tr > td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 3px 0 !important;
    border: 0 !important;
    text-align: end;
    white-space: normal !important;
    min-height: 0;
  }
  .table-stack > tbody > tr > td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 45%;
    color: var(--muted);
    font-size: .8125rem;
    font-weight: 550;
    text-align: start;
  }
  .table-stack > tbody > tr > td:first-child {
    font-weight: 650;
    font-size: 1rem;
    padding-bottom: 6px !important;
  }
  .table-stack > tbody > tr > td[data-label=""]::before,
  .table-stack > tbody > tr > td.stack-full::before { content: none; }
  .table-stack > tbody > tr > td.stack-full { justify-content: center; text-align: center; }
  .table-stack > tbody > tr > td:has(> .btn, > .btn-group, > form, > .d-flex > .btn) { justify-content: flex-end; padding-top: 8px !important; }
  .table-responsive:has(> .table-stack) { overflow: visible; }
}

/* badges & pills */
.badge {
  border-radius: var(--r-pill);
  font-weight: 650;
  font-size: .75rem;
  padding: .3em .7em;
  letter-spacing: .005em;
}
.badge.bg-light, .badge.text-bg-light { background: #E4E6EB !important; color: var(--ink) !important; }
.badge.bg-secondary, .badge.text-bg-secondary { background: #D9DCE2 !important; color: var(--ink) !important; }
.badge.bg-warning, .badge.text-bg-warning { background: #F2DDA6 !important; color: #4A3300 !important; }
.badge.bg-info, .badge.text-bg-info { background: #D5E6F2 !important; color: #123B5C !important; }
.badge.bg-success, .badge.text-bg-success { background: var(--ok) !important; color: #fff !important; }
.badge.bg-danger, .badge.text-bg-danger { background: var(--bad) !important; color: #fff !important; }
.badge.bg-primary, .badge.bg-dark, .badge.text-bg-primary, .badge.text-bg-dark { background: var(--ink) !important; color: #fff !important; }

/* alerts: calm banners, no side stripes */
.alert {
  border: 0 !important;
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-weight: 500;
  box-shadow: var(--depth-0);
  background-image: none !important;
}
.alert-success { background: #E1F0E8 !important; color: #145233 !important; }
.alert-danger { background: #F8E3E1 !important; color: #7E1B15 !important; }
.alert-warning { background: #F7ECD2 !important; color: #5A3D00 !important; }
.alert-info, .alert-primary, .alert-secondary, .alert-light { background: #E6EAF1 !important; color: var(--ink) !important; }
.alert .btn-close { padding: 18px; }

/* dropdowns (outside the nav) as floating sheets */
.dropdown-menu {
  --bs-dropdown-border-radius: var(--r-md);
  --bs-dropdown-link-active-bg: var(--ink);
  border: 0;
  border-radius: var(--r-md);
  box-shadow: var(--depth-3);
  padding: 6px;
  margin-top: 6px;
  background: var(--surface);
}
.dropdown-item {
  border-radius: 9px;
  padding: 9px 12px;
  font-weight: 500;
  color: var(--ink);
  transform: none !important;
  transition: background-color .15s var(--ease-out);
}
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-2); color: var(--ink); }
.dropdown-item.active, .dropdown-item:active { background: var(--ink); color: #fff; }
.dropdown-header { color: var(--muted); font-weight: 650; font-size: .75rem; }

/* nav tabs & pills as segmented controls */
.nav-tabs {
  border: 0;
  gap: 2px;
  background: #E3E5EA;
  padding: 3px;
  border-radius: 12px;
  display: inline-flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.nav-tabs .nav-link {
  border: 0 !important;
  border-radius: 9px;
  color: var(--ink-2);
  font-weight: 600;
  font-size: .875rem;
  padding: 7px 14px;
  white-space: nowrap;
  background: transparent;
  transition: background-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.nav-tabs .nav-link.active { background: var(--surface) !important; color: var(--ink) !important; box-shadow: var(--depth-1); }
.nav-pills .nav-link { border-radius: var(--r-pill); color: var(--ink-2); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--ink); color: #fff; }

/* list groups: inset grouped lists */
.list-group {
  --bs-list-group-border-color: var(--line);
  --bs-list-group-border-radius: var(--r-md);
  --bs-list-group-active-bg: var(--ink);
  --bs-list-group-active-border-color: var(--ink);
  box-shadow: var(--depth-1);
  border-radius: var(--r-md);
}
.list-group-flush { box-shadow: none; }
.list-group-item { border-inline: 0; padding: 13px 16px; }
.list-group-item:first-child { border-top: 0; }
.list-group-item:last-child { border-bottom: 0; }
.list-group-item-action:active { background: var(--surface-2); }

/* pagination */
.pagination { gap: 4px; --bs-pagination-border-width: 0; }
.page-link { border-radius: 10px !important; color: var(--ink); background: var(--surface); box-shadow: var(--depth-0); min-width: 40px; text-align: center; font-weight: 600; }
.page-item.active .page-link { background: var(--ink); color: #fff; }
.page-item.disabled .page-link { background: transparent; color: var(--faint); box-shadow: none; }

/* breadcrumbs */
.breadcrumb { font-size: .8125rem; margin-bottom: 8px; }
.breadcrumb-item a { color: var(--muted); text-decoration: none; }
.breadcrumb-item.active { color: var(--ink); }

/* progress */
.progress { background: #E3E5EA; border-radius: var(--r-pill); height: 8px; }
.progress-bar { background: var(--ink); }

/* modals: bottom sheets on phones */
.modal-content { border: 0; border-radius: var(--r-lg); box-shadow: var(--depth-3); }
.modal-header { border-bottom: 1px solid var(--line); padding: 16px 20px; }
.modal-footer { border-top: 1px solid var(--line); padding: 12px 20px; }
.modal-title { font-weight: 700; letter-spacing: -.012em; }
.modal-backdrop.show { opacity: .32; background: var(--ink); }
@media (max-width: 575.98px) {
  .modal-dialog { margin: 0; min-height: 100%; display: flex; align-items: flex-end; max-width: none; }
  .modal-dialog-centered, .modal-dialog-scrollable { min-height: 100%; }
  .modal-content { border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: calc(100dvh - 48px); padding-bottom: var(--safe-bottom); }
  .modal.fade .modal-dialog { transform: translateY(100%); transition: transform .42s var(--ease-sheet); }
  .modal.show .modal-dialog { transform: none; }
}

/* offcanvas & toasts */
.offcanvas { border: 0 !important; box-shadow: var(--depth-3); }
.offcanvas-bottom { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.toast { border: 0; border-radius: var(--r-md); box-shadow: var(--depth-3); }

/* utilities that carried the old look */
.bg-light { background-color: var(--surface-2) !important; }
.bg-white { background-color: var(--surface) !important; }
.text-primary { color: var(--ink) !important; }
.text-success { color: var(--ok) !important; }
.text-info { color: var(--info) !important; }
.text-warning { color: var(--warn) !important; }
.border { border-color: var(--line-strong) !important; }
.rounded { border-radius: var(--r-sm) !important; }
.rounded-3, .rounded-4 { border-radius: var(--r-md) !important; }

/* ---------------------------------------------------------------------
   Clearance Wallet: passes (DMS)
   --------------------------------------------------------------------- */
.wallet-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.wallet-head .large-title { margin: 0; }
.wallet-head .head-actions { display: flex; gap: 8px; }

/* The clearance pass: the ink card you carry, pinned on top of the wallet */
.clearance {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px 20px 16px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), var(--depth-2);
  margin-bottom: 16px;
  overflow: hidden;
}
.clearance-top { display: flex; align-items: center; gap: 10px; }
.clearance-chip {
  width: 34px; height: 26px;
  border-radius: 6px;
  background: var(--brass);
  box-shadow: none;
}
.clearance-brand { font-size: .8125rem; font-weight: 650; color: var(--brass); letter-spacing: .01em; }
.clearance-name { font-size: 1.3125rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
.clearance-meta { color: rgba(255, 255, 255, .72); font-size: .875rem; }
.clearance-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.clearance-level { font-size: 1.0625rem; font-weight: 700; }
.clearance-flag { font-size: .75rem; font-weight: 650; color: var(--brass); border: 1px solid rgba(201, 162, 74, .5); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.clearance-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.clearance-scale span { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.clearance-scale span.on:nth-child(1) { background: var(--sens-general); }
.clearance-scale span.on:nth-child(2) { background: #4FA59F; }
.clearance-scale span.on:nth-child(3) { background: #6F84D6; }
.clearance-scale span.on:nth-child(4) { background: var(--brass); }

/* Category passes: header band (name + figure), body (tier + mark) */
.wallet { display: flex; flex-direction: column; margin-bottom: 28px; }
.pass {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 148px;
  border-radius: var(--r-lg);
  text-decoration: none;
  color: #fff;
  background: var(--pass-bg, var(--ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 -1px 0 rgba(20, 22, 27, .22), var(--depth-1);
  overflow: hidden;
  transition: transform .32s var(--ease-out), box-shadow .32s var(--ease-out);
}
.pass + .pass { margin-top: -86px; }
.pass-band { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 12px 18px; }
.pass-name { font-size: 1rem; font-weight: 700; letter-spacing: -.008em; }
.pass-fig { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.pass-count { font-size: 1.75rem; font-weight: 750; letter-spacing: -.025em; line-height: 1; }
.pass-unit { font-size: .8125rem; font-weight: 600; opacity: .82; }
.pass-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex: 1; padding: 0 18px 16px; }
.pass-tier { display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 600; opacity: .88; }
.pass-open { display: inline-flex; align-items: center; gap: 2px; font-size: .8125rem; font-weight: 650; opacity: .9; }
.pass-foil { font-size: .6875rem; font-weight: 750; letter-spacing: .08em; color: var(--brass); border: 1px solid rgba(201, 162, 74, .55); border-radius: 6px; padding: 3px 8px; }
a.pass:hover { color: #fff; transform: translateY(-6px); }
a.pass:active { transform: translateY(-2px) scale(.99); }
a.pass:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.pass--general { --pass-bg: var(--sens-general); color: var(--sens-general-ink); }
a.pass--general:hover { color: var(--sens-general-ink); }
.pass--operational { --pass-bg: var(--sens-operational); }
.pass--management { --pass-bg: var(--sens-management); }
.pass--board { --pass-bg: var(--sens-board); }
.pass--board .pass-count { color: var(--brass); }
.pass.is-empty .pass-count { opacity: .7; }
.pass.is-locked { background: repeating-linear-gradient(135deg, rgba(255,255,255,0) 0 10px, rgba(255,255,255,.05) 10px 11px), var(--pass-bg); cursor: not-allowed; }
.pass.is-locked .pass-fig { gap: 6px; font-weight: 650; }
.pass.is-locked .pass-fig .bi { font-size: .9375rem; }
@media (min-width: 992px) {
  .wallet { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .pass + .pass { margin-top: 0; }
  .pass { min-height: 164px; }
  .pass-count { font-size: 2rem; }
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 10px; }
.section-head h2, .section-head .h2 { font-size: 1.25rem; margin: 0; }
.section-head a { font-size: .875rem; font-weight: 600; text-decoration: none; }

.activity { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--depth-1); overflow: hidden; margin: 0; padding: 0; list-style: none; }
.activity li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.activity .act-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.activity .act-icon.is-denied { background: #F8E3E1; color: var(--bad); }
.activity .act-main { min-width: 0; }
.activity .act-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity .act-sub { color: var(--muted); font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity .act-time { color: var(--muted); font-size: .8125rem; text-align: end; white-space: nowrap; }
.empty-invite { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty-invite .bi { font-size: 1.75rem; color: var(--faint); display: block; margin-bottom: 6px; }

/* ---------------------------------------------------------------------
   Login & unauthenticated pages keep the frame quiet
   --------------------------------------------------------------------- */
.auth-page .app-nav .navbar { background: transparent !important; }
.auth-page { background: var(--ground); }

/* ---------------------------------------------------------------------
   Motion preferences
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------------------------------------------------------------------
   Assistant ("Do things by typing") joins the world and clears the tab bar
   --------------------------------------------------------------------- */
body #asstBar { right: auto; inset-inline-end: 20px; }
body .asst-fab {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-pill);
  box-shadow: var(--depth-2);
  min-height: 48px;
  padding: 10px 18px;
}
body .asst-fab .bi { color: var(--brass); }
body .asst-fab:hover { filter: none; background: #2A2E37; }
body .asst-head { background: var(--ink); }
body .asst-panel { border: 0; border-radius: var(--r-lg); box-shadow: var(--depth-3); }
body .asst-body { background: var(--surface-2); }
body .asst-hint code { background: #E4E6EB; color: var(--ink); }
@media (max-width: 991.98px) {
  .is-authed #asstBar { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px); inset-inline-end: 14px; }
  .is-authed .asst-fab { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .is-authed .asst-fab .asst-fab-txt { display: none; }
  .sheet-open #asstBar { display: none; }
}

/* Sensitivity badges: the same pale-to-deep axis as the passes */
.badge.badge-sens { color: #fff; }
.badge.badge-sens--general { background: var(--sens-general); color: var(--sens-general-ink); }
.badge.badge-sens--operational { background: var(--sens-operational); }
.badge.badge-sens--management { background: var(--sens-management); }
.badge.badge-sens--board { background: var(--sens-board); color: var(--brass); box-shadow: inset 0 0 0 1px rgba(201, 162, 74, .5); }
.card:has(.table), .card:has(.list-group-flush) { overflow: hidden; }

/* ---------------------------------------------------------------------
   Review fixes: raised Upload, de-duplicated sheet, assistant in the bar,
   phone document list
   --------------------------------------------------------------------- */
.tabbar .tab-primary .tab-disc {
  width: 54px; height: 54px;
  border-radius: 18px;
  transform: translateY(-14px);
  margin-bottom: -14px;
  box-shadow: 0 0 0 4px var(--surface), var(--depth-2);
}
.tabbar .tab-primary .tab-disc .bi { font-size: 1.5rem; }
.tabbar .tab-primary:active .tab-disc { transform: translateY(-14px) scale(.94); }

@media (max-width: 991.98px) {
  .app-nav .nav-in-tabbar { display: none !important; }
  .is-authed .asst-fab { display: none !important; }
  .is-authed .asst-panel { position: fixed; inset-inline: 8px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px); width: auto; max-width: none; }
}
@media (min-width: 992px) {
  .is-authed footer.app-footer { padding-bottom: 88px !important; }
}

.doc-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--depth-1); overflow: hidden; }
.doc-list li + li { border-top: 1px solid var(--line); }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; color: var(--ink) !important; text-decoration: none; min-height: 64px; transition: background-color .15s var(--ease-out); }
.doc-row:active { background: var(--surface-2); }
.doc-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.doc-title { font-weight: 650; font-size: 1rem; line-height: 1.3; }
.doc-desc { color: var(--muted); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: .8125rem; margin-top: 4px; }
.doc-chevron { color: var(--faint); flex: 0 0 auto; }
[dir="rtl"] .doc-chevron { transform: scaleX(-1); }

/* Header band reads as its own strip of the pass at every width */
.pass-band { background: rgba(0, 0, 0, .10); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.pass--general .pass-band { background: rgba(20, 22, 27, .06); border-bottom-color: rgba(20, 22, 27, .06); }
.pass-body { padding-top: 14px; }

/* The assistant opens from the app bar at every width; the panel drops from it */
.is-authed .asst-fab { display: none !important; }
@media (min-width: 992px) {
  .is-authed #asstBar { bottom: auto; top: 0; inset-inline-end: 0; }
  .is-authed .asst-panel { position: fixed; top: 60px; bottom: auto; inset-inline-end: 24px; }
  .is-authed footer.app-footer { padding-bottom: 16px !important; }
}

/* ---------------------------------------------------------------------
   Ask the Repository: chat, composer, dictation, attachments
   --------------------------------------------------------------------- */
.chat-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-meta span { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); box-shadow: var(--depth-0); border-radius: var(--r-pill); padding: 5px 12px; font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.chat-meta .bi { color: var(--muted); }

.chat-card { position: relative; display: flex; flex-direction: column; overflow: hidden; }
.chat-log { min-height: 300px; max-height: 58vh; overflow-y: auto; padding: 18px 18px 6px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 991.98px) { .chat-log { max-height: none; min-height: calc(100dvh - 430px); } }
.chat-empty { margin: auto; text-align: center; color: var(--muted); padding: 24px 8px; max-width: 520px; }
.chat-empty > .bi { font-size: 2rem; color: var(--faint); display: block; margin-bottom: 10px; }
.chat-suggest { display: inline-block; margin: 6px 3px 0; border: 0; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: var(--depth-0); color: var(--ink); font-size: .875rem; font-weight: 550; padding: 7px 14px; }
.chat-suggest:hover { background: #E4E6EB; }

.msg { display: flex; }
.msg-user { justify-content: flex-end; }
.msg-bubble { max-width: min(80%, 680px); padding: 10px 14px; border-radius: 18px; line-height: 1.5; overflow-wrap: anywhere; }
.msg-user .msg-bubble { background: var(--ink); color: #fff; border-end-end-radius: 6px; }
.msg-assistant .msg-bubble { background: var(--surface-2); color: var(--ink); box-shadow: var(--depth-0); border-end-start-radius: 6px; }
.msg-bubble.is-error { background: #F8E3E1; color: #7E1B15; box-shadow: none; }
.msg .cite { display: inline-block; background: #E4E6EB; color: var(--ink); border-radius: 6px; padding: 0 6px; font-size: .8125rem; font-weight: 600; }
.msg-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .8125rem; }
.msg-sources > span { color: var(--muted); font-weight: 600; margin-inline-end: 2px; }
.msg-sources a { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); box-shadow: var(--depth-0); border-radius: var(--r-pill); padding: 3px 10px; color: var(--ink) !important; text-decoration: none; font-weight: 600; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-files span { display: inline-flex; align-items: center; gap: 5px; background: rgba(255, 255, 255, .12); border-radius: 8px; padding: 3px 8px; font-size: .8125rem; }
.msg-files .bi { color: var(--brass); }
.msg-note { margin-top: 8px; font-size: .8125rem; color: var(--warn); display: flex; gap: 6px; align-items: center; }

.composer { border-top: 1px solid var(--line); padding: 10px 12px 12px; background: var(--surface); }
.composer-row { display: flex; align-items: flex-end; gap: 6px; background: var(--surface-2); border-radius: 24px; padding: 5px; box-shadow: var(--depth-0); transition: box-shadow .18s var(--ease-out); }
.composer-row:focus-within { box-shadow: 0 0 0 1.5px var(--ink); }
.cmp-input { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; padding: 9px 6px; font-size: 1rem; line-height: 1.4; color: var(--ink); max-height: 160px; outline: 0; }
.cmp-input::placeholder { color: var(--faint); }
.cmp-input:focus-visible { outline: 0; }
.cmp-btn, .cmp-send { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 1.15rem; transition: background-color .18s var(--ease-out), color .18s var(--ease-out), transform .12s var(--ease-out); }
.cmp-btn { background: transparent; color: var(--ink-2); }
.cmp-btn:hover:not(:disabled) { background: rgba(20, 22, 27, .07); }
.cmp-btn:disabled { color: var(--faint); opacity: .6; }
.cmp-btn.is-on { color: var(--ink); }
.cmp-send { background: var(--ink); color: #fff; }
.cmp-send:hover:not(:disabled) { background: #2A2E37; }
.cmp-send:disabled { background: #6B707B; }
.cmp-btn:active:not(:disabled), .cmp-send:active:not(:disabled) { transform: scale(.92); }
@media (pointer: coarse) { .cmp-btn, .cmp-send { width: 44px; height: 44px; } }

/* dictation: the mic turns ink with a brass pulse while listening */
.cmp-btn.is-listening { background: var(--ink); color: var(--brass); animation: mic-pulse 1.4s var(--ease-out) infinite; }
@keyframes mic-pulse { 0% { box-shadow: 0 0 0 0 rgba(201, 162, 74, .55); } 100% { box-shadow: 0 0 0 12px rgba(201, 162, 74, 0); } }
.mic-status { min-height: 0; font-size: .8125rem; color: var(--muted); padding: 6px 8px 0; display: flex; align-items: center; gap: 8px; }
.mic-status:empty { padding: 0; }
.mic-status.is-warn { color: var(--bad); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: rec-blink 1s steps(2, start) infinite; }
@keyframes rec-blink { to { visibility: hidden; } }

.attach-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 8px; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: var(--surface); box-shadow: var(--depth-1); border-radius: 12px; padding: 5px 4px 5px 10px; font-size: .8438rem; }
.attach-chip .bi:first-child { color: var(--ink-2); }
.attach-chip .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.attach-chip .sz { color: var(--muted); font-size: .75rem; }
.attach-chip button { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.attach-chip button:hover { background: var(--surface-2); color: var(--ink); }

.drop-hint { position: absolute; inset: 8px; z-index: 3; display: none; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--ink); border-radius: var(--r-md); background: rgba(238, 240, 243, .94); font-weight: 650; color: var(--ink); pointer-events: none; }
.chat-card.is-dragging .drop-hint { display: flex; }
@media (prefers-reduced-motion: reduce) { .cmp-btn.is-listening, .rec-dot { animation: none; } }
@media (max-width: 991.98px) {
  .chat-card { overflow: visible; }
  .chat-log { min-height: 240px; }
  .composer {
    position: sticky;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom));
    z-index: 5;
    border-radius: 0 0 var(--r-md) var(--r-md);
    box-shadow: 0 -8px 16px -12px rgba(20, 22, 27, .25);
  }
}
.msg .li { display: inline-block; padding-inline-start: 14px; position: relative; }
.msg .li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
