/* ATARAXIA / GRAPHITE
   Default palette sampled from the supplied graphite-and-teal interface.
   Load AFTER the component, admin and ambience stylesheets. Every component
   override is scoped to Graphite so saved legacy palettes keep their appearance.
   Kept identical in the standalone checkout service (covered by regression tests).
*/
:root:not([data-theme]),
:root[data-theme="graphite"] {
  color-scheme: dark;
  --cl-bg-0: #141b24;
  --cl-bg-1: #17202b;
  --cl-bg-2: #243140;
  --cl-background: 20,27,36;
  --cl-surface: #1b2531;
  --cl-surface-2: #243140;
  --cl-border: #304052;
  --cl-border-strong: #4d6278;
  --cl-border-faint: rgba(167,183,201,.08);
  --cl-text: #e6edf5;
  --cl-text-muted: #a7b7c9;
  --cl-text-disabled: #8a9fb5;
  --cl-accent: #6fd3c4;
  --cl-accent-soft: #8de0d3;
  --cl-accent-dim: #233f43;
  --cl-accent-fg: #0f2027;
  --cl-success: #6fd3c4;
  --cl-warning: #e4bd7c;
  --cl-danger: #f08e9c;
  --cl-ring: #6fd3c4;
  --cl-accent-rgb: 111,211,196;
  --cl-text-rgb: 230,237,245;
  --cl-accent-fg-rgb: 15,32,39;
  --cl-success-rgb: 111,211,196;
  --cl-warning-rgb: 228,189,124;
  --cl-danger-rgb: 240,142,156;
  --sh-1: 0 2px 5px #0002;
  --sh-2: 0 12px 36px #0003;
  --sh-3: 0 24px 80px #0006;
  --sh-focus: 0 0 0 3px #6fd3c430;
  --ff-display: Inter,"Segoe UI",Arial,sans-serif;
  --ff-body: Inter,"Segoe UI",Arial,sans-serif;
  --theme-header: rgba(20,27,36,.96);
  --hero-scrim: #0f1822;
  --hero-ink: #e6edf5;
  --hero-muted: #b3c3d3;
  --hero-accent: #6fd3c4;
  --hero-overlay: rgba(15,24,34,.92);
  --graphite-inset: #0f141b;
  --graphite-scrim-rgb: 15,24,34;
}

/* Dark artwork still has its own contrast-safe controls. No artwork files or
   product media are recolored; these rules replace the old purple UI overlays. */
[data-theme="graphite"] :is(.cinema-frame, .visual-scene, .account-art,
  .help-hero-image, .support-banner-art, .auth-story) {
  background: var(--hero-scrim);
}
[data-theme="graphite"] :is(.cinema-copy h1, .auth-story h2) { color: var(--hero-ink); }
[data-theme="graphite"] :is(.cinema-copy h1>span, .cinema-benefits .icon,
  .gaming-hero-copy .eyebrow, .auth-story .eyebrow) { color: var(--hero-accent); }
[data-theme="graphite"] :is(.cinema-copy>p, .cinema-benefits,
  .gaming-hero .hero-footnote, .auth-story p) { color: var(--hero-muted); }
[data-theme="graphite"] .cinema-media .scene-layers:after {
  background: linear-gradient(90deg,#0f1822 0%,#0f1822 34%,#0f1822f8 47%,#0f1822b8 59%,#0f18223d 72%,#0f182200 88%),
              linear-gradient(0deg,#0f1822c7,transparent 32%);
}
[data-theme="graphite"] .hero-atmosphere:after {
  background: linear-gradient(90deg,#0f1822 2%,#0f1822f7 27%,#0f18228a 54%,#0f182214 86%),
              linear-gradient(0deg,#0f1822c9,transparent 55%,#0f182229);
}
[data-theme="graphite"] :is(.cinema-copy, .gaming-hero) .btn-dark {
  background: var(--cl-accent);
  border-color: var(--cl-accent);
  color: var(--cl-accent-fg);
}
[data-theme="graphite"] :is(.cinema-copy, .gaming-hero) .btn-dark:hover {
  background: var(--cl-accent-soft);
  border-color: var(--cl-accent-soft);
  color: var(--cl-accent-fg);
}
[data-theme="graphite"] :is(.cinema-copy, .gaming-hero) .btn-secondary {
  background: #1b2531ed;
  border-color: var(--cl-border-strong);
  color: var(--cl-text);
}
[data-theme="graphite"] :is(.cinema-copy, .gaming-hero) .btn-secondary:hover {
  background: var(--cl-surface-2);
  border-color: var(--cl-text-disabled);
}
[data-theme="graphite"] :is(.hero-featured, .scene-dots, .scene-buttons) {
  background: var(--hero-overlay);
  border-color: var(--cl-border-strong);
}
[data-theme="graphite"] .hero-featured:hover { border-color: var(--cl-accent); }
[data-theme="graphite"] :is(.featured-kicker, .featured-cta,
  .hero-footnote .icon, .hero-grid-corner) { color: var(--cl-accent); }
[data-theme="graphite"] .hero-featured>[data-hero-category] { color: var(--cl-text-muted); }
[data-theme="graphite"] .featured-cta { border-color: var(--cl-border); }
[data-theme="graphite"] .scene-controls button { color: var(--hero-ink); }
[data-theme="graphite"] .scene-controls button:hover { background: var(--cl-accent-dim); }
[data-theme="graphite"] .scene-controls button:focus-visible {
  outline-color: var(--cl-ring);
}
[data-theme="graphite"] .scene-dot>span { background: var(--cl-text-muted); }
[data-theme="graphite"] .scene-dot[aria-pressed=true]>span { background: var(--cl-accent); }
[data-theme="graphite"] .scene-buttons [data-motion-toggle][aria-pressed=true] {
  background: var(--cl-accent-dim);
}
[data-theme="graphite"] .scene-controls select.scene-select {
  color: var(--hero-ink);
  background: var(--hero-overlay);
  border-color: var(--cl-border-strong);
}
[data-theme="graphite"] .scene-controls select.scene-select:focus {
  background: var(--hero-scrim);
  outline-color: var(--cl-ring);
}
[data-theme="graphite"] .guide-art .scene-layers:after {
  background: linear-gradient(0deg,#0f1822a0,transparent 35%);
}
[data-theme="graphite"] .auth-orbit:after {
  background: linear-gradient(180deg,#0f1822f5,#0f182238 55%,#0f1822f5);
}
[data-theme="graphite"] .auth-story-signature { color: var(--cl-text-muted); }

/* Catalog, galleries, dialogs and status information. */
[data-theme="graphite"] :is(.card-open, .card-demo-label) {
  background: var(--hero-overlay);
  color: var(--hero-ink);
  border-color: var(--cl-border-strong);
}
[data-theme="graphite"] .product-card .media:after {
  background: linear-gradient(transparent,#0f182290);
}
[data-theme="graphite"] .product-card .media>.pill {
  background: #173532ed;
  color: #9be5d8;
  border-color: #6fd3c44d;
}
[data-theme="graphite"] .product-card .media>.pill-warning {
  background: #3b3022ed;
  color: var(--cl-warning);
  border-color: #e4bd7c4d;
}
[data-theme="graphite"] .lightbox::backdrop { background: #0f141be8; }
[data-theme="graphite"] .workspace-scrim { background: #0f141ba8; }
[data-theme="graphite"] .ui-toast {
  background: var(--cl-surface-2);
  color: var(--cl-text);
  border: 1px solid var(--cl-border-strong);
}
[data-theme="graphite"] :is(.review-card .stars, .review-stars) { color: var(--cl-warning); }
[data-theme="graphite"] :is(.nav-logo img, .philosophy-symbol img) { filter: brightness(0) invert(91%); }

/* Keep the editor's legacy charts and helper labels within the same palette. */
[data-theme="graphite"] :is(.workspace-topbar, .workspace-sidebar) {
  background: var(--cl-bg-1);
  border-color: var(--cl-border);
}
[data-theme="graphite"] :is(.workspace-label, .admin-eyebrow, .admin-kpi-meta,
  .chart-meta, .workspace-help, .workspace-profile small, .admin-table .muted) {
  color: var(--cl-text-muted);
}
[data-theme="graphite"] :is(.workspace-profile, .workspace-sidebar-bottom) {
  border-color: var(--cl-border);
}
[data-theme="graphite"] :is(.ranking-track, .bar-chart-track) { background: var(--cl-surface-2); }
[data-theme="graphite"] .bar-chart-fill { background: var(--cl-accent); }
[data-theme="graphite"] .native-chart text { fill: var(--cl-text-muted); }
[data-theme="graphite"] .native-chart .chart-gridline { stroke: var(--cl-border); }
[data-theme="graphite"] .native-chart .chart-area { fill: var(--cl-accent-dim); }
[data-theme="graphite"] .native-chart .chart-line { stroke: var(--cl-accent); }
[data-theme="graphite"] .native-chart circle {
  fill: var(--cl-accent);
  stroke: var(--cl-surface);
}
[data-theme="graphite"] :is(.chart-data-table, .chart-data-table summary,
  .bar-chart-row, .bar-chart-row strong) { color: var(--cl-text-muted); }
[data-theme="graphite"] :is(.chart-data-table th, .chart-data-table td) {
  border-color: var(--cl-border);
}

/* Preserve the original responsive scrim geometry, not a desktop gradient
   stretched over the separate image/text regions on phones. */
@media (min-width:701px) and (max-width:900px) {
  [data-theme="graphite"] .cinema-media .scene-layers:after {
    background: linear-gradient(90deg,#0f1822ed,#0f1822b8 37%,#0f182230 75%),
                linear-gradient(0deg,#0f1822aa,transparent 45%);
  }
}
@media (max-width:700px) {
  [data-theme="graphite"] .cinema-copy { background: var(--hero-scrim); }
  [data-theme="graphite"] .cinema-media .scene-layers:after {
    background: linear-gradient(0deg,#0f182280,transparent 45%),
                linear-gradient(180deg,#0f182240,transparent 20%);
  }
  [data-theme="graphite"] .hero-atmosphere:after {
    background: linear-gradient(180deg,#0f1822 0%,#0f1822fa 23%,#0f1822dc 39%,#0f182200 65%,#0f18228a),
                linear-gradient(90deg,#0f182220,#0f182240);
  }
}

/* Screenshot pass 2: the gallery retained hard-coded plum controls, and the
   assurance captions inherited a low-contrast legacy color from their children. */
[data-theme="graphite"] :is(.gallery-controls .icon-button, .gallery-count) {
  background: #0f1822ed;
  color: var(--cl-text);
  border: 1px solid var(--cl-border-strong);
}
[data-theme="graphite"] .gallery-controls .icon-button:hover {
  background: var(--cl-accent-dim);
  border-color: var(--cl-accent);
}
[data-theme="graphite"] .product-assurance>div:not(.product-assurance-art) {
  color: var(--cl-text-muted);
}
[data-theme="graphite"] :is(.input, .select, .textarea, .form-input,
  .admin-input, .admin-select, .admin-textarea, .catalog-search) {
  background: var(--cl-surface-2);
}
/* Search input itself remains transparent inside its raised field container. */
[data-theme="graphite"] .catalog-search input[type=search] { background: transparent; }

/* Screenshot pass 3: support shortcuts and the bare search input bypassed the
   shared component colors. Use one field outline and readable placeholder ink. */
[data-theme="graphite"] .help-sidebar a { color: var(--cl-text-muted); }
[data-theme="graphite"] .help-sidebar a:hover { color: var(--cl-accent); }
[data-theme="graphite"] .help-search {
  background: var(--cl-surface-2);
  border-color: var(--cl-border);
}
[data-theme="graphite"] .help-search:focus-within {
  border-color: var(--cl-ring);
  box-shadow: var(--sh-focus);
}
[data-theme="graphite"] .help-search input[type=search] {
  background: transparent;
  color: var(--cl-text);
  border: 0;
  box-shadow: none;
  outline: none;
  padding: 10px 0;
  min-width: 0;
}
[data-theme="graphite"] .help-search input[type=search]::placeholder {
  color: var(--cl-text-disabled);
  opacity: 1;
}
