:root {
  --bg:       #f0fdf4;
  --card:     #ffffff;
  --border:   #d1fae5;
  --border2:  #e5e7eb;
  --text:     #111827;
  --muted:    #6b7280;
  --accent:   #16a34a;
  --accent-h: #15803d;
  --accent-l: #dcfce7;
  --radius:   22px;
  --shadow:   0 4px 24px rgba(22,163,74,.1), 0 1px 4px rgba(0,0,0,.06);
  --shadow-s: 0 1px 6px rgba(0,0,0,.07);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 80px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  width: 100%;
  max-width: 540px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
}

/* ── Header ── */
.header {
  text-align: center;
  margin-bottom: 22px;
}

.brand {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.header-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 10px;
}

.header-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 5px;
  color: var(--text);
}

.header-sub {
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Mode switcher ── */
.mode-switcher {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 20px;
}

.mode-btn {
  flex: 1;
  background: none;
  border: none;
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.mode-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(22,163,74,.3);
}

.mode-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(22,163,74,.08);
}

/* ── Form ── */
form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.field-wrap {
  position: relative;
}

.address-input {
  width: 100%;
  background: #f9fafb;
  border: 1.5px solid var(--border2);
  border-radius: 14px;
  padding: 13px 42px 13px 16px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.address-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
  background: #fff;
}

.address-input::placeholder { color: #9ca3af; }

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
  z-index: 2;
}
.clear-btn:hover { color: var(--text); }

/* ── Autocomplete ── */
.autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1.5px solid var(--border2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  list-style: none;
  z-index: 100;
  overflow: hidden;
  animation: slideDown 0.15s ease;
}

.autocomplete-item {
  padding: 11px 16px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  color: var(--text);
}

.autocomplete-item:not(:last-child) {
  border-bottom: 1px solid #f3f4f6;
}

.autocomplete-item:hover,
.autocomplete-item.focused {
  background: var(--accent-l);
  color: var(--accent);
}

/* ── Find button ── */
.find-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(22,163,74,.28);
}

.find-btn:hover:not(:disabled) {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(22,163,74,.38);
}

.find-btn:active:not(:disabled) { transform: translateY(0); }
.find-btn:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

/* ── Spinner ── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Notice (ошибка) ── */
.notice {
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.22);
  color: #dc2626;
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* ── Result card ── */
.result {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-s);
}

.result-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.result-tag {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-l);
  border-radius: 6px;
  padding: 3px 9px;
}

.source-badge {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--muted);
  background: #f3f4f6;
  border-radius: 6px;
  padding: 3px 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.result-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.35;
  color: var(--text);
}

.result-address {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
  line-height: 1.45;
}

.result-distance {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ── Status / Schedule / Contacts / Rating ── */
.result-status {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.result-schedule {
  font-size: 0.83rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.schedule-toggle {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  text-decoration: underline dotted;
}

.schedule-full {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 3px 10px;
  font-size: 0.8rem;
}

.schedule-day  { color: var(--muted); }
.schedule-time { color: var(--text); font-weight: 500; }

.schedule-today.schedule-day,
.schedule-today.schedule-time {
  color: var(--accent);
  font-weight: 700;
}

.result-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.contact-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: opacity 0.15s;
}

.contact-link:hover { opacity: 0.72; text-decoration: underline; }

.result-rating {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Actions ── */
.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid rgba(22,163,74,.4);
  border-radius: 10px;
  padding: 8px 16px;
  transition: background 0.2s, border-color 0.2s;
}

.map-btn:hover {
  background: var(--accent-l);
  border-color: var(--accent);
}

.refresh-btn {
  background: none;
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.refresh-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-l);
}

.refresh-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Landmarks ── */
.result-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0 15px;
}

.landmarks-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}

.landmarks-list { list-style: none; }

.landmark-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 10px;
  transition: background 0.15s;
}

.landmark-item + .landmark-item {
  border-top: 1px solid #f3f4f6;
}

.landmark-item:hover { background: #f9fafb; }
.landmark-item[data-url] { cursor: pointer; }
.landmark-item[data-url]:hover { background: var(--accent-l); }

.lm-icon {
  font-size: 1.1rem;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}

.lm-info { flex: 1; min-width: 0; }

.lm-name {
  font-size: 0.875rem;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.lm-type {
  font-size: 0.72rem;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

.lm-dist {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

.lm-empty {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 4px 2px;
}

/* ── Utils ── */
.hidden { display: none !important; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 540px) {
  body  { padding: 16px 10px 60px; }
  .card { padding: 26px 18px; }
  .header-title { font-size: 1.35rem; }
}
