/* EV UA web map (/web). Uses the site.css tokens: Manrope, one green accent, light surfaces. */

body.page-web { block-size: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
body.page-web main { flex: 1; min-block-size: 0; position: relative; }

.web-app { position: absolute; inset: 0; display: flex; flex-direction: column; }
.web-stage { position: relative; flex: 1; min-block-size: 0; overflow: hidden; }
.web-map { position: absolute; inset: 0; background: var(--mint); }

/* --- overlays ------------------------------------------------------------------------------------------------ */
/* One column: the top bar (account + chips, search) above the station panel. Whatever the top bar needs in height,
   the panel simply starts below it, and an open search takes width from the chips (or a row of its own) instead of overlapping them. */
.web-overlay { position: absolute; z-index: 5; inset: 12px; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.web-top { position: relative; flex: none; display: flex; align-items: flex-start; gap: 8px; pointer-events: none; }
.web-row { flex: 1 1 0; min-inline-size: 0; display: flex; align-items: flex-start; gap: 8px; pointer-events: none; }
.web-row > *, .chip-wrap, .web-right > * { pointer-events: auto; }
.web-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
.web-tools { position: absolute; z-index: 5; pointer-events: none; inset-block-end: 36px; inset-inline-end: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.web-tools > * { pointer-events: auto; }

/* author display rules below would otherwise beat the hidden attribute */
.web-app [hidden] { display: none !important; }

/* round buttons (account, search, locate) */
.web-round {
  flex: none; inline-size: 48px; block-size: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--accent); box-shadow: var(--shadow); cursor: pointer;
  display: grid; place-items: center; font: 700 1rem/1 var(--font); padding: 0;
}
.web-round:hover { background: var(--mint); }
.web-round-small { inline-size: 40px; block-size: 40px; }
.web-round svg { inline-size: 22px; block-size: 22px; }
.web-account { position: relative; flex: none; }
.web-menu {
  position: absolute; inset-block-start: 56px; inset-inline-start: 0; z-index: 10; min-inline-size: 200px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-small); box-shadow: var(--shadow); padding: 0.5rem;
}
.web-menu p { margin: 0.25rem 0.5rem 0.5rem; font-weight: 700; overflow-wrap: anywhere; }
.web-menu p.w-menu-email { margin: -0.35rem 0.5rem 0.6rem; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.web-menu p.w-menu-tier { margin: 0 0.5rem 0.6rem; }
.web-menu button { inline-size: 100%; }

/* filter chips: wrap onto 2-3 lines instead of scrolling */
.web-chips { display: flex; flex-wrap: wrap; gap: 8px; min-inline-size: 0; pointer-events: none; }
.chip-wrap { position: relative; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem; min-block-size: 40px; padding: 0.4rem 0.85rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: 600 0.9375rem/1 var(--font); cursor: pointer; box-shadow: var(--shadow); white-space: nowrap;
}
.chip:hover { background: var(--bg); }
.chip[aria-expanded="true"], .chip.is-on { background: var(--mint); border-color: var(--accent); color: var(--accent-strong); }
.chip svg { inline-size: 14px; block-size: 14px; flex: none; }
.chip-menu {
  position: absolute; inset-block-start: calc(100% + 6px); inset-inline-start: 0; z-index: 10; inline-size: max-content; min-inline-size: 200px;
  max-inline-size: min(320px, calc(100vw - 48px)); max-block-size: min(60dvh, 420px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-small); box-shadow: var(--shadow); padding: 0.4rem;
}
.chip-option { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; border-radius: 8px; cursor: pointer; font-size: 0.9375rem; }
.chip-option:hover { background: var(--bg); }
.chip-option input { accent-color: var(--accent); inline-size: 18px; block-size: 18px; flex: none; }
.chip-option .swatch { inline-size: 10px; block-size: 10px; border-radius: 50%; flex: none; }
.chip-menu-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0.75rem; min-inline-size: min(440px, calc(100vw - 48px)); max-inline-size: min(520px, calc(100vw - 48px)); }
.chip-group h4 { margin: 0.5rem 0.6rem 0.15rem; font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); }
.chip-menu-groups .chip-reset { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 480px) { .chip-menu-groups { grid-template-columns: 1fr; min-inline-size: 0; } }
.chip-reset { margin: 0.25rem 0.4rem 0.1rem; padding: 0.4rem 0.2rem; border: 0; background: none; color: var(--accent); font: 600 0.875rem var(--font); cursor: pointer; }

/* search */
.web-search { display: flex; align-items: center; justify-content: flex-end; gap: 8px; inline-size: 100%; }
.web-search-input {
  display: none; flex: 1; inline-size: min(380px, 100%); min-inline-size: 0; block-size: 48px; padding: 0 1rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); font: 500 1rem var(--font); color: var(--ink);
}
.web-search.is-open .web-search-input { display: block; }
.web-results {
  position: absolute; inset-block-start: 56px; inset-inline-end: 0; inline-size: min(420px, 100%); z-index: 6; max-block-size: calc(100dvh - 180px); overflow: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.5rem;
}
.web-results h3 { font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); margin: 0.5rem 0.5rem 0.25rem; }
.result-row { display: flex; align-items: center; gap: 0.75rem; inline-size: 100%; padding: 0.6rem 0.5rem; border: 0; border-radius: 10px; background: none; text-align: start; cursor: pointer; font: inherit; color: inherit; }
.result-row:hover { background: var(--bg); }
.result-power { flex: none; min-inline-size: 3.2rem; text-align: center; color: var(--accent); font-weight: 800; line-height: 1.1; }
.result-power small { display: block; font-size: 0.75rem; font-weight: 600; }
.result-text { flex: 1; min-inline-size: 0; }
.result-text strong, .result-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-text span { color: var(--ink-2); font-size: 0.875rem; }
.result-distance { flex: none; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.results-empty { margin: 0.75rem; color: var(--ink-2); }

/* map style switch */
.web-segment { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.web-segment button { display: grid; place-items: center; inline-size: 46px; block-size: 40px; border: 0; border-radius: 999px; padding: 0; background: none; color: var(--ink-2); cursor: pointer; }
.web-segment svg { inline-size: 22px; block-size: 22px; }
.web-segment button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* toast */
.web-toast { position: absolute; inset-inline: 0; inset-block-end: 16px; margin-inline: auto; inline-size: max-content; max-inline-size: calc(100% - 32px); z-index: 20; padding: 0.6rem 1rem; border-radius: 999px; background: var(--ink); color: #fff; font-size: 0.9375rem; }

/* promo strip (mockups: "more in the mobile app") */
.web-promo { flex: none; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 0.4rem var(--gutter); background: var(--ink); color: #fff; font-size: 0.9375rem; font-weight: 600; min-block-size: 48px; }
.web-promo .button { min-block-size: 34px; padding: 0.3rem 0.9rem; }

/* --- station panel -------------------------------------------------------------------------------------------- */
.web-panel {
  flex: 1; min-block-size: 0; align-self: flex-start; inline-size: min(100%, 520px); pointer-events: auto; overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.web-panel[hidden] { display: none; }

.w-gallery-wrap { position: relative; background: var(--mint); }
.w-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; block-size: clamp(150px, 26dvh, 210px); }
.w-gallery::-webkit-scrollbar { display: none; }
/* Photos are fitted whole (aspect fit, like the iOS app); a blurred, filled copy of the same photo fills the rest of the slide */
.w-gallery .shot { position: relative; flex: none; inline-size: 100%; block-size: 100%; overflow: hidden; scroll-snap-align: center; border-radius: 0; background: var(--mint); }   /* .shot: site.js opens it in the lightbox */
.w-gallery .shot .w-photo-bg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; filter: blur(22px) brightness(0.92); transform: scale(1.2); }
.w-gallery .shot .w-photo { position: relative; inline-size: 100%; block-size: 100%; object-fit: contain; }
.w-gallery-empty { block-size: clamp(150px, 26dvh, 210px); display: grid; align-content: center; justify-items: center; gap: 0.5rem; color: var(--accent); font-weight: 600; }   /* same height as a photo */
.w-gallery-empty svg { inline-size: 40px; block-size: 40px; opacity: 0.6; }
.w-gallery-empty span { color: var(--ink-2); font-size: 0.9375rem; }
.w-gallery-dots { position: absolute; inset-block-end: 8px; inset-inline: 0; display: flex; justify-content: center; gap: 5px; }
.w-gallery-dots i { inline-size: 7px; block-size: 7px; border-radius: 50%; background: rgb(255 255 255 / 55%); }
.w-gallery-dots i.is-on { background: #fff; }
.panel-close { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; inline-size: 36px; block-size: 36px; border: 0; border-radius: 50%; background: rgb(22 36 26 / 60%); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; z-index: 2; }

.panel-body { padding: 0.75rem 1rem 1rem; display: grid; gap: 0.5rem; }
.panel-head { display: grid; gap: 0.3rem; }
.panel-title { margin: 0; font-size: 1.375rem; line-height: 1.2; font-weight: 800; }
.panel-address { display: flex; gap: 0.4rem; align-items: flex-start; margin: 0; color: var(--ink-2); font-size: 0.8125rem; }
.panel-address svg { inline-size: 16px; block-size: 16px; flex: none; margin-block-start: 0.2em; color: var(--accent); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.panel-actions .button { flex: 1 1 0; min-inline-size: 0; justify-content: center; padding-inline: 0.75rem; white-space: nowrap; }
.w-app-hint { flex: 1 0 100%; margin: 0; text-align: center; }

.w-tabs { display: flex; margin-block-start: -0.25rem; border-block-end: 1px solid var(--line); margin-inline: -1rem; padding-inline: 1rem; }
.w-tab { flex: 1; padding: 0.7rem 0.25rem; border: 0; border-block-end: 3px solid transparent; background: none; color: var(--ink-2); font: 700 0.9375rem var(--font); cursor: pointer; }
.w-tab[aria-selected="true"] { color: var(--accent); border-block-end-color: var(--accent); }
.w-tab-panel { display: grid; gap: 0.6rem; padding-block-start: 0.1rem; }

/* stations tab */
.station-block { display: grid; gap: 0.2rem; padding-block-end: 1rem; border-block-end: 1px solid var(--line); }
.station-block:last-of-type { border-block-end: 0; }
.w-station-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.station-title { margin: 0; font-size: 1.125rem; font-weight: 800; }
.station-meta { margin: 0; color: var(--ink-2); font-size: 0.875rem; }
.w-connector-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.2rem 0; }
.w-connector-icon { position: relative; flex: none; inline-size: 36px; block-size: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); overflow: hidden; }
/* the plug PNGs are white glyphs; pinned to the tile so a tall glyph (CCS2) is scaled to fit, not overflowing an auto grid row */
.w-connector-icon img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; padding: 7px; object-fit: contain; }
.w-is-off .w-connector-icon { background: #9AA59D; }   /* offline connectors are grey, not green */
.w-is-off .w-connector-icon-text { background: var(--line); color: var(--ink-2); }
.w-is-off .w-connector-name { color: var(--ink-2); }
.w-is-busy .w-connector-icon { background: #D76B1D; }   /* a connector in use takes its status colour, like the pill */
.w-is-busy .w-connector-icon-text { background: var(--peach); color: #D76B1D; }
.w-is-busy .w-connector-name { color: #D76B1D; }
.w-connector-icon-text { background: var(--mint); color: var(--accent-strong); font-size: 0.75rem; font-weight: 800; }
.chip-option .w-connector-icon { inline-size: 28px; block-size: 28px; border-radius: 8px; }
.w-connector-name { margin: 0; line-height: 1.25; font-weight: 700; color: var(--accent); }
.w-connector-detail { margin: 0; line-height: 1.3; color: var(--ink-2); font-size: 0.875rem; }
.w-connector-text { flex: 1; min-inline-size: 0; }

.w-pill { flex: none; display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.w-pill-good { background: var(--mint); color: var(--accent-strong); }
.w-pill-busy { background: var(--peach); color: #D76B1D; }
.w-pill-bad { background: #FBE7E7; color: #BD0909; }
.footnote.w-stale { color: #D76B1D; font-weight: 600; }   /* data fetched a while ago */
.footnote { margin: 0; color: var(--ink-2); font-size: 0.8125rem; line-height: 1.3; }

.signin-card { padding: 1rem; border-radius: var(--radius-small); background: var(--sky); display: grid; gap: 0.5rem; }
.signin-card h3 { margin: 0; font-size: 1rem; }
.signin-card p { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }

/* location tab: outage + standby */
.power-section { display: grid; gap: 0.2rem; }
.power-section h3 { margin: 0 0 0.1rem; font-size: 17px; line-height: 1.25; }   /* title 17 px, everything else in the block 13 px */
.power-line { margin: 0; font-size: 13px; line-height: 1.35; }
.power-line.power-title { font-size: 17px; font-weight: 700; line-height: 1.25; }   /* "Група відключень 6.2" is a title like the heading */
.power-section .w-day-bar { margin-block-start: 0.25rem; }
.power-section .w-legend { margin-block-start: 0.35rem; }
.w-tone-good { color: var(--accent); font-weight: 700; }
.w-tone-warn { color: #D76B1D; font-weight: 700; }
.w-tone-bad { color: #BD0909; font-weight: 700; }
.w-day-bar { position: relative; block-size: 10px; border-radius: 999px; background: var(--accent); overflow: hidden; }
.w-day-bar .off { position: absolute; inset-block: 0; background: #BD0909; }
.w-day-bar .future { position: absolute; inset-block: 0; inset-inline-end: 0; background: rgb(255 255 255 / 60%); }
.w-day-bar .now { position: absolute; inset-block: 0; inline-size: 2px; background: var(--ink); }
.day-scale { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 13px; }
.w-legend { margin: 0; display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; color: var(--ink-2); font-size: 13px; }
.w-legend i { display: inline-block; inline-size: 10px; block-size: 10px; border-radius: 50%; margin-inline-end: 0.35rem; }
.how-to { white-space: pre-line; margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }

/* amenities tab */
.poi-sort { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--ink-2); }
.poi-sort select { padding: 0.3rem 0.5rem; border-radius: 8px; border: 1px solid var(--line); font: inherit; background: var(--surface); color: var(--ink); }
.poi-group h3 { margin: 0 0 0.25rem; font-size: 1.0625rem; }
.poi-row { display: flex; gap: 0.75rem; align-items: center; padding: 0.3rem 0; text-decoration: none; color: inherit; }
.poi-row img, .poi-thumb { flex: none; inline-size: 80px; block-size: 80px; border-radius: 10px; object-fit: cover; background: var(--mint); }
.poi-row strong { display: block; line-height: 1.3; }
.poi-row div > span { display: block; color: var(--ink-2); font-size: 0.875rem; line-height: 1.35; }   /* the ★ inside the rating line stays inline */
.poi-row .poi-rating { display: flex; align-items: center; gap: 0.4rem; }
.w-stars { color: #EA9C38; font-size: 0.8125rem; letter-spacing: 0.04em; line-height: 1; white-space: nowrap; }
.w-stars .w-stars-off { color: var(--line); }

/* arrows of the shared lightbox (site.js opens it; the map page adds previous/next across a station's photos) */
.lightbox-nav { position: absolute; inset-block-start: 50%; transform: translateY(-50%); z-index: 1; inline-size: 48px; block-size: 48px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); display: grid; place-items: center; padding: 0; cursor: pointer; box-shadow: var(--shadow); }
.lightbox-prev { inset-inline-start: 0.75rem; }
.lightbox-next { inset-inline-end: 0.75rem; }
.lightbox-nav[hidden] { display: none; }

/* sign-in dialog */
.web-dialog { inline-size: min(420px, calc(100% - 32px)); border: 0; border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 24px 64px rgb(22 36 26 / 25%); color: var(--ink); }
.web-dialog::backdrop { background: rgb(22 36 26 / 45%); }
.web-dialog h2 { font-size: 1.375rem; margin: 0 2rem 0.5rem 0; }
.web-dialog h3 { font-size: 1rem; margin: 0 0 0.25rem; }
.web-dialog-close { position: absolute; inset-block-start: 0.75rem; inset-inline-end: 0.75rem; inline-size: 36px; block-size: 36px; border: 0; border-radius: 50%; background: var(--bg); font-size: 1.4rem; cursor: pointer; }
.signin-qr { display: grid; justify-items: center; gap: 0.5rem; margin-block: 1rem 0.5rem; text-align: center; }
.qr-box { padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-small); }
.qr-box canvas { display: block; inline-size: 200px; block-size: 200px; }
.qr-countdown { margin: 0; font-variant-numeric: tabular-nums; }
.qr-expired { display: grid; gap: 0.5rem; justify-items: center; }
.signin-or { display: flex; align-items: center; gap: 0.75rem; color: var(--ink-2); margin: 0.75rem 0; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; border-block-start: 1px solid var(--line); }
.signin-sso { display: grid; gap: 0.5rem; justify-items: center; }
.google-button { min-block-size: 44px; }
.apple-button { inline-size: 260px; justify-content: center; }
.signin-error { color: #BD0909; margin: 0.75rem 0 0; text-align: center; }

/* tablets and narrow windows: an open search takes a full row on top, the chips move below it */
@media (max-width: 900px) {
  .web-stage.search-open .web-top { flex-wrap: wrap; }
  .web-stage.search-open .web-right { order: -1; flex: 1 0 100%; }
  .web-stage.search-open .web-row { flex: 1 0 100%; }
  .web-stage.search-open .web-search-input { inline-size: auto; }
  .web-results { inset-inline: 0; inline-size: auto; }
}

/* --- phones and narrow windows: the station card takes the whole map area (the site header stays visible) ---------- */
@media (max-width: 640px) {
  .web-overlay { position: static; display: contents; }
  .web-top { position: absolute; z-index: 5; inset-block-start: 12px; inset-inline: 12px; }
  .web-panel {
    position: absolute; inset: 0; z-index: 6; inline-size: auto; block-size: auto; align-self: auto;
    border-radius: 0; border: 0; box-shadow: none;
  }
  body.has-sheet .web-tools { display: none; }
  .web-promo { font-size: 0.8125rem; gap: 0.6rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .chip, .web-round, .w-tab { transition: background-color 0.15s ease, color 0.15s ease; }
}
