/* =====================================================================================
   Site-wide design system layer. Loaded after site_new.css (and before app.css in the app),
   so it evens out what older page styles and Bootstrap 5.1 defaults left inconsistent:
   one colour scheme, one control size scale, readable colours (WCAG AA), tabs, tables, cards.
   ===================================================================================== */

:root {
  /* One palette for Bootstrap utilities too (bg-primary, text-success, badges...).
     Bootstrap's own blue (#0d6efd) no longer mixes with the app's indigo. */
  --bs-primary: #4F46E5;   --bs-primary-rgb: 79, 70, 229;
  --bs-success: #047857;   --bs-success-rgb: 4, 120, 87;
  --bs-info: #0E7490;      --bs-info-rgb: 14, 116, 144;
  --bs-warning: #D97706;   --bs-warning-rgb: 217, 119, 6;
  --bs-danger: #DC2626;    --bs-danger-rgb: 220, 38, 38;
  --bs-secondary: #64748B; --bs-secondary-rgb: 100, 116, 139;

  /* Control size scale */
  --ctl-h-sm: 32px;
  --ctl-h: 38px;
  --ctl-h-lg: 44px;
  --ctl-radius: 0.625rem;
  --focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.22);
}

/* ---------- Buttons ------------------------------------------------------------------ */
.btn {
  min-height: var(--ctl-h);
  padding: 0.4375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid transparent;
  border-radius: var(--ctl-radius);
  gap: 0.5rem;
  box-shadow: none;
}
.btn-sm { min-height: var(--ctl-h-sm); padding: 0.3125rem 0.625rem; font-size: 0.8125rem; border-radius: 0.5rem; gap: 0.375rem; }
.btn-lg { min-height: var(--ctl-h-lg); padding: 0.625rem 1.125rem; font-size: 0.9375rem; }
/* Icons sit in the button's gap; the old me-1/me-2 margins would double the space. */
.btn > i, .btn > .bi, .btn > svg { font-size: 1em; margin-left: 0 !important; margin-right: 0 !important; flex: none; }
.btn:focus, .btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.btn:disabled, .btn.disabled { opacity: 0.55; }

.btn-primary { background: #4F46E5; border-color: #4F46E5; color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: #4338CA; border-color: #4338CA; color: #fff; }
.btn-success { background: #047857; border-color: #047857; color: #fff; }
.btn-success:hover, .btn-success:focus { background: #065F46; border-color: #065F46; color: #fff; }
.btn-danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.btn-danger:hover, .btn-danger:focus { background: #B91C1C; border-color: #B91C1C; color: #fff; }
.btn-info { background: #0E7490; border-color: #0E7490; color: #fff; }
.btn-info:hover, .btn-info:focus { background: #155E75; border-color: #155E75; color: #fff; }
/* Amber with white text is unreadable; warning actions (mostly "Edit") use a soft amber. */
.btn-warning { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
.btn-warning:hover, .btn-warning:focus { background: #FDE68A; border-color: #F59E0B; color: #78350F; }
.btn-secondary { background: #64748B; border-color: #64748B; color: #fff; }
.btn-secondary:hover, .btn-secondary:focus { background: #475569; border-color: #475569; color: #fff; }
.btn-light { background: #F1F5F9; border-color: #E2E8F0; color: #334155; }
.btn-light:hover { background: #E2E8F0; color: #1E293B; }

.btn-outline-primary { background: #fff; border-color: #C7D2FE; color: #4F46E5; }
.btn-outline-primary:hover, .btn-outline-primary:focus { background: #EEF2FF; border-color: #A5B4FC; color: #4338CA; }
.btn-outline-success { background: #fff; border-color: #A7F3D0; color: #047857; }
.btn-outline-success:hover, .btn-outline-success:focus { background: #ECFDF5; border-color: #6EE7B7; color: #065F46; }
.btn-outline-danger { background: #fff; border-color: #FECACA; color: #B91C1C; }
.btn-outline-danger:hover, .btn-outline-danger:focus { background: #FEF2F2; border-color: #FCA5A5; color: #991B1B; }
.btn-outline-warning { background: #fff; border-color: #FDE68A; color: #B45309; }
.btn-outline-warning:hover, .btn-outline-warning:focus { background: #FFFBEB; border-color: #FCD34D; color: #92400E; }
.btn-outline-info { background: #fff; border-color: #A5F3FC; color: #0E7490; }
.btn-outline-info:hover, .btn-outline-info:focus { background: #ECFEFF; border-color: #67E8F9; color: #155E75; }
.btn-outline-secondary { background: #fff; border-color: #E2E8F0; color: #334155; }
.btn-outline-secondary:hover, .btn-outline-secondary:focus { background: #F8FAFC; border-color: #CBD5E1; color: #0F172A; }
/* On coloured backgrounds (home page hero and call-to-action). */
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, 0.7); color: #fff; }
.btn-outline-light:hover, .btn-outline-light:focus { background: rgba(255, 255, 255, 0.15); border-color: #fff; color: #fff; }
.btn-outline-dark { background: #fff; border-color: #CBD5E1; color: #1E293B; }
.btn-outline-dark:hover { background: #1E293B; border-color: #1E293B; color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: #64748B; }
.btn-ghost:hover { background: #F1F5F9; color: #1E293B; }

/* Icon-only buttons (table row actions): square, the same size everywhere. */
.btn-icon, .table .btn-sm.rounded-circle { width: var(--ctl-h-sm); min-width: var(--ctl-h-sm); height: var(--ctl-h-sm); min-height: var(--ctl-h-sm); padding: 0; border-radius: 0.5rem !important; }

/* Tile buttons (dashboard quick actions: btn ... flex-column): neutral tile, coloured icon. */
.btn.flex-column {
  min-height: 72px; padding: 0.75rem !important; gap: 0.375rem;
  background: #fff; border-color: var(--border-color, #E2E8F0); color: #1E293B; font-weight: 600;
}
.btn.flex-column > i { font-size: 1.125rem !important; margin: 0 !important; }
.btn.flex-column:hover { background: #F8FAFC; border-color: #CBD5E1; color: #0F172A; transform: translateY(-1px); }
.btn-outline-primary.flex-column > i { color: #4F46E5; }
.btn-outline-success.flex-column > i { color: #047857; }
.btn-outline-info.flex-column > i { color: #0E7490; }
.btn-outline-warning.flex-column > i { color: #D97706; }
.btn-outline-danger.flex-column > i { color: #DC2626; }
.btn-outline-secondary.flex-column > i { color: #64748B; }

/* An icon inside a button in an empty state must not take the big empty-state icon size. */
.empty-state .btn i { font-size: 1em; margin: 0; opacity: 1; display: inline-block; }

/* ---------- Tabs and pills (inside pages; the top navbar has its own styles) ------------ */
.nav-pills { gap: 0.25rem; }
.nav-pills .nav-link {
  height: auto; margin: 0; padding: 0.4375rem 0.875rem; border: 0; border-radius: var(--ctl-radius);
  font-size: 0.875rem; font-weight: 600; color: #64748B; background: transparent;
}
.nav-pills .nav-link:hover { color: #1E293B; background: #F1F5F9; }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { color: #fff; background: #4F46E5; }
.nav-tabs .nav-link { height: auto; margin-right: 0.25rem; padding: 0.625rem 0.875rem; font-size: 0.875rem; font-weight: 600; }
.nav-tabs .nav-link .badge, .nav-pills .nav-link .badge { margin-left: 0.25rem; }

/* ---------- Cards ---------------------------------------------------------------------- */
.card-header { padding: 0.875rem 1.25rem; }
.card-header h5, .card-header .h5 { font-size: 1rem; font-weight: 600; }
/* Solid coloured headers (bg-primary, bg-success, ...) next to each other looked loud and the
   cyan/amber ones were hard to read. They become white headers with a coloured top accent. */
.card-header.bg-primary   { --hdr: #4F46E5; }
.card-header.bg-success   { --hdr: #047857; }
.card-header.bg-info      { --hdr: #0E7490; }
.card-header.bg-warning   { --hdr: #D97706; }
.card-header.bg-danger    { --hdr: #DC2626; }
.card-header.bg-secondary { --hdr: #64748B; }
.card-header.bg-dark      { --hdr: #1E293B; }
.card-header:is(.bg-primary, .bg-success, .bg-info, .bg-warning, .bg-danger, .bg-secondary, .bg-dark) {
  background: #fff !important; color: #1E293B !important;
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  box-shadow: inset 0 3px 0 var(--hdr);
}
.card-header:is(.bg-primary, .bg-success, .bg-info, .bg-warning, .bg-danger, .bg-secondary, .bg-dark) :is(h1, h2, h3, h4, h5, h6, .h5, span, small, p, div):not(.badge):not(.btn) {
  color: inherit !important;
}
.card-header:is(.bg-primary, .bg-success, .bg-info, .bg-warning, .bg-danger, .bg-secondary, .bg-dark) :is(h1, h2, h3, h4, h5, h6, .h5) > i {
  color: var(--hdr) !important;
}
.card-header.bg-light { background: #F8FAFC !important; }

/* ---------- Tables --------------------------------------------------------------------- */
/* Bootstrap 5.1 draws the divider under a table section in the text colour (a black line). */
.table > :not(:last-child) > :last-child > * { border-bottom-color: var(--border-color, #E2E8F0); }
/* site_new.css resets the last row with "border-bottom: none", which turns the cells' inherited
   border colour into the text colour: a dark line under every table. The card edge is enough. */
.table > tbody > tr:last-child > * { border-bottom-color: transparent; }
.table { --bs-table-hover-bg: #F8FAFC; }

/* ---------- Forms ---------------------------------------------------------------------- */
.form-control, .form-select { min-height: var(--ctl-h); border-radius: var(--ctl-radius); }
.form-control-sm, .form-select-sm { min-height: var(--ctl-h-sm); }
textarea.form-control { min-height: 0; }
.form-control-lg, .form-select-lg { min-height: var(--ctl-h-lg); }
.form-control:focus, .form-select:focus, .form-check-input:focus { box-shadow: var(--focus-ring); border-color: #818CF8; }
.form-check-input:checked { background-color: #4F46E5; border-color: #4F46E5; }
.form-label { font-weight: 600; color: #334155; }

/* ---------- Badges ---------------------------------------------------------------------- */
.badge.bg-warning, .badge.bg-warning.text-dark { color: #92400E !important; background-color: #FEF3C7 !important; }
.badge.bg-info { color: #fff; }

/* ---------- Top navbar: one line, icons always shown -------------------------------------
   js/site.js (fitNavbar) picks the roomiest layout that fits at the current width / browser zoom:
   nav-roomy = normal spacing; default = compact spacing; if even that does not fit, the last menu items
   move into a "More" dropdown. Help, profile, password and Logout live in the account dropdown. */
.navbar .navbar-nav .nav-link { white-space: nowrap; }
@media (min-width: 992px) {
  .navbar .navbar-nav.me-auto .nav-link { padding: 0.5rem 0.55rem !important; margin: 0; font-size: 0.84rem; }
  .navbar .navbar-nav.me-auto .nav-link i { margin-right: 0.3rem !important; }
  .navbar.nav-roomy .navbar-nav.me-auto .nav-link { padding: 0.5rem 0.875rem !important; font-size: 0.875rem; }
  .navbar.nav-roomy .navbar-nav.me-auto .nav-link i { margin-right: 0.5rem !important; }
  .navbar .nav-more-item.d-none { display: none !important; }
}
.navbar .nav-overflowed { display: none !important; }
.navbar .nav-more .dropdown-menu { min-width: 200px; }
.navbar .nav-more .dropdown-item i { width: 18px; margin-right: 0.5rem; text-align: center; color: var(--text-secondary, #64748B); }
.navbar .nav-more .dropdown-item.active { background: var(--primary-soft, #EEF2FF); color: #4338CA; }
.navbar.nav-measuring .nav-link, .navbar.nav-measuring .navbar-brand { transition: none !important; }

/* ---------- Page loading: progress bar, skeleton, page entry (js/page-loader.js) -------- */
.pl-bar {
  position: fixed; top: 0; left: 0; z-index: 2000; height: 3px; width: 0;
  background: linear-gradient(90deg, #6366F1, #4F46E5); box-shadow: 0 0 8px rgba(79, 70, 229, 0.5);
  border-radius: 0 3px 3px 0; pointer-events: none;
}
.pl-bar.go { width: 82%; transition: width 2.4s cubic-bezier(0.1, 0.7, 0.2, 1); }

.pl-skeleton {
  position: fixed; left: 0; right: 0; z-index: 1020; overflow: hidden;
  background: #F8FAFC; animation: pl-fade-in 0.18s ease-out both;
}
.pl-skeleton-inner { max-width: 1320px; margin: 0 auto; padding: 1.5rem; }
.sk {
  border-radius: 8px;
  background: linear-gradient(90deg, #ECEFF5 25%, #F5F7FB 40%, #ECEFF5 60%);
  background-size: 300% 100%;
  animation: pl-shimmer 1.3s ease-in-out infinite;
}
.sk-line { height: 12px; margin: 8px 0; }
.sk-sm { height: 9px; }
.sk-title { height: 22px; width: 42%; margin-bottom: 10px; }
.sk-btn { width: 120px; height: 38px; border-radius: 10px; flex: none; }
.sk-btn-primary { background: linear-gradient(90deg, #E0E3FF 25%, #EEF0FF 40%, #E0E3FF 60%); background-size: 300% 100%; }
.sk-circle { width: 38px; height: 38px; border-radius: 50%; flex: none; }
.sk-avatar { width: 80px; height: 80px; border-radius: 50%; margin: 4px auto 0; }
.sk-pill { width: 72px; height: 20px; border-radius: 999px; flex: none; }
.sk-input { height: 38px; border-radius: 10px; }
.sk-head { display: flex; align-items: center; gap: 16px; margin-bottom: 1.25rem; }
.sk-grow { flex: 1; min-width: 0; }
.sk-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 16px; padding: 1.25rem; margin-bottom: 1rem; }
.sk-narrow { max-width: 760px; }
.sk-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #F1F5F9; }
.sk-row:last-child { border-bottom: 0; }
.sk-field { margin-bottom: 14px; }
.sk-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.sk-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.sk-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.sk-stat { margin-bottom: 0; }
@media (min-width: 992px) {
  .sk-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .sk-cols.sk-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sk-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
}
@keyframes pl-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes pl-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* The new page fades in (opacity only: a transform would move fixed elements inside main). */
body > main { animation: pl-fade-in 0.2s ease-out both; }

/* Smooth page changes in browsers that support cross-document view transitions: the bars stay,
   the content cross-fades with a small lift. Older browsers simply get the fade above. */
@view-transition { navigation: auto; }
body > header .navbar { view-transition-name: site-navbar; }
::view-transition-old(root) { animation: 0.16s ease-out both pl-vt-out; }
::view-transition-new(root) { animation: 0.24s ease-out both pl-vt-in; }
@keyframes pl-vt-out { to { opacity: 0; } }
@keyframes pl-vt-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  .sk, body > main, .pl-skeleton { animation: none; }
  .pl-bar.go { transition: none; }
  @view-transition { navigation: none; }
}

/* ---------- Laptops and big screens ----------------------------------------------------
   Website only (the app shell has its own layout). Page content and the navbar content share
   one readable width and sit centred on very wide monitors; the bars themselves stay full width. */
:root {
  --page-max: 1680px;
  /* Slate 400 / 500 text fell below 4.5:1 on white and on the tinted page background. */
  --text-secondary: #526071;
  --text-muted: #5B6B80;
  --bs-secondary: #566579;  --bs-secondary-rgb: 86, 101, 121;
}
html:not(.app-mode) body > main {
  width: 100%;
  max-width: calc(var(--page-max) + 2rem);
  margin-left: auto;
  margin-right: auto;
}
html:not(.app-mode) .navbar > .container-fluid {
  max-width: calc(var(--page-max) + 2rem);
  margin-left: auto;
  margin-right: auto;
}
/* Lists that were written with a coloured h2 title look like the other pages' page titles. */
html:not(.app-mode) h2.mb-0:is(.text-success, .text-info, .text-warning, .text-primary) {
  color: var(--text-primary) !important;
  font-size: 1.5rem;
  font-weight: 600;
}
html:not(.app-mode) h2.mb-0:is(.text-success, .text-info, .text-warning, .text-primary) > i { color: var(--bs-primary); }
/* Green initials badges (inline colours) need a darker green to be readable. */
.avatar[style*="#059669"] { color: #047857 !important; }
/* Action buttons next to a page title keep their label on one line and their size. */
html:not(.app-mode) .d-flex.justify-content-between > .btn,
html:not(.app-mode) .d-flex.justify-content-between > a.btn { flex: none; white-space: nowrap; }
.avatar[style*="#D97706"] { color: #B45309 !important; }
/* Row action buttons (Edit / Set password / Remove) stay in one row on desktop widths. */
@media (min-width: 992px) {
  html:not(.app-mode) td[data-label="Actions"] .d-flex.flex-wrap { flex-wrap: nowrap !important; }
  html:not(.app-mode) td[data-label="Actions"] .btn { white-space: nowrap; }
}
/* Toggle buttons (Regular patient / Guest) and active outline buttons use the palette's indigo, not Bootstrap's blue. */
.btn-check:checked + .btn-outline-primary, .btn-check:active + .btn-outline-primary,
.btn-outline-primary:active, .btn-outline-primary.active { background: #4F46E5; border-color: #4F46E5; color: #fff; }
/* Columns that can wait: dropped between tablet and small laptop widths so row actions stay visible. */
@media (min-width: 768px) and (max-width: 1279.98px) {
  html:not(.app-mode) .col-wide-only { display: none; }
}
/* Prescription designer on small laptops: slimmer side panels so the 504px page canvas still fits. */
@media (min-width: 1001px) and (max-width: 1199.98px) {
  html:not(.app-mode) main .designer { grid-template-columns: 190px minmax(0, 1fr) 220px; }
}
/* Sign in / Register paint their own full-width backdrop, so they are not capped. */
html:not(.app-mode) body > main:has(> .auth-page) { max-width: none; }

/* Short explanation under a receptionist right (Receptionist/Form, MyPermissions): sits under the label, not beside it. */
.perm-help { margin: -0.25rem 0 0.75rem 1.5em; font-size: 0.8rem; color: #6b7280; }

/* ---- List pagination (wwwroot/js/list-pager.js) ---- */
.lp-hide { display: none !important; }
.list-pager {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: .6rem 1rem; padding: .85rem 1rem .75rem; border-top: 1px solid #e2e8f0;
}
.list-pager[hidden] { display: none !important; }
.list-pager .lp-info { font-size: .85rem; color: #475569; }
.list-pager-top { display: flex; justify-content: flex-end; padding: .6rem 1rem 0; }
.list-pager-top[hidden], .lp-filter-cell[hidden] { display: none !important; }
/* Card lists (doctors, my records): no rule under the cards, and room between the cards and the pager. */
.list-pager.lp-cards { border-top: 0; margin-top: 1.5rem; padding-top: 0; }
.list-pager-top .lp-size, .list-pager .lp-size { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .85rem; color: #475569; }
.lp-size select { width: auto; min-width: 4.5rem; }
.list-pager .lp-pages { flex-wrap: wrap; gap: 2px; }
.list-pager .lp-pages .page-link { min-width: 2.1rem; text-align: center; border-radius: 6px; }
@media (max-width: 575.98px) {
    .list-pager { flex-direction: column; align-items: stretch; text-align: center; }
    .list-pager .lp-size, .list-pager .lp-pages { justify-content: center; }
    .list-pager .lp-pages .page-link { min-width: 2.4rem; padding: .4rem .6rem; }
}
@media print { .list-pager, .list-pager-top { display: none !important; } .lp-hide { display: revert !important; } }

/* Accessibility: "Skip to content" link, hidden until it receives keyboard focus. */
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 3000;
  padding: 8px 14px;
  border-radius: 6px;
  background: #1e1b4b;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.skip-link, .skip-link:link, .skip-link:visited, .skip-link:hover { color: #fff !important; }
.skip-link:focus { top: 8px; outline: 2px solid #fff; outline-offset: 2px; }
main#main:focus { outline: none; }

/* Appointment display states: Past due is computed, No show is stored. */
.status-pastdue { background: #FEF3C7; color: #92400E; }
.status-noshow { background: #E5E7EB; color: #991B1B; }

/* The floating AI assistant button (56px, bottom right) must not cover the last row's actions:
   leave room under the page content so the last rows can scroll clear of it. */
html:not(.app-mode) body:has(.hca-widget) > main { padding-bottom: 5.5rem; }
.lp-filter-cell .lp-size { display: flex; align-items: center; gap: .5rem; margin: 0; flex-wrap: nowrap; white-space: nowrap; font-size: .85rem; }
.lp-filter-cell .lp-size span { font-size: .85rem; }
@media (max-width: 575.98px) { .lp-filter-cell { width: 100%; } .lp-filter-cell .lp-size { justify-content: flex-end; } }

/* Calendar: "+N more" button and its popup (all appointments of the day) */
.calendar-cell .more-btn { border: 0; background: transparent; padding: 1px 4px; font-size: .78rem; color: #4F46E5; cursor: pointer; border-radius: 4px; font-weight: 600; }
.calendar-cell .more-btn:hover, .calendar-cell .more-btn[aria-expanded="true"] { background: #EEF2FF; }
.day-popover { position: fixed; z-index: 3500; width: 300px; max-width: calc(100vw - 16px); max-height: 60vh; overflow: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 23, 42, .22); }
.day-popover[hidden] { display: none; }
.day-popover-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .8rem; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; background: #fff; }
.day-popover-close { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: #475569; }
.day-popover-close:hover { background: #f1f5f9; }
.day-popover-body { padding: .35rem; }
.day-popover .more-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem; border-radius: 8px; text-decoration: none; color: #1e293b; font-size: .85rem; }
.day-popover .more-row:hover, .day-popover .more-row:focus { background: #f1f5f9; outline: none; }
.day-popover .more-time { flex: 0 0 4.6rem; font-variant-numeric: tabular-nums; color: #475569; }
.day-popover .more-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ---- Searchable dropdowns (wwwroot/js/searchable-select.js) ---- */
.ss { position: relative; }
.ss .ss-native { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.ss .ss-btn { width: 100%; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 2.25rem; }
.ss .ss-btn.ss-placeholder { color: #64748b; }
.ss .ss-btn:disabled { background-color: #e9ecef; cursor: not-allowed; }
.ss .ss-native.is-invalid ~ .ss-btn { border-color: #dc3545; }
.ss-panel { position: fixed; left: 0; top: 0; min-width: 100%; width: max-content; max-width: min(28rem, 92vw); z-index: 3600; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 16px 40px rgba(15, 23, 42, .2); }
.ss-panel[hidden] { display: none; }
.ss-search-wrap { padding: .5rem; border-bottom: 1px solid #e2e8f0; }
.ss-list { max-height: 17rem; overflow: auto; margin: 0; padding: .25rem; list-style: none; }
.ss-list li[role="option"] { padding: .5rem .65rem; border-radius: 6px; cursor: pointer; font-size: .9rem; color: #1e293b; }
.ss-list li.active { background: #EEF2FF; }
.ss-list li[aria-selected="true"] { font-weight: 600; color: #4338CA; }
.ss-list li.ss-group { padding: .45rem .65rem .2rem; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; color: #64748b; font-weight: 700; }
.ss-empty { padding: .75rem; text-align: center; color: #64748b; font-size: .85rem; }
@media (max-width: 575.98px) { .ss-list li[role="option"] { padding: .7rem .75rem; } .ss-panel { min-width: 100%; } }

/* Phones (website): action buttons with a name next to the icon, wrapping instead of running off the card */
@media (max-width: 575.98px) {
    html:not(.app-mode) .table td .btn-group, html:not(.app-mode) .table td .d-flex { flex-wrap: wrap; gap: 6px; }
    html:not(.app-mode) .table td .btn-group > .btn { border-radius: 8px !important; margin: 0 !important; }
    html:not(.app-mode) .btn.has-web-label { display: inline-flex; align-items: center; gap: 6px; padding-left: 12px; padding-right: 12px; min-height: 36px; }
    html:not(.app-mode) .web-btn-label { font-size: .8rem; font-weight: 600; }
}
