:root {
  color-scheme: light;
  --bg: #edf3ee;
  --panel: #ffffff;
  --soft: #f7fbf8;
  --text: #111f18;
  --muted: #65746b;
  --line: #dce7df;
  --accent: #168653;
  --accent-dark: #0f6b45;
  --accent-soft: #e5f5ec;
  --warm: #f2b84b;
  --danger: #c24f35;
  --danger-soft: #faece7;
  --shadow: 0 22px 60px rgba(21, 41, 29, 0.1);
  --shadow-soft: 0 12px 34px rgba(21, 41, 29, 0.08);
  --ring: 0 0 0 4px rgba(22, 134, 83, 0.16);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --nav-height: 78px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 10% -10%, rgba(22, 134, 83, 0.18), transparent 320px),
    radial-gradient(circle at 92% 8%, rgba(242, 184, 75, 0.16), transparent 260px),
    linear-gradient(180deg, #f7faf6 0%, var(--bg) 52%, #e9f0ea 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: auto;
  -webkit-font-smoothing: antialiased;
}

button,
input,
a {
  font: inherit;
  min-width: 0;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.12s ease;
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

button:hover:not(:disabled),
a:hover {
  transform: translateY(-1px);
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.app {
  height: 100dvh;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 16px 16px calc(var(--nav-height) + 18px + env(safe-area-inset-bottom));
  overflow: hidden;
}

.app-header,
.bottom-nav,
.card,
.map-screen,
.chat-history-card,
.chat-empty,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-header {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-color: rgba(255, 255, 255, 0.76);
  padding: 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.06em;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%),
    linear-gradient(135deg, #22a96b, #0b6842);
  box-shadow: 0 14px 28px rgba(22, 134, 83, 0.28);
  flex: 0 0 auto;
}

.brand h1,
.card-title,
.chat-header h2,
.map-toolbar h2,
.chat-empty h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 22px;
  letter-spacing: -0.04em;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.city-badge,
.station-count {
  border-radius: 999px;
  background: rgba(232, 243, 236, 0.9);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 6px 11px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.08);
}

.app-main {
  min-height: 0;
  height: 100%;
  display: grid;
  overflow: hidden;
  overscroll-behavior: contain;
}

.tab-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.tab-panel.active {
  display: block;
}

.panel-grid {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  transition: grid-template-rows 0.24s ease, gap 0.24s ease;
}

.panel-grid.stations-expanded {
  grid-template-rows: 0 0 minmax(0, 1fr);
  gap: 0;
}

.panel-grid.stations-expanded > .card:not(.station-card-wrap) {
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-8px);
}

.card {
  min-width: 0;
  padding: 15px;
  transition: opacity 0.18s ease, transform 0.18s ease, padding 0.18s ease;
}

.card-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.city-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.selected-city-card {
  margin-top: 10px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(22, 134, 83, 0.14);
  border-radius: 15px;
  background: linear-gradient(180deg, #f8fcf9, #edf6f0);
  padding: 7px 8px 7px 13px;
}

.selected-city-card span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-city-card span::before {
  content: "Город: ";
  color: var(--muted);
  font-weight: 800;
}

.selected-city-card button {
  min-height: 30px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 0 12px;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.14);
}

.city-card.is-selected {
  padding-bottom: 12px;
}

.city-card.is-selected .city-form {
  display: none;
}

input {
  width: 100%;
  border: 1px solid rgba(196, 211, 201, 0.94);
  border-radius: 15px;
  min-height: 46px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.city-form button,
.primary-action,
.message-form button {
  border-radius: 15px;
  min-height: 46px;
  padding: 0 15px;
  background: linear-gradient(135deg, #1d9a61, #0f6b45);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(22, 134, 83, 0.2);
}

.city-form button:hover,
.primary-action:hover,
.message-form button:hover {
  background: var(--accent-dark);
}

.city-chat-button {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(22, 134, 83, 0.2);
  border-radius: 17px;
  background:
    radial-gradient(circle at 0% 0%, rgba(22, 134, 83, 0.12), transparent 150px),
    linear-gradient(180deg, #fbfefc, #edf7f1);
  color: var(--text);
  padding: 9px 12px;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.05), var(--shadow-soft);
}

.city-chat-button::after {
  content: "›";
  margin-left: auto;
  color: var(--accent-dark);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.city-chat-button:hover:not(:disabled) {
  border-color: rgba(22, 134, 83, 0.48);
  background: #edf8f1;
  color: var(--accent-dark);
}

.city-chat-button.active {
  border-color: var(--accent);
  background: #e8f5ed;
  box-shadow: inset 4px 0 0 var(--accent), 0 12px 30px rgba(22, 134, 83, 0.12);
}

.city-chat-button__icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: visible;
  border-radius: 13px;
  background: linear-gradient(135deg, #21a86b, #0f6b45);
  color: #fff;
  box-shadow: 0 10px 20px rgba(22, 134, 83, 0.22);
}

.city-chat-button__icon svg {
  width: 18px;
  height: 18px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

button svg,
a svg,
.nav-icon svg,
.ui-icon {
  display: block;
  flex: 0 0 auto;
  overflow: visible;
  transform-box: fill-box;
  shape-rendering: geometricPrecision;
  margin: 0;
}

button svg path,
button svg circle,
a svg path,
a svg circle,
.nav-icon svg path,
.nav-icon svg circle,
.ui-icon path,
.ui-icon circle {
  vector-effect: non-scaling-stroke;
}

.city-chat-button__text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.city-chat-button__text strong,
.city-chat-button__text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-chat-button__text strong {
  font-size: 14px;
  line-height: 1.15;
}

.city-chat-button__text small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.city-card.is-selected + .card .city-chat-button {
  min-height: 38px;
  margin-top: 7px;
}

.station-card-wrap {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  gap: 11px;
  overflow: hidden;
}

.panel-grid.stations-expanded .station-card-wrap {
  padding-top: 14px;
  border-radius: 20px;
}

.section-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-row > div {
  min-width: 0;
}

.station-search {
  min-height: 42px;
  font-size: 13px;
}

.station-scope {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.station-controls,
.map-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-width: 0;
}

.status-filter {
  min-width: 0;
  display: inline-flex;
  gap: 6px;
  border: 1px solid rgba(196, 211, 201, 0.9);
  border-radius: 999px;
  background: #edf3ef;
  padding: 4px;
}

.filter-chip {
  min-height: 34px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  padding: 0 11px;
}

.filter-chip.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 18px rgba(21, 41, 29, 0.1);
}

.filter-dot {
  width: 15px;
  height: 15px;
  display: inline-block;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(28, 42, 34, 0.12);
}

.filter-dot--available {
  background: var(--accent);
}

.filter-dot--all {
  background: var(--danger);
}

.nearby-button {
  min-height: 42px;
  min-width: max-content;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef8f2;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
  padding: 0 13px;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.12);
}

.nearby-button.active {
  background: linear-gradient(135deg, #1d9a61, #0f6b45);
  color: #fff;
  box-shadow: 0 10px 24px rgba(22, 134, 83, 0.2);
}

.fuel-filter {
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.fuel-filter::-webkit-scrollbar {
  display: none;
}

.fuel-chip {
  min-height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f5f8f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  padding: 0 11px;
  box-shadow: inset 0 0 0 1px rgba(196, 211, 201, 0.92);
}

.fuel-chip.active {
  background: linear-gradient(180deg, #fff8e5, #fff1c4);
  color: #7b5614;
  box-shadow: inset 0 0 0 1px rgba(242, 184, 75, 0.48);
}

.station-list,
.chat-history-list,
.messages {
  overflow: auto;
}

.station-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 10px 7px 18px 1px;
  border-top: 1px solid rgba(220, 231, 223, 0.9);
  border-bottom: 1px solid rgba(220, 231, 223, 0.9);
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  touch-action: pan-y;
  background:
    linear-gradient(#fff 30%, rgba(255, 255, 255, 0)),
    linear-gradient(rgba(255, 255, 255, 0), #fff 70%) 0 100%,
    linear-gradient(rgba(24, 33, 27, 0.12), rgba(24, 33, 27, 0)),
    linear-gradient(rgba(24, 33, 27, 0), rgba(24, 33, 27, 0.12)) 0 100%;
  background-attachment: local, local, scroll, scroll;
  background-repeat: no-repeat;
  background-size: 100% 22px, 100% 22px, 100% 8px, 100% 8px;
}

.station-list::-webkit-scrollbar,
.chat-history-list::-webkit-scrollbar,
.messages::-webkit-scrollbar {
  width: 8px;
}

.station-list::-webkit-scrollbar-track,
.chat-history-list::-webkit-scrollbar-track,
.messages::-webkit-scrollbar-track {
  background: #eef2ea;
  border-radius: 999px;
}

.station-list::-webkit-scrollbar-thumb,
.chat-history-list::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb {
  background: #a7b7ad;
  border: 2px solid #eef2ea;
  border-radius: 999px;
}

.station-card {
  width: 100%;
  min-height: 124px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: stretch;
  text-align: left;
  border: 1px solid rgba(217, 229, 220, 0.96);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 250, 0.98));
  color: var(--text);
  padding: 15px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(21, 41, 29, 0.055);
  flex: 0 0 auto;
}

.station-card:hover,
.station-card.active {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent), 0 14px 34px rgba(22, 134, 83, 0.12);
}

.station-card strong,
.chat-row strong {
  display: block;
  font-size: 15.5px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.station-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.station-card-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.station-card-badges {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.station-fav-mark {
  min-width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #fff7d8;
  color: #b9860d;
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(242, 184, 75, 0.34);
}

.station-fav-mark svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.station-distance {
  border-radius: 999px;
  background: #e9f5ee;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 950;
  padding: 5px 8px;
  white-space: nowrap;
}

.station-address,
.chat-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.station-address {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.station-card-foot {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.station-status {
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  color: #53635a;
  font-size: 12px;
  font-weight: 850;
}

.station-status em {
  min-width: 0;
  overflow-wrap: anywhere;
  font-style: normal;
  line-height: 1.22;
}

.station-tags {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.station-tags small {
  min-height: 26px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #edf7f1;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
}

.station-tags .station-fuel-tag {
  background: #f5f1e7;
  color: #7b5614;
}

.map-screen {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.map-toolbar {
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.map-toolbar p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-toolbar h2 {
  font-size: 21px;
  letter-spacing: -0.035em;
}

#map {
  min-height: 0;
  width: 100%;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
}

.map-filter {
  background: rgba(255, 255, 255, 0.88);
}

.dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 4px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.75), 0 0 0 4px rgba(21, 41, 29, 0.05);
}

.available {
  background: #18a660;
}

.empty {
  background: #d24f35;
}

.unknown {
  background: #91a096;
}

.queue_big {
  background: #f2b84b;
}

.low {
  background: #e5aa22;
}

.map-attribution {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #4f5a54;
  font-size: 10px;
  padding: 4px 8px;
  backdrop-filter: blur(10px);
}

.map-station-preview {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 34px;
  z-index: 1200;
  max-height: min(500px, calc(100% - 100px));
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(21, 41, 29, 0.22);
  padding: 14px;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.station-list-preview {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  border: 1px solid rgba(220, 231, 223, 0.95);
  border-radius: 20px;
  background:
    radial-gradient(circle at 0% 0%, rgba(22, 134, 83, 0.1), transparent 190px),
    #fbfefc;
  box-shadow: 0 16px 42px rgba(21, 41, 29, 0.1);
  padding: 14px;
  overflow: hidden;
}

.station-list-preview h3 {
  max-width: calc(100% - 82px);
  margin: 4px 0 6px;
  display: -webkit-box;
  overflow: hidden;
  font-size: 19px;
  line-height: 1.18;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  white-space: normal;
}

.station-list-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.station-list-preview #listPreviewStatus {
  color: var(--text);
  font-weight: 900;
}

.map-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(239, 246, 241, 0.96);
  color: #365045;
  font-size: 22px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.08);
}

.map-preview-close svg,
.favorite-preview-btn svg,
.settings-button svg,
.icon-button svg,
.close-chat-button svg,
.chat-row-actions button svg,
.settings-menu-action svg,
.favorite-station-head [data-remove-favorite] svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.map-preview-close,
.favorite-preview-btn,
.settings-button,
.icon-button,
.close-chat-button,
.chat-row-actions button,
.favorite-station-head [data-remove-favorite] {
  display: inline-grid;
  place-items: center;
}

.favorite-preview-btn {
  position: absolute;
  top: 10px;
  right: 52px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(239, 246, 241, 0.96);
  color: #66756b;
  font-size: 20px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.08);
}

.favorite-preview-btn svg {
  width: 19px;
  height: 19px;
}

.favorite-preview-btn.active svg {
  fill: rgba(184, 132, 11, 0.18);
}

.favorite-preview-btn.active {
  background: linear-gradient(180deg, #fff8df, #ffefb7);
  color: #a87500;
  box-shadow: inset 0 0 0 1px rgba(242, 184, 75, 0.5), 0 10px 24px rgba(242, 184, 75, 0.2);
}

.map-preview-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.preview-status-card {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  border: 1px solid rgba(220, 231, 223, 0.9);
  border-radius: 18px;
  background: #f7fbf8;
  padding: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.preview-status-card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #e8f5ed;
  color: var(--accent);
}

.preview-status-card__icon svg {
  width: 21px;
  height: 21px;
}

.preview-status-card__main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.preview-status-card strong {
  color: var(--text);
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.preview-status-card small {
  min-width: 0;
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.preview-status-card--available {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.035)), #fff;
}

.preview-status-card--queue {
  border-color: rgba(242, 184, 75, 0.42);
  background: linear-gradient(145deg, rgba(242, 184, 75, 0.15), rgba(242, 184, 75, 0.04)), #fff;
}

.preview-status-card--low {
  border-color: rgba(245, 158, 11, 0.34);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.035)), #fff;
}

.preview-status-card--empty {
  border-color: rgba(194, 79, 53, 0.26);
  background: linear-gradient(145deg, rgba(194, 79, 53, 0.11), rgba(194, 79, 53, 0.035)), #fff;
}

.preview-status-card--empty .preview-status-card__icon {
  background: #ffe7e2;
  color: #c24f35;
}

.preview-status-card--queue .preview-status-card__icon,
.preview-status-card--low .preview-status-card__icon {
  background: #fff3d6;
  color: #b77908;
}

.preview-confidence {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(42px, 1fr) auto;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.preview-confidence i {
  height: 7px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(201, 214, 205, 0.9);
}

.preview-confidence b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2b84b, #22c55e);
}

.preview-confidence em {
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 950;
}

.preview-fuel-now {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(22, 134, 83, 0.08);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-vote-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview-vote-actions button {
  min-width: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #eef6f1;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 950;
  line-height: 1.08;
  padding: 0 7px;
  text-align: center;
  white-space: normal;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.08);
}

.preview-vote-actions button:first-child {
  background: linear-gradient(135deg, #1d9a61, #0f6b45);
  color: #fff;
  box-shadow: 0 12px 24px rgba(22, 134, 83, 0.18);
}

.preview-vote-actions button:nth-child(2) {
  background: #fff5de;
  color: #835b13;
}

.preview-vote-actions button:nth-child(3) {
  background: #fff0ec;
  color: #a8442e;
}

.preview-vote-actions button:disabled {
  opacity: 0.58;
}

.map-station-preview h3 {
  flex: 0 0 auto;
  max-width: calc(100% - 84px);
  margin: 2px 0 0;
  display: -webkit-box;
  overflow: hidden;
  font-size: 21px;
  line-height: 1.18;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  white-space: normal;
}

.map-station-preview p {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.map-station-preview #mapPreviewStatus {
  color: var(--text);
  font-weight: 900;
}

.map-preview-fuel {
  width: fit-content;
  max-width: 100%;
  margin-top: 9px;
  border-radius: 999px;
  background: #fff4d7;
  color: #7b5614;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 9px;
  overflow-wrap: anywhere;
}

.recent-marks {
  margin-top: 12px;
  min-height: 0;
  border: 1px solid rgba(220, 231, 223, 0.9);
  border-radius: 16px;
  background: #f8fbf8;
  overflow: hidden;
}

.map-station-preview > .recent-marks,
.station-list-preview > .recent-marks {
  max-height: min(176px, 30vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.map-station-preview > .recent-marks {
  flex: 1 1 auto;
  min-height: 92px;
}

.recent-marks__title {
  padding: 10px 11px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recent-mark {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  border-top: 1px solid rgba(220, 231, 223, 0.8);
  padding: 10px 11px;
}

.recent-mark__dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: #8f9891;
}

.recent-mark__main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.recent-mark__status {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
}

.recent-mark__meta,
.recent-mark__detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.28;
}

.recent-mark__thanks {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf3ef;
  color: var(--muted);
}

.recent-mark__thanks svg {
  width: 14px;
  height: 14px;
}

.recent-mark--yes .recent-mark__dot,
.recent-mark--available .recent-mark__dot {
  background: var(--accent);
}

.recent-mark--queue .recent-mark__dot,
.recent-mark--low .recent-mark__dot {
  background: var(--warm);
}

.recent-mark--no .recent-mark__dot,
.recent-mark--empty .recent-mark__dot {
  background: var(--danger);
}

.recent-mark--loading .recent-mark__dot {
  background: var(--line);
}

.chat-marks-panel {
  grid-row: 3;
  max-height: min(162px, 22vh);
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
  overflow-y: auto;
}

.map-preview-actions {
  flex: 0 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 9px;
  margin-top: 0;
}

.map-preview-actions button,
.map-preview-actions a {
  min-height: 40px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  background: #eef6f1;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
  text-decoration: none;
  padding: 0 8px;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.08);
}

.map-preview-actions span,
.favorite-station-actions span,
.favorites-empty-actions span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-preview-actions svg,
.favorite-station-actions svg,
.favorites-empty-actions svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.map-preview-actions #openStationChatBtn,
.map-preview-actions #openListChatBtn {
  background: linear-gradient(135deg, #1d9a61, #0f6b45);
  color: #fff;
  box-shadow: 0 12px 24px rgba(22, 134, 83, 0.2);
}

.chats-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 16px;
}

.chats-layout:not(.chat-open) {
  grid-template-columns: minmax(0, 1fr);
}

.chats-layout:not(.chat-open) .chat-empty {
  display: none;
}

.chats-layout.chat-open {
  grid-template-columns: minmax(0, 1fr);
}

.chats-layout.chat-open .chat-history-card,
.chats-layout.chat-open .chat-empty {
  display: none;
}

.chat-history-card {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

.chat-history-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 6px;
}

.chat-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid rgba(217, 229, 220, 0.96);
  border-radius: 17px;
  background: linear-gradient(180deg, #fff, #fbfdfb);
  color: var(--text);
  padding: 13px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(21, 41, 29, 0.05);
}

.chat-row.active,
.chat-row:hover,
.chat-row:focus {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent), 0 14px 34px rgba(22, 134, 83, 0.1);
  outline: none;
}

.chat-row-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.chat-row-actions button,
.small-action,
.icon-button {
  border-radius: 12px;
  background: #eff6f1;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.08);
}

.chat-row-actions button {
  min-width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
}

.chat-row-actions button.active,
.small-action.active {
  background: linear-gradient(135deg, #1d9a61, #0f6b45);
  color: #fff;
}

.chat-row-actions button {
  line-height: 1;
}

.chat-empty {
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.chats-layout:not(.chat-open) .chat-panel {
  display: none;
}

.chat-empty h2 {
  font-size: 26px;
}

.chat-empty p {
  max-width: 420px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.chat-panel {
  height: 100%;
  min-height: 0;
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(22, 134, 83, 0.12), transparent 300px),
    radial-gradient(circle at 100% 16%, rgba(242, 184, 75, 0.1), transparent 240px),
    linear-gradient(180deg, #f8fbf8 0%, #edf4ef 100%);
  border-radius: 24px;
  isolation: isolate;
}

.chat-header {
  grid-row: 1;
  position: relative;
  min-height: 58px;
  border-bottom: 1px solid rgba(220, 231, 223, 0.78);
  padding: 9px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.chat-header > div {
  min-width: 0;
}

.chat-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-header p {
  margin: 0;
  color: var(--muted);
  margin-bottom: 1px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-header h2 {
  font-size: 18px;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.room-meta {
  margin-top: 2px;
  font-size: 11px;
}

.chat-title-row h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.chat-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.back-button {
  min-height: 38px;
  border-radius: 999px;
  padding: 0 13px;
  background: #f0f8f3;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.1);
}

.back-button:hover {
  background: #e4f1e8;
}

.small-action,
.settings-menu-action {
  min-height: 32px;
  padding: 0 10px;
}

.settings-button,
.icon-button {
  width: 36px;
  height: 36px;
  line-height: 1;
}

.settings-button {
  flex: 0 0 auto;
  border: 1px solid rgba(22, 134, 83, 0.12);
  border-radius: 999px;
  background: #f0f8f3;
  color: var(--accent-dark);
  font-weight: 900;
  padding: 0;
}

.settings-button svg {
  width: 18px;
  height: 18px;
}

.chat-header-actions .small-action,
.close-chat-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 999px;
  padding: 0;
  background: var(--danger-soft);
  color: #aa4c35;
  font-size: 22px;
  font-weight: 750;
  line-height: 1;
}

.settings-button.active {
  border-color: var(--accent);
  background: #e8f3ec;
  color: var(--accent-dark);
}

.chat-settings-menu {
  position: absolute;
  top: 52px;
  right: 16px;
  z-index: 6;
  width: min(280px, calc(100vw - 42px));
  border: 1px solid rgba(220, 231, 223, 0.96);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 22px 65px rgba(21, 41, 29, 0.18);
  padding: 12px;
  backdrop-filter: blur(16px);
}

.settings-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.settings-menu-head strong {
  font-size: 14px;
}

.settings-menu-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border-radius: 13px;
  background: #eef6f1;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.settings-menu-action + .settings-menu-action {
  margin-top: 8px;
}

.settings-menu-action.active {
  background: linear-gradient(135deg, #1d9a61, #0f6b45);
  color: #fff;
}

.vote-panel {
  grid-row: 2;
  border-bottom: 1px solid rgba(220, 231, 223, 0.78);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.vote-panel > div,
.vote-actions,
.vote-group {
  min-width: 0;
}

.vote-panel strong,
.vote-panel span {
  display: block;
}

.vote-panel strong {
  font-size: 12px;
}

.vote-panel span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.vote-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.vote-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.vote-group span {
  margin: 0 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.vote-actions button {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  background: #eef6f1;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.vote-actions button[data-fuel-vote="true"].selected,
.vote-actions button[data-queue-vote="none"].selected,
.vote-actions button[data-queue-vote="small"].selected {
  background: linear-gradient(135deg, #1d9a61, #0f6b45);
  color: #fff;
}

.vote-actions button[data-fuel-vote="false"].selected {
  background: var(--danger);
  color: #fff;
}

.vote-actions button[data-queue-vote="big"].selected {
  background: var(--warm);
  color: #2b2106;
}

.vote-actions button:hover:not(:disabled) {
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.12), 0 8px 18px rgba(21, 41, 29, 0.08);
}

.messages {
  grid-row: 4;
  height: 100%;
  min-height: 0;
  position: relative;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  overflow-y: auto;
  overflow-anchor: none;
  background: transparent;
}

.empty-state {
  margin: auto;
  max-width: 340px;
  border: 1px solid rgba(220, 231, 223, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  padding: 16px 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.42;
  box-shadow: 0 14px 34px rgba(21, 41, 29, 0.08);
}

.messages .empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(340px, calc(100% - 28px));
  margin: 0;
  transform: translate(-50%, -50%);
}

.message {
  max-width: min(760px, 82%);
  min-width: 0;
  width: fit-content;
  border: 0;
  border-radius: 20px 20px 20px 7px;
  padding: 10px 13px 11px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(21, 41, 29, 0.08);
}

.message.own {
  align-self: flex-end;
  border-radius: 20px 20px 7px 20px;
  background: linear-gradient(180deg, #ddf7e8, #d1f1df);
  box-shadow: 0 10px 24px rgba(22, 134, 83, 0.14);
}

.message-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 4px;
}

.message-head strong {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
}

.message-head time {
  color: var(--muted);
  font-size: 11px;
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  font-size: 14px;
  line-height: 1.38;
}

.message-form {
  grid-row: 5;
  min-height: 66px;
  border-top: 1px solid rgba(220, 231, 223, 0.78);
  padding: 10px 11px 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 9px;
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.message-form input {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: #f1f6f2;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.08);
  font-size: 14px;
}

.message-form .send-button {
  width: 46px;
  height: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #23aa6d, #0f6b45);
  color: #fff;
  padding: 0;
  box-shadow: 0 12px 26px rgba(22, 134, 83, 0.25);
}

.message-form .send-button:hover {
  background: linear-gradient(135deg, #22a96b, #0e6a40);
}

.send-button svg {
  width: 22px;
  height: 22px;
  transform: translateX(1px);
  fill: currentColor;
}

.message-form .send-button:disabled {
  background: #cfd8d1;
  box-shadow: none;
}

.settings-grid,
.favorites-grid {
  height: 100%;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 1px;
}

.settings-text {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.favorites-grid {
  padding-right: 4px;
}

.favorites-hero {
  min-height: 166px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background:
    radial-gradient(circle at 10% 0%, rgba(22, 134, 83, 0.2), transparent 260px),
    radial-gradient(circle at 100% 0%, rgba(242, 184, 75, 0.2), transparent 220px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 243, 0.94));
  box-shadow: var(--shadow);
  padding: 20px;
  overflow: hidden;
}

.brand-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-dark);
  font-weight: 950;
}

.brand-inline-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #23aa6d, #0f6b45);
  color: #fff;
  font-size: 11px;
  letter-spacing: -0.05em;
  box-shadow: 0 10px 22px rgba(22, 134, 83, 0.22);
}

.favorites-hero h2 {
  margin: 18px 0 6px;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.favorites-hero p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.favorites-notify-btn {
  width: fit-content;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 950;
  padding: 0 14px;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.12), 0 12px 26px rgba(21, 41, 29, 0.08);
}

.favorites-notify-btn.active {
  background: linear-gradient(135deg, #1d9a61, #0f6b45);
  color: #fff;
}

.favorites-notify-btn svg {
  width: 17px;
  height: 17px;
}

.favorites-total {
  min-width: 92px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(22, 134, 83, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.favorites-total strong {
  color: var(--accent-dark);
  font-size: 34px;
  line-height: 1;
}

.favorites-total span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.favorite-list-card {
  border: 1px solid rgba(220, 231, 223, 0.95);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.favorite-list-card {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

.favorite-list-card--main {
  min-height: min(620px, calc(100dvh - 300px));
}

.favorites-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}

.favorite-station-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(217, 229, 220, 0.96);
  border-radius: 20px;
  background:
    radial-gradient(circle at 0% 0%, rgba(22, 134, 83, 0.08), transparent 160px),
    #fff;
  box-shadow: 0 12px 30px rgba(21, 41, 29, 0.065);
  padding: 14px;
}

.favorite-station-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: center;
}

.favorite-station-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #f0f6f2;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.1);
}

.favorite-station-head strong,
.favorite-station-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  white-space: normal;
}

.favorite-station-head strong {
  display: block;
  font-size: 16px;
  line-height: 1.18;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.favorite-station-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.favorite-station-head [data-remove-favorite] {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: #aa4c35;
  font-size: 22px;
}

.favorite-station-status {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.favorite-station-status small {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fff4d7;
  color: #7b5614;
  font-size: 11px;
  font-weight: 950;
  padding: 0 9px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.favorite-station-actions,
.favorites-empty-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.favorite-station-actions button,
.favorite-station-actions a,
.favorites-empty-actions button {
  min-height: 38px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  background: #eef6f1;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.08);
}

.favorite-station-actions button:nth-child(2),
.favorites-empty-actions button:first-child {
  background: linear-gradient(135deg, #1d9a61, #0f6b45);
  color: #fff;
  box-shadow: 0 12px 24px rgba(22, 134, 83, 0.2);
}

.favorites-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px dashed rgba(160, 181, 167, 0.85);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(22, 134, 83, 0.08), transparent 240px),
    rgba(255, 255, 255, 0.66);
  padding: 26px;
  text-align: center;
}

.favorites-empty-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: #f4f8f5;
  color: #96a79c;
  font-size: 42px;
  box-shadow: inset 0 0 0 1px rgba(160, 181, 167, 0.26);
}

.favorites-empty-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.favorites-empty h3 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.favorites-empty p {
  max-width: 380px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.favorites-empty-actions {
  width: min(380px, 100%);
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
}

.bottom-nav {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  border-color: rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  padding: 8px;
  box-shadow: 0 20px 56px rgba(21, 41, 29, 0.18);
  backdrop-filter: blur(22px);
}

.nav-item {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  min-width: 0;
  overflow: visible;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  line-height: 1;
  overflow: visible;
}

.nav-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-item.active {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.75), transparent 34px),
    linear-gradient(180deg, #e8f7ee, #d9efe3);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(22, 134, 83, 0.18), 0 10px 24px rgba(22, 134, 83, 0.12);
}

.app-prompt-stack {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.app-prompt {
  width: min(560px, 100%);
  justify-self: center;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  border: 1px solid rgba(220, 231, 223, 0.94);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 68px rgba(21, 41, 29, 0.2);
  backdrop-filter: blur(22px);
  padding: 12px;
  pointer-events: auto;
}

.app-prompt__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #e8f5ed;
  color: var(--accent);
}

.app-prompt__icon svg {
  width: 20px;
  height: 20px;
}

.app-prompt__body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.app-prompt__body strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.15;
}

.app-prompt__body span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.app-prompt__actions {
  display: flex;
  gap: 7px;
}

.app-prompt__actions button {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.app-prompt__primary {
  background: linear-gradient(135deg, #1d9a61, #0f6b45);
  color: #fff;
}

.app-prompt__ghost {
  background: #eef6f1;
  color: var(--muted);
}

.app-prompt--amber .app-prompt__icon {
  background: #fff4d5;
  color: #a96f08;
}

[hidden] {
  display: none !important;
}

@media (min-width: 981px) {
  body {
    min-height: 100vh;
    padding: 16px;
  }

  .app {
    width: min(1320px, 100%);
    height: max(720px, calc(100vh - 32px));
    max-height: 980px;
    margin: 0 auto;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 32px;
    background:
      radial-gradient(circle at 0% 0%, rgba(22, 134, 83, 0.12), transparent 360px),
      rgba(255, 255, 255, 0.34);
    box-shadow: 0 30px 90px rgba(21, 41, 29, 0.14);
    padding: 16px 108px 16px 16px;
    overflow: hidden;
  }

  .app-header {
    min-height: 66px;
    border-radius: 24px;
    padding: 12px 14px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .app-main {
    min-height: 0;
    height: 100%;
  }

  .tab-panel.active {
    height: 100%;
  }

  .panel-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
  }

  .panel-grid > .city-card {
    grid-column: 1;
    grid-row: 1;
  }

  .panel-grid > .card:not(.city-card):not(.station-card-wrap) {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .panel-grid > .station-card-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .panel-grid.stations-expanded {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
  }

  .panel-grid.stations-expanded > .card:not(.station-card-wrap) {
    min-height: unset;
    padding: 15px;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    transform: none;
  }

  .station-card-wrap {
    border-radius: 24px;
    padding: 16px;
  }

  .station-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 390px), 1fr));
    align-content: start;
    padding-right: 9px;
  }

  .station-card {
    min-height: 122px;
    border-radius: 20px;
  }

  .station-card-foot {
    margin-top: auto;
  }

  .map-screen,
  .chat-history-card,
  .chat-empty,
  .chat-panel,
  .favorite-list-card,
  .favorites-hero {
    border-radius: 24px;
  }

  .map-toolbar {
    min-height: 68px;
    padding: 12px 14px;
  }

  .map-station-preview {
    width: min(460px, calc(100% - 36px));
    right: auto;
    left: 18px;
    bottom: 18px;
    max-height: min(520px, calc(100% - 92px));
  }

  .chats-layout {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 14px;
  }

  .chats-layout:not(.chat-open) {
    grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  }

  .chats-layout:not(.chat-open) .chat-empty {
    display: grid;
  }

  .chats-layout.chat-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-panel {
    border-radius: 24px;
  }

  .chat-header {
    min-height: 56px;
  }

  .settings-grid,
  .favorites-grid {
    padding-right: 8px;
  }

  .favorites-grid {
    grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
    align-content: stretch;
  }

  .favorites-hero {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .favorite-list-card--main {
    min-height: 0;
    height: 100%;
  }

  .bottom-nav {
    position: absolute;
    top: 16px;
    right: 16px;
    bottom: 16px;
    left: auto;
    width: 78px;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 10px;
    border-radius: 26px;
    padding: 10px;
  }

  .nav-item {
    min-height: 0;
    border-radius: 18px;
    padding: 8px 3px;
  }

  .nav-item span:last-child {
    max-width: 100%;
    font-size: 10.5px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-align: center;
  }
}

@media (max-width: 980px) {
  body {
    overflow: hidden;
  }

  .app {
    padding: 10px 10px 8px;
    gap: 10px;
    padding-bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom));
  }

  .app-header {
    min-height: 62px;
    border-radius: 22px;
    padding: 10px 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    font-size: 13px;
  }

  .brand h1 {
    font-size: 19px;
  }

  .brand p {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .city-badge {
    display: none;
  }

  .panel-grid {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .card {
    border-radius: 20px;
    padding: 13px;
  }

  .city-chat-button {
    border-radius: 16px;
  }

  .map-screen {
    min-height: calc(100vh - 170px);
  }

  .chats-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }

  .chat-panel {
    min-height: 0;
    border-radius: 20px;
  }

  .chat-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 50px;
    padding: 7px 8px;
  }

  .back-button {
    width: fit-content;
    min-height: 34px;
    padding: 0 10px;
  }

  .chat-header p,
  .room-meta {
    display: none;
  }

  .map-toolbar,
  .vote-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-toolbar {
    gap: 10px;
    min-height: 72px;
    padding: 12px;
    border-radius: 20px 20px 0 0;
  }

  .map-toolbar-actions,
  .station-controls {
    width: 100%;
  }

  .status-filter {
    flex: 1 1 auto;
  }

  .filter-chip {
    flex: 1 1 0;
    justify-content: center;
    padding: 0 8px;
  }

  .nearby-button {
    min-height: 38px;
    padding: 0 10px;
  }

  .station-card {
    min-height: 136px;
    border-radius: 17px;
    padding: 13px;
  }

  .fuel-filter {
    margin-right: -2px;
  }

  .station-address {
    white-space: normal;
  }

  .map-station-preview {
    left: 10px;
    right: 10px;
    bottom: 28px;
    max-height: min(460px, calc(100% - 88px));
    border-radius: 22px;
    padding: 13px;
  }

  .map-preview-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .preview-vote-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .preview-vote-actions button {
    min-height: 38px;
    padding: 0 5px;
    font-size: 10.5px;
  }

  .map-preview-actions button,
  .map-preview-actions a {
    min-height: 36px;
    padding: 0 6px;
    font-size: 11px;
  }

  .favorites-hero {
    min-height: 148px;
    grid-template-columns: minmax(0, 1fr);
    border-radius: 24px;
    padding: 17px;
  }

  .favorites-notify-btn {
    width: 100%;
  }

  .favorites-total {
    width: fit-content;
    min-width: 78px;
    grid-auto-flow: column;
    gap: 7px;
    padding: 9px 12px;
  }

  .favorites-total strong {
    font-size: 24px;
  }

  .app-prompt {
    grid-template-columns: 36px minmax(0, 1fr);
    border-radius: 20px;
  }

  .app-prompt__icon {
    width: 36px;
    height: 36px;
    border-radius: 14px;
  }

  .app-prompt__actions {
    grid-column: 1 / -1;
  }

  .app-prompt__actions button {
    flex: 1 1 0;
  }

  .favorites-hero h2 {
    margin-top: 14px;
    font-size: 31px;
  }

  .favorite-list-card {
    border-radius: 22px;
    padding: 14px;
  }

  .favorite-list-card--main {
    min-height: min(560px, calc(100dvh - 270px));
  }

  .favorite-station-card {
    border-radius: 18px;
    padding: 13px;
  }

  .favorite-station-actions {
    grid-template-columns: 1fr 1fr;
  }

  .favorite-station-actions button,
  .favorite-station-actions a {
    min-height: 37px;
  }

  .map-station-preview > .recent-marks,
  .station-list-preview > .recent-marks {
    max-height: min(154px, 26vh);
  }

  .vote-panel {
    gap: 8px;
    padding: 8px 10px;
  }

  .vote-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .message-form {
    grid-template-columns: minmax(0, 1fr) 46px;
    padding: 8px 9px 9px;
  }

  .message-form input {
    min-height: 46px;
    font-size: 16px;
  }

  .message-form .send-button {
    width: 46px;
    height: 46px;
    min-height: 46px;
  }

  .chat-header-actions {
    display: none;
  }

  .message {
    max-width: 88%;
  }

  .messages {
    padding: 12px 10px;
  }

  .city-form {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    height: 76px;
    border-radius: 24px;
  }

  .nav-item span:last-child {
    font-size: 11px;
  }
}

@media (max-width: 560px) {
  .app {
    padding-left: 8px;
    padding-right: 8px;
  }

  .app-header {
    gap: 10px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .card {
    padding: 12px;
  }

  .city-chat-button {
    min-height: 44px;
    padding: 8px 10px;
  }

  .city-chat-button__icon {
    width: 30px;
    height: 30px;
    border-radius: 12px;
  }

  .station-card-wrap {
    gap: 9px;
  }

  .station-controls {
    flex-wrap: wrap;
  }

  .status-filter {
    flex: 1 1 100%;
  }

  .nearby-button {
    flex: 1 1 100%;
    min-width: 0;
  }

  .station-list {
    gap: 10px;
    padding-right: 2px;
  }

  .station-card {
    min-height: 140px;
    padding: 14px;
    gap: 8px;
  }

  .station-card-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .station-card-badges {
    justify-self: start;
    justify-content: flex-start;
  }

  .station-address {
    -webkit-line-clamp: 3;
  }

  .station-list-preview,
  .map-station-preview {
    padding: 13px;
  }

  .station-list-preview h3,
  .map-station-preview h3 {
    max-width: calc(100% - 86px);
    font-size: 18px;
  }

  .map-preview-actions {
    gap: 7px;
  }

  .map-preview-actions button,
  .map-preview-actions a {
    min-height: 38px;
    border-radius: 13px;
    font-size: 11px;
  }

  .chat-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-row-actions {
    justify-content: flex-start;
  }

  .vote-actions,
  .vote-group {
    width: 100%;
  }

  .vote-actions button {
    flex: 1 1 auto;
  }

  .favorite-station-head {
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    gap: 10px;
  }

  .favorite-station-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .favorite-station-actions {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    left: 8px;
    right: 8px;
    gap: 6px;
    padding: 7px;
  }

  .nav-item {
    border-radius: 16px;
  }
}

/* Final layout hardening for map sheet and mixed icon/text buttons. */
.map-station-preview {
  left: 10px;
  right: 10px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  height: min(720px, calc(100% - 42px));
  max-height: calc(100% - 42px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.map-station-preview > * {
  min-width: 0;
}

.map-station-preview h3,
.map-station-preview p,
.map-preview-fuel,
.preview-status-card,
.preview-vote-actions,
.map-preview-actions {
  flex: 0 0 auto;
}

.map-station-preview > .recent-marks {
  flex: 1 1 auto;
  min-height: 170px;
  max-height: none;
  margin-top: 0;
}

.preview-vote-actions,
.map-preview-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.preview-vote-actions button,
.map-preview-actions button,
.map-preview-actions a,
.favorite-station-actions button,
.favorite-station-actions a,
.favorites-empty-actions button,
.settings-menu-action,
.favorites-notify-btn,
.app-prompt__actions button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  vertical-align: middle;
}

.preview-vote-actions button,
.map-preview-actions button,
.map-preview-actions a {
  min-height: 42px;
  padding: 0 7px;
  line-height: 1.1;
}

.preview-vote-actions button {
  font-size: clamp(10px, 2.55vw, 12px);
  white-space: normal;
}

.map-preview-actions button,
.map-preview-actions a {
  font-size: clamp(10.5px, 2.65vw, 12px);
  white-space: nowrap;
}

.map-preview-actions svg,
.favorite-station-actions svg,
.favorites-empty-actions svg,
.settings-menu-action svg,
.favorites-notify-btn svg {
  margin: 0;
  flex: 0 0 auto;
  transform: none;
}

.map-preview-actions span,
.favorite-station-actions span,
.favorites-empty-actions span,
.settings-menu-action span,
.favorites-notify-btn span {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 720px) {
  .map-station-preview {
    left: 18px;
    right: auto;
    bottom: 18px;
    width: min(520px, calc(100% - 36px));
    height: min(760px, calc(100% - 72px));
    max-height: calc(100% - 72px);
    padding: 18px;
  }
}

/* List station preview opens as an overlay over filters/search to preserve space. */
.station-card-wrap {
  position: relative;
}

.station-card-wrap--preview-open .station-controls,
.station-card-wrap--preview-open .fuel-filter,
.station-card-wrap--preview-open .station-search {
  pointer-events: none;
}

.station-list-preview {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 64px;
  z-index: 9;
  max-height: min(520px, calc(100% - 82px));
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.station-list-preview > .recent-marks {
  flex: 1 1 auto;
  min-height: 116px;
  max-height: none;
  margin-top: 0;
}

.station-list-preview .map-preview-actions {
  flex: 0 0 auto;
}

@media (max-width: 560px) {
  .station-list-preview {
    left: 10px;
    right: 10px;
    top: 58px;
    max-height: min(560px, calc(100% - 74px));
  }
}

/* Bigger map sheet after usability pass. */
.map-station-preview {
  height: min(800px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  bottom: calc(8px + env(safe-area-inset-bottom));
}

.map-station-preview > .recent-marks {
  min-height: 230px;
}

@media (min-width: 720px) {
  .map-station-preview {
    width: min(560px, calc(100% - 36px));
    height: min(820px, calc(100% - 40px));
    max-height: calc(100% - 40px);
  }
}

/* v43 layout audit: deterministic button/icon centering and stable sheets. */
button,
a {
  box-sizing: border-box;
}

button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
}

button > svg,
a > svg,
button .ui-icon,
a .ui-icon,
.btn-icon svg,
.nav-icon svg {
  margin: 0 !important;
  transform: none !important;
  position: static;
  inset: auto;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
}

.btn-text {
  min-width: 0;
  max-width: 100%;
  display: block;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-preview-close,
.favorite-preview-btn,
.settings-button,
.icon-button,
.close-chat-button,
.chat-row-actions button,
.favorite-station-head [data-remove-favorite],
.message-form .send-button {
  display: inline-grid !important;
  place-items: center;
  justify-items: center;
  align-items: center;
  padding: 0 !important;
  line-height: 0;
  text-align: center;
}

.map-preview-close svg,
.favorite-preview-btn svg,
.settings-button svg,
.icon-button svg,
.close-chat-button svg,
.chat-row-actions button svg,
.favorite-station-head [data-remove-favorite] svg {
  width: 18px;
  height: 18px;
}

.message-form .send-button svg {
  width: 21px;
  height: 21px;
}

.map-preview-actions button,
.map-preview-actions a,
.favorite-station-actions button,
.favorite-station-actions a,
.favorites-empty-actions button,
.settings-menu-action,
.favorites-notify-btn,
.app-prompt__actions button,
.nearby-button,
.filter-chip,
.fuel-chip,
.vote-actions button,
.preview-vote-actions button,
.back-button,
.small-action,
.city-form button,
.primary-action {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
}

.map-preview-actions,
.preview-vote-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.map-preview-actions button,
.map-preview-actions a {
  min-height: 42px;
  padding: 0 8px;
  overflow: hidden;
}

.preview-vote-actions button {
  min-height: 42px;
  padding: 0 6px;
  overflow: hidden;
  white-space: normal;
}

.city-chat-button {
  min-width: 0;
  align-items: center;
}

.city-chat-button__icon,
.brand-mark,
.brand-inline-mark,
.nav-icon,
.station-fav-mark {
  display: grid;
  place-items: center;
  line-height: 0;
}

.nav-item {
  justify-items: center;
  text-align: center;
}

.nav-item > span:last-child {
  width: 100%;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-list {
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.station-card {
  min-width: 0;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.station-card *,
.favorite-station-card *,
.station-list-preview *,
.map-station-preview * {
  min-width: 0;
}

.station-card-head,
.station-card-foot,
.favorite-station-head,
.favorite-station-status {
  width: 100%;
}

.station-tags {
  flex: 1 1 auto;
  overflow: hidden;
}

.station-fuel-tag {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-card-wrap--preview-open .station-controls,
.station-card-wrap--preview-open .fuel-filter,
.station-card-wrap--preview-open .station-search {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.station-card-wrap--preview-open .station-list {
  opacity: 0.18;
  pointer-events: none;
}

.station-list-preview {
  border-color: rgba(191, 214, 199, 0.95);
  background:
    radial-gradient(circle at 0% 0%, rgba(22, 134, 83, 0.12), transparent 190px),
    rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(21, 41, 29, 0.18);
}

.map-station-preview {
  left: 8px;
  right: 8px;
  bottom: calc(6px + env(safe-area-inset-bottom));
  height: min(860px, calc(100% - 12px));
  max-height: calc(100% - 12px);
  padding: 16px;
}

.map-station-preview > .recent-marks {
  min-height: 260px;
}

[hidden] {
  display: none !important;
}

@media (min-width: 720px) {
  .map-station-preview {
    left: 18px;
    right: auto;
    bottom: 18px;
    width: min(600px, calc(100% - 36px));
    height: min(880px, calc(100% - 36px));
    max-height: calc(100% - 36px);
  }
}

@media (max-width: 560px) {
  .station-list {
    gap: 12px;
  }

  .station-card {
    min-height: 138px;
    border-radius: 18px;
    padding: 14px;
  }

  .station-card-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .station-card-badges {
    justify-self: start;
  }

  .map-preview-actions button,
  .map-preview-actions a {
    gap: 5px;
    font-size: 10.5px;
    padding: 0 6px;
  }

  .btn-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }

  .app-prompt {
    left: auto;
    right: auto;
  }
}

/* v44: logos, stable preview title, browser-safe map sheet height. */
.station-card-titleline {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.station-logo,
.favorite-station-logo {
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(22, 134, 83, 0.1);
  background: #f3f8f4;
  color: var(--accent-dark);
  font-weight: 950;
  line-height: 1;
}

.station-logo {
  width: 38px;
  height: 38px;
  border-radius: 15px;
  font-size: 12px;
}

.favorite-station-logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  font-size: 13px;
}

.station-logo img,
.favorite-station-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fff;
}

.station-logo--text {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), #e9f4ee);
}

.station-list-preview h3,
.map-station-preview h3 {
  width: 100%;
  max-width: none;
  padding-right: 88px;
}

.station-list-preview .map-preview-kicker,
.map-station-preview .map-preview-kicker {
  padding-right: 88px;
}

.map-station-preview {
  top: auto;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  height: auto;
  max-height: min(620px, calc(100% - 96px));
  overflow: hidden;
}

.map-station-preview > .recent-marks {
  min-height: 150px;
  max-height: min(260px, 34vh);
}

.station-list-preview {
  max-height: min(540px, calc(100% - 78px));
}

@media (min-width: 720px) {
  .map-station-preview {
    left: 18px;
    right: auto;
    bottom: 18px;
    width: min(560px, calc(100% - 36px));
    height: auto;
    max-height: min(680px, calc(100% - 108px));
  }
}

@media (max-width: 560px) {
  .station-card-titleline {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
  }

  .station-logo {
    width: 36px;
    height: 36px;
    border-radius: 14px;
  }

  .map-station-preview {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-height: min(560px, calc(100% - 84px));
  }

  .map-station-preview > .recent-marks {
    min-height: 132px;
    max-height: min(230px, 30vh);
  }
}

/* v47: desktop must keep the same bottom navigation, never a right sidebar. */
@media (min-width: 981px) {
  body {
    padding: 16px 16px calc(var(--nav-height) + 28px + env(safe-area-inset-bottom)) !important;
  }

  .app {
    padding: 16px 16px calc(var(--nav-height) + 24px + env(safe-area-inset-bottom)) !important;
  }

  .bottom-nav {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    width: min(760px, calc(100vw - 32px)) !important;
    height: var(--nav-height) !important;
    transform: translateX(-50%) !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    gap: 8px !important;
    border-radius: 24px !important;
    padding: 8px !important;
  }

  .nav-item {
    min-height: 0 !important;
    border-radius: 18px !important;
    padding: 6px 8px !important;
  }

  .nav-item span:last-child {
    max-width: 100% !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    overflow-wrap: normal !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  .station-card {
    min-height: 154px !important;
    overflow: hidden;
  }

  .station-list {
    padding-bottom: 22px;
  }
}
