/* OverTap — one stylesheet, served from this app.
   No CDN, no build step: the Content-Security-Policy is 'self' for styles and
   scripts, which is only true if the assets really are ours. */

:root {
  --ink: #1c1a17;
  --ink-soft: #55504a;
  --paper: #fbfaf8;
  --line: #ddd7cf;
  --accent: #8a5a20;
  --danger: #9a2f22;
  --ok: #2c6042;
  --radius: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--accent); }
a:hover { color: var(--ink); }

/* --- shell --------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand {
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.topbar-right { display: flex; align-items: center; gap: 1rem; }
.inline { display: inline; margin: 0; }

.page { max-width: 62rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.page.narrow { max-width: 26rem; }

.footer {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.85rem;
}

h1 { font-size: 1.5rem; letter-spacing: -0.015em; margin: 0 0 0.5rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }
.lede { color: var(--ink-soft); margin-top: 0; }
.hint { color: var(--ink-soft); font-size: 0.85rem; }

/* --- messages ------------------------------------------------------------ */

.notice, .error {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 0 0 1.25rem;
}
.notice { border-color: var(--ok); color: var(--ok); background: #f2f8f4; }
.error  { border-color: var(--danger); color: var(--danger); background: #fdf4f2; }

/* --- forms --------------------------------------------------------------- */

.stack { display: flex; flex-direction: column; gap: 0.35rem; margin: 1.5rem 0; }
.stack label { font-size: 0.85rem; font-weight: 600; margin-top: 0.6rem; }
.stack .hint { margin: 0.1rem 0 0; }

input[type="email"],
input[type="password"],
input[type="text"] {
  padding: 0.55rem 0.7rem;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .button {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.55rem 0.9rem;
}

button.primary {
  margin-top: 1rem;
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}
button.primary:hover { background: #000; }

button.linkish {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
}

.button { display: inline-block; text-align: center; text-decoration: none; color: var(--ink); width: 100%; }

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 1.5rem 0 1rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

/* --- data ---------------------------------------------------------------- */

.grid {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-variant-numeric: tabular-nums;
}
.grid caption {
  text-align: left;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding-bottom: 0.4rem;
}
.grid th, .grid td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.grid thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border-bottom-width: 2px;
}
.grid .num { text-align: right; }
.grid tbody tr:hover { background: #fff; }

.detail { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 1.5rem 0; }
.detail dt { font-size: 0.85rem; color: var(--ink-soft); }
.detail dd { margin: 0; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  background: #fff;
}

/* Search form + results (Phase 1) */
.search-form fieldset {
  border: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  gap: 1.25rem;
}
.search-form fieldset legend { font-size: 0.85rem; color: var(--ink-soft); }
.search-form label { font-size: 0.9rem; }
.search-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.75rem;
}
.field-group { display: inline-flex; gap: 0.75rem; }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.pager { display: flex; gap: 1.5rem; margin: 1rem 0; }

/* Map (Phase 3). The container is fixed-height because Leaflet needs a sized
   parent at init; a percentage height against an auto-height body collapses
   it to nothing. */
#map {
  height: 60vh;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.map-controls {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.6rem;
}
.leaflet-popup-content a { display: inline-block; margin-top: 0.35rem; }
