/* EvCar27 shared presentation. Load after the approved screen styles.
   This layer changes typography and surfaces; it does not change any handlers,
   route, map geometry, charging swipe, artwork, or fixed navigation layout. */
body {
  --ev-ui-ink: #f5f8ef;
  --ev-ui-muted: #bad0c2;
  --ev-ui-panel: #063421;
  --ev-ui-deep: #002719;
  --ev-ui-border: #507e65;
  --ev-ui-lime: #d6ff62;
  --ev-ui-error: #ffc0c4;
  --ev-ui-danger: #993f4b;
}
body, button, input, select, textarea, dialog {
  font-family: Manrope, system-ui, -apple-system, sans-serif;
}
body:not(.auth-screen) {
  --text: var(--ev-ui-ink);
  --muted: var(--ev-ui-muted);
  --panel: var(--ev-ui-panel);
  --line: #426f56;
  --yellow: var(--ev-ui-lime);
}
body:not(.auth-screen) :is(.meta, .ev-profile-note, .ev-profile-intro) {
  line-height: 1.6;
}
body :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--ev-ui-lime);
  outline-offset: 3px;
}
body :is(input[type="checkbox"], input[type="radio"]) { accent-color: #c3f86b; }
body :is(input, select, textarea)::placeholder { color: #a3bfaf; opacity: 1; }
/* The silver inactive sprite keeps its cutout when grayscale is applied. */
body:not(.auth-screen) #tabs .ev-nav-profile { mix-blend-mode: screen; }
body:not(.auth-screen) #tabs button:not(.selected) .ev-nav-profile { filter: grayscale(1) brightness(1.2) contrast(1.8); }

/* Dialogs: auth, account/about, balance notices, documents and QR use the same
   material. Preserve the launch sheet and the JS-positioned RFID menu geometry. */
body dialog {
  color: var(--ev-ui-ink);
  background: var(--ev-ui-deep);
  border-color: var(--ev-ui-border);
  border-radius: 22px;
  box-shadow: 0 20px 65px #0009, inset 0 0 0 1px #a9e9a008;
  scrollbar-color: #578a64 #063421;
  scrollbar-width: thin;
}
body dialog:not(.rfid-action-menu):not(.launch-dialog):not(.client-news-dialog) {
  width: min(460px, calc(100% - 28px));
  max-width: calc(100% - 28px);
  max-height: min(88dvh, 780px);
  padding: clamp(18px, 5vw, 25px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
body dialog::backdrop { background: #00140cd6; backdrop-filter: blur(7px); }
body dialog :is(h1, h2, h3) { color: var(--ev-ui-ink); overflow-wrap: anywhere; }
body dialog h2 {
  font-size: clamp(21px, 5.6vw, 25px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.25;
}
body dialog :is(p, .meta) { color: var(--ev-ui-muted); line-height: 1.65; }
body dialog p { font-size: 14px; }
body dialog .meta { font-size: 12.5px; }
body dialog .row { font-size: 14px; gap: 12px; border-color: #355c46; }
body dialog .row > span { min-width: 0; overflow-wrap: anywhere; }
body dialog :is(.primary, .secondary, .danger, .booking-primary, .booking-back) {
  min-height: 46px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.4;
}
body:not(.auth-screen) dialog .primary, body.auth-screen dialog .primary, body dialog .booking-primary {
  color: #10220d;
  background: var(--ev-ui-lime);
  border: 1px solid #e7ff9b;
  box-shadow: 0 4px 15px #92d53420;
}
body:not(.auth-screen) dialog .secondary, body.auth-screen dialog .secondary, body dialog .booking-back {
  color: var(--ev-ui-ink);
  background: #0a3b28;
  border: 1px solid #659575;
  box-shadow: none;
}
body:not(.auth-screen) dialog .danger, body.auth-screen dialog .danger {
  color: #fff4f4;
  background: #883b49;
  border-color: #d17d86;
  box-shadow: none;
}
body dialog :is(button, a)[disabled], body dialog :is(button, a)[aria-disabled="true"] {
  opacity: .48;
  box-shadow: none;
}
body dialog .buttons { gap: 10px; }
body dialog .buttons button { min-width: 0; overflow-wrap: anywhere; }
body dialog form > button + button { margin-top: 10px; }
body dialog :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]), select, textarea) {
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #618a77;
  border-radius: 13px;
  color: var(--ev-ui-ink);
  background: #0c3929;
  padding: 11px 13px;
  font-size: 16px;
  line-height: 1.4;
}
body dialog textarea { width: 100%; min-height: 116px; resize: vertical; }
body dialog :is(input, select, textarea):focus-visible { outline-offset: 2px; }
body dialog .dialog-emblem { background: #0e452b; border-color: #7cad6e; color: var(--ev-ui-lime); }

/* Shared feedback treatment, including real inline server errors. */
body:not(.auth-screen) .notice, body dialog .notice {
  color: #d7eada;
  background: #0a3c28;
  border: 1px solid #4d7e5b;
  border-radius: 13px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
body:not(.auth-screen) .notice.error, body dialog .notice.error {
  color: var(--ev-ui-error);
  background: #412029;
  border-color: #a35b67;
}
body #toast {
  color: var(--ev-ui-ink);
  background: #073924f7;
  border: 1px solid #78a770;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 10px 30px #0008;
  overflow-wrap: anywhere;
}

/* Lists and selected controls keep the common material without recoloring
   availability, charging, reservation or error status indicators. */
body:not(.auth-screen) :is(.search, .connector-filters select) {
  color: var(--ev-ui-ink);
  background: #0b3527;
  border-color: #557e6b;
}
body.catalog-screen #screen .station-card { background: #063421; border-color: #426f56; }
body:not(.auth-screen) :is(.filters button, .list-toolbar button) { border-color: #537d62; background: #073522; }
body:not(.auth-screen) :is(.filters button.selected, .list-toolbar .selected) {
  color: #13240c; background: var(--ev-ui-lime); border-color: var(--ev-ui-lime);
}
body:not(.auth-screen) :is(.menu-card, .rfid-card-list) { background: #04311f; border-color: #507e60; }
body:not(.auth-screen) :is(.menu-card > button, .menu-card > div, .rfid-card-row + .rfid-card-row) { border-color: #355f46; }
body:not(.auth-screen) :is(.menu-card button, .rfid-card-row, .rfid-menu-item) { color: var(--ev-ui-ink); }
body:not(.auth-screen) .rfid-menu-remove { color: #ffb6bf; }
body:not(.auth-screen) #confirm.rfid-action-menu { background: #053322; border-color: #679575; }
body:not(.auth-screen) .rfid-action-menu .rfid-menu-item { min-height: 50px; font-size: 14px; }
body:not(.auth-screen) .rfid-action-menu p { font-size: 12px; }

/* Existing map controls and station drawer receive color/font only. */
body.map-page :is(.map-controls > button, .zoom-controls, .map-list, .map-caption > span, .map-caption button) {
  color: var(--ev-ui-ink); background: #053321ef; border-color: #65886e;
}
body.map-page .station-sheet { color: var(--ev-ui-ink); background: #042b1e; border-color: #5f8a68; }
body.map-page .sheet-close { background: #174a35; color: #deeee1; }

/* Booking actions join the lime/emerald system. Purple port-status semantics
   remain in bookings.css; this only restyles the chooser/confirmation surfaces. */
body:not(.auth-screen) .booking-entry { color: #fbf6ff; background: #63368e; border-color: #cfa5ff; box-shadow: inset 0 1px 0 #e9d4ff33, 0 0 12px #ad6cff25; }
body:not(.auth-screen) :is(.booking-window, .booking-state) { color: #e2c6ff; }
body dialog .booking-time-options button { color: var(--ev-ui-ink); background: #0a3b28; border-color: #658e71; }
body dialog .booking-time-options [aria-pressed="true"] { color: #fbf6ff; background: #63368e; border-color: #cfa5ff; }
body dialog .booking-primary { color: #fbf6ff; background: #63368e; border-color: #cfa5ff; }
body dialog .booking-consent input { accent-color: #cfa5ff; }
body dialog .booking-heading button { border-color: #658e71; color: var(--ev-ui-ink); }
body dialog .booking-port-options { display: grid; gap: 8px; margin: 14px 0; }
body dialog .booking-port-choice { color: #f4ebff; border-color: #9c71c8; background: #342345; margin: 0; }
body .station-help-actions { display: grid; gap: 4px; padding: 7px 0 0; text-align: center; }
body .station-help-actions :is(button,a) { display: block; width: 100%; padding: 7px; border: 0; background: none; color: #cbdccf; font: inherit; font-size: 12px; line-height: 1.4; text-decoration: underline; text-underline-offset: 3px; }

/* News dialogs keep their scrolling structure and API-provided article body. */
body .client-news-dialog { background: #04301f; border-color: #638f69; }
body .client-news-dialog .client-news-head > span { color: #d0faaa; }
body .client-news-scroll p { color: #d7e5d8; }
body .client-news-station { border-color: #3b674c; color: var(--ev-ui-muted); }
body .client-news-continue { color: #d2e5d6; }
body .legal-toolbar { background: #002719; }
body .legal-reader { font-size: 14px; line-height: 1.7; }
body .legal-reader :is(h1,h2,h3) { font-weight: 800; }
body .legal-reader p { color: #dcebdd; }

@media (hover: hover) {
  body:not(.auth-screen) dialog .primary:enabled:hover, body.auth-screen dialog .primary:enabled:hover, body dialog .booking-primary:enabled:hover { background: #e5ff97; }
  body dialog .booking-primary:enabled:hover, body:not(.auth-screen) .booking-entry:enabled:hover { background: #7b49a7; color: #fff; }
  body:not(.auth-screen) dialog .secondary:enabled:hover, body.auth-screen dialog .secondary:enabled:hover, body dialog .booking-back:enabled:hover { background: #134e34; }
  body:not(.auth-screen) :is(.rfid-card-row, .rfid-menu-item):enabled:hover { background: #18503255; }
}
@media (max-width: 350px) {
  body dialog:not(.rfid-action-menu):not(.launch-dialog):not(.client-news-dialog) { padding: 18px 15px; width: calc(100% - 24px); max-width: calc(100% - 24px); }
  body dialog h2 { font-size: 21px; }
  body dialog .buttons { gap: 8px; }
  body dialog .buttons button { padding-inline: 8px; font-size: 13px; }
  body #toast { left: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body dialog, body dialog *, body #toast { scroll-behavior: auto; transition: none; }
}
