:root {
  color-scheme: dark;
  --ink: #f8fbff;
  --muted: #aeb9c6;
  --panel: rgba(8, 20, 35, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.13);
  --yellow: #ffd21a;
  --yellow-soft: #fff16f;
  --blue: #66d9ef;
  --green: #1f6f48;
  --danger: #ff7a5c;
  --night: #020813;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 8%, rgba(255, 210, 26, 0.16), transparent 24rem),
    radial-gradient(circle at 24% 70%, rgba(102, 217, 239, 0.11), transparent 22rem),
    linear-gradient(180deg, #06162a 0%, #020813 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(3, 10, 20, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand,
.app-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: #fff;
  font-weight: 950;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: url("sunline-icon.svg") center / cover no-repeat;
  box-shadow: 0 12px 28px rgba(255, 210, 26, 0.28);
}

.app-nav {
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 3vw, 28px);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.94rem;
  font-weight: 850;
}

.app-nav a {
  text-decoration: none;
}

.app-nav a:hover {
  color: var(--yellow);
}

.session-pill {
  justify-self: end;
  max-width: 220px;
  padding: 8px 12px;
  overflow: hidden;
  color: #081423;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-soft));
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webapp-shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(20px, 4vw, 38px) 0 clamp(54px, 7vw, 90px);
}

.control-panel,
.results-panel {
  min-width: 0;
}

.control-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.panel-section,
.map-panel,
.result-card,
.detail-drawer,
.admin-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-section {
  padding: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--yellow);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 4.1rem);
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

p {
  color: rgba(248, 251, 255, 0.74);
}

.auth-tabs,
.preset-row,
.session-actions,
.load-more-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-tabs {
  margin-top: 18px;
}

.tab-button,
.preset-row button {
  min-height: 38px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.78);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.tab-button.is-active,
.preset-row button:hover {
  color: #07101c;
  background: var(--yellow);
}

.auth-form,
.search-card {
  display: grid;
  gap: 14px;
}

.auth-form {
  margin-top: 16px;
}

.is-hidden {
  display: none !important;
}

label,
.weather-wishes legend {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  outline: none;
}

select option {
  color: #07101c;
  background: #fff;
}

input:focus,
select:focus {
  border-color: rgba(255, 210, 26, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 210, 26, 0.14);
}

input[type="date"],
input[type="datetime-local"] {
  color-scheme: dark;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 950;
  text-decoration: none;
}

.button-primary {
  color: #07101c;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-soft));
}

.button-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.session-actions {
  margin-top: 14px;
}

.api-settings {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.78);
}

.api-settings summary {
  cursor: pointer;
  font-weight: 850;
}

.api-settings label {
  margin-top: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.location-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.place-search-label {
  min-width: 0;
}

.location-button {
  white-space: nowrap;
}

.mode-switch {
  display: flex;
  gap: 6px;
}

.mode-button {
  min-height: 38px;
  padding: 8px 13px;
  color: rgba(255, 255, 255, 0.78);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
}

.mode-button.is-active {
  color: #07101c;
  background: var(--yellow);
}

.preset-row {
  margin-top: 12px;
}

.weather-wishes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.weather-wishes legend {
  padding: 0 6px;
}

.weather-wishes label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px;
  background: var(--panel-soft);
  border-radius: 8px;
}

.weather-wishes input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--yellow);
}

.premium-note {
  padding: 12px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 210, 26, 0.1);
  border: 1px solid rgba(255, 210, 26, 0.24);
  border-radius: 8px;
  font-size: 0.9rem;
}

.results-panel {
  display: grid;
  gap: 16px;
}

.status-line {
  min-height: 44px;
  padding: 11px 14px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.status-line.error {
  color: #fff;
  background: rgba(255, 122, 92, 0.16);
  border-color: rgba(255, 122, 92, 0.36);
}

.status-line.success {
  color: #fff;
  background: rgba(31, 111, 72, 0.22);
  border-color: rgba(82, 212, 145, 0.34);
}

.map-panel {
  min-height: 360px;
  padding: 12px;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  margin-bottom: 10px;
}

.map-summary {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.map-controls button {
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 950;
}

.map-controls button:hover {
  color: #07101c;
  background: var(--yellow);
}

.map-surface {
  position: relative;
  min-height: 336px;
  overflow: hidden;
  touch-action: none;
  background: #0a1e32;
  border-radius: 8px;
  cursor: grab;
  user-select: none;
}

.map-surface.is-dragging {
  cursor: grabbing;
}

.map-surface:focus {
  outline: 3px solid rgba(255, 210, 26, 0.34);
  outline-offset: 3px;
}

.map-tiles,
.map-pins {
  position: absolute;
  inset: 0;
}

.map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  background: #10283f;
  image-rendering: auto;
}

.map-pins {
  z-index: 2;
  pointer-events: none;
}

.map-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.84);
  background: linear-gradient(180deg, rgba(4, 12, 24, 0.26), rgba(4, 12, 24, 0.42));
  font-weight: 900;
  text-align: center;
}

.map-empty.is-hidden {
  display: none;
}

.map-pin {
  position: absolute;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 2px;
  place-items: center;
  width: auto;
  min-width: 92px;
  max-width: 300px;
  height: auto;
  padding: 0;
  color: #07101c;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.76rem;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: transform 160ms ease, filter 160ms ease;
}

.map-pin-badge {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 32px;
  padding: 5px 10px;
  color: var(--apple-ink);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: 0 9px 18px rgba(20, 28, 42, 0.12), 0 1px 0 rgba(255, 255, 255, 0.66) inset;
  backdrop-filter: blur(20px) saturate(1.25);
}

.map-pin-weather-mark {
  position: relative;
  display: block;
  flex: 0 0 26px;
  width: 26px;
  height: 24px;
  overflow: hidden;
  color: var(--apple-ink);
  background: #fff4b8;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(23, 34, 48, 0.08);
}

.weather-symbol::before,
.weather-symbol::after {
  position: absolute;
  content: "";
}

.weather-symbol.is-sunny::before {
  inset: 5px 6px;
  background:
    radial-gradient(circle, #fbbf24 0 42%, transparent 44%),
    conic-gradient(
      transparent 0 8deg,
      #f59e0b 8deg 18deg,
      transparent 18deg 45deg,
      #f59e0b 45deg 55deg,
      transparent 55deg 90deg,
      #f59e0b 90deg 100deg,
      transparent 100deg 135deg,
      #f59e0b 135deg 145deg,
      transparent 145deg 180deg,
      #f59e0b 180deg 190deg,
      transparent 190deg 225deg,
      #f59e0b 225deg 235deg,
      transparent 235deg 270deg,
      #f59e0b 270deg 280deg,
      transparent 280deg 315deg,
      #f59e0b 315deg 325deg,
      transparent 325deg 360deg
    );
  border-radius: 999px;
}

.weather-symbol.is-partly-cloudy::before {
  top: 4px;
  left: 5px;
  width: 12px;
  height: 12px;
  background: #fbbf24;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.24);
}

.weather-symbol.is-partly-cloudy::after,
.weather-symbol.is-cloudy::before,
.weather-symbol.is-rain::before,
.weather-symbol.is-heavy-rain::before,
.weather-symbol.is-drizzle::before,
.weather-symbol.is-snow::before,
.weather-symbol.is-sleet::before,
.weather-symbol.is-storm::before {
  top: 10px;
  left: 7px;
  width: 14px;
  height: 8px;
  background: #94a3b8;
  border-radius: 999px;
  box-shadow:
    -4px 2px 0 #94a3b8,
    4px -3px 0 1px #94a3b8;
}

.weather-symbol.is-partly-cloudy::after {
  background: #f8fafc;
  box-shadow:
    -4px 2px 0 #f8fafc,
    4px -3px 0 1px #f8fafc;
}

.weather-symbol.is-overcast::before,
.weather-symbol.is-fog::before {
  top: 7px;
  left: 5px;
  width: 16px;
  height: 10px;
  background:
    linear-gradient(#94a3b8, #94a3b8) 0 0 / 16px 2px no-repeat,
    linear-gradient(#94a3b8, #94a3b8) 3px 4px / 14px 2px no-repeat,
    linear-gradient(#94a3b8, #94a3b8) 0 8px / 16px 2px no-repeat;
}

.weather-symbol.is-fog::before {
  background:
    linear-gradient(#64748b, #64748b) 0 0 / 16px 2px no-repeat,
    linear-gradient(#64748b, #64748b) 3px 4px / 14px 2px no-repeat,
    linear-gradient(#64748b, #64748b) 0 8px / 16px 2px no-repeat;
}

.weather-symbol.is-drizzle::after,
.weather-symbol.is-rain::after,
.weather-symbol.is-heavy-rain::after {
  top: 17px;
  left: 8px;
  width: 2px;
  height: 5px;
  background: #0ea5e9;
  border-radius: 999px;
  box-shadow:
    5px 0 0 #0ea5e9,
    10px 0 0 #0ea5e9;
  transform: rotate(14deg);
}

.weather-symbol.is-drizzle::after {
  height: 3px;
  opacity: 0.9;
}

.weather-symbol.is-heavy-rain::after {
  height: 6px;
  background: #2563eb;
  box-shadow:
    4px 0 0 #2563eb,
    8px 0 0 #2563eb,
    12px 0 0 #2563eb;
}

.weather-symbol.is-snow::after {
  top: 17px;
  left: 8px;
  width: 3px;
  height: 3px;
  background: #67e8f9;
  border-radius: 999px;
  box-shadow:
    6px 1px 0 #67e8f9,
    12px 0 0 #67e8f9;
}

.weather-symbol.is-sleet::after {
  top: 17px;
  left: 8px;
  width: 3px;
  height: 3px;
  background: #67e8f9;
  border-radius: 999px;
  box-shadow:
    6px 0 0 0 #38bdf8,
    12px 0 0 0 #67e8f9;
  transform: rotate(12deg);
}

.weather-symbol.is-storm::after {
  top: 14px;
  left: 11px;
  width: 7px;
  height: 10px;
  background: #facc15;
  clip-path: polygon(46% 0, 100% 0, 62% 43%, 100% 43%, 30% 100%, 45% 55%, 0 55%);
}

.weather-symbol.is-dust::before {
  inset: 7px 5px;
  background:
    radial-gradient(circle at 4px 4px, #a16207 0 2px, transparent 2px),
    radial-gradient(circle at 13px 2px, #a16207 0 2px, transparent 2px),
    linear-gradient(#a16207, #a16207) 2px 9px / 16px 2px no-repeat;
}

.weather-symbol.is-neutral::before {
  top: 8px;
  left: 7px;
  width: 12px;
  height: 8px;
  background: #94a3b8;
  border-radius: 999px;
  box-shadow: 4px -2px 0 1px #94a3b8;
}

.map-pin-temp {
  font-size: 0.82rem;
  font-weight: 850;
}

.map-pin-label {
  max-width: min(300px, 42vw);
  padding: 4px 9px 5px;
  overflow: visible;
  color: var(--apple-ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: 0 8px 17px rgba(20, 28, 42, 0.1), 0 1px 0 rgba(255, 255, 255, 0.66) inset;
  font-size: 0.72rem;
  font-weight: 780;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
  backdrop-filter: blur(20px) saturate(1.25);
}

.map-pin.is-cloudy .map-pin-weather-mark {
  background: #eaf2ff;
}

.map-pin.is-rainy .map-pin-weather-mark {
  background: #dff7ff;
}

.map-pin.is-snowy .map-pin-weather-mark {
  background: #ecfeff;
}

.map-pin.is-stormy .map-pin-weather-mark {
  background: #eef2ff;
}

.map-pin.is-dusty .map-pin-weather-mark {
  background: #fef3c7;
}

.map-pin.is-neutral .map-pin-weather-mark {
  background: #e2e8f0;
}

.map-pin.is-selected {
  z-index: 5;
}

.map-pin.is-selected .map-pin-badge,
.map-pin.is-selected .map-pin-label {
  border-color: rgba(0, 122, 255, 0.38);
  box-shadow:
    0 0 0 3px rgba(0, 122, 255, 0.14),
    0 12px 24px rgba(20, 28, 42, 0.16);
}

.map-pin:hover {
  z-index: 4;
  filter: saturate(1.04);
  transform: translate(-50%, -50%) scale(1.025);
}

.map-attribution {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  padding: 4px 6px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(3, 10, 20, 0.72);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  text-decoration: none;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.results-list {
  display: grid;
  gap: 12px;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
}

.result-card.is-selected {
  border-color: rgba(255, 210, 26, 0.72);
  box-shadow:
    0 0 0 1px rgba(255, 210, 26, 0.36),
    var(--shadow);
}

.result-card h3 {
  margin-bottom: 8px;
  font-size: 1.14rem;
}

.meta-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 8px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 850;
}

.score-badge {
  min-width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: #07101c;
  background: var(--yellow);
  border-radius: 50%;
  font-size: 1.05rem;
  font-weight: 950;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.card-actions button,
.card-actions a {
  min-height: 36px;
  padding: 8px 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.card-actions .is-favorite {
  color: #07101c;
  background: var(--yellow);
}

.load-more-row {
  justify-content: center;
}

.detail-drawer {
  position: fixed;
  top: 88px;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: min(460px, calc(100% - 36px));
  padding: 22px;
  overflow-y: auto;
  transform: translateX(calc(100% + 36px));
  transition: transform 180ms ease;
}

.detail-drawer.is-open {
  transform: translateX(0);
}

.close-button {
  position: sticky;
  top: 0;
  float: right;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.close-button::before,
.close-button::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 9px;
  width: 18px;
  height: 2px;
  background: #fff;
}

.close-button::before {
  transform: rotate(45deg);
}

.close-button::after {
  transform: rotate(-45deg);
}

.forecast-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.forecast-day {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-page {
  min-height: 100vh;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(42px, 8vw, 96px) 0;
}

.admin-card {
  padding: clamp(24px, 5vw, 48px);
}

.admin-card p {
  max-width: 760px;
}

.admin-session-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-self: end;
}

.admin-header-logout {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.admin-login-card {
  width: min(760px, 100%);
}

.admin-login-form {
  max-width: 520px;
  margin-top: 24px;
}

.admin-status {
  min-height: 1.5em;
  width: min(760px, 100%);
  margin: 16px 0 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-weight: 850;
}

.admin-status.error {
  color: #ffb09a;
  background: transparent;
  border: 0;
}

.admin-status.success {
  color: var(--yellow);
  background: transparent;
  border: 0;
}

.admin-dashboard-header,
.admin-toolbar {
  display: flex;
  gap: 16px;
  align-items: end;
}

.admin-dashboard-header {
  justify-content: space-between;
  margin-bottom: 18px;
}

.admin-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-toolbar label {
  display: grid;
  gap: 7px;
  min-width: 150px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-filter-panel label,
.compact-field,
.breakdown-controls label,
.raw-event-actions label,
.admin-advanced-filters label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-advanced-filters {
  grid-column: 1 / -1;
}

.admin-advanced-filters summary {
  width: fit-content;
  color: var(--yellow);
  cursor: pointer;
  font-weight: 900;
}

.admin-advanced-filters div {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.admin-grid article {
  min-height: 112px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-grid strong,
.admin-grid span {
  display: block;
}

.admin-grid span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
}

.admin-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
}

.admin-kpi-grid article {
  display: grid;
  gap: 7px;
  min-height: 112px;
}

.admin-kpi-grid strong {
  color: var(--yellow);
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  line-height: 1;
}

.admin-kpi-grid small {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 820;
}

.admin-analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 14px;
}

.admin-bi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 14px;
}

.admin-panel {
  min-width: 0;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-panel-header {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.admin-panel h2,
.admin-panel h3 {
  color: #fff;
}

.admin-panel h2 {
  font-size: 1.08rem;
}

.admin-panel h3 {
  margin-bottom: 7px;
  font-size: 0.86rem;
}

.admin-panel-header span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.86rem;
  font-weight: 850;
}

.admin-panel-wide {
  grid-column: 1 / -1;
}

.daily-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 180px;
}

.daily-chart-item {
  display: grid;
  grid-template-rows: 1fr auto auto auto;
  gap: 5px;
  align-items: end;
  min-width: 0;
  height: 180px;
  text-align: center;
}

.daily-chart-item span {
  display: block;
  width: 100%;
  align-self: end;
  background: linear-gradient(180deg, var(--yellow), rgba(102, 217, 239, 0.92));
  border-radius: 8px 8px 3px 3px;
  box-shadow: 0 10px 24px rgba(255, 210, 26, 0.14);
}

.daily-chart-item small,
.daily-chart-item strong,
.daily-chart-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-chart-item small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
}

.daily-chart-item em {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1.15;
  white-space: normal;
}

.breakdown-list {
  display: grid;
  gap: 7px;
}

.breakdown-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.breakdown-row span,
.breakdown-row strong,
.breakdown-row small {
  position: relative;
  z-index: 1;
}

.breakdown-row span,
.breakdown-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-row small {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.78rem;
}

.breakdown-row i {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(255, 210, 26, 0.14);
}

.split-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.split-list.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-list.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.funnel-list {
  display: grid;
  gap: 7px;
  margin-top: 0;
}

.funnel-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  overflow: hidden;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.funnel-row span,
.funnel-row strong,
.funnel-row small {
  position: relative;
  z-index: 1;
}

.funnel-row span {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel-row small {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.6);
}

.funnel-row i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(255, 210, 26, 0.18), rgba(102, 217, 239, 0.11));
}

.compact-field {
  font-size: 0.8rem;
}

.breakdown-controls,
.raw-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.breakdown-controls {
  margin-bottom: 14px;
}

.raw-event-actions label {
  min-width: 92px;
}

.compact-button {
  min-height: 40px;
  padding: 9px 12px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-table td {
  color: rgba(255, 255, 255, 0.82);
}

.raw-events-table {
  min-width: 980px;
}

.raw-events-table td:last-child {
  max-width: 340px;
  color: rgba(255, 255, 255, 0.68);
}

.inline-filter-button {
  padding: 0;
  color: var(--yellow);
  background: transparent;
  border: 0;
  font-weight: 850;
  text-align: left;
}

.inline-filter-button:hover {
  text-decoration: underline;
}

.admin-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

.simple-admin-dashboard {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.admin-page-subtitle {
  max-width: none;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-weight: 820;
}

.simplified-toolbar {
  align-items: center;
  gap: 10px;
}

.period-control {
  min-width: 172px;
}

.period-control span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.period-control select {
  width: 128px;
  min-height: 32px;
  padding: 6px 8px;
}

.date-popover-wrap {
  position: relative;
}

.date-popover,
.filter-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: grid;
  width: min(340px, calc(100vw - 32px));
  gap: 12px;
  padding: 16px;
  background: rgba(5, 15, 28, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.filter-popover {
  width: min(560px, calc(100vw - 32px));
}

.date-popover[hidden],
.filter-popover[hidden] {
  display: none;
}

.date-popover strong,
.filter-popover strong {
  color: #fff;
}

.date-popover p,
.filter-popover p {
  max-width: none;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
  font-weight: 820;
}

.date-popover label,
.filter-popover label {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
  font-weight: 900;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.date-popover-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.simplified-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 10px;
}

.simplified-kpis article {
  min-height: 104px;
}

.simplified-kpis span {
  margin-top: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.admin-overview-grid .admin-panel-wide {
  grid-column: 1 / -1;
}

.admin-panel-third {
  grid-column: span 4;
}

.admin-panel-half {
  grid-column: span 6;
}

.admin-panel-third .split-list {
  grid-template-columns: 1fr;
}

.bi-chart {
  min-height: 190px;
}

.bi-chart-item {
  height: 190px;
}

.admin-raw-details {
  margin-top: 12px;
}

.admin-raw-details summary {
  width: fit-content;
  color: var(--yellow);
  cursor: pointer;
  font-weight: 950;
}

.admin-raw-details[open] summary {
  margin-bottom: 10px;
}

@media (max-width: 1060px) {
  .webapp-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-overview-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .admin-overview-grid .admin-panel-wide {
    grid-column: 1 / -1;
  }

  .admin-panel-third,
  .admin-panel-half {
    grid-column: span 3;
  }
}

@media (max-width: 760px) {
  .app-header {
    grid-template-columns: 1fr;
  }

  .app-nav {
    justify-content: flex-start;
  }

  .session-pill {
    justify-self: start;
  }

  .control-panel,
  .form-grid,
  .weather-wishes,
  .admin-grid,
  .admin-kpi-grid,
  .admin-analytics-layout,
  .admin-bi-grid,
  .admin-overview-grid,
  .admin-filter-panel,
  .admin-advanced-filters div,
  .split-list,
  .split-list.three,
  .split-list.four {
    grid-template-columns: 1fr;
  }

  .admin-panel-third,
  .admin-panel-half {
    grid-column: 1 / -1;
  }

  .admin-dashboard-header {
    align-items: start;
    flex-direction: column;
  }

  .admin-toolbar {
    justify-content: flex-start;
  }

  .simplified-toolbar,
  .simplified-toolbar > button,
  .date-popover-wrap,
  .period-control {
    width: 100%;
  }

  .period-control span {
    width: 100%;
  }

  .period-control select {
    flex: 1;
    min-width: 0;
  }

  .date-popover,
  .filter-popover {
    right: auto;
    left: 0;
    width: 100%;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .results-header,
  .result-card {
    grid-template-columns: 1fr;
  }

  .score-badge {
    width: 64px;
  }

  .map-panel {
    min-height: 300px;
  }

  .map-surface {
    min-height: 276px;
  }
}

@media (max-width: 520px) {
  .webapp-shell,
  .admin-shell {
    width: min(100% - 24px, 1500px);
  }

  .panel-section,
  .result-card,
  .detail-drawer {
    padding: 16px;
  }

  .button {
    width: 100%;
  }
}

.map-app {
  min-height: 100vh;
  overflow: hidden;
  color: #111827;
  background: #f4f7fa;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  --glass: rgba(255, 255, 255, 0.76);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --glass-subtle: rgba(247, 249, 252, 0.82);
  --glass-border: rgba(255, 255, 255, 0.58);
  --hairline: rgba(18, 27, 39, 0.09);
  --glass-shadow: 0 20px 50px rgba(20, 28, 42, 0.12), 0 1px 0 rgba(255, 255, 255, 0.58) inset;
  --glass-shadow-soft: 0 12px 28px rgba(20, 28, 42, 0.11), 0 1px 0 rgba(255, 255, 255, 0.58) inset;
  --apple-accent: #ffcc00;
  --apple-blue: #007aff;
  --apple-ink: #111827;
  --apple-muted: #5f6b7a;
  --apple-muted-soft: #7a8795;
  --control-fill: rgba(247, 249, 252, 0.78);
}

.map-app .app-header {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 50;
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 0;
  padding: 0;
  pointer-events: none;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}

.map-app .brand,
.map-app .app-nav,
.map-app .session-pill {
  pointer-events: auto;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(28px) saturate(1.35);
}

.map-app .brand {
  min-height: 46px;
  padding: 7px 14px 7px 8px;
  color: var(--apple-ink);
  border-radius: 999px;
  font-weight: 850;
}

.map-app .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(255, 204, 0, 0.18);
}

.map-app .app-nav {
  gap: 6px;
  margin-left: auto;
  padding: 6px;
  border-radius: 999px;
  color: var(--apple-muted-soft);
  font-size: 0.86rem;
  font-weight: 760;
}

.map-app .app-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
}

.map-app .app-nav a:hover {
  color: var(--apple-ink);
  background: rgba(0, 122, 255, 0.09);
}

.map-app .session-pill {
  display: none;
}

.map-app .webapp-shell {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.map-app .results-panel {
  position: fixed;
  inset: 0;
  display: block;
}

.map-app .map-panel {
  position: fixed;
  inset: 0;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  background: #f8fafc;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.map-app .map-surface {
  width: 100%;
  min-height: 100vh;
  border-radius: 0;
  background: #f8fafc;
}

.map-app .map-surface:focus {
  outline: none;
  box-shadow: inset 0 0 0 3px rgba(0, 122, 255, 0.14);
}

.map-app .map-surface::before,
.map-app .map-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.map-app .map-surface::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0) 14%),
    linear-gradient(0deg, rgba(248, 250, 252, 0.2) 0%, rgba(248, 250, 252, 0) 18%);
}

.map-app .map-surface::after {
  background: rgba(255, 255, 255, 0.02);
}

.map-app .map-toolbar {
  position: fixed;
  right: 16px;
  bottom: 92px;
  z-index: 45;
  display: grid;
  gap: 10px;
  align-items: end;
  justify-items: end;
  min-height: 0;
  margin: 0;
  pointer-events: none;
}

.map-app .map-summary,
.map-app .map-controls {
  pointer-events: auto;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(28px) saturate(1.35);
}

.map-app .map-summary {
  max-width: 210px;
  min-width: auto;
  padding: 9px 12px;
  color: var(--apple-muted-soft);
  border-radius: 999px;
  font-weight: 780;
}

.map-app .map-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border-radius: 18px;
}

.map-app .map-controls button {
  min-width: 44px;
  height: 44px;
  color: var(--apple-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  font-weight: 760;
}

.map-app .map-controls button:last-child {
  border-bottom: 0;
}

.map-app .map-controls button:hover {
  background: rgba(0, 122, 255, 0.09);
}

.map-app .map-controls button:disabled {
  cursor: default;
  opacity: 0.42;
}

.map-app .map-empty {
  inset: auto auto 112px 50%;
  width: min(360px, calc(100% - 32px));
  min-height: 52px;
  padding: 12px 16px;
  color: var(--apple-ink);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--glass-shadow-soft);
  transform: translateX(-50%);
  backdrop-filter: blur(22px) saturate(1.25);
}

.map-app .map-tile {
  opacity: 1;
  filter: saturate(0.98) contrast(0.98) brightness(1.01);
}

.map-app .map-attribution {
  right: 12px;
  bottom: 8px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--apple-muted-soft);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(14px) saturate(1.2);
}

.map-app .map-attribution a {
  color: inherit;
  text-decoration: none;
}

.map-app .map-attribution a:hover {
  color: var(--apple-ink);
}

.map-app .control-panel {
  position: fixed;
  top: 76px;
  left: 14px;
  z-index: 55;
  display: grid;
  width: min(430px, calc(100% - 28px));
  gap: 10px;
  pointer-events: none;
}

.map-app .panel-section,
.map-app .status-line,
.map-app .result-card,
.map-app .detail-drawer {
  color: #172230;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(30px) saturate(1.35);
}

.map-app .auth-card {
  display: none;
}

.map-app .search-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 24px;
  pointer-events: auto;
}

.map-app.is-panel-expanded .search-card {
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  scrollbar-width: none;
}

.map-app.is-panel-expanded .search-card::-webkit-scrollbar {
  display: none;
}

.map-app .panel-collapsed-row {
  display: none;
  gap: 8px;
  align-items: center;
}

.map-app .panel-toggle-button {
  flex: 1 1 auto;
  justify-content: flex-start;
  width: auto;
  min-height: 48px;
  padding-inline: 18px;
  color: #172230;
  background: var(--glass-strong);
  border-color: var(--glass-border);
  box-shadow: none;
  font-weight: 780;
}

.map-app .quick-location-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 48px;
  padding-inline: 14px;
}

.map-app .search-heading {
  display: none;
}

.map-app .mode-switch {
  grid-column: 1 / -1;
  order: -1;
  padding: 3px;
  background: rgba(239, 243, 247, 0.82);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
}

.map-app .mode-button {
  flex: 1 1 0;
  min-height: 38px;
  color: var(--apple-muted-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 780;
}

.map-app .mode-button.is-active {
  color: var(--apple-ink);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 18px rgba(20, 28, 42, 0.12);
}

.map-app:not(.is-panel-expanded) .mode-switch,
.map-app:not(.is-panel-expanded) .location-search,
.map-app:not(.is-panel-expanded) .text-search,
.map-app:not(.is-search-mode) .location-search,
.map-app:not(.is-search-mode) .form-grid,
.map-app:not(.is-search-mode) .date-chip-row,
.map-app:not(.is-search-mode) .weather-wishes,
.map-app:not(.is-search-mode) .fine-tune-panel,
.map-app:not(.is-search-mode) .attribute-filters,
.map-app:not(.is-search-mode) .premium-note,
.map-app:not(.is-text-search-mode) .text-search,
.map-app.is-text-search-mode .search-card > .button-primary,
.map-app:not(.is-panel-expanded) .search-card > .button-primary {
  display: none;
}

.map-app:not(.is-panel-expanded) .control-panel {
  width: min(310px, calc(100% - 28px));
}

.map-app:not(.is-panel-expanded) .search-card {
  padding: 5px;
  border-radius: 999px;
}

.map-app:not(.is-panel-expanded) .panel-collapsed-row {
  display: flex;
}

.map-app .preset-row,
.map-app .location-search,
.map-app .text-search,
.map-app .form-grid,
.map-app .date-chip-row,
.map-app .weather-wishes,
.map-app .fine-tune-panel,
.map-app .attribute-filters,
.map-app .search-card {
  min-width: 0;
}

.map-app .preset-row {
  grid-column: 1 / -1;
  order: 2;
  margin: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.map-app .preset-row::-webkit-scrollbar {
  display: none;
}

.map-app .preset-row button,
.map-app .button,
.map-app .weather-wishes label,
.map-app input,
.map-app select {
  border-radius: 999px;
}

.map-app .button,
.map-app .preset-row button {
  font-weight: 780;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.map-app .button:hover,
.map-app .preset-row button:hover {
  transform: translateY(-1px);
}

.map-app .button:active,
.map-app .mode-button:active,
.map-app .preset-row button:active,
.map-app .map-controls button:active {
  transform: scale(0.985);
}

.map-app .preset-row button {
  flex: 0 0 auto;
  min-height: 40px;
  color: #293548;
  background: var(--control-fill);
  border-color: var(--glass-border);
}

.map-app .preset-row button:hover {
  color: var(--apple-ink);
  background: rgba(0, 122, 255, 0.09);
}

.map-app .form-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.42fr);
  gap: 8px;
}

.map-app .date-chip-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 7px;
  order: 2;
  overflow-x: auto;
  scrollbar-width: none;
}

.map-app .date-chip-row::-webkit-scrollbar {
  display: none;
}

.map-app .date-chip-row button {
  flex: 0 0 auto;
  display: grid;
  min-width: 58px;
  min-height: 48px;
  place-items: center;
  padding: 7px 10px;
  color: #293548;
  background: var(--control-fill);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  font-weight: 820;
}

.map-app .date-chip-row button span {
  color: var(--apple-muted-soft);
  font-size: 0.68rem;
  font-weight: 820;
}

.map-app .date-chip-row button strong {
  font-size: 1.05rem;
  line-height: 1;
}

.map-app .date-chip-row button.is-active {
  color: var(--apple-ink);
  background: rgba(255, 204, 0, 0.18);
  border-color: rgba(255, 204, 0, 0.42);
}

.map-app label,
.map-app .weather-wishes legend {
  color: var(--apple-muted-soft);
  font-size: 0.72rem;
  font-weight: 820;
}

.map-app .location-search {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.map-app .text-search {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.map-app .form-grid label,
.map-app .location-search label,
.map-app .text-search label {
  gap: 3px;
  padding: 7px 10px;
  background: var(--control-fill);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
}

.map-app .place-search-label {
  min-height: 56px;
  padding-inline: 14px;
  background: var(--glass-strong);
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.44);
}

.map-app .place-search-label input {
  font-size: 1.02rem;
  font-weight: 760;
}

.map-app .place-search-label:focus-within {
  border-color: rgba(0, 122, 255, 0.38);
  box-shadow:
    0 0 0 4px rgba(0, 122, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.map-app .location-button {
  min-height: 56px;
  padding-inline: 16px;
}

.map-app .text-search .button {
  min-height: 56px;
  padding-inline: 18px;
}

.map-app input,
.map-app select {
  min-height: 26px;
  padding: 0;
  color: var(--apple-ink);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.map-app select option {
  color: var(--apple-ink);
  background: #fff;
}

.map-app input:focus,
.map-app select:focus {
  border-color: transparent;
  box-shadow: none;
}

.map-app input[type="date"],
.map-app input[type="datetime-local"] {
  color-scheme: light;
}

.map-app .weather-wishes {
  grid-column: 1 / -1;
  order: 3;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  border: 0;
  scrollbar-width: none;
}

.map-app .weather-wishes::-webkit-scrollbar {
  display: none;
}

.map-app .weather-wishes legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.map-app .weather-wishes label {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  color: #293548;
  background: var(--control-fill);
  border: 1px solid var(--glass-border);
  font-weight: 780;
}

.map-app .weather-wishes label:has(input:checked) {
  color: #003b75;
  background: rgba(0, 122, 255, 0.12);
  border-color: rgba(0, 122, 255, 0.18);
}

.map-app .weather-wishes input {
  width: 16px;
  min-height: 16px;
}

.map-app .fine-tune-panel {
  grid-column: 1 / -1;
  order: 4;
  padding: 0;
}

.map-app .fine-tune-panel summary {
  min-height: 40px;
  padding: 10px 13px;
  color: #293548;
  background: var(--control-fill);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 820;
  list-style: none;
}

.map-app .fine-tune-panel summary::-webkit-details-marker {
  display: none;
}

.map-app .fine-tune-panel summary::after {
  float: right;
  color: var(--apple-muted-soft);
  content: "+";
}

.map-app .fine-tune-panel[open] summary::after {
  content: "-";
}

.map-app .fine-tune-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.map-app .fine-tune-grid label {
  display: grid;
  gap: 7px;
  min-height: 80px;
  padding: 10px 12px;
  color: var(--apple-muted-soft);
  background: var(--control-fill);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
}

.map-app .fine-tune-grid output {
  justify-self: end;
  color: var(--apple-ink);
  font-size: 0.8rem;
  font-weight: 850;
}

.map-app input[type="range"] {
  width: 100%;
  accent-color: var(--apple-blue);
}

.map-app .attribute-filters {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  order: 5;
}

.map-app .filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.map-app .filter-chip-group legend {
  flex: 0 0 100%;
  color: var(--apple-muted-soft);
  font-size: 0.72rem;
  font-weight: 820;
}

.map-app .filter-chip-group label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  color: #293548;
  background: var(--control-fill);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 780;
}

.map-app .filter-chip-group label:has(input:checked) {
  color: #003b75;
  background: rgba(0, 122, 255, 0.11);
  border-color: rgba(0, 122, 255, 0.2);
}

.map-app .filter-chip-group input {
  width: 14px;
  min-height: 14px;
}

.map-app .premium-note {
  grid-column: 1 / -1;
  order: 6;
  padding: 8px 12px;
  color: #6d5200;
  background: rgba(255, 248, 214, 0.76);
  border: 1px solid rgba(255, 204, 0, 0.24);
  border-radius: 14px;
}

.map-app .search-card > .button-primary {
  grid-column: 1 / -1;
  grid-row: auto;
  order: 7;
  min-width: 112px;
  min-height: 56px;
  color: var(--apple-ink);
  background: var(--apple-accent);
  border-color: rgba(185, 135, 0, 0.16);
  box-shadow: 0 10px 20px rgba(255, 204, 0, 0.22);
}

.map-app .button-secondary {
  color: #293548;
  background: var(--control-fill);
  border-color: var(--glass-border);
}

.map-app .button-secondary:hover {
  background: rgba(0, 122, 255, 0.09);
  border-color: rgba(0, 122, 255, 0.16);
}

.map-app .status-line {
  position: fixed;
  left: 16px;
  bottom: 86px;
  z-index: 45;
  width: min(360px, calc(100% - 32px));
  min-height: 0;
  padding: 11px 14px;
  color: var(--apple-muted-soft);
  border-radius: 999px;
  font-weight: 760;
}

.map-app.has-results.is-results-mode .status-line {
  display: none;
}

.map-app .status-line.error {
  color: #84210d;
  background: rgba(255, 238, 232, 0.96);
  border-color: rgba(255, 122, 92, 0.38);
}

.map-app .status-line.success {
  color: #145236;
  background: rgba(229, 250, 237, 0.96);
  border-color: rgba(82, 212, 145, 0.38);
}

.map-app .results-header {
  position: fixed;
  left: 16px;
  bottom: 84px;
  z-index: 44;
  display: none;
  width: min(420px, calc(100% - 32px));
  align-items: center;
  color: var(--apple-ink);
}

.map-app .results-header h2 {
  font-size: 1.1rem;
}

.map-app .results-header .eyebrow {
  margin-bottom: 3px;
  color: #8a6500;
}

.map-app .results-list {
  display: none;
}

.map-app.is-results-mode .results-list {
  position: fixed;
  right: 96px;
  bottom: 94px;
  left: 16px;
  z-index: 48;
  display: flex;
  gap: 12px;
  max-width: min(980px, calc(100% - 128px));
  padding: 4px 4px 10px;
  overflow-x: auto;
  pointer-events: auto;
  scroll-padding-left: 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.map-app.is-results-mode .results-list::-webkit-scrollbar {
  display: none;
}

.map-app .result-card {
  flex: 0 0 min(330px, calc(100vw - 56px));
  padding: 14px;
  border-radius: 20px;
  scroll-snap-align: start;
}

.map-app .result-card.is-selected {
  border-color: rgba(255, 204, 0, 0.9);
  box-shadow:
    0 0 0 2px rgba(255, 204, 0, 0.22),
    var(--glass-shadow);
}

.map-app .result-card h3 {
  color: var(--apple-ink);
  font-size: 1rem;
  line-height: 1.22;
}

.map-app .chip {
  color: var(--apple-muted);
  background: rgba(238, 243, 247, 0.7);
  border-color: var(--glass-border);
  border-radius: 999px;
}

.map-app .score-badge {
  min-width: 54px;
  height: 54px;
  color: var(--apple-ink);
  background: var(--apple-accent);
}

.map-app .card-actions button,
.map-app .card-actions a {
  color: #293548;
  background: rgba(242, 246, 250, 0.76);
  border-color: var(--glass-border);
  border-radius: 999px;
}

.map-app .card-actions .is-favorite {
  color: var(--apple-ink);
  background: var(--apple-accent);
}

.map-app .load-more-row {
  display: none;
}

.map-app .load-more-row .button {
  width: auto;
  min-height: 44px;
}

.map-app .footer-dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  z-index: 62;
  display: flex;
  gap: 3px;
  align-items: center;
  padding: 6px;
  color: #fff;
  background: rgba(21, 24, 30, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.28);
  transform: translateX(-50%);
  backdrop-filter: blur(30px) saturate(1.25);
}

.map-app .footer-dock button {
  display: grid;
  width: 70px;
  min-height: 52px;
  place-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 780;
}

.map-app .footer-dock button:hover,
.map-app .footer-dock button.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.map-app .footer-dock button.is-active span {
  color: var(--apple-accent);
}

.map-app .footer-dock button:disabled {
  cursor: default;
  opacity: 0.42;
}

.map-app .footer-dock span {
  font-size: 1.1rem;
  line-height: 1;
}

.map-app .footer-dock small {
  font-size: 0.66rem;
  line-height: 1;
}

.map-app .menu-popover {
  position: fixed;
  bottom: 84px;
  left: 50%;
  z-index: 61;
  display: grid;
  min-width: 190px;
  padding: 8px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: var(--glass-shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(30px) saturate(1.28);
}

.map-app .menu-popover[hidden] {
  display: none;
}

.map-app .menu-popover a {
  padding: 10px 12px;
  color: var(--apple-ink);
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 780;
  text-decoration: none;
}

.map-app .menu-popover a:hover {
  background: rgba(0, 122, 255, 0.09);
}

.map-app .detail-drawer {
  top: 136px;
  right: auto;
  bottom: 14px;
  left: 14px;
  z-index: 70;
  width: min(430px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
  border-radius: 28px;
  transform: translateX(calc(-100% - 28px));
}

.map-app .detail-drawer.is-open {
  transform: translateX(0);
}

.map-app #detailContent {
  height: 100%;
  overflow-y: auto;
  padding: 0 18px 20px;
}

.map-app .detail-hero {
  display: grid;
  gap: 10px;
  padding: 24px 48px 18px 0;
  border-bottom: 1px solid rgba(23, 34, 48, 0.1);
}

.map-app .detail-drawer h2,
.map-app .detail-drawer h3,
.map-app .forecast-day strong {
  color: #172230;
}

.map-app .detail-drawer h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.08;
}

.map-app .detail-drawer h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.map-app .detail-drawer p {
  color: #475569;
}

.map-app .close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: #f5f8fb;
  border-color: rgba(23, 34, 48, 0.12);
}

.map-app .close-button::before,
.map-app .close-button::after {
  background: #172230;
}

.map-app .detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-app .detail-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 13px;
  color: #172230;
  background: #ffd21a;
  border: 1px solid rgba(209, 153, 0, 0.22);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 900;
  text-decoration: none;
}

.map-app .detail-section {
  padding: 18px 0;
  border-bottom: 1px solid rgba(23, 34, 48, 0.1);
}

.map-app .detail-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.map-app .detail-stat,
.map-app .detail-feature-item,
.map-app .detail-poi-item {
  background: #f5f8fb;
  border: 1px solid rgba(23, 34, 48, 0.1);
  border-radius: 16px;
}

.map-app .detail-stat {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px;
}

.map-app .detail-stat span,
.map-app .detail-feature-item span,
.map-app .detail-poi-item small,
.map-app .forecast-summary,
.map-app .detail-empty {
  color: #64748b;
}

.map-app .detail-stat strong {
  color: #172230;
  font-size: 0.96rem;
}

.map-app .detail-feature-list,
.map-app .detail-poi-list {
  display: grid;
  gap: 8px;
}

.map-app .detail-feature-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1fr);
  gap: 10px;
  padding: 11px 12px;
}

.map-app .detail-feature-item strong,
.map-app .detail-poi-item strong {
  color: #172230;
}

.map-app .detail-poi-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  text-decoration: none;
}

.map-app .detail-poi-marker {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #172230;
  background: #ffd21a;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 950;
}

.map-app .detail-poi-item span:last-child {
  display: grid;
  gap: 2px;
}

.map-app .detail-empty {
  margin: 0;
  padding: 12px;
  background: #f5f8fb;
  border-radius: 16px;
}

.map-app .forecast-day {
  grid-template-columns: minmax(0, 1fr);
  background: #f5f8fb;
  border-color: rgba(23, 34, 48, 0.1);
  border-radius: 16px;
}

.map-app .forecast-summary {
  font-size: 0.88rem;
  font-weight: 800;
}

.cookie-notice {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 16px;
  color: #172230;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(23, 34, 48, 0.14);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(20, 30, 43, 0.24);
  backdrop-filter: blur(16px);
}

.cookie-notice[hidden] {
  display: none;
}

.cookie-notice strong {
  display: block;
  margin-bottom: 3px;
  color: #172230;
  font-size: 0.92rem;
}

.cookie-notice p {
  margin: 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.45;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.cookie-actions a {
  color: #334155;
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
}

.cookie-actions .button {
  min-height: 42px;
  padding-inline: 16px;
}

@media (max-width: 720px) {
  .cookie-notice {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    grid-template-columns: 1fr;
    gap: 12px;
    width: auto;
    max-width: none;
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 16px 42px rgba(20, 30, 43, 0.24);
  }

  .cookie-notice strong {
    margin-bottom: 4px;
    font-size: 0.9rem;
  }

  .cookie-notice p {
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .cookie-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .cookie-actions a {
    display: inline-flex;
    min-height: 38px;
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background: #f5f8fb;
    border: 1px solid rgba(23, 34, 48, 0.1);
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.1;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .cookie-actions .button {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
    justify-content: center;
    border-radius: 8px;
  }
}

@media (max-width: 940px) {
  .map-app {
    overflow: hidden;
  }

  .map-app .app-header {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .map-app .app-nav {
    display: none;
  }

  .map-app .control-panel {
    left: 10px;
    top: 68px;
    width: calc(100% - 20px);
  }

  .map-app .search-card {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .map-app.is-panel-expanded .search-card {
    max-height: calc(100vh - 86px);
  }

  .map-app .location-search,
  .map-app .text-search {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .map-app .form-grid {
    grid-column: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-app .search-card > .button-primary {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    min-height: 44px;
  }

  .map-app .results-list {
    right: 0;
    left: 0;
    bottom: 84px;
    width: 100%;
    max-width: none;
    padding: 2px 12px 12px;
    scroll-padding-left: 12px;
  }

  .map-app .status-line {
    left: 10px;
    bottom: 82px;
    width: calc(100% - 20px);
    border-radius: 18px;
  }

  .map-app .map-toolbar {
    right: 10px;
    bottom: 84px;
  }

  .map-app .map-summary {
    display: none;
  }

  .map-app .load-more-row {
    display: none;
  }

  .map-app .detail-drawer {
    top: 128px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: calc(100% - 20px);
    border-radius: 22px;
  }

  .map-app .footer-dock {
    bottom: 10px;
    width: calc(100% - 20px);
    justify-content: space-between;
  }

  .map-app .footer-dock button {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
  }

  .map-app .menu-popover {
    bottom: 78px;
    width: min(260px, calc(100% - 24px));
  }

  .map-app .cookie-notice {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .map-app .brand span:last-child {
    display: none;
  }

  .map-app .control-panel {
    top: 62px;
  }

  .map-app .form-grid {
    grid-template-columns: 1fr;
    max-height: 206px;
    overflow-y: auto;
  }

  .map-app .fine-tune-grid {
    grid-template-columns: 1fr;
  }

  .map-app .weather-wishes,
  .map-app .preset-row {
    margin-right: -4px;
    padding-right: 4px;
  }

  .map-app .result-card {
    flex-basis: calc(100vw - 34px);
  }

  .map-app .detail-stat-grid,
  .map-app .detail-feature-item {
    grid-template-columns: 1fr;
  }

  .map-app .cookie-notice {
    bottom: calc(76px + env(safe-area-inset-bottom));
    padding: 12px;
  }
}
