/* Light colors inherit the existing design. These tokens describe site surfaces. */
:root {
  color-scheme: light;
  --surface: #f7f8f4;
  --surface-raised: #fff;
  --text-muted: #6b6f66;
  --theme-border: #dedfd9;
  --theme-track: #e9ece5;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f6f7f3;
  --paper: #080b09;
  --yellow: #182019;
  --blue: var(--theme-accent);
  --blue-soft: #111812;
  --purple: #19211b;
  --line: #343b35;
  --surface: #101611;
  --surface-raised: #19211b;
  --text-muted: #a7b0a6;
  --theme-border: #343b35;
  --theme-track: #29332a;
  --theme-accent: #bec9bc;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  flex: none;
  font-size: 11px;
  font-weight: 550;
}
.theme-toggle:hover { background: var(--surface); }
.theme-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.theme-label { min-width: 49px; text-align: left; }
.theme-track { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--theme-track); flex: none; }
.theme-thumb { display: grid; place-items: center; position: absolute; inset: 3px auto 3px 3px; width: 20px; border-radius: 50%; background: #fff; color: #383f35; transition: transform .2s ease; }
.theme-thumb svg { width: 13px; height: 13px; }
.theme-moon { display: none; }
[data-theme="dark"] .theme-thumb { transform: translateX(18px); background: var(--theme-accent); color: #10150b; }
[data-theme="dark"] .theme-sun { display: none; }
[data-theme="dark"] .theme-moon { display: block; }

[data-theme="dark"] body { background: radial-gradient(ellipse at 72% 0, #19231b55, transparent 32%), var(--paper); }
[data-theme="dark"] ::selection { background: var(--theme-accent); color: #080b09; }
[data-theme="dark"] :is(button, a, summary, input, textarea):focus-visible { outline-color: var(--theme-accent); }
[data-theme="dark"] .pill { background: var(--theme-accent); color: #10150b; }
[data-theme="dark"] .pill:hover { box-shadow: 0 5px 24px #bec9bc22; }
[data-theme="dark"] .pill .arrow { background: #10150b; color: var(--theme-accent); }
[data-theme="dark"] .underlined:after { background: var(--theme-accent); opacity: .45; }
[data-theme="dark"] :is(.eyebrow, .hero-caption, .concept-note, .process-grid p, .about-content .about-note, .form-explanation, .flow-status) { color: var(--text-muted); }
[data-theme="dark"] .eyebrow span { color: var(--theme-accent); }
[data-theme="dark"] .brand-mark { color: var(--theme-accent); }
[data-theme="dark"] .asterisk-still { filter: grayscale(1) brightness(1.4); }


[data-theme="dark"] .auto-card { background: var(--surface-raised); color: var(--ink); border: 1px solid var(--theme-border); box-shadow: 3px 5px 14px #0004; }
[data-theme="dark"] .auto-connector { color: var(--theme-accent); }
[data-theme="dark"] .integration:not(.telegram) { background: var(--surface-raised); border: 1px solid var(--theme-border); }
[data-theme="dark"] .marquee { background: #111812; color: var(--theme-accent); border-block: 1px solid var(--theme-border); }
[data-theme="dark"] .service { background: var(--surface); border-right: 1px solid var(--theme-border); }
[data-theme="dark"] :is(.bot-service, .auto-service) { background: #141c15; }
[data-theme="dark"] :is(.service-description, .faq-grid details, .detail-related a, .process-grid article, .process-grid i.process-icon, .project-filters) { border-color: var(--theme-border); }
[data-theme="dark"] .service-description:hover { background: var(--surface-raised); border-color: var(--theme-accent); }
[data-theme="dark"] :is(.service-select button, .project-filters button)[aria-pressed="true"] { background: var(--theme-accent); color: #10150b; }
[data-theme="dark"] .service-select button { background: #263128; color: var(--ink); }
[data-theme="dark"] .project-filters button { color: var(--text-muted); }
[data-theme="dark"] :is(.project-web, .project-app) { background: var(--surface); border: 1px solid var(--theme-border); }
[data-theme="dark"] .concept { color: var(--theme-accent); background: #263323; }
[data-theme="dark"] .ecosystem { background: #111812; border-block: 1px solid var(--theme-border); }
[data-theme="dark"] .flow-node { background: var(--surface-raised); border: 1px solid var(--theme-border); }
[data-theme="dark"] .flow-node p { background: #29332a; color: #dce3d8; }
[data-theme="dark"] .flow-line path { stroke: var(--theme-accent); }
[data-theme="dark"] .text-button { color: var(--theme-accent); border-color: var(--theme-accent); }
[data-theme="dark"] .process-grid article:after { background: var(--theme-border); }
[data-theme="dark"] .process-grid i.process-icon { color: var(--theme-accent); }
[data-theme="dark"] .contact { background: #111812; }
[data-theme="dark"] .contact-form { background: var(--surface-raised); color: var(--ink); border: 1px solid var(--theme-border); }
[data-theme="dark"] .contact-form :is(input, textarea) { background: #101611; color: var(--ink); border-color: #465047; }
[data-theme="dark"] .contact-form :is(input, textarea)::placeholder { color: var(--text-muted); }
[data-theme="dark"] .form-status { color: var(--theme-accent); }
[data-theme="dark"] :is(.detail-cta, .concept-banner) { background: var(--surface); border: 1px solid var(--theme-border); }
[data-theme="dark"] .menu-toggle span { background: var(--ink); }
[data-theme="dark"] .header nav { border-color: var(--theme-border); }
/* Device screens represent independent products, so retain their own light palettes. */
.phone-screen, .laptop-screen, .integration-workflow { color-scheme: light; }
[data-theme="dark"] .phone-screen { --blue: #2447d8; --yellow: #f4ebc8; }
[data-theme="dark"] .automation-details summary:before { color: #10150b; }
[data-theme="dark"] .integration-workflow { background: linear-gradient(145deg, #1e2921, #131b16); border-color: var(--theme-border); color: var(--ink); box-shadow: 7px 10px 0 -3px #263028, 12px 21px 27px #0004; }
[data-theme="dark"] .workflow-topline b { color: var(--text-muted); }
[data-theme="dark"] .workflow-result { border-color: var(--theme-border); }
[data-theme="dark"] .workflow-node svg { background: #2b382d; }
[data-theme="dark"] .workflow-node.is-primary svg { background: #375422; }
[data-theme="dark"] .workflow-connector { background: #6d865e; }
/* Detail navigation uses a normal row on small screens instead of the home menu. */
@media (max-width: 1100px) and (min-width: 801px) { .header { gap: 12px; } .header-actions { gap: 8px; } .header nav { gap: 16px; } }
@media (max-width: 800px) {
  .detail-header { height: auto; min-height: 80px; flex-wrap: wrap; padding-block: 18px; }
  .detail-header .theme-toggle { margin-left: auto; }
  .detail-header .detail-nav { position: static; display: flex; flex-direction: row; order: 3; width: 100%; padding: 8px 0 0; background: transparent; border: 0; font-size: 12px; gap: 18px; }
  .detail-nav a:first-child { display: inline; }
}
@media (max-width: 480px) {
  .theme-label { display: none; }
  .theme-toggle { padding-inline: 7px; min-width: 60px; }
  .header-actions { gap: 8px; }
  .header { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .theme-thumb { transition: none; } }
