@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');


@import url("./theme-tokens.cdc5dd9737f1.css");
@import url("./theme-controls.a5f96abdbb03.css");

/* ── Body background — theme-aware ──────────────────────── */
html[data-theme="light"] body,
html[data-theme="light"] body.rb-theme-body {
  background: var(--bg-page) !important;
  color: var(--text-secondary) !important;
}

/* ── Header — theme-aware ────────────────────────────────── */
html[data-theme="light"] header,
html[data-theme="light"] body.rb-theme-body header {
  background: var(--header-bg) !important;
  border-bottom: 1px solid var(--border-color) !important;
  box-shadow: inset 0 1px 0 var(--seam-color), 0 3px 8px var(--shadow-soft) !important;
}

html[data-theme="light"] header .brand,
html[data-theme="light"] header .header-left,
html[data-theme="light"] header .page-title {
  color: var(--text-primary) !important;
}

/* ── Buttons — light theme ───────────────────────────────── */
html[data-theme="light"] .btn-ghost,
html[data-theme="light"] .btn-secondary {
  background: var(--chrome-face) !important;
  border: 1px solid var(--input-border) !important;
  color: var(--text-secondary) !important;
  box-shadow: var(--rs-key-shadow), inset 0 1px 0 var(--rs-highlight);
}

html[data-theme="light"] .btn-ghost:hover,
html[data-theme="light"] .btn-secondary:hover {
  color: var(--text-primary) !important;
  border-color: var(--rs-accent) !important;
}

/* ── Form inputs — light theme ───────────────────────────── */
html[data-theme="light"] :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]),
  textarea,
  select
) {
  border: 1px solid var(--input-border) !important;
  background-color: var(--bg-well) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--rs-inset-shadow);
}

html[data-theme="light"] :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]),
  textarea,
  select
):focus {
  border-color: var(--rs-accent) !important;
  box-shadow: var(--rs-inset-shadow) !important;
}

/* A background-color override alone leaves legacy dark gradient layers intact. */
html[data-theme="light"] :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]), textarea) {
  background-image: none !important;
}
html[data-theme="light"] :where(input, textarea)::placeholder {
  color: var(--text-muted) !important;
  opacity: 1;
}
html[data-theme="light"] :where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--focus-outline) !important;
  outline-offset: 3px;
}

/* ── Cards — light theme ─────────────────────────────────── */
html[data-theme="light"] .chain-card,
html[data-theme="light"] .stat-pill,
html[data-theme="light"] .group,
html[data-theme="light"] .doc-card,
html[data-theme="light"] .progress-panel,
html[data-theme="light"] .upload-panel,
html[data-theme="light"] .modal {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  box-shadow:
    inset 0 1px 0 var(--seam-color),
    0 8px 24px var(--shadow-soft) !important;
}

/* Light-mode readability for common content text */
html[data-theme="light"] .desc,
html[data-theme="light"] .section-copy,
html[data-theme="light"] .muted,
html[data-theme="light"] .helper-btn,
html[data-theme="light"] .manage a,
html[data-theme="light"] .manage button,
html[data-theme="light"] .empty,
html[data-theme="light"] .no-results {
  color: var(--text-muted) !important;
}

html[data-theme="light"] .main-content .name,
html[data-theme="light"] .main-content .title-row h2,
html[data-theme="light"] .main-content .usage-value,
html[data-theme="light"] .main-content h1,
html[data-theme="light"] .main-content h2,
html[data-theme="light"] .main-content h3,
html[data-theme="light"] .panel .name,
html[data-theme="light"] .panel .title-row h2,
html[data-theme="light"] .panel h2,
html[data-theme="light"] .panel h3 {
  color: var(--text-primary) !important;
}

html[data-theme="light"] .chat-link,
html[data-theme="light"] .profile-signout,
html[data-theme="light"] .admin-item-signout,
html[data-theme="light"] .count,
html[data-theme="light"] .badge-soft,
html[data-theme="light"] .welcome-kicker {
  color: var(--link-color) !important;
}

html[data-theme="light"] .chat-link:hover,
html[data-theme="light"] .profile-signout:hover,
html[data-theme="light"] .admin-item-signout:hover {
  color: var(--link-hover) !important;
}

html[data-theme="light"] .badge-soft.archie-badge {
  color: var(--text-primary) !important;
}

/* The rail follows the theme like the rest of the product chrome */
html[data-theme="light"] .left-stack .toolbar-title,
html[data-theme="light"] .left-stack .brand-card-title,
html[data-theme="light"] .left-stack h2,
html[data-theme="light"] .left-stack h3 {
  color: var(--text-primary) !important;
}

html[data-theme="light"] .left-stack .toolbar-copy,
html[data-theme="light"] .left-stack .brand-card-copy,
html[data-theme="light"] .left-stack .sidebar-ai-notice,
html[data-theme="light"] .left-stack .sidebar-ai-notice p,
html[data-theme="light"] .left-stack .sidebar-ai-notice a {
  color: var(--text-secondary) !important;
}

html[data-theme="light"] .left-stack .sidebar-ai-notice a {
  color: var(--link-color) !important;
}

/* ── Scrollbars — light theme ────────────────────────────── */
html[data-theme="light"] * {
  scrollbar-color: var(--scroll-thumb-color) var(--scroll-track-color);
}

/* ── Select arrow — theme-aware chevron (never fill the control) ─ */
select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 36px !important;
  background-color: var(--bg-well) !important;
  background-image: var(--rs-select-caret) !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px 8px !important;
}

select option,
select optgroup {
  background: var(--bg-well) !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary);
}

/* ── Theme toggle button ─────────────────────────────────── */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--navy-border) !important;
  background: rgba(27,50,80,0.45) !important;
  color: var(--text-mid) !important;
  cursor: pointer;
  transition: all 150ms ease;
  flex-shrink: 0;
  padding: 0 !important;
  font-size: 0 !important;
  line-height: 1 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
}

.theme-toggle-btn:hover {
  border-color: var(--amber) !important;
  color: var(--amber) !important;
  background: rgba(217,119,6,0.12) !important;
}

html[data-theme="light"] .theme-toggle-btn {
  background: rgba(240,237,230,0.8) !important;
  border-color: #D4CFC6 !important;
  color: #5A6E82 !important;
}

html[data-theme="light"] .theme-toggle-btn:hover {
  border-color: var(--amber) !important;
  color: var(--amber) !important;
  background: rgba(217,119,6,0.08) !important;
}

.theme-toggle-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Show correct icon per theme */
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle-btn .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle-btn .icon-moon { display: none; }

.theme-toggle-btn .glyph-sun,
.theme-toggle-btn .glyph-moon {
  display: none;
  font-size: 18px !important;
  line-height: 1 !important;
  font-weight: 700;
}

.theme-toggle-btn.glyph-toggle svg {
  display: none !important;
}

.theme-toggle-btn.glyph-toggle .glyph-moon {
  display: inline-block;
}

html[data-theme="light"] .theme-toggle-btn.glyph-toggle .glyph-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle-btn.glyph-toggle .glyph-sun {
  display: inline-block;
}

.top .theme-toggle-btn,
.top-links .theme-toggle-btn,
.top-actions .theme-toggle-btn,
.nav-links .theme-toggle-btn,
.header-actions .theme-toggle-btn,
.actions .theme-toggle-btn,
.header-right .theme-toggle-btn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Temporarily hide legacy standalone theme toggles — Appearance lives in account menus */
.theme-toggle-btn,
.top .theme-toggle-btn,
.top-links .theme-toggle-btn,
.top-actions .theme-toggle-btn,
.nav-links .theme-toggle-btn,
.header-actions .theme-toggle-btn,
.actions .theme-toggle-btn,
.header-right .theme-toggle-btn {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Shared account / profile menu chrome ─────────────────── */
.profile-menu,
.admin-menu.rb-account-menu {
  position: relative;
}

.profile-trigger,
.rb-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--surface-raised);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--seam-color);
}

.profile-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  transform-origin: center;
}

.profile-dropdown,
.rb-account-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--rim-color);
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
  z-index: 200;
}

.profile-menu.open .profile-dropdown,
.admin-menu.open .admin-dropdown,
.rb-account-menu.open .rb-account-dropdown {
  display: block;
}

.profile-menu-item,
.rb-account-item,
.admin-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-secondary) !important;
  text-decoration: none;
  background: transparent;
  border: 0;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.profile-menu-item:hover,
.rb-account-item:hover,
.admin-item:hover {
  background: rgba(217, 119, 6, 0.12);
  color: var(--text-primary) !important;
}

.profile-signout,
.admin-item-signout {
  color: var(--link-color) !important;
  font-weight: 700;
}

.profile-signout:hover,
.admin-item-signout:hover {
  color: var(--link-hover) !important;
  background: rgba(217, 119, 6, 0.12);
}

.profile-divider,
.rb-account-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 8px 4px;
}

/* ── Account Appearance control (shared physical toggle) ─── */
.rb-appearance {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rb-appearance-label {
  display: block;
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rb-appearance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rb-appearance-state {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
}

.rb-theme-toggle,
[data-theme-toggle] {
  position: relative;
  width: 68px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--border-strong) !important;
  background: var(--bg-well) !important;
  background-image: none !important;
  box-shadow:
    inset 0 4px 12px rgba(0,0,0,.18),
    inset 0 1px 0 var(--seam-color) !important;
  cursor: pointer;
  padding: 0 !important;
  min-width: 68px !important;
  min-height: 34px !important;
  color: transparent !important;
}

.rb-theme-toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-amber-light), var(--brand-amber));
  box-shadow:
    0 4px 12px rgba(217,119,6,.32),
    inset 0 1px 0 rgba(255,255,255,.45);
  transition: left 140ms ease;
}

html[data-theme="light"] .rb-theme-toggle::after {
  left: 32px;
}

.rb-theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), inset 0 4px 12px rgba(0,0,0,.18);
}

[data-theme-feedback] {
  display: block;
  min-height: 1.1em;
  font-size: 11px;
  color: var(--status-error);
}

[data-theme-feedback=""]:empty {
  display: none;
}

.rb-surface-raised {
  background: var(--surface-raised);
  border: 1px solid var(--rim-color);
  box-shadow: inset 0 1px 0 var(--seam-color), var(--shadow-card);
}

.rb-surface-well {
  background: var(--bg-well);
  border: 1px solid var(--border-color);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.25);
}

.rb-surface-rail {
  background: var(--bg-rail);
  border-right: 1px solid var(--rim-color);
}

/* ── Additive micro-label / status / color / display primitives ── */

.rb-small-label {
  display: block;
  color: var(--brand-amber-light);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.2;
}

html[data-theme="light"] .rb-small-label {
  color: var(--link-color);
}

.rb-indicator-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--brand-amber);
  box-shadow:
    0 0 0 3px rgba(217, 119, 6, 0.16),
    0 0 18px rgba(245, 158, 11, 0.58);
  vertical-align: middle;
}

.rb-indicator-dot.is-success {
  background: var(--status-success);
  box-shadow:
    0 0 0 3px rgba(126, 224, 176, 0.18),
    0 0 18px rgba(126, 224, 176, 0.55);
}

html[data-theme="light"] .rb-indicator-dot.is-success {
  box-shadow:
    0 0 0 3px rgba(11, 104, 77, 0.16),
    0 0 14px rgba(11, 104, 77, 0.35);
}

.rb-indicator-dot.is-error {
  background: var(--status-error);
  box-shadow:
    0 0 0 3px rgba(255, 211, 211, 0.18),
    0 0 18px rgba(255, 211, 211, 0.45);
}

html[data-theme="light"] .rb-indicator-dot.is-error {
  box-shadow:
    0 0 0 3px rgba(142, 26, 26, 0.14),
    0 0 14px rgba(142, 26, 26, 0.28);
}

.rb-indicator-dot.is-warning {
  background: var(--status-warning);
  box-shadow:
    0 0 0 3px rgba(245, 158, 11, 0.18),
    0 0 18px rgba(245, 158, 11, 0.5);
}

html[data-theme="light"] .rb-indicator-dot.is-warning {
  box-shadow:
    0 0 0 3px rgba(217, 119, 6, 0.16),
    0 0 14px rgba(217, 119, 6, 0.32);
}

.rb-color-well {
  display: inline-flex;
  align-items: stretch;
  width: 52px;
  height: 34px;
  padding: 4px;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-well);
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 var(--seam-color);
  overflow: hidden;
  vertical-align: middle;
}

.rb-color-well input[type="color"] {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  margin: 0;
  border: 0 !important;
  border-radius: calc(var(--radius-sm) - 3px);
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.rb-color-well input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.rb-color-well input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: calc(var(--radius-sm) - 3px);
}

.rb-color-well input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: calc(var(--radius-sm) - 3px);
}

.rb-display-value {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-well-strong);
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 var(--seam-color);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

/* Status pill — black label on success/error fill; light-theme uses
   lighter tints so black text stays WCAG AA against dark status tokens. */
.rb-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #000000;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.rb-status-pill.is-success {
  background: var(--status-success);
  border-color: color-mix(in srgb, var(--status-success) 70%, #000000 12%);
}

.rb-status-pill.is-error {
  background: var(--status-error);
  border-color: color-mix(in srgb, var(--status-error) 70%, #000000 12%);
}

html[data-theme="light"] .rb-status-pill.is-success {
  background: #9FE3C2;
  border-color: color-mix(in srgb, #0B684D 28%, #9FE3C2);
}

html[data-theme="light"] .rb-status-pill.is-error {
  background: #F2B8B8;
  border-color: color-mix(in srgb, #8E1A1A 28%, #F2B8B8);
}

html {
  background-color: var(--bg-page);
}

body.rb-theme-body {
  font-family: var(--font-body) !important;
  min-height: 100vh;
  background: var(--bg-page) !important;
  color: var(--text-secondary) !important;
}

body.rb-theme-body header {
  background: var(--header-bg) !important;
  border-bottom: 1px solid var(--border-color) !important;
  box-shadow: inset 0 1px 0 var(--seam-color), 0 3px 8px var(--shadow-soft);
}

body.rb-theme-body header .brand,
body.rb-theme-body header .header-left,
body.rb-theme-body header .page-title {
  color: var(--text-primary);
}


textarea {
  resize: vertical;
  min-height: 88px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb-color) var(--scroll-track-color);
}

html,
body {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb-color) var(--scroll-track-color);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scroll-track-color);
  border-radius: 999px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: var(--scroll-track-color);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb-color);
  border-radius: 999px;
  border: 2px solid var(--scroll-track-color);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb-color);
  border-radius: 999px;
  border: 2px solid var(--scroll-track-color);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover-color);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover-color);
}

*::-webkit-scrollbar-corner {
  background: var(--scroll-track-color);
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner {
  background: var(--scroll-track-color);
}

.chain-card,
.stat-pill,
.group,
.doc-card,
.progress-panel,
.upload-panel,
.modal,
.profile-dropdown,
.rb-account-dropdown,
.admin-dropdown {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: var(--radius-md);
  box-shadow: var(--rs-panel-shadow) !important;
}

/* Panels/forms are layout shells — do not force nested card chrome */
.panel,
form {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.group summary,
.section-label,
.page-subtitle,
.doc-desc,
.count,
.date,
.chain-date,
.progress-meta {
  color: var(--text-muted) !important;
}

/* ── Terms of Service Page ─────────────────────────────────── */

.terms-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  font-family: inherit;
}

.terms-header {
  margin-bottom: 40px;
}

.terms-company {
  font-size: 13px;
  color: #718096;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.terms-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1E3A5F;
  margin: 0 0 8px;
}

.terms-meta {
  font-size: 13px;
  color: #718096;
}

.terms-body {
  color: #2D3E50;
  font-size: 15px;
  line-height: 1.7;
}

.terms-body h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1E3A5F;
  margin: 36px 0 12px;
}

.terms-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1E3A5F;
  margin: 24px 0 8px;
}

.terms-body p {
  margin: 0 0 16px;
}

.terms-body ul {
  padding-left: 24px;
  margin: 0 0 16px;
}

.terms-body ul li {
  margin-bottom: 6px;
}

.terms-body a {
  color: #D97706;
  text-decoration: none;
}

.terms-body a:hover {
  text-decoration: underline;
}

.terms-body hr {
  border: none;
  border-top: 1px solid #E2E8F0;
  margin: 32px 0;
}

.terms-body address {
  font-style: normal;
  line-height: 1.8;
}

.terms-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #E2E8F0;
  text-align: center;
  font-size: 13px;
  color: #718096;
  font-style: italic;
}

/* ── Sidebar AI Notice ─────────────────────────────────────── */

.sidebar-ai-notice {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.sidebar-ai-notice p {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-faint);
  margin: 0;
}

.sidebar-ai-notice a {
  color: var(--text-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sidebar-ai-notice a:hover {
  color: var(--text-secondary);
}

/* Archie daily briefing modal */
.ab-modal.modal-backdrop {
  z-index: 120;
}

.ab-card.modal {
  width: min(560px, 94vw);
  border-left: 3px solid var(--amber) !important;
  animation: ab-rise 200ms ease-out;
}

.ab-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.ab-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ab-owl {
  flex: 0 0 auto;
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(217, 119, 6, 0.28));
}

.ab-eyebrow {
  color: var(--link-color);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  margin-bottom: 6px;
}

.ab-title {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
}

.ab-close.close {
  position: static;
  flex: 0 0 auto;
}

.ab-loading {
  padding: 10px 0 4px;
}

.ab-loading p,
.ab-error p {
  margin: 12px 0 0;
  color: var(--text-muted);
}

.ab-scan-track {
  height: 4px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-well-strong);
}

.ab-scan-bar {
  width: 36%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--amber-bright));
  animation: ab-scan 1.1s ease-in-out infinite;
}

.ab-body {
  max-height: min(58vh, 520px);
  overflow: auto;
  padding-right: 4px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.ab-body strong {
  color: var(--text-primary);
}

.ab-body code {
  color: var(--link-color);
  font-family: var(--font-mono);
}

.ab-body pre {
  overflow: auto;
  margin: 12px 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--navy-deep);
}

.ab-body pre code {
  color: var(--link-color);
  white-space: pre-wrap;
}

.ab-actions {
  margin-top: 16px;
}

/* Buttons and the onboarding link share one look: centered labels, one or two lines, same capitals. */
.ab-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
}

@keyframes ab-scan {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(285%); }
}

@keyframes ab-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .ab-card.modal {
    padding: 14px;
  }

  .ab-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ab-actions .btn {
    width: 100%;
  }

  .ab-title {
    font-size: 18px;
  }

  .ab-owl {
    font-size: 30px;
  }
}

/* Public legal content always uses its light document palette. */
.terms-container :is(.terms-company, .terms-meta, .terms-footer p) { color: #4A5568; }
.terms-container a { color: #92400E; }
