/* Lunaris adapters for the InstantBlock console, account flow and documentation.
   The shared adapter supplies theme-aware palette and Satoshi font tokens.
   Component layouts and responsive behavior remain in their existing files. */

html[data-theme] body.customer-dashboard {
  --db-bg: var(--void);
  --db-panel: var(--panel);
  --db-panel-soft: var(--panel-2);
  --db-hover: color-mix(in srgb, var(--ink) 4%, var(--panel));
  --db-line: var(--line);
  --db-line-strong: var(--line-2);
  --db-ink: var(--ink);
  --db-copy: var(--mute);
  --db-subtle: var(--dim);
  --db-violet: var(--cobalt);
  --db-violet-soft: var(--acc-dim);
  --db-violet-line: var(--acc-line);
  --db-allow: var(--allow);
  --db-allow-soft: color-mix(in srgb, var(--allow) 10%, var(--panel));
  --db-challenge: var(--warn);
  --db-challenge-soft: color-mix(in srgb, var(--warn) 10%, var(--panel));
  --db-block: var(--block);
  --db-block-soft: color-mix(in srgb, var(--block) 10%, var(--panel));
}
html[data-theme] body.operations-overview {
  --ops-ink: var(--ink);
  --ops-muted: var(--mute);
  --ops-line: var(--line);
  --ops-soft: var(--panel-2);
  --ops-violet: var(--cobalt);
}
html[data-theme] body.admin-surface {
  --admin-violet: var(--cobalt);
  --admin-blue: var(--cobalt);
}
/* The chart renderer uses these semantic aliases for Allowed, Challenged and
   Blocked. Brand actions use --acc/--cobalt independently. */
html[data-theme] body.app-surface {
  --accent: var(--allow);
  --accent-soft: color-mix(in srgb, var(--allow) 10%, transparent);
  --acc-dim: color-mix(in srgb, var(--ember) 11%, var(--panel));
}
html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface, .error-surface) {
  background: var(--void);
  color: var(--ink);
  font-family: var(--font);
}
html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface, .error-surface) :focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

/* Workspace navigation: the same quiet black panels and blue accents as Lunaris. */
html[data-theme] body.app-surface .console-nav {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: none;
}
html[data-theme] body.app-surface .console-brand {
  color: var(--ink);
  border-color: var(--line);
  font-family: var(--font);
  font-weight: 750;
  letter-spacing: -.045em;
}
html[data-theme] body.app-surface .console-brand .brand-sub { color: var(--cobalt); }
html[data-theme="light"] body.app-surface .console-brand img { filter: none; }
html[data-theme] body.app-surface .console-nav-link {
  color: var(--mute);
  border-radius: 8px;
  font-weight: 550;
}
html[data-theme] body.app-surface .console-nav-link:is(:hover, :focus-visible) {
  color: var(--ink);
  background: var(--panel-2);
}
html[data-theme] body.app-surface .console-nav-link :is(svg, i) { color: var(--dim); }
html[data-theme] body.app-surface .console-nav-link[aria-current="page"] {
  color: var(--ink);
  background: var(--acc-dim);
  font-weight: 700;
}
html[data-theme] body.app-surface .console-nav-link[aria-current="page"] :is(svg, i) { color: var(--cobalt); }
html[data-theme] body.app-surface .console-nav-link[aria-current="page"]::before { background: var(--ember); }
html[data-theme] body.app-surface :is(.console-brand, .console-account) { border-color: var(--line); }
html[data-theme] body.app-surface .console-nav-divider { background: var(--line); }
html[data-theme] body.app-surface :is(.console-account-email, .console-nav-group, .console-credit) { color: var(--dim); }
html[data-theme] body.app-surface .console-credit a:hover { color: var(--ink); }
html[data-theme] body.app-surface .side-status { color: var(--mute); }
html[data-theme] body.app-surface .side-status.up i { background: var(--allow); }
html[data-theme] body.app-surface .side-status.up span::after { color: var(--allow); }
html[data-theme] body.app-surface .side-status.down i { background: var(--block); }
html[data-theme] body.app-surface .side-status.down span::after { color: var(--block); }
html[data-theme] body.app-surface .console-nav .console-account :is(.console-signout, .theme-toggle) {
  background: transparent;
  border-color: var(--line-2);
  color: var(--mute);
  box-shadow: none;
}
html[data-theme] body.app-surface .console-nav .console-account :is(.console-signout, .theme-toggle):hover {
  background: var(--panel-2);
  color: var(--ink);
}
html[data-theme] body.app-surface .console-nav[data-enhanced="true"] .console-nav-toggle {
  background: var(--panel-2);
  border-color: var(--line-2);
  color: var(--ink);
}

/* Reusable panels, data and controls. */
html[data-theme] body.app-surface :is(.surface, .stat-card, .viewer-summary, .blog-editor-panel, .blog-visual-frame,
  .admin-overview-metrics, .admin-site-analytics, .admin-site-trend, .admin-sites-results) {
  background: var(--panel);
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: none;
}
html[data-theme] body.app-surface :is(.main-head h1, .section-heading h2, .surface-head h2, .surface-head h3,
  .stat-card .stat-value, .empty-state h3) {
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: -.035em;
}
html[data-theme] body.app-surface :is(.main-head p, .surface-copy, .empty-state p) { color: var(--mute); }
html[data-theme] body.app-surface :is(.surface-head p, .surface-head small, .muted, .field-hint,
  .section-heading p, .stat-context, .chart-legend) { color: var(--dim); }
html[data-theme] body.app-surface :is(.surface-head, .form-section, .credential-row) { border-color: var(--line); }
html[data-theme] body.app-surface :is(.back-link, .section-heading a, .surface-head a, .data-table a) { color: var(--cobalt); }

html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface, .error-surface) .btn {
  background: var(--panel);
  border-color: var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 650;
  box-shadow: none;
}
html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface, .error-surface) .btn:hover {
  background: var(--panel-2);
  border-color: color-mix(in srgb, var(--ink) 28%, var(--panel));
  transform: none;
  box-shadow: none;
}
html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface, .error-surface) .btn:is(.btn-acc, .btn-primary),
html[data-theme] body.auth-surface .auth-form .btn.btn-acc {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--void);
  border-radius: 999px;
  box-shadow: 0 8px 28px -13px color-mix(in srgb, var(--ember) 55%, transparent);
}
html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface, .error-surface) .btn:is(.btn-acc, .btn-primary):hover,
html[data-theme] body.auth-surface .auth-form .btn.btn-acc:hover {
  background: color-mix(in srgb, var(--ink) 90%, var(--void));
  border-color: color-mix(in srgb, var(--ink) 90%, var(--void));
  color: var(--void);
  box-shadow: 0 10px 34px -13px color-mix(in srgb, var(--ember) 65%, transparent);
}
html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface, .error-surface) .btn.btn-line {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}
html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface, .error-surface) .btn.btn-line:hover { background: var(--panel-2); }
html[data-theme] body.app-surface .btn.btn-danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--block) 45%, var(--panel));
  color: var(--block);
}
html[data-theme] body.app-surface .btn.btn-danger:hover { background: color-mix(in srgb, var(--block) 9%, var(--panel)); }
html[data-theme] body.app-surface .main .btn { border-radius: 999px; }

html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface) .field label { color: var(--ink); }
html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface) .field :is(input, select, textarea),
html[data-theme] body.app-surface .filter-bar select,
html[data-theme] body.auth-surface .auth-form .field input,
html[data-theme] body.admin-surface .main :is(.field, .filter-bar, .viewer-filter, .admin-search-toolbar) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
html[data-theme] body.blog-admin .blog-editor .field :is(input, textarea) {
  background: var(--panel);
  border-color: var(--line-2);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font);
  box-shadow: none;
}
html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface) .field :is(input, textarea)::placeholder,
html[data-theme] body.auth-surface .auth-form .field input::placeholder { color: var(--dim); opacity: 1; }
html[data-theme] body:is(.app-surface, .auth-surface, .docs-surface) .field :is(input, select, textarea):focus,
html[data-theme] body.app-surface .filter-bar select:focus,
html[data-theme] body.auth-surface .auth-form .field input:focus,
html[data-theme] body.admin-surface .main :is(.field, .filter-bar, .viewer-filter, .admin-search-toolbar) :is(input, select, textarea):focus {
  border-color: var(--cobalt);
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
  box-shadow: none;
}
html[data-theme] body.app-surface :is(.check-row input, input[type="checkbox"], input[type="radio"]) { accent-color: var(--ember); }
html[data-theme] body.app-surface .data-table th,
html[data-theme] body.admin-surface .main .data-table th {
  background: var(--panel-2);
  color: var(--mute);
  border-color: var(--line);
  letter-spacing: .01em;
  text-transform: none;
  font-size: 12px;
  font-weight: 650;
}
html[data-theme] body.app-surface .data-table td { border-color: var(--line); color: var(--mute); }
html[data-theme] body.app-surface .data-table td:first-child { color: var(--ink); }
html[data-theme] body.app-surface .data-table tbody tr:is(:hover, :focus-within) { background: var(--panel-2); }
html[data-theme] body.operations-overview .ops-feed .data-table tbody tr:hover { background: transparent; }
html[data-theme] body.app-surface :is(.code-inline, .keybox) {
  background: var(--panel-2);
  border-color: var(--line-2);
  color: var(--ink);
}
html[data-theme] body.app-surface .credential-row .badge.secret { color: var(--warn); }
html[data-theme] body.app-surface .range-control {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
html[data-theme] body.app-surface .range-control button { background: transparent; color: var(--dim); border-radius: 999px; }
html[data-theme] body.app-surface .range-control button:is(.on, [aria-pressed="true"]) {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}
html[data-theme] body.app-surface .bar-track { background: var(--panel-2); }
html[data-theme] body.app-surface .bar-fill { background: var(--ember); }
html[data-theme] body.app-surface .empty-state .empty-icon { background: var(--acc-dim); color: var(--cobalt); }

/* Verdicts keep distinct semantic colors across charts, rows and notices. */
html[data-theme] body.app-surface :is(.decision.allow, .dec-accept, .vbadge.ok) {
  background: color-mix(in srgb, var(--allow) 10%, var(--panel));
  color: var(--allow);
}
html[data-theme] body.app-surface :is(.decision.review, .dec-challenge) {
  background: color-mix(in srgb, var(--warn) 10%, var(--panel));
  color: var(--warn);
}
html[data-theme] body.app-surface :is(.decision.block, .dec-reject, .vbadge.no) {
  background: color-mix(in srgb, var(--block) 10%, var(--panel));
  color: var(--block);
}
html[data-theme] body.admin-surface .decision { background: transparent; }
html[data-theme] body.app-surface .stat-context.positive { color: var(--allow); }
html[data-theme] body.app-surface .stat-context.warning { color: var(--warn); }
html[data-theme] body.app-surface .stat-context.negative { color: var(--block); }
html[data-theme] body.app-surface .callout {
  background: var(--panel);
  border-color: var(--line);
  color: var(--mute);
  border-radius: 10px;
}
html[data-theme] body.app-surface .callout strong { color: inherit; }
html[data-theme] body.app-surface .callout.success {
  background: color-mix(in srgb, var(--allow) 8%, var(--panel));
  border-color: color-mix(in srgb, var(--allow) 30%, var(--panel));
  color: var(--allow);
}
html[data-theme] body.app-surface .callout.danger {
  background: color-mix(in srgb, var(--block) 8%, var(--panel));
  border-color: color-mix(in srgb, var(--block) 30%, var(--panel));
  color: var(--block);
}
html[data-theme] body.app-surface .callout.info {
  background: var(--acc-dim);
  border-color: var(--acc-line);
  color: var(--cobalt);
}
html[data-theme] body.app-surface .intro-banner { background: var(--acc-dim); border-color: var(--acc-line); }
html[data-theme] body.app-surface .intro-banner h2 { color: var(--ink); }
html[data-theme] body.app-surface .intro-banner p { color: var(--mute); }
html[data-theme] body.app-surface .danger-panel { border-color: color-mix(in srgb, var(--block) 35%, var(--panel)); }

/* Admin analytics and record viewers. */
html[data-theme] body.admin-surface .admin-command {
  background: radial-gradient(ellipse at 96% 0%, color-mix(in srgb, var(--ember) 11%, transparent), transparent 50%), var(--panel);
  border-color: var(--line);
  border-radius: 12px;
  color: var(--ink);
}
html[data-theme] body.admin-surface .admin-command::before {
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ember) 50%, transparent) 1px, transparent 1.4px);
  opacity: .3;
}
html[data-theme] body.admin-surface .admin-command::after { background: var(--ember); }
html[data-theme] body.admin-surface :is(.admin-command-top, .admin-command-status, .admin-command-volume span,
  .admin-command-main p, .admin-command-outcomes span, .admin-command-outcomes small) { color: var(--mute); }
html[data-theme] body.admin-surface .admin-command-outcomes strong { color: var(--ink); }
html[data-theme] body.admin-surface :is(.admin-command-outcomes, .admin-command-outcomes > div) { border-color: var(--line); }
html[data-theme] body.admin-surface .admin-command-meter { background: var(--panel-2); }
html[data-theme] body.admin-surface .admin-command-meter .is-allow { background: var(--allow); }
html[data-theme] body.admin-surface .admin-command-meter .is-challenge { background: var(--warn); }
html[data-theme] body.admin-surface .admin-command-meter .is-block { background: var(--block); }
html[data-theme] body.admin-surface .admin-command-status.is-up i { background: var(--allow); box-shadow: none; }
html[data-theme] body.admin-surface .admin-command-status.is-down i { background: var(--block); }
html[data-theme] body.admin-surface :is(.admin-overview-activity, .admin-overview-signals, .admin-overview-sites) { border-top-color: var(--line); }
html[data-theme] body.admin-surface .viewer-tabs a[aria-current="page"] { border-color: var(--ember); color: var(--cobalt); }
html[data-theme] body.admin-surface :is(.viewer-summary, .admin-overview-metrics) { overflow: hidden; }
html[data-theme] body.admin-surface .viewer-summary strong { font-weight: 700; }
html[data-theme] body.admin-surface :is(.viewer-flag, .admin-flags > div span) { background: var(--panel-2); border-color: var(--line); color: var(--mute); }
html[data-theme] body.app-surface :is(.data-wrap, .viewer-history, .viewer-tabs) { scrollbar-color: var(--line-2) var(--panel); }

/* Account pages and errors. */
html[data-theme] body.auth-surface :is(.auth-topline, .auth-footer, .auth-switch) { border-color: var(--line); }
html[data-theme] body.auth-surface :is(.auth-logo, .auth-card h1, .auth-aside-copy strong) { color: var(--ink); font-family: var(--font); }
html[data-theme] body.auth-surface :is(.auth-card .lead, .auth-switch, .auth-aside p, .auth-top-link, .auth-footer a) { color: var(--mute); }
html[data-theme] body.auth-surface :is(.auth-gate, .auth-footer small) { color: var(--dim); }
html[data-theme] body.auth-surface :is(.auth-switch a, .auth-gate a, .auth-top-link span) { color: var(--cobalt); }
html[data-theme] body.auth-surface .auth-aside {
  background: radial-gradient(ellipse at 55% 20%, color-mix(in srgb, var(--ember) 8%, transparent), transparent 65%), var(--panel);
  border-color: var(--line);
  border-radius: 12px;
}
html[data-theme] body.auth-surface .auth-aside-art { background-image: radial-gradient(circle, color-mix(in srgb, var(--ember) 35%, transparent) 1px, transparent 1.3px); }
html[data-theme] body.auth-surface .auth-aside-art::after { background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--ember) 12%, transparent), transparent 68%); }
html[data-theme] body.auth-surface .auth-aside-copy { border-color: var(--line); }
html[data-theme] body.auth-surface .auth-error { background: color-mix(in srgb, var(--block) 8%, var(--panel)); border-color: color-mix(in srgb, var(--block) 30%, var(--panel)); color: var(--block); }
html[data-theme] body.auth-surface .auth-gate.bad { color: var(--block); }
html[data-theme] body.auth-surface .auth-gate .dot { background: var(--ember); box-shadow: none; }
html[data-theme] body.auth-surface .auth-gate.ok .dot { background: var(--allow); }
html[data-theme] body.auth-surface .auth-gate.bad .dot { background: var(--block); }
html[data-theme] body.auth-surface .theme-toggle { background: var(--panel); border-color: var(--line-2); color: var(--mute); border-radius: 999px; }
html[data-theme] body.auth-surface .theme-toggle:hover { background: var(--panel-2); color: var(--ink); }
html[data-theme] body.error-surface .error-content { background: var(--panel); border-color: var(--line); border-radius: 12px; }
html[data-theme] body.error-surface .error-code { color: var(--cobalt); }
html[data-theme] body.error-surface .error-content h1 { color: var(--ink); }
html[data-theme] body.error-surface .error-content p { color: var(--mute); }
html[data-theme] body.error-surface .error-credit { color: var(--dim); }

/* Documentation keeps its reading measure, sticky contents and code scrolling. */
html[data-theme] body.docs-page {
  --docs-code-bg: var(--panel);
  --docs-code-line: var(--line-2);
  --docs-code-ink: var(--ink);
  --docs-note: var(--acc-dim);
  --docs-accept: var(--allow);
  --docs-challenge: var(--warn);
  --docs-reject: var(--block);
}
html[data-theme] body.docs-page .docs-hero::before {
  background-image: radial-gradient(circle, var(--ember) 1px, transparent 1.3px);
  opacity: .1;
}
html[data-theme] body.docs-page :is(.docs-nav-title, .docs-sidebar-help, .docs-code-top) { color: var(--dim); }
html[data-theme] body.docs-page .docs-sidebar > a:is(:hover, :focus-visible) { background: var(--acc-dim); }
html[data-theme] body.docs-page .docs-note { background: var(--acc-dim); border-left-color: var(--ember); }
html[data-theme] body.docs-page .docs-note.warning { background: color-mix(in srgb, var(--warn) 8%, var(--panel)); border-left-color: var(--warn); }
html[data-theme] body.docs-page .docs-copy {
  background: var(--panel-2);
  border-color: var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font);
}
html[data-theme] body.docs-page .docs-copy:hover { background: var(--acc-dim); border-color: var(--cobalt); }
html[data-theme] body.docs-page .docs-code-wrap { border-radius: 12px; }
html[data-theme] body.docs-page .docs-code { border: 0; border-radius: 0; }
html[data-theme] body.docs-page .docs-table th { background: var(--panel-2); color: var(--mute); }
html[data-theme] body.docs-page :is(.docs-table-wrap, .docs-code, .docs-sidebar) { scrollbar-color: var(--line-2) var(--panel); }

/* Mail and editor use existing sizing, pane scroll and image positioning rules. */
html[data-theme] body.mail-surface :is(.mail-workspace, .mail-compose-dialog) { border-radius: 12px; background: var(--panel); border-color: var(--line); }
html[data-theme] body.mail-surface .mail-folders { background: var(--panel); }
html[data-theme] body.mail-surface .mail-button,
html[data-theme] body.blog-admin .blog-link-dialog button { border-radius: 999px; }
html[data-theme] body.mail-surface .mail-button-primary,
html[data-theme] body.blog-admin .blog-link-dialog .blog-link-primary { background: var(--ink); color: var(--void); border-color: var(--ink); }
html[data-theme] body.mail-surface .mail-button-primary:hover { background: color-mix(in srgb, var(--ink) 90%, var(--void)); border-color: color-mix(in srgb, var(--ink) 90%, var(--void)); }
html[data-theme] body.mail-surface .mail-folder[aria-current="page"] { background: var(--acc-dim); color: var(--cobalt); }
html[data-theme] body.mail-surface .mail-folder[aria-current="page"] .mail-folder-count { color: var(--cobalt); }
html[data-theme] body.mail-surface .mail-row[aria-current="true"] { background: var(--acc-dim); }
html[data-theme] body.mail-surface .mail-row[aria-current="true"]::before { background: var(--ember); }
html[data-theme] body.mail-surface .mail-search { background: var(--panel-2); border-color: var(--line); }
html[data-theme] body.mail-surface .mail-search:focus-within { border-color: var(--cobalt); outline: 2px solid var(--cobalt); outline-offset: 2px; }
html[data-theme] body.mail-surface .mail-compose-dialog::backdrop,
html[data-theme] body.blog-admin .blog-link-dialog::backdrop { background: rgba(0, 0, 0, .65); }
html[data-theme] body.blog-admin :is(.blog-editor-toolbar, .blog-block-handle, .blog-link-dialog) { background: var(--panel); border-color: var(--line); }
html[data-theme] body.blog-admin .blog-link-dialog { border-radius: 12px; }
html[data-theme] body.blog-admin .blog-editor-toolbar button[aria-pressed="true"] { background: var(--acc-dim); border-color: var(--acc-line); color: var(--cobalt); }
html[data-theme] body.blog-admin .blog-image-position button[aria-pressed="true"] { background: var(--acc-dim); border-color: var(--cobalt); color: var(--cobalt); }
html[data-theme] body.blog-admin .blog-image-controls { background: var(--panel-2); }

@media (max-width: 850px) {
  html[data-theme] body.app-surface .console-nav { border-bottom-color: var(--line); }
  html[data-theme] body.app-surface .console-account { border-top-color: var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme] body:is(.app-surface, .auth-surface, .docs-page, .error-surface) :is(.btn, .console-nav-link) { transition: none; }
}
