:root {
  --bg: #F4F7F5;
  --surface: #FFFFFF;
  --text: #0B1220;
  --muted: #5B6B7C;
  --line: #E6ECE8;
  --primary: #0B7A6A;
  --primary-2: #0F9A86;
  --primary-ink: #FFFFFF;
  --secondary: #EEF4F1;
  --secondary-ink: #0B1220;
  --danger: #C23B3B;
  --shadow: 0 10px 30px rgba(11, 24, 32, 0.08);
  --radius: 18px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hint { color: var(--muted); font-size: .9rem; }

/* Buttons — always readable */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .7rem 1.1rem; border-radius: 999px;
  border: 1px solid transparent; font-weight: 650; letter-spacing: -.01em;
  cursor: pointer; text-decoration: none !important;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-ink) !important;
  box-shadow: 0 8px 18px rgba(11, 122, 106, .22);
}
.btn-primary:hover { background: var(--primary-2); }
.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-ink) !important;
  border-color: var(--line);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text) !important;
  border-color: var(--line);
}
.btn-text {
  background: transparent;
  color: var(--muted) !important;
  border: 0;
  min-height: 40px;
}
.btn-danger {
  background: #FFF1F1;
  color: var(--danger) !important;
  border-color: #F6CACA;
}
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: .45rem .9rem; font-size: .9rem; }
.btn-sm.btn-primary, .btn.btn-primary { color: #fff !important; }

/* Auth / content pages */
.page-wrap {
  min-height: 100%;
  padding: 1.25rem 1.1rem calc(var(--nav-h) + var(--safe-b) + 1.5rem);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(11,122,106,.10), transparent 60%),
    radial-gradient(700px 360px at 100% 0%, rgba(56,189,248,.08), transparent 55%),
    var(--bg);
}
.page-card {
  width: min(460px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.35rem;
}
.page-card h1 { margin: 0 0 .35rem; font-size: 1.55rem; letter-spacing: -.03em; }
.page-card .lead { margin: 0 0 1.2rem; color: var(--muted); }
.brand-mini {
  display: inline-flex; align-items: center; gap: .45rem;
  margin-bottom: 1rem; color: var(--text); text-decoration: none !important; font-weight: 700;
}
.brand-mini .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #38BDF8);
}
.stack-form { display: grid; gap: .85rem; }
.stack-form label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 650; }
.stack-form input, .stack-form select, .stack-form textarea,
.map-search input, .map-filter-row select {
  width: 100%;
  border: 1px solid var(--line);
  background: #FBFFFD;
  border-radius: 14px;
  padding: .8rem .9rem;
  outline: none;
}
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus,
.map-search input:focus {
  border-color: rgba(11,122,106,.45);
  box-shadow: 0 0 0 4px rgba(11,122,106,.10);
}
.check { display: flex !important; align-items: center; gap: .55rem; font-weight: 500 !important; }
.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: .65rem !important;
  font-weight: 500 !important;
  line-height: 1.35;
}
.stack-form input[type="checkbox"],
.stack-form input[type="radio"],
.check-row input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 18px;
  accent-color: var(--primary);
  border-radius: 4px;
  box-shadow: none !important;
}
.check-row span {
  flex: 1 1 auto;
  font-weight: 500;
}
.form-errors { background: #FFF1F1; color: #8F1F1F; border: 1px solid #F6CACA; border-radius: 12px; padding: .7rem .85rem; font-size: .9rem; }
.flash {
  width: min(460px, calc(100% - 0px));
  margin: 0 auto .9rem;
  padding: .75rem .9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.flash-success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.flash-error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 3000;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: .35rem .5rem var(--safe-b);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .15rem;
  background: #ffffff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(11, 24, 32, 0.06);
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  color: var(--muted); text-decoration: none !important; font-size: .68rem; font-weight: 650;
  border-radius: 14px; min-height: 52px;
}
.bn-item.active, .bn-item:hover { color: var(--primary); }
.bn-add .bn-plus {
  width: 34px; height: 34px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary); color: #fff !important; font-size: 1.35rem; line-height: 1;
  box-shadow: 0 8px 16px rgba(11,122,106,.28);
  margin-bottom: .05rem;
}
.bn-add { color: var(--primary); }

/* Content helpers */
.container { width: min(980px, calc(100% - 2rem)); margin-inline: auto; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem; }
.loc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow); color: inherit; text-decoration: none !important;
}
.loc-card img, .loc-card-placeholder { width: 100%; height: 130px; object-fit: cover; background: #DCE7E1; }
.loc-card-body { padding: .85rem; }
.loc-card h3 { margin: 0 0 .25rem; font-size: 1rem; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.site-footer { display: none; }
.page-map .site-header { display: none; }

@media (min-width: 900px) {
  body:not(.page-map) .bottom-nav {
    left: 50%; transform: translateX(-50%);
    width: min(420px, calc(100% - 2rem));
    bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    height: var(--nav-h);
    padding-bottom: .35rem;
    box-shadow: var(--shadow);
  }
}
