/* Mist Blue palette for the main console. Component layout stays in the base sheets. */
:root {
  --bg: #eef3f7;
  --panel: #fff;
  --surface: #f4f7fa;
  --sidebar: #e6eef5;
  --sidebar-text: #304a63;
  --text: #1f3040;
  --muted: #536577;
  --line: #ccdbe7;
  --accent: #24547c;
  --accent-dark: #193f61;
  --accent-soft: #e0edf7;
  --cream: var(--accent-soft);
  --teal: #246b71;
  --blue: var(--accent);
  --blue-bg: var(--accent-soft);
  --red: #9f3537;
  --red-dark: #84282c;
  --danger-bg: #fbecee;
  --danger-line: #e3b9c0;
  --amber: #f9eed7;
  --amber-text: #684714;
  --green: #205c47;
  --green-bg: #e4f1e9;
  --table-head: #edf3f8;
  --scroll-thumb: #71899c;
  --shadow: 0 18px 48px rgba(31, 48, 64, .16);
  --panel-shadow: 0 7px 24px rgba(31, 48, 64, .06);
  --focus-ring: 0 0 0 3px rgba(36, 84, 124, .2);
}

body { background: var(--bg); }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); box-shadow: none; }
.brand, .sidebar-foot { border-color: var(--line); }
.brand span, .sidebar-foot { color: var(--sidebar-text); }
.sidebar-foot i { background: var(--teal); }
.nav-button { color: var(--sidebar-text); }
.nav-button:hover { background: #d6e4ef; color: var(--accent-dark); }
.nav-button.active { background: var(--accent); color: #fff; box-shadow: none; }
.nav-button .nav-count { background: var(--teal); box-shadow: none; }
.mode, .user, .notification-button { background: var(--panel); }
.mode { color: var(--accent); }
.safety-banner {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--line);
  border-left-color: var(--accent);
  box-shadow: none;
}

.card, .panel, .catalog-package { background: var(--panel); box-shadow: var(--panel-shadow); }
.field > span, .field > label, .function-presets > span,
.package-body > small, .package-functions span, .function-choice small,
.rule-controls-panel p { color: var(--muted); }
input, select, textarea { border-color: var(--line); background: var(--panel); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
.switch input:focus-visible + span, .table-wrap[tabindex]:focus-visible,
.material-append .btn:focus-visible, .material-append a:focus-visible,
.material-append .table-wrap:focus-visible, .material-append .tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.checkbox, .rule-controls-panel input[type=checkbox], input[type=radio],
#build-progress-content progress, .function-choice input { accent-color: var(--accent); }
.btn:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--line); box-shadow: var(--panel-shadow); }
.btn.primary, .rule-controls-panel button[type=submit], .billing-switch .btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: none;
}
.btn.primary:hover:not(:disabled), .rule-controls-panel button[type=submit]:hover:not(:disabled),
.billing-switch .btn.active:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}
.btn.link { color: var(--accent); }
.btn.danger, .btn.danger:hover:not(:disabled) {
  color: var(--red);
  border-color: var(--danger-line);
  background: var(--danger-bg);
}

.table-wrap, th, td, .timeline-item, .account-row, .rule-controls-panel button,
.rule-controls-panel select, .rule-controls-panel input[type=time], .rule-controls-panel textarea,
.accounts-panel .account-tag-search input, .account-tag-editor .account-tag-search input,
.account-tag-status select, .account-tag-chip, .name-editor,
.function-choice, .function-grid fieldset { border-color: var(--line); }
.dashboard-recent-action > div {
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
}
.recent-action-summary, .recent-action-receipt { display: block; }
.recent-action-receipt, .recent-action-receipts { font-size: 12px; }
.recent-action-receipts > summary { cursor: pointer; color: var(--accent); }
@media (max-width: 560px) {
  .dashboard-recent-action { grid-template-columns: 1fr; row-gap: 3px; }
}
th, .application-head { background: var(--table-head); color: var(--muted); }
tbody tr:hover td, .account-row, .result-box, .name-editor,
.material-append-receipt, .rule-pending-evidence-body { background: var(--surface); }
.cell-title, dialog { color: var(--text); }
.binding { border-left-color: var(--line); }
.table-wrap::-webkit-scrollbar-track,
.rule-actions-panel .table-wrap::-webkit-scrollbar-track,
.material-append .table-wrap::-webkit-scrollbar-track { background: var(--table-head); }
.table-wrap::-webkit-scrollbar-thumb,
.rule-actions-panel .table-wrap::-webkit-scrollbar-thumb,
.material-append .table-wrap::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-color: var(--table-head); }
.tag, .step, .access-state { background: var(--table-head); color: var(--muted); }
.tag.danger, .access-state.muted { background: var(--danger-bg); color: var(--red); }
.access-state.opened { background: var(--green-bg); color: var(--green); }
.access-state.pending { background: var(--amber); color: var(--amber-text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.step.active { background: var(--accent); color: #fff; box-shadow: none; }
.loading-dot { background: var(--accent); }
.switch span { background: #788fa0; }
.switch input:checked + span { background: var(--green); }

.authorization-choice { background: var(--panel); }
.authorization-choice:hover { border-color: var(--scroll-thumb); }
.authorization-choice:has(input:checked),
.account-tag-chip[aria-pressed=true] { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent); }
.account-tag-chip { background: var(--surface); }
dialog::backdrop { background: rgba(31, 48, 64, .48); }
.notice-drawer { background: var(--panel); }
#toast { background: var(--text); box-shadow: var(--shadow); }
.material-append .material-append-selected td { background: var(--accent-soft); }
.material-append-video { color: var(--accent); }

.package-heading { background: var(--accent-soft); color: var(--accent-dark); }
.tone-1 .package-heading { background: #e1efef; color: #133f45; }
.tone-2 .package-heading { background: #d8e5f0; color: var(--accent-dark); }
.package-price .quoted-price { color: var(--text); }
.price-pending, .function-choice em { color: var(--amber-text); }
.feature-status { color: var(--teal); }
.inclusion-yes { color: var(--green); }
.inclusion-no { color: var(--muted); }

@media (max-width: 760px) {
  .table-wrap::after { color: var(--muted); background: var(--surface); border-top-color: var(--line); }
}

/* Keep long account names within the viewport at every screen width. */
.top-actions { min-width: 0; max-width: 100%; }
.top-actions .user { min-width: 0; max-width: 100%; overflow-wrap: anywhere; text-align: left; }

/* Keep account settings reachable for both administrators and brand users. */
@media (max-width: 760px) {
  .top-actions .user {
    display: inline-block;
  }
}

/* Long account names must wrap without pushing the close button off-screen. */
.modal-head > div { min-width: 0; overflow-wrap: anywhere; }
.modal-head .close { flex-shrink: 0; }

/* Loading placeholders wrap on narrow screens instead of expanding the page. */
.page-skeleton, .skeleton-toolbar, .skeleton-panel { min-width: 0; max-width: 100%; }
.skeleton-toolbar { flex-wrap: wrap; }
.skeleton-toolbar i { max-width: 100%; }

/* Long account names wrap within the brand user's account settings. */
.account-access-card, .assigned-account { grid-template-columns: minmax(0, 1fr); }
.assigned-account > * { min-width: 0; overflow-wrap: anywhere; }
