:root{
  --bg-rgb: 21, 32, 43;
  --bg: #15202b;
  --bg-surface:  #1b2733;
  --bg-raised:   #223242;
  --bg-input:    #1f2d3a;
  --text: #e8eef5;
  --text-muted:  rgba(232, 238, 245, 0.56);
  --text-dim:    rgba(232, 238, 245, 0.74);
  --border:      rgba(157, 178, 198, 0.26);
  --border-focus:rgba(187, 203, 220, 0.55);
  --accent-dim:  rgba(157, 178, 198, 0.18);
  --underline-color: rgba(232, 238, 245, 0.9);
  --green:       #57d08d;
  --green-bg:    rgba(87, 208, 141, 0.16);
  --max-width: 1100px;
  --nav-height: 64px; /* fixed nav clearance */
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Roboto", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:48px 20px;
}

/* ─── Top navigation ─── */
.nav{
  position:fixed;
  top:22px;
  left:28px;
  display:flex;
  gap:24px;
  align-items:center;
  z-index: 100;
}
.nav a{
  font-weight:350;
  letter-spacing:0.04em;
  text-transform:lowercase;
  color:var(--text);
  font-size:16px;
  text-decoration:none;
  padding:6px 2px;
  position:relative;
}
.nav a::after {
  content: '';
  position:absolute;
  bottom:0;
  left:0;
  width: 0%;
  height: 2px;
  background: var(--underline-color);
  transition: width 0.25s ease;
}
.nav a:hover::after { width: 100%; }
.nav a.active::after { width: 100%; }

/* ─── Center container (homepage, pages list, etc.) ─── */
.container{
  width:100%;
  max-width:var(--max-width);
  margin:0 auto;
  min-height:60vh;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* ─── Search container override ───
   Pins to the top instead of centering vertically, so the search bar
   stays visible and doesn't get pushed off-screen as cards are added. */
.search-container {
  position: relative;
  align-self: flex-start;      /* don't let body's flexbox vertically center this */
  align-items: flex-start;     /* don't vertically center .search-page within container */
  min-height: unset;           /* no artificial height forcing vertical centering */
  padding-top: var(--nav-height); /* clear the fixed nav */
}

.search-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + 22px);
  background: linear-gradient(
    to bottom,
    rgba(var(--bg-rgb), 1) 0%,
    rgba(var(--bg-rgb), 0.96) 35%,
    rgba(var(--bg-rgb), 0.76) 68%,
    rgba(var(--bg-rgb), 0) 100%
  );
  pointer-events: none;
  z-index: 90;
}

.empty-state{
  width:100%;
  border-radius:16px;
  padding:48px;
  text-align:center;
  background: var(--bg);
  min-height:260px;
}

@media (max-width:720px){
  .nav{ left:16px; top:16px; gap:16px }
  .nav a{ font-size:14px }
  .empty-state{ padding:24px; border-radius:12px }
}

/* ─── Page links (used in pages + searches listings) ─── */
.empty-state ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.page-link {
  font-weight: 350;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text);
  font-size: 16px;
  text-decoration: none;
  padding: 6px 2px;
  position: relative;
}
.page-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--underline-color);
  transition: width 0.25s ease;
}
.page-link:hover::after { width: 100%; }

/* ─── Search page layout ─── */
.search-page {
  width: 100%;
  max-width: 860px;
}

h1 {
  font-size: 22px;
  font-weight: 350;
  letter-spacing: 0.03em;
  margin: 0 0 4px;
}

.subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 0 0 32px;
}

/* ─── Controls ─── */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: 7px;
}

label {
  font-size: 10px;
  font-weight: 350;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input[type="text"],
input[type="date"] {
  font-family: "Roboto", Helvetica, Arial, sans-serif;
  font-size: 14px;
  padding: 9px 12px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
  color-scheme: dark;
}
input[type="text"] { width: 300px; }
input:focus { border-color: var(--border-focus); }
input::placeholder { color: var(--text-muted); }

button {
  font-family: "Roboto", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 350;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  padding: 10px 22px;
  background: rgba(232, 238, 245, 0.9);
  color: #13202b;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
  align-self: flex-end;
}
button:hover    { opacity: 0.85; }
button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ─── Resolved address pill ─── */
#resolved {
  display: none;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 7px 12px;
  letter-spacing: 0.03em;
}
#resolved span { font-weight: 700; color: var(--text); }

/* ─── Status line ─── */
#status {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  min-height: 18px;
}

/* ─── Permit cards ─── */
#cards {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 48px;
}

.permit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 20px 22px;
  margin-top: 20px
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.permit-number {
  font-size: 12px;
  font-weight: 350;
  color: var(--text);
  letter-spacing: 0.06em;
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}
a.permit-number::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 1px;
  background: var(--underline-color);
  transition: width 0.2s ease;
}
a.permit-number:hover::after { width: 100%; }

.permit-status {
  font-size: 10px;
  font-weight: 350;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.card-address {
  font-size: 16px;
  font-weight: 350;
  letter-spacing: 0.02em;
  margin-bottom: 3px;
}

.card-neighborhood {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
  margin-bottom: 14px;
}

.card-field label {
  font-size: 10px;
  font-weight: 350;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 3px;
  display: block;
}

.card-field p {
  font-size: 13px;
  margin: 0;
  color: var(--text-dim);
}

.card-purpose {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.card-purpose strong {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.card-purpose strong + strong { margin-top: 10px; }

/* ─── No results ─── */
.no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  body { padding: 28px 16px; }
  input[type="text"] { width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
}
