:root {
  --app-bg: #f3f6fa;
  --surface-1: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3f8;
  --border: #dfe6ef;
  --border-strong: #c5d0de;
  --text-primary: #172033;
  --text-secondary: #526078;
  --text-muted: #667085;
  --accent: #3157d5;
  --accent-hover: #2444ad;
  --accent-soft: #eaf0ff;
  --success: #087553;
  --success-soft: #e8f8f1;
  --warning: #8a5a00;
  --warning-soft: #fff6db;
  --danger: #b42318;
  --danger-soft: #fff0f0;
  --info: #245b87;
  --info-soft: #edf6ff;
  --shadow-sm: 0 2px 8px rgba(21, 35, 58, .05);
  --shadow-md: 0 10px 30px rgba(21, 35, 58, .08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 3rem;
  --merlin-navy: #0b1527;
  --merlin-navy-soft: #12213a;
  --merlin-header: #071a33;
  --merlin-header-soft: #0b2b50;
  --merlin-blue: #3157d5;
  --merlin-blue-dark: #2444ad;
  --merlin-cyan: #0e91a1;
  --merlin-green: #0b8f68;
  --merlin-red: #d14343;
  --merlin-amber: #bd7200;
  --merlin-ink: #172033;
  --merlin-muted: #667085;
  --merlin-line: #e4e9f1;
  --merlin-surface: #ffffff;
  --merlin-bg: #f4f7fb;
  --merlin-radius: 14px;
  --merlin-shadow: 0 8px 28px rgba(21, 35, 58, .07);
}

html[data-theme="dark"] {
  --app-bg: #0c121d;
  --surface-1: #131c29;
  --surface-2: #182333;
  --surface-3: #202d3e;
  --border: #2b3a4d;
  --border-strong: #405269;
  --text-primary: #edf2f8;
  --text-secondary: #c0cad8;
  --text-muted: #9baabd;
  --accent: #829bff;
  --accent-hover: #9eafff;
  --accent-soft: #202f59;
  --success: #6ce1b7;
  --success-soft: #123b32;
  --warning: #f5c66d;
  --warning-soft: #453615;
  --danger: #ff9b95;
  --danger-soft: #4b2225;
  --info: #8ecbff;
  --info-soft: #17344d;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .2);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, .3);
  --merlin-ink: var(--text-primary);
  --merlin-muted: var(--text-muted);
  --merlin-line: var(--border);
  --merlin-surface: var(--surface-1);
  --merlin-bg: var(--app-bg);
  --merlin-blue: var(--accent);
  --merlin-blue-dark: var(--accent-hover);
}

html { scroll-behavior: smooth; }
body { margin: 0; }
body.merlin-app,
.merlin-app {
  background: var(--merlin-bg);
  color: var(--merlin-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .94rem;
  -webkit-font-smoothing: antialiased;
}

.skip-link { background: var(--surface-1); border-radius: 0 0 var(--radius-sm) 0; color: var(--text-primary); font-weight: 700; left: 0; padding: .75rem 1rem; position: fixed; top: -100px; z-index: 2000; }
.skip-link:focus { top: 0; }
.app-nav > .mobile-nav-heading { display: none; }
.nav-backdrop { background: rgba(3, 10, 22, .62); inset: 0; position: fixed; z-index: 1029; }
.theme-control { align-items: center; border: 1px solid rgba(190, 210, 239, .35); border-radius: 999px; display: inline-flex; min-height: 36px; padding: 0 .25rem 0 .55rem; }
.theme-icon { color: #dbe5f5; font-size: .82rem; }
.theme-control select { appearance: none; background: transparent; border: 0; color: #f4f7fc; cursor: pointer; font-size: .75rem; min-height: 34px; padding: 0 1.1rem 0 .35rem; }
.theme-control select option { background: #12213a; color: #fff; }
.theme-control:focus-within { box-shadow: 0 0 0 3px rgba(137, 174, 232, .3); }
.theme-control select:focus { outline: 0; }
.numeric, .metric, table td, .summary-card strong, .metric-card strong { font-variant-numeric: tabular-nums; }

.app-header {
  background: linear-gradient(110deg, var(--merlin-header), var(--merlin-header-soft));
  border-bottom: 1px solid rgba(112, 153, 218, .2);
  box-shadow: 0 4px 18px rgba(3, 15, 32, .24);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.app-header-row {
  gap: 1.25rem;
  min-height: 64px;
}
.app-header-row > .brand { flex: 0 0 auto; }
.app-header-row > .d-flex:last-child { flex: 0 0 auto; margin-left: auto; }
.authenticated-profile { color: #dbe5f5; white-space: nowrap; }
.header-readiness { align-items: center; color: #dbe5f5; font-size: .75rem; gap: .35rem; text-decoration: none; }
.header-readiness span { color: #6ce1b7; }
.header-readiness:hover { color: #fff; }
.profile-name { font-size: .8rem; font-weight: 650; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.logout-form { display: inline-flex; margin: 0; }
.account-header-title { color: #fff; font-size: .92rem; }
.account-header-links a { color: #cbd5e1; font-size: .84rem; font-weight: 650; text-decoration: none; }
.account-header-links a:hover { color: #fff; }
@media (max-width: 575.98px) { .account-header-title { display: none; } .account-header-links { order: 3; width: 100%; padding-bottom: .65rem; } }
.logout-button {
  align-items: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(190, 210, 239, .42);
  border-radius: 999px !important;
  color: #f4f7fc;
  display: inline-flex;
  font-size: .78rem;
  justify-content: center;
  letter-spacing: .015em;
  min-height: 34px !important;
  padding: .35rem .85rem;
}
.logout-button:hover {
  background: #f4f7fc;
  border-color: #f4f7fc;
  color: var(--merlin-header);
  transform: none !important;
}
.logout-button:focus-visible {
  box-shadow: 0 0 0 .2rem rgba(137, 174, 232, .3) !important;
}
.brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  font-size: 1.08rem;
  font-weight: 750;
  gap: .65rem;
  letter-spacing: -.015em;
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, #5575ef, #18a7b3);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  display: inline-flex;
  font-size: .72rem;
  height: 32px;
  justify-content: center;
  letter-spacing: .03em;
  width: 32px;
}
.nav-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  display: none;
  flex-direction: column;
  gap: 4px;
  height: 38px;
  justify-content: center;
  padding: 0;
  transition: background .18s ease, border-color .18s ease;
  width: 42px;
}
.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .7);
  outline: none;
}
.nav-toggle-bar {
  background: currentColor;
  border-radius: 2px;
  display: block;
  height: 2px;
  transition: opacity .18s ease, transform .18s ease;
  width: 19px;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.app-nav {
  border-top: 0;
  flex: 1 1 auto;
  overflow: visible;
  scrollbar-width: none;
  white-space: nowrap;
}
.app-nav::-webkit-scrollbar { display: none; }
.app-nav > div {
  align-items: stretch;
  display: flex;
  gap: .25rem;
}
.nav-group {
  display: inline-block;
  position: relative;
}
.nav-group > summary {
  border-bottom: 2px solid transparent;
  color: #becae0;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 600;
  list-style: none;
  padding: .78rem 2rem .78rem .8rem;
  position: relative;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  content: "";
  height: 6px;
  position: absolute;
  right: .8rem;
  top: calc(50% - 4px);
  transform: rotate(45deg);
  transition: transform .18s ease;
  width: 6px;
}
.nav-group[open] > summary,
.nav-group.is-active > summary,
.nav-group > summary:hover,
.nav-group > summary:focus-visible {
  border-bottom-color: #6684f5;
  color: #fff;
  outline: none;
}
.nav-group[open] > summary::after { transform: translateY(3px) rotate(225deg); }
.nav-dropdown {
  background: var(--merlin-header-soft);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 12px 28px rgba(3, 10, 22, .28);
  left: 0;
  min-width: 245px;
  padding: .45rem;
  position: absolute;
  top: 100%;
  z-index: 1040;
}
.nav-dropdown a {
  border: 0;
  border-radius: 7px;
  display: block;
  padding: .65rem .75rem;
}
.app-nav .nav-dropdown a { display: block; width: 100%; }
.nav-dropdown a:hover,
.nav-dropdown a.active {
  background: rgba(255, 255, 255, .09);
  border-bottom-color: transparent;
}
.app-nav a,
.nav-linkish {
  border-bottom: 2px solid transparent;
  color: #becae0;
  display: inline-block;
  font-size: .86rem;
  font-weight: 600;
  padding: .78rem .8rem;
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.app-nav a:hover,
.app-nav a.active,
.nav-linkish:hover {
  border-bottom-color: #6684f5;
  color: #fff;
}

.page-heading { margin-bottom: 1.25rem; }
.page-eyebrow {
  color: var(--merlin-blue);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .1em;
  margin-bottom: .35rem;
  text-transform: uppercase;
}
.page-title {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 750;
  letter-spacing: -.025em;
  margin-bottom: .3rem;
}
.page-subtitle { color: var(--merlin-muted); margin-bottom: 0; }
.section-title { color: var(--merlin-ink); font-size: 1rem; font-weight: 750; }
.section-copy { color: var(--merlin-muted); font-size: .8rem; margin: .25rem 0 0; }

.merlin-app .card {
  background: var(--merlin-surface);
  border: 1px solid var(--merlin-line);
  border-radius: var(--merlin-radius);
  box-shadow: var(--merlin-shadow);
  overflow: hidden;
}
.merlin-app .card-header {
  background: var(--merlin-surface) !important;
  border-bottom: 1px solid var(--merlin-line);
  padding: 1rem 1.15rem;
}
.merlin-app .card-body { padding: 1.15rem; }
.metric-card { position: relative; }
.metric-card-success { --metric-accent: var(--success); }
.metric-card-info { --metric-accent: var(--info); }
.metric-card-warning { --metric-accent: var(--warning); }
.badge-safe { background: var(--surface-3); color: var(--text-secondary); }
.merlin-app code { color: var(--text-secondary); }
.metric-card::before {
  background: var(--metric-accent, var(--merlin-blue));
  border-radius: 0 0 4px 4px;
  content: "";
  height: 3px;
  left: 1rem;
  position: absolute;
  right: 1rem;
  top: 0;
}
.metric { color: var(--merlin-ink); font-size: 1.42rem; font-weight: 750; letter-spacing: -.025em; }
.label {
  color: var(--merlin-muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.merlin-app .btn {
  border-radius: 9px;
  font-weight: 650;
  min-height: 38px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.merlin-app .btn:hover { transform: translateY(-1px); }
.merlin-app .btn:focus-visible {
  box-shadow: 0 0 0 .2rem rgba(49, 87, 213, .22);
  outline: 0;
}
.merlin-app .btn-primary {
  background: var(--merlin-blue);
  border-color: var(--merlin-blue);
  box-shadow: 0 5px 14px rgba(49, 87, 213, .18);
}
.merlin-app .btn-primary:hover { background: var(--merlin-blue-dark); border-color: var(--merlin-blue-dark); }
.merlin-app .form-control,
.merlin-app .form-select {
  border-color: #d5dce8;
  border-radius: 9px;
  min-height: 40px;
}
.merlin-app .form-control:focus,
.merlin-app .form-select:focus {
  border-color: #8298e9;
  box-shadow: 0 0 0 .2rem rgba(49, 87, 213, .12);
}

.merlin-app .table { color: #263247; font-size: .83rem; }
.merlin-app .table > :not(caption) > * > * { border-bottom-color: #edf0f5; padding: .72rem .8rem; }
.merlin-app .table thead th {
  background: #f7f9fc;
  color: #59657a;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .035em;
  text-transform: uppercase;
  white-space: nowrap;
}
.merlin-app .table-hover tbody tr:hover { background: #f7f9ff; }
.table-responsive { scrollbar-color: #c6cfdd transparent; scrollbar-width: thin; }
.responsive-table-cards { display: none; }
.responsive-row-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); display: grid; gap: .65rem; padding: .85rem; }
.responsive-row-card > div { display: flex; justify-content: space-between; gap: 1rem; }
.responsive-row-card span { color: var(--text-muted); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.responsive-row-card strong { font-size: .84rem; font-weight: 650; overflow-wrap: anywhere; text-align: right; }

.status-dot {
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .12);
  height: 8px;
  width: 8px;
}
.status-dot.ok { box-shadow: 0 0 0 4px rgba(18, 183, 106, .12); }
.status-dot.bad { box-shadow: 0 0 0 4px rgba(240, 68, 56, .12); }
.status-badge,
.merlin-app .badge {
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .025em;
  padding: .42rem .65rem;
}
.status-badge-live { background: #e8f8f1; color: #087553; }
.status-badge-paper { background: #fff1e8; color: #a34d0d; }
.status-badge-neutral { background: #eef2f8; color: #526078; }
.state-badge, .health-badge, .user-state, .paper-chip, .status-badge { align-items: center; border: 1px solid transparent; border-radius: 999px; display: inline-flex; font-size: .7rem; font-weight: 750; gap: .35rem; letter-spacing: .025em; line-height: 1.2; padding: .38rem .62rem; }
.state-badge::before, .health-badge::before, .user-state::before { content: ""; background: currentColor; border-radius: 50%; flex: 0 0 6px; height: 6px; width: 6px; }
.state-pass, .status-pass, .state-ready, .state-connected, .state-active { background: var(--success-soft) !important; color: var(--success) !important; }
.state-warning, .status-warning, .state-degraded, .state-stale, .state-pending { background: var(--warning-soft) !important; color: var(--warning) !important; }
.state-fail, .status-fail, .state-disconnected, .state-rejected { background: var(--danger-soft) !important; color: var(--danger) !important; }
.state-info, .status-info, .state-read-only { background: var(--info-soft) !important; color: var(--info) !important; }
.state-disabled, .status-disabled, .state-neutral, .status-unknown { background: var(--surface-3) !important; color: var(--text-secondary) !important; }

.merlin-app .alert {
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: .88rem;
}
.merlin-app .alert-info { background: #edf6ff; border-color: #cee5fa; color: #245b87; }
.merlin-app .alert-success { background: #eaf8f2; border-color: #ccebdd; color: #176a51; }
.merlin-app .alert-warning { background: #fff8e8; border-color: #f1dfb5; color: #82520a; }
.merlin-app .alert-danger { background: #fff0f0; border-color: #f1caca; color: #963434; }
.empty-state {
  align-items: center;
  color: var(--merlin-muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 92px;
  padding: 1.5rem;
  text-align: center;
}
.loading {
  color: var(--merlin-muted);
  position: relative;
}
.loading::before {
  animation: merlin-spin .8s linear infinite;
  border: 2px solid #d9dfeb;
  border-radius: 50%;
  border-top-color: var(--merlin-blue);
  content: "";
  display: inline-block;
  height: 16px;
  margin-right: .5rem;
  vertical-align: -.2rem;
  width: 16px;
}
@keyframes merlin-spin { to { transform: rotate(360deg); } }

.app-footer {
  align-items: center;
  background: #111c2e;
  border-top: 3px solid var(--merlin-blue);
  border-radius: 10px 10px 0 0;
  color: #aebbd0;
  display: flex;
  font-size: .78rem;
  gap: .75rem 1.5rem;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding: .8rem 1rem;
}
.live-footer { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-muted); margin-top: var(--space-6); padding: .85rem 1rem; }
.live-footer a { color: var(--accent); font-weight: 650; text-decoration: none; }
.live-footer a:hover { text-decoration: underline; }

.live-workspace { --live-ink: var(--text-primary); --live-muted: var(--text-muted); --live-line: var(--border); --live-bg: var(--app-bg); --live-blue: var(--accent); --live-green: var(--success); --live-amber: var(--warning); --live-red: var(--danger); --live-violet: var(--accent); }
.paper-workspace { --paper-ink: var(--text-primary); --paper-muted: var(--text-muted); --paper-line: var(--border); --paper-blue: var(--accent); --paper-green: var(--success); --paper-red: var(--danger); --paper-bg: var(--app-bg); }
.option-workbench { --option-ink: var(--text-primary); --option-muted: var(--text-muted); --option-line: var(--border); --option-call: var(--success); --option-put: var(--danger); --option-atm: var(--warning-soft); --option-selected: var(--accent-soft); }
.app-footer span:first-child {
  color: #fff;
  font-weight: 700;
}
.app-footer span:nth-child(2) {
  color: #8faae8;
}

.app-footer > div, .app-footer nav { align-items: center; display: flex; flex-wrap: wrap; gap: .45rem 1rem; }
.app-footer a { color: #b9c8eb; }
.environment-badge { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: .18rem .5rem; }

.auth-shell { margin-inline: auto; max-width: 1120px; padding-inline: 1rem; width: 100%; }
.auth-header { background: var(--merlin-header); border-bottom: 1px solid rgba(255,255,255,.12); }
.auth-header .auth-shell { align-items: center; display: flex; justify-content: space-between; min-height: 64px; }
.auth-main { align-items: center; display: flex; justify-content: center; min-height: calc(100vh - 145px); padding-block: clamp(2rem, 7vh, 5rem); }
.auth-card { border: 1px solid var(--border); box-shadow: var(--shadow-md); max-width: 520px; width: 100%; }
.muted, .text-muted, .text-secondary { color: var(--text-muted) !important; }

html[data-theme="dark"] body, html[data-theme="dark"] .merlin-app { background: var(--app-bg); color: var(--text-primary); }
html[data-theme="dark"] .card, html[data-theme="dark"] .workspace-panel, html[data-theme="dark"] .panel, html[data-theme="dark"] .live-hero, html[data-theme="dark"] .identity-cell, html[data-theme="dark"] .readiness-cell, html[data-theme="dark"] .metric-card, html[data-theme="dark"] .summary-card, html[data-theme="dark"] .paper-tab, html[data-theme="dark"] .status-strip, html[data-theme="dark"] .fund-grid article, html[data-theme="dark"] .option-card, html[data-theme="dark"] .mobile-card, html[data-theme="dark"] .notification-card, html[data-theme="dark"] .report-card, html[data-theme="dark"] dialog, html[data-theme="dark"] .contract-drawer { background: var(--surface-1) !important; border-color: var(--border) !important; color: var(--text-primary); }
html[data-theme="dark"] .card-header, html[data-theme="dark"] .filter-bar, html[data-theme="dark"] .order-preview, html[data-theme="dark"] .calculation-note, html[data-theme="dark"] .review-card, html[data-theme="dark"] .report-selection, html[data-theme="dark"] .safe-details dl { background: var(--surface-2) !important; border-color: var(--border); }
html[data-theme="dark"] .table { --bs-table-bg: transparent; --bs-table-color: var(--text-primary); --bs-table-striped-bg: var(--surface-2); --bs-table-hover-bg: var(--surface-3); color: var(--text-primary); }
html[data-theme="dark"] .merlin-app .table thead th, html[data-theme="dark"] .desktop-book th, html[data-theme="dark"] .report-table th { background: var(--surface-2); color: var(--text-secondary); }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select { background-color: var(--surface-2); border-color: var(--border-strong); color: var(--text-primary); }
html[data-theme="dark"] .form-control::placeholder { color: var(--text-muted); }
html[data-theme="dark"] .btn-outline-secondary, html[data-theme="dark"] .btn-outline-primary { color: var(--text-primary); border-color: var(--border-strong); }
html[data-theme="dark"] .live-hero { background: var(--surface-1); }
html[data-theme="dark"] .state-disabled, html[data-theme="dark"] .state-neutral { background: var(--surface-3); color: var(--text-secondary); }
html[data-theme="dark"] .detail-dialog::backdrop, html[data-theme="dark"] .alert-dialog::backdrop { background: rgba(0,0,0,.72); }
html[data-theme="dark"] .admin-subnav, html[data-theme="dark"] .admin-summary article, html[data-theme="dark"] .admin-user-cards article, html[data-theme="dark"] .admin-detail-grid > div { background: var(--surface-1); border-color: var(--border); color: var(--text-primary); }
html[data-theme="dark"] .admin-subnav a { color: var(--text-secondary); }
.admin-subnav a.active { color: var(--accent); font-weight: 750; position: relative; }
.admin-subnav .admin-back-link { border-right: 1px solid var(--border); color: var(--accent); font-weight: 700; margin-right: .25rem; padding-right: 1rem; }
.admin-subnav a.active::after { background: var(--accent); border-radius: 2px; bottom: -.55rem; content: ""; height: 2px; left: 0; position: absolute; right: 0; }
.paper-safety {
  background: linear-gradient(100deg, #fff6ec, #fffaf4);
  border: 1px solid #f0d2ad;
  border-left: 4px solid #d27717;
  border-radius: 12px;
  color: #7a4308;
}

@media (max-width: 991.98px) {
  .merlin-app main.container-fluid { padding-left: 1rem !important; padding-right: 1rem !important; }
}
@media (max-width: 767.98px) {
  body.nav-open { overflow: hidden; }
  .app-header-row { flex-wrap: wrap; gap: 0 .75rem; }
  .brand-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-toggle { display: inline-flex; }
  .app-nav {
    border-top: 1px solid rgba(255, 255, 255, .1);
    background: var(--merlin-header);
    bottom: 0;
    display: block;
    max-width: min(88vw, 360px);
    overflow: auto;
    padding-bottom: env(safe-area-inset-bottom);
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(105%);
    transition: transform .2s ease;
    width: 100%;
    z-index: 1050;
    white-space: normal;
  }
  .app-nav.is-open { transform: translateX(0); }
  .app-nav > .mobile-nav-heading { align-items: center; border-bottom: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; min-height: 64px; padding: 0 1rem; }
  .mobile-nav-heading button { background: transparent; border: 0; color: #fff; font-size: 2rem; height: 44px; width: 44px; }
  .app-nav > div {
    display: block;
    padding: .55rem 1rem 1rem;
  }
  .nav-group { display: block; width: 100%; }
  .nav-group > summary {
    border-bottom: 0;
    border-left: 3px solid transparent;
    padding: .72rem 2.25rem .72rem .85rem;
  }
  .nav-group[open] > summary {
    background: rgba(255, 255, 255, .07);
    border-bottom-color: transparent;
    border-left-color: #6684f5;
    border-radius: 0 8px 8px 0;
  }
  .nav-dropdown {
    background: rgba(0, 0, 0, .12);
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    margin: .2rem 0 .45rem .75rem;
    min-width: 0;
    padding: .3rem;
    position: static;
  }
  .nav-dropdown a { padding-left: 1rem; }
  .app-nav a {
    border-bottom: 0;
    border-left: 3px solid transparent;
    display: block;
    min-height: 44px;
    padding: .72rem .85rem;
    width: 100%;
  }
  .app-nav a:hover,
  .app-nav a.active {
    background: rgba(255, 255, 255, .07);
    border-bottom-color: transparent;
    border-left-color: #6684f5;
    border-radius: 0 8px 8px 0;
  }
  .app-header .btn { min-height: 34px; }
  .page-heading { align-items: flex-start !important; }
  .merlin-app .card-body { padding: 1rem; }
  .merlin-app .table { font-size: .76rem; }
  .merlin-app .table > :not(caption) > * > * { padding: .62rem .65rem; }
  .app-footer { align-items: flex-start; flex-direction: column; }
  table.has-responsive-cards { display: none; }
  .responsive-table-cards { display: grid; gap: .65rem; }
  .app-footer > div, .app-footer nav { align-items: flex-start; flex-direction: column; }
  .theme-control select { width: 1.7rem; color: transparent; padding-right: 0; }
}
@media (max-width: 575.98px) {
  .brand-name { max-width: 120px; }
}

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