/*
 * BookCentral UI v18 foundation
 *
 * This file is intentionally loaded after legacy page styles. New features should
 * consume these tokens and shared component rules instead of adding page-specific
 * button, field, surface, or spacing values. Agency Display Settings continue to
 * own --brand, --ui-accent, --ui-font-family, and --base-font-size.
 */
:root {
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-space-7: 32px;
  --ui-space-8: 40px;
  --ui-page-gutter: clamp(18px, 2.1vw, 32px);
  --ui-surface-padding: clamp(18px, 1.7vw, 24px);
  --ui-control-height: 40px;
  --ui-control-padding-x: 14px;
  --ui-control-radius: 8px;
  --ui-surface-radius: 12px;
  --ui-panel-border: color-mix(in srgb, var(--line-strong) 76%, transparent);
  --ui-panel-bg: color-mix(in srgb, var(--paper) 98%, transparent);
  --ui-subtle-bg: color-mix(in srgb, var(--bg) 64%, var(--paper));
  --ui-hover-bg: color-mix(in srgb, var(--soft) 62%, var(--paper));
  --ui-focus: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
  --ui-elevation: 0 1px 2px rgba(18, 38, 52, .035), 0 8px 24px rgba(18, 38, 52, .045);
  --ui-elevation-raised: 0 1px 2px rgba(18, 38, 52, .05), 0 14px 34px rgba(18, 38, 52, .08);
}

:root[data-theme=dark] {
  --ui-panel-border: color-mix(in srgb, var(--line-strong) 82%, transparent);
  --ui-panel-bg: color-mix(in srgb, var(--paper) 98%, transparent);
  --ui-subtle-bg: color-mix(in srgb, var(--bg) 66%, var(--paper));
  --ui-hover-bg: color-mix(in srgb, var(--soft) 72%, var(--paper));
  --ui-elevation: 0 1px 2px rgba(0, 0, 0, .14), 0 10px 26px rgba(0, 0, 0, .12);
  --ui-elevation-raised: 0 1px 2px rgba(0, 0, 0, .18), 0 16px 38px rgba(0, 0, 0, .2);
}

*, *::before, *::after { box-sizing: border-box; }
html { text-rendering: optimizeLegibility; }
body { min-width: 0; }
button, input, select, textarea { letter-spacing: inherit; }

/* App frame and predictable page gutters */
.content {
  width: 100%;
  max-width: none;
  padding: var(--ui-space-6) var(--ui-page-gutter) var(--ui-space-8);
}
.content > :first-child { margin-top: 0; }
.content > :last-child { margin-bottom: 0; }
.topbar { padding-inline: var(--ui-page-gutter); }
.topbar-title, .top-actions, .top-search { min-width: 0; }
.app-footer { padding-inline: var(--ui-page-gutter); }

/* Shared surfaces. Keep shadows quiet and let information density lead. */
:where(.panel, .page-intro, .hero, .metrics article, .card-link, .mail-layout, .calendar-grid, .library-template-card, .library-category-card) {
  border: 1px solid var(--ui-panel-border);
  border-radius: var(--ui-surface-radius);
  background: var(--ui-panel-bg);
  box-shadow: var(--ui-elevation);
}
.panel { min-width: 0; }
.panel-head, .page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-4);
}
.panel-head {
  min-height: 68px;
  padding: var(--ui-space-4) var(--ui-surface-padding);
}
.page-intro { margin-bottom: var(--ui-space-5); padding: var(--ui-surface-padding); }
.page-intro :where(h1, h2, h3, p), .panel-head :where(h1, h2, h3, p) { max-width: 76ch; }
.panel-note, .queue { padding-inline: var(--ui-surface-padding); }
.panel > :where(p, ul, ol):not([class]) { margin-inline: var(--ui-surface-padding); }

/* One button language across links, forms, panels, dialogs, and command bars. */
:where(
  .button-link,
  .secondary-button,
  .top-actions button,
  .global-actions button,
  .global-icon-link,
  .calendar-commandbar button,
  .mail-commandbar button,
  .mail-actions button,
  .mail-link-panel button,
  .mail-inline-form button,
  .dialog-actions button,
  .display-settings-actions button,
  .panel button:not(.library-card-actions button):not(.editor-toolbar button):not(.profile-photo-trigger)
) {
  min-height: var(--ui-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ui-space-2);
  margin: 0;
  padding: 9px var(--ui-control-padding-x);
  border: 1px solid var(--ui-panel-border);
  border-radius: var(--ui-control-radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
  font: inherit;
  font-size: .92em;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}
:where(
  .button-link,
  .secondary-button,
  .top-actions button,
  .global-actions button,
  .global-icon-link,
  .calendar-commandbar button,
  .mail-commandbar button,
  .mail-actions button,
  .mail-link-panel button,
  .mail-inline-form button,
  .dialog-actions button,
  .display-settings-actions button,
  .panel button:not(.library-card-actions button):not(.editor-toolbar button):not(.profile-photo-trigger)
):hover {
  border-color: color-mix(in srgb, var(--brand) 44%, var(--ui-panel-border));
  background: var(--ui-hover-bg);
  color: var(--brand-strong);
  transform: none;
}
:where(button, .button-link, a, input, select, textarea, summary):focus-visible {
  outline: none;
  box-shadow: var(--ui-focus);
}
.primary {
  border-color: var(--brand) !important;
  background: var(--brand) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.primary:hover { border-color: var(--brand-hover) !important; background: var(--brand-hover) !important; color: #fff !important; }
.danger-button { border-color: color-mix(in srgb, var(--danger) 48%, var(--line)) !important; background: color-mix(in srgb, var(--danger) 7%, var(--paper)) !important; color: var(--danger) !important; }
.danger-button:hover { border-color: var(--danger) !important; background: color-mix(in srgb, var(--danger) 13%, var(--paper)) !important; }

:where(.form-actions, .dialog-actions, .mail-compose-actions, .email-compose-footer, .media-actions, .library-card-actions, .section-title-action, .calendar-actions, .calendar-nav, .mail-commandbar, .top-actions, .global-actions) {
  display: flex;
  align-items: center;
  gap: var(--ui-space-3);
}
:where(.form-actions, .dialog-actions, .mail-compose-actions, .email-compose-footer, .media-actions, .section-title-action, .calendar-actions, .mail-commandbar) { flex-wrap: wrap; }
:where(.form-actions, .dialog-actions, .mail-compose-actions, .email-compose-footer) form { margin: 0; }

.group-mail-recipient-summary {
  display: flex;
  align-items: center;
  gap: var(--ui-space-3);
  margin: 0 var(--ui-surface-padding) var(--ui-space-4);
  padding: var(--ui-space-3) var(--ui-space-4);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: var(--ui-control-radius);
  background: color-mix(in srgb, var(--brand) 7%, var(--paper));
}
.group-mail-recipient-summary span { color: var(--muted); }
.group-email-dialog { width: min(940px, calc(100% - 32px)); }
.group-email-form .rich-editor { min-height: 330px; }
.trip-email-recipient-line { gap: 8px; }
.trip-email-recipient-list { display: flex; flex-wrap: wrap; gap: 8px; }
.trip-email-recipient-list > div { display: contents; }
.trip-email-recipient-list > div > div { display: inline-flex; max-width: 100%; }
.trip-email-recipient-list label { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; margin: 0; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--soft); font-weight: 700; cursor: pointer; }
.trip-email-recipient-list label:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 48%, var(--line-strong)); background: color-mix(in srgb, var(--brand) 10%, var(--paper)); }
.trip-email-recipient-list label:has(input:not(:checked)) { opacity: .56; text-decoration: line-through; }
.trip-email-recipient-list input { width: auto !important; margin: 0; }
@media (max-width: 720px) {
  .group-mail-recipient-summary { align-items: flex-start; flex-direction: column; }
}

.dashboard-priority { align-self: start; }
.dashboard-priority-heading { padding: var(--ui-surface-padding); border-bottom: 1px solid var(--line); }
.dashboard-priority-heading h3 { margin: 5px 0; }
.dashboard-priority-heading > p:last-child { margin: 0; color: var(--muted); }
.priority-section { padding: var(--ui-space-4) var(--ui-surface-padding); border-bottom: 1px solid var(--line); }
.priority-section:last-child { border-bottom: 0; }
.priority-section > header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ui-space-3); margin-bottom: var(--ui-space-3); }
.priority-section > header div { display: grid; gap: 2px; min-width: 0; }
.priority-section > header span { color: var(--muted); font-size: .8rem; }
.priority-section > header a { flex: 0 0 auto; color: var(--brand); font-size: .8rem; font-weight: 800; text-decoration: none; }
.priority-items { display: grid; gap: var(--ui-space-2); }
.priority-item { display: flex; align-items: center; justify-content: space-between; gap: var(--ui-space-3); min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--ui-control-radius); background: var(--paper); color: var(--ink); text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.priority-item:hover { border-color: color-mix(in srgb, var(--brand) 48%, var(--line)); background: color-mix(in srgb, var(--brand) 5%, var(--paper)); }
.priority-item > span:first-child { display: grid; gap: 3px; min-width: 0; }
.priority-item strong, .priority-item small { overflow-wrap: anywhere; }
.priority-item small { color: var(--muted); line-height: 1.35; }
.priority-item-meta { display: grid; flex: 0 0 auto; gap: 3px; max-width: 46%; text-align: right; }
.priority-item-meta b { color: var(--ink); }
.priority-date { font-weight: 750; }
.priority-date.priority-overdue { color: var(--danger); }
.priority-date.priority-today { color: var(--brand); }
.priority-empty { margin: 0; padding: 9px 0; color: var(--muted); font-size: .86rem; }
@media (max-width: 720px) {
  .priority-item { align-items: flex-start; }
  .priority-item-meta { max-width: 42%; }
}

/* Inputs align with buttons and never sit flush against their containers. */
:where(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), select, textarea) {
  width: 100%;
  min-height: var(--ui-control-height);
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--ui-control-radius);
  background: var(--field);
  color: var(--ink);
  line-height: 1.35;
  outline: none;
}
:where(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), select, textarea):focus {
  border-color: var(--brand);
  box-shadow: var(--ui-focus);
}
textarea { min-height: 112px; }
.form-grid { gap: var(--ui-space-5); padding: var(--ui-surface-padding); }
.form-panel > .form-grid { margin: 0; }
.form-panel > .panel-head + .form-grid { padding-top: var(--ui-space-5); }
.form-grid > div, .form-grid > label { min-width: 0; }
.form-grid label, .field > label { display: block; margin-bottom: 6px; font-weight: 700; }
.helptext, .form-grid small, .field small { display: block; margin-top: 6px; color: var(--muted); }
.errorlist { margin: 6px 0 0; padding-left: 18px; color: var(--danger); }

/* Rich editors share the same protected inset and visual hierarchy as forms. */
.rich-editor { min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--ui-control-radius); background: var(--field); }
.editor-toolbar, .editor-tabs { min-height: 44px; padding: 6px 9px; gap: 4px; }
.editor-toolbar button { min-width: 32px; min-height: 32px; margin: 0; padding: 5px 7px; border-radius: 6px; }
.editor-visual { min-height: 260px; padding: var(--ui-space-4); }

/* Tables keep readable cells and use a scroll frame only when space requires it. */
.table-scroll, .panel:has(> table) { max-width: 100%; overflow-x: auto; scrollbar-gutter: stable; }
table { min-width: 100%; }
th { padding: 11px var(--ui-space-4); }
td { padding: 13px var(--ui-space-4); }
th:first-child, td:first-child { padding-left: var(--ui-surface-padding); }
th:last-child, td:last-child { padding-right: var(--ui-surface-padding); }
.inline-status-form select { margin: 0; }

/* Empty states always retain breathing room around the primary action. */
.empty-state, .empty.document-library-empty {
  width: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--ui-space-3);
  padding: var(--ui-space-7) var(--ui-surface-padding);
  text-align: center;
}
.empty-state :where(h2, h3, p), .empty.document-library-empty :where(h2, h3, p) { margin: 0; }
.empty-state p, .empty.document-library-empty p { max-width: 62ch; color: var(--muted); }
.empty-state .button-link { margin-top: var(--ui-space-1); }

/* Library inherits the same page boundary and component spacing. */
.library-hero, .library-layout { margin-inline: 0; }
.library-hero { margin-bottom: var(--ui-space-5); padding: var(--ui-surface-padding); }
.library-layout { gap: var(--ui-space-5); }
.library-navigation { padding: var(--ui-space-3); }
.library-results { min-width: 0; }
.library-results-head { margin: 0 0 var(--ui-space-4); padding: var(--ui-space-4) var(--ui-surface-padding); border: 1px solid var(--ui-panel-border); border-radius: var(--ui-surface-radius); background: var(--ui-panel-bg); box-shadow: var(--ui-elevation); }
.library-category-grid, .library-card-grid { gap: var(--ui-space-4); }
.library-template-card { overflow: hidden; }
.library-template-copy { padding: var(--ui-space-5); }
.library-card-actions { min-height: 54px; padding: 10px var(--ui-space-5); border-top: 1px solid var(--line); }
.library-card-actions :where(a, button) { min-height: 32px; display: inline-flex; align-items: center; padding: 4px 0; }
.library-template-form { padding: var(--ui-surface-padding); }
.library-template-form > .form-actions { margin-top: var(--ui-space-6); padding-top: var(--ui-space-5); }

/* Document libraries use readable cards at every desktop width. Long supplier
   filenames must wrap inside their tile instead of colliding with neighbors. */
.document-library-panel { overflow: hidden; }
.document-library-panel > .trip-document-grid,
.inline-document-library > .trip-document-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--ui-space-4);
  padding: var(--ui-surface-padding);
}
.trip-document-card {
  min-width: 0;
  gap: var(--ui-space-3);
  padding: var(--ui-space-4);
  overflow: hidden;
}
.trip-document-open,
.document-preview-button {
  width: 100%;
  min-width: 0;
  align-items: start;
  justify-content: start;
  white-space: normal !important;
  text-align: left;
}
.document-preview-button {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.trip-document-open strong {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}
.trip-document-icon { flex: 0 0 auto; }
.trip-document-card > small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-card-actions {
  align-items: center;
  gap: var(--ui-space-2);
  padding-top: var(--ui-space-3);
}
.document-card-actions > a,
.document-card-actions > button,
.document-card-actions > form > button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 6px 9px !important;
  border: 1px solid var(--ui-panel-border) !important;
  border-radius: 7px;
  background: var(--paper) !important;
  line-height: 1.2;
  white-space: nowrap;
}
.document-card-actions > form { margin: 0; }
.document-card-actions .document-delete-link {
  border-color: color-mix(in srgb, var(--danger) 36%, var(--ui-panel-border)) !important;
  border-radius: 7px !important;
  background: color-mix(in srgb, var(--danger) 5%, var(--paper)) !important;
  color: var(--danger) !important;
}
.document-preview-loading {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  font-weight: 700;
}
.document-preview-fallback { max-width: 520px; padding: var(--ui-space-7); }

/* Dialogs and email surfaces */
:where(.app-dialog, .profile-photo-dialog, .document-viewer-dialog, dialog) {
  max-width: calc(100vw - (var(--ui-page-gutter) * 2));
  max-height: calc(100vh - (var(--ui-page-gutter) * 2));
  border: 1px solid var(--ui-panel-border);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--ui-elevation-raised);
}
.document-viewer-dialog > header,
.document-viewer-dialog > footer { padding: var(--ui-space-4) var(--ui-surface-padding); }
.document-viewer-dialog {
  position: fixed !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  width: min(1120px, calc(100vw - 48px)) !important;
  height: calc(100vh - 48px) !important;
  height: calc(100dvh - 48px) !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  transform: translate(-50%, -50%);
  overflow: hidden;
}
.document-viewer-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.document-viewer-content {
  min-height: 0;
  height: auto;
  overflow: hidden;
  padding: var(--ui-space-4);
}
@media (max-width: 720px) {
  .document-viewer-dialog {
    width: calc(100vw - 24px) !important;
    height: calc(100vh - 24px) !important;
    height: calc(100dvh - 24px) !important;
  }
  .document-viewer-content { padding: var(--ui-space-2); }
}
.dialog-head { min-height: 68px; padding: var(--ui-space-4) var(--ui-surface-padding); }
.app-dialog > .form-grid, .app-dialog > form:not([class]) { padding: var(--ui-surface-padding); }
.dialog-actions, .email-compose-footer { padding: var(--ui-space-4) var(--ui-surface-padding); }
.mail-commandbar, .calendar-commandbar { margin-bottom: var(--ui-space-4); }
.mail-commandbar { align-items: center; }
.mail-search {
  min-width: 280px;
  flex: 1 1 420px;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0 !important;
}
.mail-search input:not([type=hidden]) { min-width: 0; border-radius: var(--ui-control-radius) 0 0 var(--ui-control-radius); }
.mail-search button { min-width: 76px; border-left: 0; border-radius: 0 var(--ui-control-radius) var(--ui-control-radius) 0; }
.mail-layout { min-width: 0; }
.mail-folders { padding: var(--ui-space-4) var(--ui-space-3); }
.mail-reader > header { padding: var(--ui-surface-padding); }
.mail-actions { padding: 10px var(--ui-surface-padding); }
.mail-inline-form, .mail-link-panel { padding: var(--ui-space-4) var(--ui-surface-padding); }

/* UI Designer remains the source of truth for branding and gains v18 spacing. */
.display-settings-form { gap: var(--ui-space-5); }
.display-theme-grid { gap: var(--ui-space-5); }
.display-theme-fields { gap: var(--ui-space-4); padding: var(--ui-surface-padding); }
.display-preview { margin: 0 var(--ui-surface-padding) var(--ui-surface-padding); padding: var(--ui-surface-padding); }
.display-settings-actions { bottom: var(--ui-space-3); padding: var(--ui-space-4) var(--ui-surface-padding); border-radius: var(--ui-surface-radius); }
.display-theme-card[data-theme-preview=light] { border-color: #dce4ea; background: #fff; color: #172330; }
.display-theme-card[data-theme-preview=light] .panel-head { border-color: #dce4ea; background: #fff; }
.display-theme-card[data-theme-preview=light] :where(h3, label) { color: #172330; }
.display-theme-card[data-theme-preview=light] .muted { color: #687787; }
.display-theme-card[data-theme-preview=light] :where(select, input:not([type=color])) { border-color: #c8d2dc; background: #fff; color: #172330; }
.display-theme-card[data-theme-preview=light] .color-field { border-color: #c8d2dc; background: #fff; }
.display-theme-card[data-theme-preview=light] .color-field output { color: #687787; }
.display-theme-card[data-theme-preview=dark] { border-color: #30414e; background: #18242f; color: #edf3f7; }
.display-theme-card[data-theme-preview=dark] .panel-head { border-color: #30414e; background: #18242f; }
.display-theme-card[data-theme-preview=dark] :where(h3, label) { color: #edf3f7; }
.display-theme-card[data-theme-preview=dark] .muted { color: #a9b7c2; }
.display-theme-card[data-theme-preview=dark] :where(select, input:not([type=color])) { border-color: #465a68; background: #14202a; color: #edf3f7; }
.display-theme-card[data-theme-preview=dark] .color-field { border-color: #465a68; background: #14202a; }
.display-theme-card[data-theme-preview=dark] .color-field output { color: #a9b7c2; }

/* Tablet and mobile: preserve the toolbar, then reflow actions without spill. */
@media (max-width: 1180px) {
  :root { --ui-page-gutter: 18px; }
  .topbar { gap: var(--ui-space-3); }
  .topbar .top-actions { flex-basis: min(390px, 46vw); }
  .library-layout { grid-template-columns: 220px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --ui-page-gutter: 16px; --ui-surface-padding: 18px; }
  .content { padding-top: var(--ui-space-5); }
  .topbar { align-items: stretch; flex-direction: column; padding-block: var(--ui-space-3); }
  .topbar .top-actions { width: 100%; flex-basis: auto; }
  .topbar .top-actions form.top-search { flex: 1 1 auto; }
  .panel-head, .page-intro { align-items: flex-start; }
  .library-layout { grid-template-columns: 1fr; }
  .library-navigation { position: static; }
  .display-theme-grid { grid-template-columns: 1fr; }
  .calendar-commandbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  :root { --ui-page-gutter: 12px; --ui-surface-padding: 16px; --ui-control-height: 42px; }
  .content { padding-bottom: var(--ui-space-7); }
  .topbar .top-actions { flex-wrap: wrap; }
  .top-search { flex: 1 1 100%; }
  .mail-search { min-width: 100%; flex-basis: 100%; }
  .page-intro, .panel-head { flex-direction: column; }
  .page-intro .form-actions, .panel-head .form-actions { width: 100%; }
  .form-actions > :where(button, .button-link) { flex: 1 1 auto; }
  .library-hero { align-items: stretch; }
  .library-search { width: 100%; min-width: 0; }
  .library-category-grid, .library-card-grid { grid-template-columns: 1fr; }
  .display-settings-actions { align-items: stretch; flex-direction: column; }
  .display-settings-actions button { width: 100%; }
}

@media (max-width: 480px) {
  .content { padding-inline: 10px; }
  .topbar { padding-inline: 10px; }
  .library-search { display: grid; grid-template-columns: 1fr; }
  .library-search button { width: 100%; }
  .form-actions > :where(button, .button-link) { width: 100%; }
}

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

/* Promotions and rewards */
.promotion-card-image { width:100%; height:150px; object-fit:cover; border-radius:14px; border:1px solid var(--line); margin-bottom:14px; }
.promotion-record-panel { margin:18px 0; }
.promotion-intro { align-items: flex-end; }
.promotion-disclaimer-panel { margin-bottom: var(--ui-space-5); }
.promotion-disclaimer-panel > p { margin: 0; padding: var(--ui-surface-padding); color: var(--muted); line-height: 1.65; }
.promotion-section { margin-top: var(--ui-space-5); }
.promotion-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: var(--ui-space-4); padding: var(--ui-surface-padding); }
.promotion-card { min-width: 0; padding: var(--ui-space-5); border: 1px solid var(--ui-panel-border); border-radius: var(--ui-surface-radius); background: var(--ui-panel-bg); box-shadow: var(--ui-elevation); }
.promotion-card header { display: flex; gap: var(--ui-space-2); flex-wrap: wrap; }
.promotion-card h3 { margin: var(--ui-space-3) 0 var(--ui-space-2); overflow-wrap: anywhere; }
.promotion-card > p { min-height: 3em; color: var(--muted); }
.promotion-card dl { display: grid; gap: var(--ui-space-2); margin: var(--ui-space-4) 0; }
.promotion-card dl div { display: flex; justify-content: space-between; gap: var(--ui-space-3); padding-top: var(--ui-space-2); border-top: 1px solid var(--ui-panel-border); }
.promotion-card dt { color: var(--muted); }
.promotion-card dd { margin: 0; text-align: right; font-weight: 750; }
.promotion-status-pending { background: #fff2c7; color: #765600; }
.promotion-status-approved { background: #def3e8; color: #176340; }
.promotion-status-rejected { background: #fee7e4; color: #8f2818; }
.promotion-form-panel { max-width: 1120px; margin-inline: auto; }
.promotion-request-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .7fr); gap: var(--ui-space-5); align-items: start; }
.promotion-review-panel { position: sticky; top: calc(var(--header-height) + var(--ui-space-4)); max-width: none; }
.promotion-review-panel form { padding: var(--ui-surface-padding); }
.promotion-review-item { display: grid; gap: var(--ui-space-1); margin: var(--ui-space-4) var(--ui-surface-padding) 0; padding: var(--ui-space-4); border: 1px solid var(--line); border-radius: var(--ui-radius-md); background: color-mix(in srgb, var(--accent) 7%, var(--paper)); }
.promotion-review-item span, .promotion-review-item small { color: var(--muted); }
.promotion-review-item strong { font-size: 1.05rem; color: var(--ink); }
@media (max-width: 900px) {
  .promotion-intro { align-items: stretch; }
  .promotion-request-layout { grid-template-columns: 1fr; }
  .promotion-review-panel { position: static; }
}
/* Automation workspace: reusable V18 surfaces inherited by future rules. */
.automation-tabs{display:flex;gap:6px;padding:5px;margin:0 0 18px;border:1px solid var(--line);border-radius:14px;background:var(--paper);box-shadow:var(--shadow-soft)}.automation-tabs a{padding:10px 16px;border-radius:10px;color:var(--ink);font-weight:750;text-decoration:none}.automation-tabs a.active{background:var(--soft);color:var(--brand)}.workflow-apply{padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--soft)}.workflow-apply summary{cursor:pointer;font-weight:800}.workflow-apply form{display:flex;align-items:end;gap:12px;margin-top:12px}.workflow-apply label{flex:1}.workflow-apply select{width:100%}.workflow-template-selectors select{min-height:180px}
.automation-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:28px;margin-bottom:18px}.automation-hero h2{margin:4px 0 8px}.automation-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:18px}.automation-summary-grid .metric-card{min-height:130px}.automation-workspace{padding:0;overflow:hidden}.automation-workspace>.panel-head{padding:22px 24px}.automation-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;padding:24px}.automation-card{display:flex;flex-direction:column;gap:18px;padding:22px;border:1px solid var(--line);border-radius:16px;background:var(--paper);box-shadow:var(--shadow-soft)}.automation-card.is-paused{opacity:.78}.automation-card header,.automation-card footer{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.automation-card h3{margin:8px 0 0}.automation-card dl{display:grid;gap:12px;margin:0}.automation-card dl div{display:grid;grid-template-columns:72px 1fr;gap:10px}.automation-card dt{font-size:.75rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}.automation-card dd{margin:0}.automation-card footer{justify-content:flex-end;margin-top:auto;padding-top:4px}.automation-card footer form{margin:0}.status-dot{font-size:.78rem;font-weight:800;color:var(--muted)}.status-dot:before{content:'';display:inline-block;width:8px;height:8px;margin-right:6px;border-radius:50%;background:#a8b1bc}.status-dot.active:before{background:#20a66a;box-shadow:0 0 0 4px color-mix(in srgb,#20a66a 14%,transparent)}.automation-last-run{display:grid;grid-template-columns:1fr auto;gap:5px 12px;padding:13px 14px;border-radius:12px;background:var(--soft)}.automation-last-run small,.automation-last-run form{grid-column:1/-1}.run-completed{color:#147a50}.run-failed{color:#b83222}.automation-editor{max-width:1180px;margin-inline:auto;padding:0;overflow:hidden}.automation-editor>.panel-head{padding:24px 28px}.automation-builder-form>section{padding:24px 28px;border-top:1px solid var(--line)}.automation-step{display:flex;align-items:flex-start;gap:13px;margin-bottom:18px}.automation-step>strong{display:grid;place-items:center;flex:0 0 32px;height:32px;border-radius:50%;background:var(--brand);color:#fff}.automation-step span{display:grid;gap:3px}.automation-step small{color:var(--muted)}.automation-action-choice{display:flex;gap:14px;margin-bottom:18px}.automation-action-choice>label,.automation-activation>label{display:flex;align-items:center;gap:10px;padding:15px 18px;border:1px solid var(--line);border-radius:12px;background:var(--soft);font-weight:750}.automation-action-choice input,.automation-activation input{width:18px;height:18px}.automation-builder-form>.form-actions{padding:20px 28px;border-top:1px solid var(--line);justify-content:flex-end}.automation-save-template{margin:0 28px 28px;padding:16px;border:1px solid var(--line);border-radius:12px}.automation-save-template form{display:flex;align-items:end;gap:12px;margin-top:14px}.automation-save-template label{flex:1}.automation-save-template select,.automation-save-template input{width:100%}@media(max-width:900px){.automation-summary-grid,.automation-card-grid{grid-template-columns:1fr}.automation-hero{align-items:flex-start;flex-direction:column}.automation-save-template form{align-items:stretch;flex-direction:column}}@media(max-width:600px){.automation-summary-grid{grid-template-columns:1fr}.automation-card-grid{padding:14px}.automation-builder-form>section,.automation-editor>.panel-head{padding:20px}.automation-card dl div{grid-template-columns:1fr}.automation-card footer{flex-wrap:wrap}}

/* Automation and workflow KPI cards own their layout; do not inherit inline metric content. */
.automation-summary-grid .metric-card{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;min-width:0;padding:22px 24px;border:1px solid var(--line);border-radius:16px;background:var(--paper);box-shadow:var(--shadow-soft);overflow:hidden}
.automation-summary-grid .metric-card span,.automation-summary-grid .metric-card strong,.automation-summary-grid .metric-card small{display:block;max-width:100%;margin:0;line-height:1.25;overflow-wrap:anywhere}
.automation-summary-grid .metric-card span{font-size:.78rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.automation-summary-grid .metric-card strong{font-size:clamp(1.7rem,2.5vw,2.35rem);color:var(--ink)}
.automation-summary-grid .metric-card small{color:var(--muted)}

/* Trips workspace: list and status Kanban share one durable visual language. */
.trip-workspace-actions{align-items:center}.workspace-view-switcher{display:flex;align-items:center;gap:4px;padding:4px;border:1px solid var(--line);border-radius:10px;background:var(--soft)}.workspace-view-switcher a{padding:8px 13px;border-radius:7px;color:var(--muted);font-weight:800;text-decoration:none}.workspace-view-switcher a.active{background:var(--paper);color:var(--brand);box-shadow:0 2px 7px rgba(18,34,48,.1)}
.trip-prospecting-section{border-color:color-mix(in srgb,var(--ui-accent) 34%,var(--line))}.trip-prospecting-section>.trip-group-heading{background:color-mix(in srgb,var(--ui-accent) 10%,var(--paper))}.trip-section-empty{margin:0;padding:30px 20px;text-align:left}.configurable-table tr.trip-needs-attention>td{background:color-mix(in srgb,#f4c842 20%,var(--paper))}.configurable-table tr.trip-needs-attention>td:first-child{box-shadow:inset 5px 0 #d7a900}.configurable-table td[data-column=trip]>small{display:block;margin-top:6px;color:var(--muted)}
.task-attention-badge{display:inline-flex;align-items:center;width:max-content;margin-top:7px;padding:4px 8px;border:1px solid color-mix(in srgb,#b58b00 34%,transparent);border-radius:999px;background:#fff0ad;color:#664f00;font-size:.7rem;font-weight:850;line-height:1.15}.task-attention-key{display:inline-flex;align-items:center;gap:7px}.task-attention-key:before{content:'';width:11px;height:11px;border-radius:3px;background:#f4c842;box-shadow:inset 0 0 0 1px #c59a09}
.trip-kanban-help{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 20px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--soft);color:var(--muted);font-size:.82rem}.trip-kanban-board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(300px,340px);gap:16px;min-height:560px;padding:20px;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-gutter:stable}.trip-kanban-column{display:flex;min-width:0;flex-direction:column;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--bg) 72%,var(--paper));transition:border-color .16s,background .16s}.trip-kanban-column.is-drop-target{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 7%,var(--paper))}.trip-kanban-column>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px;border-bottom:1px solid var(--line)}.trip-kanban-column>header h3{margin:0 0 3px;font-size:.96rem;overflow-wrap:anywhere}.trip-kanban-column>header small{color:var(--muted)}.trip-kanban-column>header>[data-kanban-count]{display:grid;place-items:center;min-width:27px;height:27px;padding:0 7px;border-radius:999px;background:var(--paper);color:var(--muted);font-size:.75rem;font-weight:850;box-shadow:inset 0 0 0 1px var(--line)}
.trip-kanban-card-list{display:grid;align-content:start;gap:12px;min-height:180px;padding:12px}.trip-kanban-card{display:grid;gap:10px;min-width:0;padding:15px;border:1px solid var(--line);border-radius:12px;background:var(--paper);box-shadow:0 5px 16px rgba(20,37,51,.07);transition:opacity .16s,transform .16s,box-shadow .16s}.trip-kanban-card.is-draggable{cursor:grab}.trip-kanban-card.is-draggable:active{cursor:grabbing}.trip-kanban-card.is-dragging,.trip-kanban-card.is-updating{opacity:.58;transform:scale(.985)}.trip-kanban-card.trip-needs-attention{border-color:#d7ad1b;background:color-mix(in srgb,#f4c842 19%,var(--paper));box-shadow:inset 4px 0 #d7a900,0 5px 16px rgba(20,37,51,.07)}.trip-kanban-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.trip-kanban-card-top .task-attention-badge{margin:0}.trip-kanban-title{color:var(--ink);font-size:1rem;font-weight:850;line-height:1.32;text-decoration:none;overflow-wrap:anywhere}.trip-kanban-title:hover{color:var(--brand);text-decoration:underline}.trip-kanban-card>p{margin:0}.trip-kanban-card dl{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:2px 0}.trip-kanban-card dl div{display:grid;gap:2px;padding:9px;border-radius:8px;background:color-mix(in srgb,var(--soft) 76%,transparent)}.trip-kanban-card dt{color:var(--muted);font-size:.67rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em}.trip-kanban-card dd{margin:0;color:var(--ink);font-weight:850}.trip-kanban-card>small{color:var(--muted)}.trip-kanban-group{color:var(--brand);font-size:.78rem;font-weight:800;text-decoration:none}.trip-kanban-card form{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;padding-top:9px;border-top:1px solid var(--line)}.trip-kanban-card form label{color:var(--muted);font-size:.72rem;font-weight:800}.trip-kanban-card form select{width:100%;min-width:0;height:36px;border:1px solid var(--line);border-radius:7px;padding:0 8px;background:var(--field);color:var(--ink);font-size:.76rem}.trip-kanban-empty{margin:0;padding:26px 12px;color:var(--muted);font-size:.8rem;text-align:center}
@media(max-width:760px){.trip-workspace-actions{width:100%;align-items:stretch;flex-direction:column}.workspace-view-switcher{width:100%}.workspace-view-switcher a{flex:1;text-align:center}.trip-kanban-help{align-items:flex-start;flex-direction:column}.trip-kanban-board{grid-auto-columns:minmax(280px,calc(100vw - 60px));min-height:500px;padding:14px}}

/* Notification center */
.notification-menu{position:relative;flex:0 0 auto;min-width:0}.notification-menu>summary{position:relative;display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--line);border-radius:11px;background:var(--paper);color:var(--ink);cursor:pointer;list-style:none}.notification-menu>summary::-webkit-details-marker{display:none}.notification-bell{font-size:0}.notification-bell:before{content:'🔔';font-size:18px;filter:grayscale(1)}.notification-menu>summary>b{position:absolute;top:-7px;right:-7px;display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border:2px solid var(--paper);border-radius:999px;background:var(--ui-accent);color:#fff;font-size:10px;line-height:1}.notification-popover{position:absolute;z-index:90;top:calc(100% + 10px);right:0;width:min(400px,calc(100vw - 32px));max-width:calc(100vw - 32px);border:1px solid var(--line);border-radius:15px;background:var(--paper);box-shadow:0 20px 50px rgba(17,35,49,.22);overflow:hidden}.notification-popover>header,.notification-popover>footer{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;padding:16px 18px}.notification-popover>header{border-bottom:1px solid var(--line)}.notification-popover>header>div{display:grid;min-width:0;gap:2px}.notification-popover>header small{color:var(--muted)}.notification-popover>footer{justify-content:flex-end;flex-wrap:wrap;border-top:1px solid var(--line)}.notification-popover>footer form{min-width:0;margin:0}.notification-popover>footer button{border:0;background:none;color:var(--brand);font-weight:800;cursor:pointer}.notification-preview-list{width:100%;min-width:0;max-height:430px;overflow-x:hidden;overflow-y:auto}.notification-preview-list form{width:100%;min-width:0;margin:0}.global-actions .notification-preview{display:grid;width:100%;min-width:0;max-width:100%;gap:5px;padding:16px 18px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--ink);text-align:left;white-space:normal;cursor:pointer;overflow:hidden}.notification-preview:hover{background:var(--soft)}.notification-preview>*{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:break-word}.notification-preview strong{font-weight:600;line-height:1.35}.notification-preview.unread strong{font-weight:900}.notification-preview small,.notification-preview time{color:var(--muted);font-size:.75rem;line-height:1.4}.notification-kind{display:inline-flex;width:max-content;padding:3px 7px;border-radius:999px;background:var(--soft);color:var(--brand);font-size:.66rem;font-weight:850;text-transform:uppercase;letter-spacing:.05em}.notification-kind-email{background:color-mix(in srgb,var(--brand) 12%,var(--paper))}.notification-kind-task{background:color-mix(in srgb,#e5ad16 18%,var(--paper));color:#755700}.notification-empty{margin:0;padding:28px 18px;color:var(--muted);text-align:center}.notification-center-panel{padding:0;overflow:hidden}.notification-center-list{display:grid}.notification-center-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:16px;padding:20px 22px;border-bottom:1px solid var(--line)}.notification-center-item:last-child{border-bottom:0}.notification-center-item h3{margin:0 0 5px;font-size:1rem;font-weight:600}.notification-center-item.unread{background:color-mix(in srgb,var(--brand) 5%,var(--paper))}.notification-center-item.unread h3{font-weight:900}.notification-center-item p{margin:0 0 6px;color:var(--muted)}.notification-center-item small{color:var(--muted)}.notification-center-empty{padding:70px 20px}.notification-settings>form{padding:var(--ui-surface-padding)}.mobile-notification-nav{display:none!important;align-items:center;justify-content:space-between;gap:12px}.mobile-notification-nav b{display:grid;place-items:center;min-width:23px;height:23px;padding:0 7px;border-radius:999px;background:var(--ui-accent);color:#fff;font-size:.7rem;line-height:1}
@media(max-width:1030px){.main-nav .mobile-notification-nav{display:flex!important}}
@media(max-width:720px){.notification-menu{position:static}.notification-menu .notification-popover{position:fixed;top:calc(var(--header-height) + 8px);right:12px;left:12px;width:auto;max-width:none;max-height:calc(100dvh - var(--header-height) - 20px)}.notification-preview-list{max-height:calc(100dvh - var(--header-height) - 152px)}.notification-center-item{grid-template-columns:1fr}.notification-center-item>.notification-kind{grid-row:auto}.notification-center-item form,.notification-center-item form button{width:100%}}
@media(max-width:420px){.notification-menu .notification-popover{right:8px;left:8px;max-height:calc(100dvh - var(--header-height) - 16px);border-radius:13px}.notification-popover>header,.notification-popover>footer{padding:14px}.global-actions .notification-preview{padding:14px}.notification-preview-list{max-height:calc(100dvh - var(--header-height) - 136px)}.notification-popover>footer form{flex:1}.notification-popover>footer button{width:100%;padding-inline:8px}}
:root[data-layout=tablet] .notification-menu{display:block;flex:0 0 auto}:root[data-layout=tablet] .notification-menu>summary{width:40px;height:40px}:root[data-layout=tablet] .notification-menu .notification-popover{position:fixed;top:calc(var(--header-height) + 8px);right:12px;left:auto;width:min(400px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - var(--header-height) - 20px)}:root[data-layout=tablet] .main-nav .mobile-notification-nav{display:flex!important}
@media(max-width:720px){:root[data-layout=tablet] .notification-menu .notification-popover{right:12px;left:12px;width:auto;max-width:none}}
@media(max-width:420px){:root[data-layout=tablet] .notification-menu .notification-popover{right:8px;left:8px}}

/* Automatic iPad/phone layout: keep the compact header readable even when a
   user has explicitly forced the desktop layout on a narrow viewport. */
@media(max-width:720px){
  .globalbar{min-width:0;padding-inline:8px}
  .global-brand{min-width:0;flex:0 1 auto;padding-inline:2px 7px}
  .global-actions{min-width:0;flex:0 0 auto;gap:4px;margin-left:auto}
  .theme-toggle,.layout-toggle{display:inline-flex;width:36px;min-width:36px;padding:0;font-size:0}
  .theme-toggle span,.layout-toggle span{font-size:0}
  .theme-toggle:before{content:'◐';font-size:17px;line-height:1}
  .layout-toggle:before{content:'▣';font-size:15px;line-height:1}
  .mobile-nav-toggle{flex:0 0 38px}
}
@media(max-width:560px){
  .global-brand span{display:none}
  .layout-toggle{display:none!important}
}
@media(max-width:360px){
  .global-actions .button-link.primary{display:none}
}


/* Shared component completion, October 2026. Agency settings own brand colors. */
:root {
  --surface: var(--paper);
  --panel: var(--paper);
  --text: var(--ink);
  --border: var(--line);
  --shadow-soft: var(--ui-elevation);
  --ui-radius-md: var(--ui-control-radius);
  --brand-hover: color-mix(in srgb, var(--brand) 85%, var(--ink));
  --brand-strong: color-mix(in srgb, var(--brand) 80%, var(--ink));
}
.panel-body, .panel-inset { padding: var(--ui-surface-padding); }
.panel-inset > :first-child, .panel-body > :first-child { margin-top: 0; }
.panel-inset > :last-child, .panel-body > :last-child { margin-bottom: 0; }
.panel.panel-inset > :where(p, ul, ol, h2, h3, a), .panel-body > :where(p, ul, ol, h2, h3, a) { margin-inline: 0; }
.panel-inset > .form-grid { padding: 0; margin-top: var(--ui-space-5); }
.panel-inset > .form-actions { margin-top: var(--ui-space-4); }
.panel-inset > h2, .panel-body > h2 { font-size: 1.25rem; line-height: 1.35; }
.panel-inset > h3, .panel-body > h3 { font-size: 1.1rem; line-height: 1.35; }
.panel-inset > a:first-child { display: inline-flex; margin-bottom: var(--ui-space-4); font-weight: 700; }
.panel-inset > article + article { margin-top: var(--ui-space-5); padding-top: var(--ui-space-5); border-top: 1px solid var(--line); }
.panel-inset + .panel-inset { margin-top: var(--ui-space-5); }
.filter-bar, .panel > form.form-actions { display: flex; align-items: end; flex-wrap: wrap; gap: var(--ui-space-4); padding: var(--ui-space-4) var(--ui-surface-padding); }
.filter-bar > label, .panel > form.form-actions > label { display: grid; gap: 6px; flex: 1 1 180px; min-width: 0; max-width: 320px; font-size: .86rem; font-weight: 700; }
.filter-bar > label:has(input[type=checkbox]), .panel > form.form-actions > label:has(input[type=checkbox]) { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-height: var(--ui-control-height); }
.filter-bar > button { flex: 0 0 auto; }
.panel-inset > form.form-actions { padding-inline: 0; }
.panel-footer, .panel > div.form-actions:not(.panel-head) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-3); padding: var(--ui-space-4) var(--ui-surface-padding); border-top: 1px solid var(--line); }
.panel.panel-inset > div.form-actions { padding-inline: 0; }
.panel > .notice { margin: var(--ui-space-4) var(--ui-surface-padding); }
.form-actions > label { min-width: 0; }
.form-actions input:not([type=checkbox]):not([type=radio]), .form-actions select { min-width: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); flex-shrink: 0; }
.form-grid > div:has(> input[type=checkbox]) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-grid > div:has(> input[type=checkbox]) > label { margin: 0; }
.form-grid > div:has(> input[type=checkbox]) > :where(.helptext, .errorlist) { flex-basis: 100%; }
.error, .errorlist { color: var(--danger); }
.run-completed, .status-active { color: var(--success); }
.run-failed, .status-error { color: var(--danger); }
.task-sync-synced { color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--paper)); }
.task-sync-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--paper)); }
.task-sync-not_connected { color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--paper)); }
.detail-list { display: grid; grid-template-columns: minmax(120px, .35fr) minmax(0, 1fr); gap: 12px 24px; margin-block: var(--ui-space-5); }
.detail-list dt { color: var(--muted); font-weight: 700; }
.detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.table-scroll td { overflow-wrap: anywhere; }
button:disabled, .button-link[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
@media (max-width: 720px) {
  .filter-bar > label, .panel > form.form-actions > label { flex: 1 1 100%; max-width: none; }
  .filter-bar > button { width: 100%; }
  .detail-list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .detail-list dd { margin-bottom: 12px; }
  .panel-inset, .panel-body { padding: var(--ui-surface-padding); }
}

/* Keep every primary workspace reachable at intermediate desktop widths. */
.global-nav { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; overscroll-behavior-inline: contain; }
.global-nav > a { flex-shrink: 0; }
/* Standalone sign-in pages do not load modern.css; supply their missing tokens. */
body.login { --line-strong: #bdcbd2; --danger: #b53626; }
