﻿/* Paletas adicionais do RoutePilot.
   Carregada DEPOIS de theme-dark.css: redefine apenas variaveis e componentes.
   data-theme continua light|dark (CSS escuro existente) e data-palette identifica a paleta.
   Contraste verificado: texto >= 4,5:1 sobre fundo, superficie e superficie elevada. */

/* ---------- Âmbar: fundo marrom, acento âmbar ---------- */
html[data-theme="dark"][data-palette="amber"] {
  color-scheme: dark;
  --tp-page: #17120d;
  --tp-surface: #221a12;
  --tp-raised: #2c2118;
  --tp-hover: #33271b;
  --tp-border: #453626;
  --tp-border-strong: #5b4832;
  --tp-text: #f5ede1;
  --tp-text-soft: #d8c6ae;
  --tp-muted: #b4a087;
  --tp-accent: #e0a13a;
  --tp-accent-bright: #f2b75f;
  --tp-accent-deep: #8a5a16;
  --tp-glyph: #e0a13a;
  --tp-on-accent: #241505;
  --tp-on-deep: #fff3d9;
  --tp-shadow: rgba(0, 0, 0, .32);
  --tp-focus-ring: rgba(224, 161, 58, .32);
  --tp-success: #8fd6a8;
  --tp-success-bg: #1c3225;
  --tp-success-text: #bce8d3;
  --tp-warning-bg: #3a2b17;
  --tp-warning-text: #f0c27b;
}

/* ---------- Oceano: azuis profundos e ciano ---------- */
html[data-theme="dark"][data-palette="ocean"] {
  color-scheme: dark;
  --tp-page: #071722;
  --tp-surface: #0d2433;
  --tp-raised: #142f40;
  --tp-hover: #193b4f;
  --tp-border: #25485c;
  --tp-border-strong: #35657c;
  --tp-text: #e8f6fb;
  --tp-text-soft: #c3dce8;
  --tp-muted: #9dbcca;
  --tp-accent: #4fd1e8;
  --tp-accent-bright: #86e6f5;
  --tp-accent-deep: #0d5a73;
  --tp-glyph: #5fd8ec;
  --tp-on-accent: #062430;
  --tp-on-deep: #dff9ff;
  --tp-shadow: rgba(0, 0, 0, .36);
  --tp-focus-ring: rgba(79, 209, 232, .32);
  --tp-success: #6fe3c4;
  --tp-success-bg: #10332f;
  --tp-success-text: #b8f0df;
  --tp-warning-bg: #3a2b17;
  --tp-warning-text: #f0c27b;
}

/* ---------- Aurora: ameixa profunda, acento lilás ---------- */
html[data-theme="dark"][data-palette="aurora"] {
  color-scheme: dark;
  --tp-page: #1a1024;
  --tp-surface: #271638;
  --tp-raised: #332048;
  --tp-hover: #3d2555;
  --tp-border: #4a2f63;
  --tp-border-strong: #644080;
  --tp-text: #f6ecff;
  --tp-text-soft: #dbc7ee;
  --tp-muted: #b9a1d1;
  --tp-accent: #b79cff;
  --tp-accent-bright: #d4c4ff;
  --tp-accent-deep: #5b3fa8;
  --tp-accent-2: #b79cff;
  --tp-glyph: #c6b3ff;
  --tp-on-accent: #1d1230;
  --tp-on-deep: #f3eaff;
  --tp-shadow: rgba(0, 0, 0, .38);
  --tp-focus-ring: rgba(183, 156, 255, .32);
  --tp-success: #7de8cf;
  --tp-success-bg: #17382f;
  --tp-success-text: #c4f5e4;
  --tp-warning-bg: #3a2329;
  --tp-warning-text: #ffb0cf;
}

/* ---------- Variaveis herdadas pelo CSS escuro existente ---------- */
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) {
  --ink: var(--tp-text);
  --muted: var(--tp-muted);
  --line: var(--tp-border);
  --bg: var(--tp-page);
  --accent: var(--tp-accent);
  --btn-bg: var(--tp-surface);
  --btn-border: var(--tp-border);
  --btn-text: var(--tp-text-soft);
  --btn-hover-bg: var(--tp-raised);
  --btn-hover-border: var(--tp-border-strong);
  --btn-hover-text: var(--tp-text);
  --input-bg: var(--tp-page);
  --input-border: var(--tp-border);
  --input-text: var(--tp-text);
  --input-placeholder: var(--tp-muted);
  --focus-ring: var(--tp-focus-ring);
  --surface: var(--tp-surface);
  --surface-elevated: var(--tp-raised);
  --surface-hover: var(--tp-raised);
  --divider: var(--tp-border);
  --dark-page: var(--tp-page);
  --dark-sidebar: var(--tp-surface);
  --dark-surface: var(--tp-surface);
  --dark-raised: var(--tp-raised);
  --dark-border: var(--tp-border);
  --dark-heading: var(--tp-text);
  --dark-copy: var(--tp-text-soft);
  --dark-muted: var(--tp-muted);
  --dark-accent: var(--tp-text-soft);
  --route-navy: var(--tp-text-soft);
  --route-navy-strong: var(--tp-text);
  --route-cyan: var(--tp-accent);
  --route-cyan-dark: var(--tp-accent-bright);
  --route-border: var(--tp-border);
  --route-green: var(--tp-success);
}

/* ---------- Componentes: uma unica regra, tres paletas ---------- */
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) body,
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .app.is-start,
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .app.is-map-hidden,
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .operations-workspace {
  background: var(--tp-page);
  color: var(--tp-text);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) header {
  background: var(--tp-surface);
  color: var(--tp-text);
  border-color: var(--tp-border);
  box-shadow: inset 0 2px var(--tp-accent-deep);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(aside, #contextSidebar, .system-footer, .map-context, .map-note, .auth-menu, .agenda-modal, .route-builder-panel > section, .work-order-form, .operations-map-panel, .admin-review-section, .admin-review-summary > div, .compare-suggestions, .map-guide, .layers-popover, .agenda-filter-popover, .unassigned-drawer, .tools-panel, .area-inspector, .add-point-modal, .confirmation-card, .submissions-panel, .review-modal, .weather-dialog-panel, .point-icon-picker) {
  background: var(--tp-surface);
  color: var(--tp-text);
  border-color: var(--tp-border);
  box-shadow: 0 14px 34px var(--tp-shadow);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(h1, h2, h3, .context-heading h2, .operations-heading h2, .modal-heading h2, .section-title, .header-copy h1, .start-heading h2, .weather-city-name, .weather-city-reading strong) {
  color: var(--tp-text);
  text-shadow: none;
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(p, small, dt, .empty, .address-note, .map-caution, .local-storage-note, .agenda-empty, .panel-intro, .nav-row small, .start-subtitle, .city-grid-intro, .weather-city-range, .weather-source, .weather-day, .weather-content button) {
  color: var(--tp-text-soft);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.context-heading small, .operations-heading small, .modal-heading small, .layers-heading small, .is-start .nav-top h2, #navigation .nav-top h2, #contextSidebar #searchForm label, .is-start #searchForm label, .map-context-coords span, .form-hint) {
  color: var(--tp-muted);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.start-eyebrow, .stat-chip, .coverage-warning, .note-summary, .note-state, .review-status, .radius-row, .box, .hint, .review-note) {
  background: var(--tp-raised);
  color: var(--tp-text-soft);
  border-color: var(--tp-border);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .start-eyebrow::before,
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .chevron {
  background: var(--tp-accent);
  color: var(--tp-on-accent);
  box-shadow: 0 0 0 3px var(--tp-focus-ring);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(#contextSidebar #searchForm, .search-field, #contextSidebar .search-field, .app.is-start .search-field) {
  background: var(--tp-page);
  color: var(--tp-text);
  border-color: var(--tp-border);
  box-shadow: none;
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(input, select, textarea, .coords-display input, .coords-row input, .modal-minimap) {
  background: var(--tp-page);
  color: var(--tp-text);
  border-color: var(--tp-border);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(input, select, textarea)::placeholder {
  color: var(--tp-muted);
  opacity: 1;
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(input, select, textarea):focus,
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.search-field, .app.is-start .search-field):focus-within {
  outline-color: var(--tp-accent);
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 3px var(--tp-focus-ring);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(button, .nav-row, .reference-row, .compare-suggestion):hover {
  background-color: var(--tp-hover);
  color: var(--tp-text);
  border-color: var(--tp-border-strong);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.context-actions button, .context-actions a, .inspector-actions button, .inspector-actions a, .near-buttons button, .map-point-menu-actions button, .map-visibility-button, .auth-button.is-authenticated) {
  background: var(--tp-surface);
  color: var(--tp-text-soft);
  border-color: var(--tp-border);
}

/* Acao principal: texto escuro sobre acento claro garante AA nas tres paletas. */
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.agenda-primary, .compare-button, .auth-gate button) {
  background: var(--tp-accent) !important;
  color: var(--tp-on-accent) !important;
  border-color: var(--tp-accent) !important;
  box-shadow: none !important;
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.agenda-primary, .compare-button):hover {
  background: var(--tp-accent-bright) !important;
  border-color: var(--tp-accent-bright) !important;
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.primary-tabs, .compare-modes) {
  background: var(--tp-page);
  border-color: var(--tp-border);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.primary-tabs button, .compare-modes button, .share-mode-tabs button, .map-toolbar button, .radius-options button) {
  background: transparent;
  color: var(--tp-text-soft);
  border-color: transparent;
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.primary-tabs button[aria-pressed="true"], .compare-modes button[aria-pressed="true"], .share-mode-tabs button[aria-pressed="true"], .map-toolbar button[aria-pressed="true"], .radius-options button[aria-pressed="true"]) {
  background: var(--tp-accent-deep);
  color: var(--tp-on-deep);
  border-color: var(--tp-accent);
  box-shadow: none;
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) #mapToolbarItems #annotatePointButton[aria-pressed="true"] {
  background: var(--orange) !important;
  border-color: var(--orange) !important;
  color: var(--tp-on-accent) !important;
  box-shadow: 0 3px 8px rgba(242, 118, 34, .25) !important;
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.map-toolbar, .street-view-tool) {
  background: var(--tp-surface);
  border-color: var(--tp-border);
  box-shadow: 0 8px 22px var(--tp-shadow);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.agenda-board, .agenda-column, .agenda-time-header, .agenda-tech-header, .agenda-time-axis, .agenda-block, .route-origin, .route-edit-stop, .route-stop-card, .route-summary, .route-add-stop, .work-order-card, .schedule-result, .unassigned-card, .address-correction-list article, .admin-review-card, .saved-filter-list article) {
  background: var(--tp-surface);
  color: var(--tp-text);
  border-color: var(--tp-border);
  box-shadow: none;
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.route-summary strong, .route-add-stop, .context-breadcrumb button, a) {
  color: var(--tp-accent-bright);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.weather-strip-heading span:first-child, .weather-hourly-heading span:first-child) {
  color: var(--tp-muted) !important;
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.start-weather-strip, .weather-current, .weather-hour, .weather-day, .weather-hourly, .weather-city-icon, .weather-hour-icon, .weather-day-icon, .weather-close) {
  background: var(--tp-raised);
  border-color: var(--tp-border);
  color: var(--tp-text-soft);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.weather-city-icon.is-sunny, .weather-hour-icon.is-sunny, .weather-day-icon.is-sunny) {
  background: var(--tp-warning-bg);
  color: var(--tp-warning-text);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.weather-city-icon.is-wet, .weather-hour-icon.is-wet, .weather-day-icon.is-wet, .weather-city-icon.is-snow, .weather-hour-icon.is-snow, .weather-day-icon.is-snow, .weather-city-icon.is-cloudy, .weather-hour-rain.is-light, .weather-city-rain.is-light, .weather-hour-rain.is-wet, .weather-city-rain.is-wet) {
  background: var(--tp-accent-deep);
  color: var(--tp-accent-bright);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.note-state.is-validated, .review-status.is-approved, .review-status.is-validated) {
  background: var(--tp-success-bg);
  color: var(--tp-success-text);
  border-color: var(--tp-success);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.auth-gate) {
  color-scheme: dark;
  background: var(--tp-page);
  color: var(--tp-text);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.auth-gate h1, .auth-gate #authGateMessage, .auth-gate small, .point-login-steps b, .point-login-note, .map-context-note, .map-context-close, .map-context-coords b, .map-context-heading b) {
  color: var(--tp-text);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.map-context-head, .map-context-glyph, .point-login-pin, .point-icon-preview, .point-icon-trigger, .point-icon-option-face, .point-icon-search, .menu-secondary-action, .point-login-location, .add-point-location, .add-point-map-toggle, .point-icon-trigger .point-icon-preview.is-empty) {
  background: var(--tp-raised);
  color: var(--tp-text-soft);
  border-color: var(--tp-border);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.map-context-glyph, .point-login-pin, .point-icon-option-face .app-icon, .point-icon-trigger .point-icon-preview, .point-icon-option-icon) {
  color: var(--tp-glyph);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.point-icon-trigger, .point-icon-group) {
  --point-icon-accent: var(--tp-glyph);
  --point-icon-tile-a: var(--tp-accent-deep);
  --point-icon-tile-b: var(--tp-page);
  --point-icon-glow: var(--tp-focus-ring);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.app-toast) {
  background: var(--tp-accent-bright);
  color: var(--tp-on-accent);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) ::selection {
  background: var(--tp-accent-deep);
  color: var(--tp-text);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) ::-webkit-scrollbar-track,
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) ::-webkit-scrollbar-thumb {
  background-color: var(--tp-raised);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) ::-webkit-scrollbar-thumb {
  border-color: var(--tp-page);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.city-monogram:has(.city-map-thumbnail), .region-name) {
  background: color-mix(in srgb, var(--tp-accent) 8%, var(--tp-surface));
  border-color: color-mix(in srgb, var(--tp-accent) 32%, var(--tp-border));
}

/* ---------- Seletor de tema no cabeçalho ---------- */
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .theme-menu {
  background: var(--tp-surface);
  color: var(--tp-text);
  border-color: var(--tp-border);
  box-shadow: 0 14px 35px var(--tp-shadow);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .theme-menu-title {
  color: var(--tp-muted);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .theme-option {
  color: var(--tp-text-soft);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .theme-option:hover {
  background: var(--tp-hover);
  border-color: var(--tp-border-strong);
  color: var(--tp-text);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .theme-option[aria-pressed="true"] {
  background: var(--tp-accent-deep);
  border-color: var(--tp-accent);
  color: var(--tp-text);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .theme-option:focus-visible {
  outline-color: var(--tp-accent);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .theme-option[aria-pressed="true"] .theme-option-check {
  color: var(--tp-accent-bright);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .theme-swatch {
  border-color: var(--tp-border-strong);
}

/* Textos e detalhes que ainda usavam ciano/verde do tema escuro original. */
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.nav-copy, .work-order-card strong, .unassigned-card strong, .agenda-tech-header strong, .agenda-block strong, .order-details dd, .unassigned-drawer-heading strong, .admin-review-card h3, .modal-section h3, .review-section h3, .route-stop-copy strong, .point-login-location b, .point-icon-trigger-copy small) {
  color: var(--tp-text-soft);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.context-breadcrumb, .context-breadcrumb span, .map-context-heading small, .map-context-coords span, .map-context-note, .map-context-close, .menu-secondary-action, .form-hint, .point-login-steps small, .point-login-note, .add-point-location-copy small, .add-point-location-copy > span, .point-icon-group legend, .point-icon-empty, .point-icon-search, .point-icon-search input::placeholder, .point-icon-trigger-chevron, .point-icon-preview.is-empty, .weather-strip-heading span:first-child) {
  color: var(--tp-muted);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.map-context-coords > div, .point-login-location, .point-icon-preview.is-empty, .point-icon-search, .point-icon-option-face, .point-icon-option:hover .point-icon-option-face, .add-point-location-pin, .map-context-glyph, .point-login-pin) {
  background: var(--tp-raised);
  border-color: var(--tp-border);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.point-icon-option-icon, .point-icon-trigger .point-icon-preview, .point-icon-trigger.has-selection .point-icon-preview, .point-icon-option input:checked + .point-icon-option-face .point-icon-option-icon) {
  background: linear-gradient(145deg, var(--tp-accent-deep), var(--tp-page));
  color: var(--tp-text);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.point-icon-option input:checked + .point-icon-option-face) {
  background: var(--tp-accent-deep);
  border-color: var(--tp-glyph);
  color: var(--tp-text);
  box-shadow: inset 0 0 0 1px var(--tp-glyph);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) :where(.point-icon-option-check, .point-icon-option-check .app-icon) {
  background: var(--tp-glyph);
  color: var(--tp-page);
}

:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .popup-icon.is-brand,
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) .point-icon-option-icon.is-brand {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--tp-accent), 0 2px 8px var(--tp-shadow);
}

/* ---------- Detalhes elaborados por paleta (AGIM 2026-11-25) ---------- */
html[data-theme="dark"][data-palette="amber"] {
  --tp-ochre: #e0a33e;
  --tp-ochre-bright: #ffc36b;
  --tp-ochre-deep: #7a4f1d;
}
:is(html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"]) body {
  background-repeat:no-repeat;
  background-attachment:fixed;
}
html[data-theme="dark"][data-palette="amber"] body {
  background-image:radial-gradient(circle at 88% -12%, rgba(224,163,62,.16), transparent 44%);
}
html[data-theme="dark"][data-palette="ocean"] body {
  background-image:radial-gradient(circle at 84% -14%, rgba(79,209,232,.14), transparent 46%);
}
html[data-theme="dark"][data-palette="aurora"] body {
  background-image:radial-gradient(circle at 82% -12%, rgba(183,156,255,.14), transparent 42%),
                   radial-gradient(circle at 12% 6%, rgba(183,156,255,.08), transparent 44%);
}
html[data-theme="dark"][data-palette="amber"] .app.is-start #navigation .city-grid .city-option {
  box-shadow:inset 3px 0 0 var(--tp-ochre), 0 1px 2px var(--tp-shadow);
}
html[data-theme="dark"][data-palette="amber"] .app.is-start #navigation .city-grid .city-option:hover {
  box-shadow:inset 3px 0 0 var(--tp-ochre-bright), 0 8px 20px rgba(0,0,0,.35);
}
html[data-theme="dark"][data-palette="amber"] .weather-city-card:hover,
html[data-theme="dark"][data-palette="amber"] .stat-chip.is-map {
  border-color:var(--tp-ochre-bright);
}
html[data-theme="dark"][data-palette="amber"] .stat-chip.is-map {
  background:linear-gradient(180deg, rgba(224,163,62,.22), rgba(224,163,62,.10));
  color:var(--tp-ochre-bright);
}
html[data-theme="dark"][data-palette="amber"] .theme-button {
  border-color:color-mix(in srgb, var(--tp-ochre) 42%, var(--tp-border));
}
html[data-theme="dark"][data-palette="ocean"] .app.is-start #navigation .city-grid .city-option {
  box-shadow:inset 3px 0 0 var(--tp-accent), 0 1px 2px var(--tp-shadow);
}
html[data-theme="dark"][data-palette="aurora"] .app.is-start #navigation .city-grid .city-option {
  box-shadow:inset 3px 0 0 var(--tp-accent-2), 0 1px 2px var(--tp-shadow);
}
html[data-theme="dark"][data-palette="aurora"] .weather-city-card:hover {
  border-color:var(--tp-accent-2);
}


/* ---------- Paletas mais claras e vibrantes (revisao do usuario) ---------- */
/* Cada paleta tem UM acento: as variaveis claras/escuras/sombra sao apenas
   tonalidades dele. Cards claros sao toned (nunca branco puro). */
html[data-theme="dark"][data-palette="dark"] {
  --tp-page:#18212b; --tp-surface:#222d3a; --tp-raised:#2c3948; --tp-hover:#354454;
  --tp-border:#415367; --tp-border-strong:#58708a; --tp-text:#f7fbff; --tp-text-soft:#dbe7f0;
  --tp-muted:#adc1d1; --tp-accent:#79c8f7; --tp-accent-bright:#a6dfff; --tp-accent-deep:#23527a;
  --tp-glyph:#8ad2fb; --tp-on-accent:#102030; --tp-on-deep:#eaf7ff; --tp-shadow:rgba(0,0,0,.30);
  --tp-focus-ring:rgba(121,200,247,.38);
  --tp-card:#e8eef4; --tp-card-text:#14202b; --tp-card-soft:#566875; --tp-card-border:#cad6e2;
}
html[data-theme="dark"][data-palette="amber"] {
  --tp-page:#2b2119; --tp-surface:#372a20; --tp-raised:#423224; --tp-hover:#4d3a29;
  --tp-border:#5d4934; --tp-border-strong:#7b6043; --tp-text:#fff8ed; --tp-text-soft:#f0dfc7;
  --tp-muted:#cdb69a; --tp-accent:#e0a13a; --tp-accent-bright:#f2b75f; --tp-accent-deep:#8a5a16;
  --tp-glyph:#e0a13a; --tp-on-accent:#241505; --tp-on-deep:#fff3d9;
  --tp-ochre:var(--tp-accent); --tp-ochre-bright:var(--tp-accent-bright);
  --tp-shadow:rgba(0,0,0,.28); --tp-focus-ring:rgba(224,161,58,.36);
  --tp-card:#efe0ca; --tp-card-text:#2a1a0a; --tp-card-soft:#5b4526; --tp-card-border:#d6c09e;
}
html[data-theme="dark"][data-palette="ocean"] {
  --tp-page:#10283b; --tp-surface:#18354b; --tp-raised:#21435d; --tp-hover:#2a506d;
  --tp-border:#35617d; --tp-border-strong:#4b7c9a; --tp-text:#f2fbff; --tp-text-soft:#d8eff8;
  --tp-muted:#aecfdf; --tp-accent:#79e2f3; --tp-accent-bright:#aef3ff; --tp-accent-deep:#166f8b;
  --tp-glyph:#8be9f7; --tp-on-accent:#062430; --tp-on-deep:#dff9ff;
  --tp-shadow:rgba(0,0,0,.30); --tp-focus-ring:rgba(121,226,243,.36);
  --tp-card:#e4f2f7; --tp-card-text:#102a35; --tp-card-soft:#3d5b68; --tp-card-border:#bfdae6;
}
html[data-theme="dark"][data-palette="aurora"] {
  --tp-page:#27183b; --tp-surface:#332049; --tp-raised:#3e2a58; --tp-hover:#4a3268;
  --tp-border:#5a3e79; --tp-border-strong:#77539a; --tp-text:#fdf5ff; --tp-text-soft:#ead9f7;
  --tp-muted:#c9b0dd; --tp-accent:#b79cff; --tp-accent-bright:#d4c4ff; --tp-accent-deep:#5b3fa8;
  --tp-accent-2:#b79cff; --tp-glyph:#c6b3ff; --tp-on-accent:#1d1230; --tp-on-deep:#f3eaff;
  --tp-shadow:rgba(0,0,0,.32); --tp-focus-ring:rgba(183,156,255,.38);
  --tp-card:#eee4f8; --tp-card-text:#241633; --tp-card-soft:#57436b; --tp-card-border:#d6c5e8;
}

/* ---------- Ônix: preto profundo com detalhes roxos ---------- */
html[data-theme="dark"][data-palette="onyx"] {
  color-scheme:dark;
  --tp-page:#0a0a0f; --tp-surface:#12121c; --tp-raised:#1a1a28; --tp-hover:#222132;
  --tp-border:#302c42; --tp-border-strong:#483e66; --tp-text:#f7f4ff; --tp-text-soft:#ded7f0;
  --tp-muted:#b3a9cc; --tp-accent:#b18cff; --tp-accent-bright:#d4b9ff; --tp-accent-deep:#5b3a9e;
  --tp-accent-2:#8f6cff; --tp-glyph:#c2a6ff; --tp-on-accent:#140d24; --tp-on-deep:#efe6ff;
  --tp-shadow:rgba(0,0,0,.5); --tp-focus-ring:rgba(177,140,255,.4);
  --tp-success:#7ee0b8; --tp-success-bg:#102b22; --tp-success-text:#b9f2da;
  --tp-warning-bg:#2a1830; --tp-warning-text:#f0b9ff;
}
html[data-theme="dark"][data-palette="onyx"] {
  --ink:var(--tp-text); --muted:var(--tp-muted); --line:var(--tp-border); --bg:var(--tp-page);
  --accent:var(--tp-accent); --btn-bg:var(--tp-surface); --btn-border:var(--tp-border);
  --btn-text:var(--tp-text-soft); --btn-hover-bg:var(--tp-raised); --btn-hover-border:var(--tp-border-strong);
  --btn-hover-text:var(--tp-text); --input-bg:var(--tp-page); --input-border:var(--tp-border);
  --input-text:var(--tp-text); --input-placeholder:var(--tp-muted); --focus-ring:var(--tp-focus-ring);
  --surface:var(--tp-surface); --surface-elevated:var(--tp-raised); --surface-hover:var(--tp-raised);
  --divider:var(--tp-border); --dark-page:var(--tp-page); --dark-sidebar:var(--tp-surface);
  --dark-surface:var(--tp-surface); --dark-raised:var(--tp-raised); --dark-border:var(--tp-border);
  --dark-heading:var(--tp-text); --dark-copy:var(--tp-text-soft); --dark-muted:var(--tp-muted);
  --dark-accent:var(--tp-text-soft); --route-navy:var(--tp-text-soft); --route-navy-strong:var(--tp-text);
  --route-cyan:var(--tp-accent); --route-cyan-dark:var(--tp-accent-bright); --route-border:var(--tp-border);
  --route-green:var(--tp-success);
}
html[data-theme="dark"][data-palette="onyx"] body {
  background-image:radial-gradient(circle at 84% -12%, rgba(143,108,255,.14), transparent 44%);
}
html[data-theme="dark"][data-palette="onyx"] .app.is-start #navigation .city-grid .city-option {
  box-shadow:inset 3px 0 0 var(--tp-accent), 0 1px 2px var(--tp-shadow);
}
html[data-theme="dark"][data-palette="onyx"] .weather-city-card:hover { border-color:var(--tp-accent-bright); }

/* ---------- Ajustes de contraste e clareza (todas as paletas escuras) ---------- */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"]) {
  --a11y-muted:var(--tp-muted);
  --a11y-muted-strong:var(--tp-text-soft);
  --a11y-text:var(--tp-text);
}
html[data-theme="dark"][data-palette="dark"] body,
html[data-theme="dark"][data-palette="dark"] .app.is-start,
html[data-theme="dark"][data-palette="dark"] .app.is-map-hidden,
html[data-theme="dark"][data-palette="dark"] .operations-workspace {
  background:var(--tp-page)!important;
}
html[data-theme="dark"][data-palette="dark"] header { background:var(--tp-surface)!important; }
/* ---------- Cards toned dentro dos temas escuros (nunca branco puro) ----------
   Cada paleta define --tp-card/--tp-card-text/--tp-card-soft/--tp-card-border.
   A profundidade vem de borda + brilho do proprio acento, nao de sombra preta. */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) {
  --tp-card-hover:color-mix(in srgb, var(--tp-card) 88%, #ffffff);
  --tp-card-glow:0 0 0 1px color-mix(in srgb, var(--tp-accent) 12%, transparent),0 8px 22px color-mix(in srgb, var(--tp-accent) 14%, transparent);
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .app.is-start #navigation .city-grid .city-option {
  background:var(--tp-card);border-color:var(--tp-card-border);color:var(--tp-card-text);box-shadow:var(--tp-card-glow);
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .app.is-start #navigation .city-grid .city-option:hover {
  background:var(--tp-card-hover);border-color:var(--tp-accent);
  box-shadow:0 0 0 1px color-mix(in srgb, var(--tp-accent) 26%, transparent),0 12px 28px color-mix(in srgb, var(--tp-accent) 22%, transparent);
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .app.is-start #navigation .city-grid .city-option .nav-copy { color:var(--tp-card-text); }
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .app.is-start #navigation .city-grid .city-option .nav-copy small { color:var(--tp-card-soft); }
/* Seta circular na cor do acento (o mesmo usado no CTA, foco e linha do topo). */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .app.is-start #navigation .city-grid .city-option .chevron {
  background:var(--tp-accent);color:var(--tp-on-accent);
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-card {
  background:var(--tp-card);border-color:var(--tp-card-border);color:var(--tp-card-text);box-shadow:var(--tp-card-glow);
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-card:hover {
  background:var(--tp-card-hover);border-color:var(--tp-accent);
  box-shadow:0 0 0 1px color-mix(in srgb, var(--tp-accent) 26%, transparent),0 12px 26px color-mix(in srgb, var(--tp-accent) 22%, transparent);
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) :where(.weather-city-name,.weather-city-reading strong,.weather-city-range,.weather-city-rain,.weather-city-loading) { color:var(--tp-card-text); }
/* Cabecalho da faixa de clima sobre fundo escuro: texto claro obrigatorio. */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-strip-heading,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-strip-heading > span { color:var(--tp-text-soft)!important; }
/* Badges: o ponto e a borda acompanham o acento da paleta. */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .stat-chip { background:color-mix(in srgb, var(--tp-accent) 10%, var(--tp-surface));border-color:color-mix(in srgb, var(--tp-accent) 32%, var(--tp-border));color:var(--tp-text); }
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .stat-chip.is-map { background:color-mix(in srgb, var(--tp-accent) 16%, var(--tp-surface));color:var(--tp-text);border-color:var(--tp-accent); }
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .stat-chip::before,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .stat-chip.is-map::before { background:var(--tp-accent); }
/* Tiles dos simbolos: o fundo segue o card toned e o traco fica na cor da cidade. */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .app.is-start #navigation .city-grid .city-option .city-monogram,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .app.is-start #navigation .city-grid .city-option .city-monogram:has(.city-map-thumbnail) {
  background:color-mix(in srgb, var(--city-color) 12%, var(--tp-card))!important;
  border-color:color-mix(in srgb, var(--city-color) 30%, var(--tp-card-border))!important;
  color:var(--city-color);
}
/* Profundidade suave: anelas topograficas e brilho da paleta. */
body {
  background-image:
    radial-gradient(circle at 84% 10%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 35%),
    repeating-radial-gradient(circle at 88% 14%, transparent 0 26px, color-mix(in srgb, var(--accent) 4%, transparent) 27px 28px, transparent 29px 60px);
  background-attachment:fixed;
  background-repeat:no-repeat;
}

/* ===== Verificação de contraste dos textos secundarios (6 temas) =====
   --muted e --a11y-muted foram medidos (WCAG 2.1) sobre fundo, superficie e
   superficie elevada. Todas as paletas escuras ja passam de 4.5:1, entao
   nenhuma cor de acento/vibrante foi alterada aqui. O unico ajuste necessario
   foi no tema claro (--muted) e esta em routepilot.css.

   tema      --muted / fundo · superficie · elevada
   clear     4.95 · 5.35 · 4.95   (#5a6e76)
   dark      6.15 · 5.62 · 4.95   (#8b949e) / a11y 11.63 · 10.63 · 9.35
   dark pal  8.77 · 7.53 · 6.34   (#adc1d1)
   amber     8.06 · 7.10 · 6.28   (#cdb69a)
   ocean     9.21 · 7.75 · 6.31   (#aecfdf)
   aurora    8.39 · 7.44 · 6.40   (#c9b0dd)
   onyx      8.90 · 8.38 · 7.74   (#b3a9cc)

   Cartoes claros dentro dos temas escuros: --tp-card-soft 5.38:1 (padrao) e
   5.88:1 (onyx) sobre --tp-card — acima do minimo AA. */

/* ---------- Rosa: fundo rosado sutil, CTA e tiles em rosa ---------- */
html[data-theme="light"][data-palette="rose"] {
  color-scheme:light;
  /* Textos com leve rosado: --ink/--muted/--btn-text/--input-text/--a11y-muted
     passam AA (>= 5,4:1) sobre --bg #fff3f7 e --tp-card #fff7fa.
     O acento do CTA permanece #b93a72. */
  --ink:#4a2437; --muted:#83566d; --line:#e7c9d6; --bg:#fff3f7; --accent:#d64f8b;
  /* Tom mais profundo da mesma familia: branco sobre #b93a72 = 5,37:1 (AA). */
  --route-cyan:#b93a72; --route-cyan-dark:#a9346b; --a11y-solid-accent:#b93a72;
  --rose-text-strong:#a9346b; /* rosa profundo para titulos/destaques: 5,7:1 no fundo */
  --surface:#fff8fb; --surface-elevated:#ffffff; --surface-hover:#ffeef4;
  --tp-card:#fff7fa; --tp-card-border:#f0d3df;
  --btn-bg:#ffffff; --btn-border:#e7c9d6; --btn-text:#4a2437;
  --btn-hover-bg:#fff0f5; --btn-hover-border:#d64f8b; --btn-hover-text:#4a2437;
  --input-bg:#ffffff; --input-border:#e7c9d6; --input-text:#4a2437; --input-placeholder:#8a6d7c;
  --focus-ring:rgba(214,79,139,.30); --a11y-muted:#7d5168;
}
/* ---------- Marfim: creme quente, tres detalhes (teal/laranja/violeta) ---------- */
html[data-theme="light"][data-palette="ivory"] {
  color-scheme:light;
  --ink:#1d2b2c; --muted:#5b6b6c; --line:#dfe8e6; --bg:#fffdf7; --accent:#0f8b8d;
  --accent-2:#d97706; --accent-3:#7c5cc4;
  --surface:#fffdf7; --surface-elevated:#fffaf0; --surface-hover:#fbf5e8;
  --tp-card:#fffaf0; --tp-card-border:#ece3cf;
  --route-cyan:#067d98; --route-cyan-dark:#056b83;
  --btn-bg:#fffaf0; --btn-border:#dfe8e6; --btn-text:#1d2b2c;
  --btn-hover-bg:#fbf5e8; --btn-hover-border:#0f8b8d; --btn-hover-text:#1d2b2c;
  --input-bg:#fffaf0; --input-border:#dfe8e6; --input-text:#1d2b2c; --input-placeholder:#718283;
  --focus-ring:rgba(15,139,141,.28); --a11y-muted:#5b6b6c;
}
html[data-theme="light"][data-palette="ivory"] .stat-chip.is-map { border-color:var(--accent-2); color:#9a5304; }
html[data-theme="light"][data-palette="ivory"] .city-monogram { border-bottom:2px solid var(--accent-3); }
/* ---------- Damasco: azul profundo com detalhe dourado ---------- */
html[data-theme="dark"][data-palette="damask"] {
  color-scheme:dark;
  --tp-page:#101f3d; --tp-surface:#172b50; --tp-raised:#203964; --tp-hover:#284575;
  --tp-border:#345087; --tp-border-strong:#5272b5; --tp-text:#f2f6ff; --tp-text-soft:#d3e0fa;
  --tp-muted:#a9bde3; --tp-accent:#8fb3ff; --tp-accent-bright:#bed3ff; --tp-accent-deep:#2d5296;
  --tp-accent-2:#d9b46a; --tp-glyph:#a8c4ff; --tp-on-accent:#101a30; --tp-on-deep:#eaf1ff;
  --tp-shadow:rgba(0,0,0,.32); --tp-focus-ring:rgba(143,179,255,.38);
  --tp-card:#e6edfa; --tp-card-text:#15223c; --tp-card-soft:#42506b; --tp-card-border:#ccd9f0;
  --ink:var(--tp-text); --muted:var(--tp-muted); --line:var(--tp-border); --bg:var(--tp-page);
  --accent:var(--tp-accent); --surface:var(--tp-surface); --surface-elevated:var(--tp-raised);
  --surface-hover:var(--tp-hover); --btn-bg:var(--tp-surface); --btn-border:var(--tp-border);
  --btn-text:var(--tp-text-soft); --btn-hover-bg:var(--tp-raised); --btn-hover-border:var(--tp-border-strong);
  --btn-hover-text:var(--tp-text); --input-bg:var(--tp-page); --input-border:var(--tp-border);
  --input-text:var(--tp-text); --input-placeholder:var(--tp-muted); --focus-ring:var(--tp-focus-ring);
  --a11y-muted:var(--tp-muted); --dark-page:var(--tp-page); --dark-surface:var(--tp-surface);
  --dark-raised:var(--tp-raised); --dark-border:var(--tp-border); --dark-heading:var(--tp-text);
  --dark-copy:var(--tp-text-soft); --dark-muted:var(--tp-muted); --dark-accent:var(--tp-text-soft);
  --route-navy:var(--tp-text-soft); --route-navy-strong:var(--tp-text); --route-cyan:var(--tp-accent);
  --route-cyan-dark:var(--tp-accent-bright); --route-border:var(--tp-border); --route-green:#7fe0b8;
}
html[data-theme="dark"][data-palette="damask"] body {
  background-image:radial-gradient(circle at 82% -12%, rgba(217,180,106,.14), transparent 44%);
}
html[data-theme="dark"][data-palette="damask"] .app.is-start #navigation .city-grid .city-option {
  background:var(--tp-card);border-color:var(--tp-card-border);color:var(--tp-card-text);box-shadow:0 2px 8px rgba(0,0,0,.2);
}
html[data-theme="dark"][data-palette="damask"] .app.is-start #navigation .city-grid .city-option .nav-copy,
html[data-theme="dark"][data-palette="damask"] .app.is-start #navigation .city-grid .city-option .nav-copy small { color:var(--tp-card-text); }
html[data-theme="dark"][data-palette="damask"] .app.is-start #navigation .city-grid .city-option .nav-copy small { color:var(--tp-card-soft); }
html[data-theme="dark"][data-palette="damask"] .weather-city-card { background:var(--tp-card);border-color:var(--tp-card-border);color:var(--tp-card-text); }
html[data-theme="dark"][data-palette="damask"] .weather-city-name,
html[data-theme="dark"][data-palette="damask"] .weather-city-reading strong,
html[data-theme="dark"][data-palette="damask"] .weather-city-range { color:var(--tp-card-text); }
html[data-theme="dark"][data-palette="damask"] .weather-strip-heading { color:var(--tp-text-soft)!important; }
html[data-theme="dark"][data-palette="damask"] .city-monogram { background:color-mix(in srgb,var(--city-color) 12%,var(--tp-card))!important;border-color:color-mix(in srgb,var(--city-color) 30%,var(--tp-card-border))!important; }
/* ---------- Profundidade reforcada em todos os temas ---------- */
html body {
  background-image:
    radial-gradient(circle at 84% 10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 35%),
    repeating-radial-gradient(circle at 88% 14%, transparent 0 26px, color-mix(in srgb, var(--accent) 4%, transparent) 27px 28px, transparent 29px 60px),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--muted) 9%, transparent) 1px, transparent 0);
  background-size:auto,auto,26px 26px;
  background-attachment:fixed;
}
html[data-theme="dark"][data-palette="damask"] .weather-city-rain.is-dry,
html[data-theme="dark"][data-palette="damask"] .weather-city-rain.is-dry span { color:var(--tp-card-soft)!important; }

/* ===== Acabamento final (2026-11-25) =====
   UM acento por tema em setas, linha do topo, CTA, foco e badges.
   Profundidade = borda + halo do acento (sem sombra preta).
   Brilho radial + anelas + trama da pagina permanecem intactos. */

/* Linha de acento do cabecalho. */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) header {
  box-shadow:inset 0 2px var(--tp-accent);
}

/* CTA "Mostrar mapa": fundo do acento, texto escuro (AA em todas as paletas). */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .map-visibility-button {
  background:var(--tp-accent)!important;color:var(--tp-on-accent)!important;border-color:var(--tp-accent)!important;
  box-shadow:0 4px 16px color-mix(in srgb, var(--tp-accent) 24%, transparent)!important;
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .map-visibility-button:hover {
  background:var(--tp-accent-bright)!important;border-color:var(--tp-accent-bright)!important;color:var(--tp-on-accent)!important;
}

/* Foco da busca e dos campos acompanha o mesmo acento. */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) :where(input, select, textarea):focus,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) :where(.search-field, .app.is-start .search-field):focus-within {
  outline-color:var(--tp-accent)!important;border-color:var(--tp-accent)!important;
  box-shadow:0 0 0 3px var(--tp-focus-ring)!important;
}

/* Painéis: leve brilho colorido no lugar da sombra preta. */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) :where(aside, #contextSidebar, .map-context, .map-note, .auth-menu, .agenda-modal, .route-builder-panel > section, .work-order-form, .operations-map-panel, .admin-review-section, .admin-review-summary > div, .compare-suggestions, .map-guide, .layers-popover, .agenda-filter-popover, .unassigned-drawer, .tools-panel, .area-inspector, .add-point-modal, .confirmation-card, .submissions-panel, .review-modal, .weather-dialog-panel, .point-icon-picker, .map-toolbar, .street-view-tool) {
  box-shadow:0 0 0 1px color-mix(in srgb, var(--tp-accent) 9%, transparent),0 14px 32px color-mix(in srgb, var(--tp-accent) 9%, transparent)!important;
}

/* Âmbar: nenhum azul/teal sobra na busca, no CTA ou nos detalhes. */
html[data-theme="dark"][data-palette="amber"] .start-weather-strip,
html[data-theme="dark"][data-palette="amber"] .weather-current,
html[data-theme="dark"][data-palette="amber"] .weather-hour,
html[data-theme="dark"][data-palette="amber"] .weather-hour.is-now { border-color:color-mix(in srgb, var(--tp-accent) 32%, var(--tp-border)); }
html[data-theme="dark"][data-palette="amber"] .stat-chip.is-map { background:color-mix(in srgb, var(--tp-accent) 18%, var(--tp-surface));color:var(--tp-accent-bright);border-color:var(--tp-accent); }

/* Aurora: lilás substitui o menta também nos detalhes do clima. */
html[data-theme="dark"][data-palette="aurora"] .weather-city-card:hover { border-color:var(--tp-accent); }
html[data-theme="dark"][data-palette="aurora"] .weather-city-icon.is-wet,
html[data-theme="dark"][data-palette="aurora"] .weather-hour-icon.is-wet,
html[data-theme="dark"][data-palette="aurora"] .weather-day-icon.is-wet { background:var(--tp-accent-deep);color:var(--tp-accent-bright); }

/* Setas e mark do "eyebrow" no acento da paleta (inclui Ônix, sem ciano). */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .is-start .chevron,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .start-eyebrow::before { background:var(--tp-accent);color:var(--tp-on-accent); }
html[data-theme="dark"][data-palette="onyx"] .weather-strip-heading span:first-child,
html[data-theme="dark"][data-palette="onyx"] .weather-hourly-heading span:first-child { color:var(--tp-accent-bright)!important; }

/* Damasco: azul no topo/CTA, dourado apenas como detalhe secundário discreto. */
html[data-theme="dark"][data-palette="damask"] .stat-chip.is-map::before { background:var(--tp-accent-2); }
html[data-theme="dark"][data-palette="damask"] .weather-strip-heading span:first-child,
html[data-theme="dark"][data-palette="damask"] .weather-hourly-heading span:first-child { color:var(--tp-accent-2)!important; }
html[data-theme="dark"][data-palette="damask"] .app.is-start #navigation .city-grid .city-option {
  background:var(--tp-card);border-color:var(--tp-card-border);color:var(--tp-card-text);
  box-shadow:0 0 0 1px color-mix(in srgb, var(--tp-accent) 12%, transparent),0 8px 22px color-mix(in srgb, var(--tp-accent) 14%, transparent);
}
html[data-theme="dark"][data-palette="damask"] .app.is-start #navigation .city-grid .city-option .chevron { background:var(--tp-accent);color:var(--tp-on-accent); }

/* Rosa: fundo, cards, CTA, tiles e badges em rosa — não só as setas. */
html[data-theme="light"][data-palette="rose"] .map-visibility-button:hover { background:var(--route-cyan-dark)!important;border-color:var(--route-cyan-dark)!important;color:#fff!important; }
html[data-theme="light"][data-palette="rose"] .app.is-start #navigation .city-grid .city-option { background:var(--tp-card);border-color:var(--tp-card-border); }
html[data-theme="light"][data-palette="rose"] .app.is-start #navigation .city-grid .city-option:hover { background:#ffeef4;border-color:var(--accent);box-shadow:0 8px 20px rgba(214,79,139,.16); }
html[data-theme="light"][data-palette="rose"] .app.is-start #navigation .city-grid .city-option .city-monogram { background:color-mix(in srgb, var(--city-color) 10%, var(--tp-card));border-color:color-mix(in srgb, var(--accent) 28%, var(--tp-card-border)); }
html[data-theme="light"][data-palette="rose"] .app.is-start #navigation .city-grid .city-option .chevron { background:var(--accent);color:#fff; }
html[data-theme="light"][data-palette="rose"] .weather-city-card { background:var(--tp-card);border-color:var(--tp-card-border); }
html[data-theme="light"][data-palette="rose"] .weather-strip-heading span:first-child,
html[data-theme="light"][data-palette="rose"] .weather-hourly-heading span:first-child { color:var(--rose-text-strong)!important; }
html[data-theme="light"][data-palette="rose"] .stat-chip.is-map::before { background:var(--accent);box-shadow:0 0 0 3px rgba(214,79,139,.12); }
html[data-theme="light"][data-palette="rose"] .start-eyebrow { background:#fff0f5;border-color:#f0c7d9;color:#8a2b57; }
html[data-theme="light"][data-palette="rose"] .start-eyebrow::before { background:var(--accent); }

/* Rosa discreto nos textos de destaque — sem tocar no acento do CTA. */
html[data-theme="light"][data-palette="rose"] .start-heading h2 { color:var(--ink); }
html[data-theme="light"][data-palette="rose"] .app.is-start #navigation .city-grid .city-option .nav-copy { color:#63405a; }
html[data-theme="light"][data-palette="rose"] .theme-menu-title { color:#8a2b57; }
html[data-theme="light"][data-palette="rose"] .theme-option-name { color:#6a4055; }
html[data-theme="light"][data-palette="rose"] .theme-option:hover .theme-option-name,
html[data-theme="light"][data-palette="rose"] .theme-option[aria-pressed="true"] .theme-option-name { color:var(--rose-text-strong); }

/* Marfim: creme quente com três detalhes — teal, laranja e violeta. */
html[data-theme="light"][data-palette="ivory"] .app.is-start #navigation .city-grid .city-option { background:var(--tp-card);border-color:var(--tp-card-border); }
html[data-theme="light"][data-palette="ivory"] .app.is-start #navigation .city-grid .city-option:hover { background:#fff5df;border-color:var(--accent);box-shadow:0 8px 20px rgba(15,139,141,.13); }
html[data-theme="light"][data-palette="ivory"] .app.is-start #navigation .city-grid .city-option .city-monogram { background:color-mix(in srgb, var(--city-color) 10%, var(--tp-card)); }
html[data-theme="light"][data-palette="ivory"] .weather-city-card { background:var(--tp-card);border-color:var(--tp-card-border); }
html[data-theme="light"][data-palette="ivory"] .stat-chip.is-map::before { background:var(--accent-2);box-shadow:0 0 0 3px rgba(217,119,6,.12); }
html[data-theme="light"][data-palette="ivory"] .start-eyebrow { background:#fbf5e8;border-color:#e8dcc0;color:#6b5410; }
html[data-theme="light"][data-palette="ivory"] .start-eyebrow::before { background:var(--accent-3);box-shadow:0 0 0 3px rgba(124,92,196,.12); }
html[data-theme="light"][data-palette="ivory"] .weather-strip-heading span:first-child,
html[data-theme="light"][data-palette="ivory"] .weather-hourly-heading span:first-child { color:var(--accent)!important; }

/* Textos secundários dentro dos cards toned: --a11y-muted é claro (para fundo
   escuro) e não pode ser usado sobre o card. Usa-se --tp-card-soft (AA). */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-range,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-rain,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-rain.is-dry,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-loading { color:var(--tp-card-soft)!important; }
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-card.is-unavailable,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-card.is-unavailable .weather-city-loading { color:#9b4b42!important; }

/* Badges dentro dos cards de cidade: toned como o card, não ilha escura. */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .app.is-start #navigation .city-grid .city-option .nav-copy .stat-chip {
  background:color-mix(in srgb, var(--tp-accent) 10%, var(--tp-card));
  border-color:color-mix(in srgb, var(--tp-accent) 26%, var(--tp-card-border));
  color:var(--tp-card-text);
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .app.is-start #navigation .city-grid .city-option .nav-copy .stat-chip::before { background:var(--tp-accent); }

/* Foco dos cards de clima também usa o acento da paleta. */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-card:focus-visible,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-close:focus-visible { outline-color:var(--tp-accent)!important; }
html[data-theme="light"][data-palette="rose"] .weather-city-card:focus-visible,
html[data-theme="light"][data-palette="rose"] .weather-close:focus-visible,
html[data-theme="light"][data-palette="ivory"] .weather-city-card:focus-visible,
html[data-theme="light"][data-palette="ivory"] .weather-close:focus-visible { outline-color:var(--accent)!important; }

/* ===== Titulo da esquerda e busca no acento de CADA paleta (2026-11-25) =====
   Escopo exclusivo por tema+paleta. Nenhuma medida, alvo de 44px ou estado de
   foco e removido. UM acento por paleta — o mesmo ja usado em CTA, setas e
   foco; o titulo leva um tom profundo/tionado desse unico acento (AA >= 4,5:1
   sobre o cabecalho) e a busca leva borda/foco/icone/caret do acento, sem
   colorir o texto digitado no #q. */

/* --- Paletas escuras: acento unico --tp-accent. O titulo e o acento
       suavizado sobre o texto claro (ciano, ocre, lilas, roxo e azul). --- */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .header-copy h1,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) header h1,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .start-heading h2,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .start-eyebrow {
  color:color-mix(in srgb, var(--tp-accent) 40%, var(--tp-text));
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .header-copy p {
  color:color-mix(in srgb, var(--tp-accent) 28%, var(--tp-text-soft));
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .is-start #searchForm label[for="q"],
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) #contextSidebar #searchForm label[for="q"] {
  color:color-mix(in srgb, var(--tp-accent) 32%, var(--tp-text-soft));
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .search-field,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) #contextSidebar .search-field {
  border-color:color-mix(in srgb, var(--tp-accent) 38%, var(--tp-border));
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .search-field:focus-within,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) #contextSidebar .search-field:focus-within {
  outline-color:var(--tp-accent)!important;
  border-color:var(--tp-accent)!important;
  box-shadow:0 0 0 3px var(--tp-focus-ring)!important;
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .search-leading { color:var(--tp-accent); }
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) #q { caret-color:var(--tp-accent); }
/* Damasco: azul no titulo/busca; o dourado fica apenas no ponto do eyebrow. */
html[data-theme="dark"][data-palette="damask"] .start-heading .start-eyebrow::before { background:var(--tp-accent-2)!important; }

/* --- Paleta light (excecao: nao tem --tp-*, so --accent/--route-cyan): ciano. --- */
html[data-theme="light"][data-palette="light"] .header-copy h1,
html[data-theme="light"][data-palette="light"] header h1,
html[data-theme="light"][data-palette="light"] .start-heading h2,
html[data-theme="light"][data-palette="light"] .start-eyebrow { color:#067d98; }
html[data-theme="light"][data-palette="light"] .header-copy p { color:#0a6f86; }
html[data-theme="light"][data-palette="light"] .is-start #searchForm label[for="q"],
html[data-theme="light"][data-palette="light"] #contextSidebar #searchForm label[for="q"] { color:#0a6f86; }
html[data-theme="light"][data-palette="light"] .search-field,
html[data-theme="light"][data-palette="light"] #contextSidebar .search-field { border-color:color-mix(in srgb, var(--accent) 38%, var(--line)); }
html[data-theme="light"][data-palette="light"] .search-field:focus-within,
html[data-theme="light"][data-palette="light"] #contextSidebar .search-field:focus-within {
  outline-color:var(--accent)!important;
  border-color:var(--accent)!important;
  box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent)!important;
}
html[data-theme="light"][data-palette="light"] .search-leading { color:var(--accent); }
html[data-theme="light"][data-palette="light"] #q { caret-color:var(--accent); }

/* --- Rosa: titulo #a9346b (5,7:1 no fundo rosado), secundario #8a2b57;
       borda/foco/icone/caret no rosa da paleta, texto do input intacto. --- */
html[data-theme="light"][data-palette="rose"] .header-copy h1,
html[data-theme="light"][data-palette="rose"] header h1,
html[data-theme="light"][data-palette="rose"] .start-heading h2 { color:var(--rose-text-strong); }
html[data-theme="light"][data-palette="rose"] .start-eyebrow,
html[data-theme="light"][data-palette="rose"] .header-copy p { color:#8a2b57; }
html[data-theme="light"][data-palette="rose"] .is-start #searchForm label[for="q"],
html[data-theme="light"][data-palette="rose"] #contextSidebar #searchForm label[for="q"] { color:#8a2b57; }
html[data-theme="light"][data-palette="rose"] .search-field,
html[data-theme="light"][data-palette="rose"] #contextSidebar .search-field { border-color:color-mix(in srgb, var(--accent) 32%, var(--line)); }
html[data-theme="light"][data-palette="rose"] .search-field:focus-within,
html[data-theme="light"][data-palette="rose"] #contextSidebar .search-field:focus-within {
  outline-color:var(--route-cyan)!important;
  border-color:var(--route-cyan)!important;
  box-shadow:0 0 0 3px var(--focus-ring)!important;
}
html[data-theme="light"][data-palette="rose"] .search-leading { color:var(--route-cyan); }
html[data-theme="light"][data-palette="rose"] #q { caret-color:var(--route-cyan); }

/* --- Marfim: teal, titulo #0b6e70 (5,9:1 no creme); busca no mesmo acento. --- */
html[data-theme="light"][data-palette="ivory"] .header-copy h1,
html[data-theme="light"][data-palette="ivory"] header h1,
html[data-theme="light"][data-palette="ivory"] .start-heading h2,
html[data-theme="light"][data-palette="ivory"] .start-eyebrow { color:#0b6e70; }
html[data-theme="light"][data-palette="ivory"] .header-copy p { color:#0f6f71; }
html[data-theme="light"][data-palette="ivory"] .is-start #searchForm label[for="q"],
html[data-theme="light"][data-palette="ivory"] #contextSidebar #searchForm label[for="q"] { color:#0f6f71; }
html[data-theme="light"][data-palette="ivory"] .search-field,
html[data-theme="light"][data-palette="ivory"] #contextSidebar .search-field { border-color:color-mix(in srgb, var(--accent) 34%, var(--line)); }
html[data-theme="light"][data-palette="ivory"] .search-field:focus-within,
html[data-theme="light"][data-palette="ivory"] #contextSidebar .search-field:focus-within {
  outline-color:var(--accent)!important;
  border-color:var(--accent)!important;
  box-shadow:0 0 0 3px var(--focus-ring)!important;
}
html[data-theme="light"][data-palette="ivory"] .search-leading { color:var(--accent); }
html[data-theme="light"][data-palette="ivory"] #q { caret-color:var(--accent); }
/* Estado indisponivel do clima tambem usa o card tonado nos temas escuros. */
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-card.is-unavailable,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-card.is-unavailable span {
  background:var(--tp-card)!important;
  color:#8a3c35!important;
  border-color:var(--tp-card-border)!important;
}
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-reading strong,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-name,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-range,
:is(html[data-theme="dark"][data-palette="dark"],html[data-theme="dark"][data-palette="amber"],html[data-theme="dark"][data-palette="ocean"],html[data-theme="dark"][data-palette="aurora"],html[data-theme="dark"][data-palette="onyx"],html[data-theme="dark"][data-palette="damask"]) .weather-city-rain span { color:var(--tp-card-text)!important; }
html[data-theme="light"][data-palette="ivory"] .start-weather-strip .weather-strip-heading > span:first-child { color:#0b5f61!important; }

/* Fundo da home tambem nos temas: o background: dos temas apaga o image. */
html[data-palette] .app.is-start {
  background-image:linear-gradient(rgba(255,255,255,.28),rgba(255,255,255,.48)),url('../fundo-sistema.webp')!important;
  background-repeat:no-repeat!important;
  background-position:center top!important;
  background-size:cover!important;
}
/* Contraste AA dos botões de acao nos paletas claras mais suaves. */
html[data-theme="light"][data-palette="rose"] #homeButton,
html[data-theme="light"][data-palette="ivory"] #homeButton { color:#1f4652!important; }
html[data-theme="light"][data-palette="rose"] #toggleMap {
  background:#8d1f57!important;border-color:#8d1f57!important;color:#fff!important;
}
html[data-theme="light"][data-palette="ivory"] #toggleMap {
  background:#075e75!important;border-color:#075e75!important;color:#fff!important;
}

html[data-theme="dark"][data-palette] .app.is-start {
  background-image:linear-gradient(rgba(255,255,255,.28),rgba(255,255,255,.48)),url('../fundo-sistema.webp')!important;
  background-size:cover!important;
  background-position:center top!important;
  background-repeat:no-repeat!important;
}
html[data-theme="dark"][data-palette] body:has(> main.app.is-start:not(.is-overview-embedded)) > .app.is-start {
  align-self:stretch;
  min-height:100%;
}
/* Home clara tambem nos temas escuros: textos e cartoes acompanham o fundo. */
html[data-theme="dark"][data-palette] .app.is-start #navigation .city-grid .city-option,
html[data-theme="dark"][data-palette] .app.is-start .city-grid .city-option {
  background:rgba(255,255,255,.94)!important;
  border-color:#cbd8df!important;
  color:#102033!important;
}
html[data-theme="dark"][data-palette] .app.is-start #navigation .city-grid .city-option .nav-copy,
html[data-theme="dark"][data-palette] .app.is-start #navigation .city-grid .city-option .nav-copy small,
html[data-theme="dark"][data-palette] .app.is-start .start-heading h2,
html[data-theme="dark"][data-palette] .app.is-start .start-subtitle,
html[data-theme="dark"][data-palette] .app.is-start #searchForm label,
html[data-theme="dark"][data-palette] .app.is-start #navigation .nav-top h2,
html[data-theme="dark"][data-palette] .app.is-start .section-title {
  color:#102033!important;
}
html[data-theme="dark"][data-palette] .app.is-start #navigation .city-grid .city-option .chevron {
  background:#dcecf1!important;
  color:#075e75!important;
}
