/* R88 · Measured foreground/background pairs. Brand artwork keeps its original
   colours. These tokens describe UI surfaces, not advertiser creative output. */
:root {
  --r88-ink:#241735;--r88-copy:#605174;--r88-muted:#685b7c;
  --r88-page:#f6f4fb;--r88-paper:#fff;--r88-soft:#f1edf8;
  --r88-line:#d7cee5;--r88-control-line:#87779b;
  --r88-link:#59359f;--r88-selected:#ede5fa;--r88-focus:#6b46c1;
  --r88-success:#086b48;--r88-success-bg:#e8f6ef;
  --r88-danger:#b12e43;--r88-danger-bg:#fff0f2;
  --r88-warning:#855000;--r88-warning-bg:#fff4dd;
}
:root[data-theme="dark"] {
  --r88-ink:#f3edf9;--r88-copy:#d8cde9;--r88-muted:#c0b2d3;
  --r88-page:#170f26;--r88-paper:#231833;--r88-soft:#30223f;
  --r88-line:#554566;--r88-control-line:#9683ad;
  --r88-link:#d0baf8;--r88-selected:#3a2658;--r88-focus:#cfb9f5;
  --r88-success:#8ce2bd;--r88-success-bg:#163a2d;
  --r88-danger:#ffb6c0;--r88-danger-bg:#482432;
  --r88-warning:#f5d08a;--r88-warning-bg:#44321b;
}
@media(prefers-color-scheme:dark) {
  :root[data-ddak-surface="admin"]:not([data-theme="light"]) {
    --r88-ink:#f3edf9;--r88-copy:#d8cde9;--r88-muted:#c0b2d3;
    --r88-page:#170f26;--r88-paper:#231833;--r88-soft:#30223f;
    --r88-line:#554566;--r88-control-line:#9683ad;
    --r88-link:#d0baf8;--r88-selected:#3a2658;--r88-focus:#cfb9f5;
    --r88-success:#8ce2bd;--r88-success-bg:#163a2d;
    --r88-danger:#ffb6c0;--r88-danger-bg:#482432;
    --r88-warning:#f5d08a;--r88-warning-bg:#44321b;
  }
}
/* A faint focus halo cannot identify keyboard focus. Use a solid, offset ring. */
:root :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible,
html[data-ddak-surface] body #app :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible {
  outline:3px solid var(--r88-focus)!important;outline-offset:3px!important;
}
:root .side :focus-visible,html[data-ddak-surface="admin"] body #app .sidebar :focus-visible {outline-color:#cfb9f5!important}
@media(min-width:1024px) {
  html[data-ddak-surface="advertiser"] body #app .app-bottom-nav :focus-visible {outline-color:#cfb9f5!important}
}
:root :is(input,textarea)::placeholder,
html[data-ddak-surface] body #app :is(input,textarea)::placeholder {
  color:var(--r88-muted)!important;opacity:1!important;
}
:root :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]),select,textarea),
html[data-ddak-surface] body #app :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]),select,textarea) {
  border-color:var(--r88-control-line)!important;
}
/* Public page footnotes and form placeholders retain a quiet, readable tone. */
:root .inquiry-r87 :is(input,textarea)::placeholder {color:var(--r88-muted)!important;opacity:1}
:root body a.skip-link {background:#6b46c1!important;color:#fff!important}
:root .mobile-menu-caption-r87 {color:var(--r88-muted)!important}

/* Foundation tokens previously stayed light even when the shell was dark. */
:root[data-ddak-surface="admin"] {
  --r71-admin-page:var(--r88-page);--r71-admin-ink:var(--r88-ink);--r71-admin-muted:var(--r88-muted);--r71-admin-line:var(--r88-line);
  --ddak76-ink:var(--r88-ink);--ddak76-text:var(--r88-copy);--ddak76-muted:var(--r88-muted);
  --ddak76-canvas:var(--r88-page);--ddak76-surface:var(--r88-paper);--ddak76-soft:var(--r88-soft);--ddak76-line:var(--r88-line);--ddak76-line-strong:var(--r88-control-line);
  --ink:var(--r88-ink);--text:var(--r88-copy);--sub:var(--r88-copy);--muted:var(--r88-muted);
  --bg:var(--r88-paper);--bg-page:var(--r88-page);--panel:var(--r88-paper);--input:var(--r88-paper);
  --line:var(--r88-line);--line-strong:var(--r88-control-line);--border:var(--r88-line);
  --chip-bg:var(--r88-soft);--chip-fg:var(--r88-copy);
  --brand:#6b46c1;--brand-deep:#59349e;--brand-text:var(--r88-link);--brand-soft:var(--r88-selected);
  --danger:var(--r88-danger);--danger-deep:var(--r88-danger);--danger-soft:var(--r88-danger-bg);
  --success:var(--r88-success);--success-deep:var(--r88-success);--success-soft:var(--r88-success-bg);
  --warning:var(--r88-warning);--warning-deep:var(--r88-warning);--warning-soft:var(--r88-warning-bg);
  --r85-copy:var(--r88-copy);--r85-line:var(--r88-line);
}
html[data-ddak-surface="admin"] body #app :is(.topbar,.app-header,.admin-header) {
  background:var(--r88-paper)!important;color:var(--r88-ink)!important;
}
html[data-ddak-surface="admin"] body #app :is(.panel,.card,.system-card,.advertiser-control-panel,.cafe24-r56-panel) {
  background:var(--r88-paper)!important;
}
html[data-ddak-surface="admin"] body #app :is(.panel-head p,.hint,.empty,.muted,.admin-chart-source,.pi51-drop>small) {color:var(--r88-muted)!important}
html[data-ddak-surface="admin"] body #app :is(.table-wrap thead th,table thead th) {background:var(--r88-soft)!important;color:var(--r88-copy)!important}
html[data-ddak-surface="admin"] body #app :is(.table-wrap td small,.detail-grid>div>small) {color:var(--r88-muted)!important}
html[data-ddak-surface="admin"] body #app :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea) {background:var(--r88-paper)!important;color:var(--r88-ink)!important}
html[data-ddak-surface="admin"] body #app .r17-skip-link {background:#6b46c1!important;color:#fff!important}
html[data-ddak-surface="admin"] body #app .segmented button.active {color:var(--r88-link)!important;border-color:var(--r88-focus)!important}
html[data-ddak-surface="admin"] body #app .icon-btn:is(:hover,:focus-visible,[aria-expanded="true"]) {color:var(--r88-link)!important}
html[data-ddak-surface="admin"] body #app :is(.pi54-source-identity,.pi54-report-guide,.pi54-guide-grid small,.admin-conversation-feedback,.admin-request-feedback) {background:var(--r88-soft);color:var(--r88-copy)}
html[data-ddak-surface="admin"] body #app .pi54-guide-grid small.is-verified {background:var(--r88-success-bg);color:var(--r88-success)}
html[data-ddak-surface="admin"] body #app :is(.ps49-text-button,.ps49-kicker) {color:var(--r88-link)}
html[data-ddak-surface="admin"] body #app :is(.web-inquiry-list-meta-r87 time,.web-inquiry-list-r87>button>span:not(:first-child),.web-inquiry-list-r87>button>p) {color:var(--r88-muted)}
html[data-ddak-surface="admin"] body #app .web-inquiry-list-meta-r87 em {background:var(--r88-selected);color:var(--r88-link)}
html[data-ddak-surface="admin"] body #app :is(.web-inquiry-stats-r87 button,.web-inquiry-list-r87>button)[aria-pressed="true"] {background:var(--r88-selected);color:var(--r88-ink);border-color:var(--r88-focus)}
html[data-ddak-surface="admin"] body #app :is(.pi54-report-guide summary span,.pi54-guide-grid span,.r48-access-mode em,.r48-access-mode small,.cafe24-r56-note,.cafe24-r56-count,.cafe24-r56-panel li) {color:var(--r88-muted)!important}
html[data-ddak-surface="admin"] body #app :is(.r47-settings-kicker,.r47-registration-steps li>span,.r46-step-title>span,.r46-setup-field em,.r46-url-status,.r46-copy-feedback,.r48-permission-dependency,.r48-permission-feedback,.cafe24-r56-guide,.cafe24-r56-kicker) {color:var(--r88-link)!important}
html[data-ddak-surface="admin"] body #app .mw55 {--mw55-ink:var(--r88-ink);--mw55-sub:var(--r88-copy);--mw55-muted:var(--r88-muted);--mw55-line:var(--r88-line);--mw55-paper:var(--r88-paper);--mw55-soft:var(--r88-soft);--mw55-lavender:var(--r88-selected)}
html[data-ddak-surface="admin"] body #app :is(.mw55-hero,.mw55-head,.mw55-empty,.mw55-notifications>summary) {background:var(--r88-paper)!important;color:var(--r88-ink)!important}
html[data-ddak-surface="admin"] body #app :is(.mw55-nav,.mw55-notification-list) {background:var(--r88-paper)!important;color:var(--r88-copy)!important}
html[data-ddak-surface="admin"] body #app :is(.mw55-btn:not(.primary),.mw55-nav button) {color:var(--r88-copy)!important}
html[data-ddak-surface="admin"] body #app :is(.mw55-eyebrow,.mw55-notifications>summary span,.mw55-nav button.is-active) {color:var(--r88-link)!important}
html[data-ddak-surface="admin"] body #app .mw55-nav button.is-active {background:var(--r88-selected)!important}

/* Advertiser: preserve semantic positive/negative/neutral states on both themes. */
html[data-ddak-surface="advertiser"] body #app .ddak-pro-metric-reading>em {background:var(--r88-soft)!important;color:var(--r88-copy)!important}
html[data-ddak-surface="advertiser"] body #app .ddak-pro-metric-reading>em.positive {background:var(--r88-success-bg)!important;color:var(--r88-success)!important}
html[data-ddak-surface="advertiser"] body #app .ddak-pro-metric-reading>em.negative {background:var(--r88-danger-bg)!important;color:var(--r88-danger)!important}
html[data-ddak-surface="advertiser"] body #app .ddak-skip-to-content {background:#6b46c1!important;color:#fff!important}
html[data-ddak-surface="advertiser"] body #app :is(.ddak-ui-section-head>button,.ddak-ui-business-avatar) {color:var(--r88-link)!important}
html[data-ddak-surface="advertiser"] body #app .ddak-operation-filters>button>span {color:var(--r88-link)!important}
html[data-ddak-surface="advertiser"] body #app .ddak-ui-state-pill.running {color:var(--r88-success)!important;background:var(--r88-success-bg)!important}
html[data-ddak-surface="advertiser"] body #app .ddak-notice-head>span {color:var(--r88-link)!important}
html[data-ddak-surface="advertiser"] body #app .ddak-password-field>button {color:var(--r88-link)!important}
/* SVG text uses fill rather than color. Keep legend, axis, line and point colours
   in sync, including inline styles in the existing chart renderer. */
html[data-ddak-surface] body #app {
  --naver-clone-blue:var(--r88-link);--naver-clone-green:var(--r88-success);
  --naver-clone-axis:var(--r88-muted);
  --naver-chart-series-1:var(--r88-link);--naver-chart-series-2:var(--r88-success);
}
html[data-ddak-surface] body #app .naver-clone-line {stroke-width:2}
html[data-ddak-surface] body #app .naver-clone-line.series-2 {stroke-dasharray:7 3}
html[data-ddak-surface] body #app .naver-clone-compare {opacity:1;stroke-dasharray:2 5;stroke-width:1.5}
html[data-ddak-surface="advertiser"][data-theme="dark"] body #app :is(.ddak-home-v12-operation-strip .ddak-icon,.ddak-operation-types .ddak-icon,.ddak-ui-quick-actions .ddak-icon,.ddak-performance-meaning>span) {color:var(--r88-link)!important}

@media(forced-colors:active) {
  :root :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible,
  html[data-ddak-surface] body #app :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible {outline-color:Highlight!important}
}

/* Preserve the existing user-selected high-contrast preference. */
:root[data-contrast="high"] {--r88-ink:#1d102f;--r88-copy:#352344;--r88-muted:#493753;--r88-control-line:#63516f}
:root[data-theme="dark"][data-contrast="high"] {--r88-ink:#fff;--r88-copy:#f5edff;--r88-muted:#e4d6f4;--r88-control-line:#beaad6}
@media(prefers-color-scheme:dark) {
  :root[data-ddak-surface="admin"][data-contrast="high"]:not([data-theme="light"]) {--r88-ink:#fff;--r88-copy:#f5edff;--r88-muted:#e4d6f4;--r88-control-line:#beaad6}
}
