/* Glass on the Street — design system.
   Minimal, modern, softer contrast than a pure black-on-white extreme:
   an off-white surface, a warm near-black (not pure #000) for text, one
   muted accent color used sparingly, a single humanist sans, flat
   surfaces, no shadows except on floating map popovers. */

:root {
  --ink: #18181b;
  --ink-soft: #71717a;
  --paper: #fafaf9;
  --paper-raised: #f0f0ee;
  --rule: #e4e4e1;
  --accent: #ea580c;
  --accent-soft: #fdf1e9;
  --positive: #15803d;
  --radius: 6px;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden; /* full-bleed sections below intentionally exceed 100% width */
}

h1, h2, h3, .display {
  font-family: "Manrope", -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 0.4em;
}

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

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

/* ---------- masthead ---------- */

.masthead-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.masthead-title {
  font-family: "Manrope", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.masthead-title em {
  font-style: normal;
  color: var(--accent);
}

.masthead-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.92rem;
}

.masthead-nav a {
  text-decoration: none;
  color: var(--ink-soft);
}

.masthead-nav a:hover {
  color: var(--ink);
}

.masthead-cta {
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  color: var(--paper) !important;
  font-weight: 600;
}

.masthead-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
}

.masthead-rule {
  height: 1px;
  background: var(--rule);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---------- generic page shell ---------- */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.75rem 1.5rem 4rem;
}

.page-narrow {
  max-width: 640px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.76rem;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 640px;
}

/* ---------- stat callout ---------- */

.stat-line {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0;
  margin: 2rem 0;
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.stat {
  min-width: 140px;
}

.stat-value {
  font-family: "Manrope", sans-serif;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-value.up {
  color: var(--accent);
}

.stat-value.down {
  color: var(--positive);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- buttons / form controls ---------- */

.btn {
  display: inline-block;
  font-family: "Manrope", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-toggle {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.btn-toggle.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Understated text tabs for the map's date/mode filters -- distinct from
   .btn-toggle (used for real buttons like admin Remove/Restore and the
   popup Flag action, which need a button's affordance). */
.tab-toggle {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.05rem;
  cursor: pointer;
}

.tab-toggle:hover {
  color: var(--ink);
}

.tab-toggle.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 1.25rem 0 0.35rem;
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  background: #fff;
  border-radius: var(--radius);
  color: var(--ink);
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}

fieldset {
  border: none;
  padding: 0;
  margin: 1.25rem 0 0;
}

.choice-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.choice-chip {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-size: 0.92rem;
  background: #fff;
}

.choice-chip input {
  margin-right: 0.4rem;
}

.choice-chip:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

/* ---------- map page ---------- */

/* Breaks the map out of the readable text column to the full viewport
   width -- the map is the centerpiece here, not a widget in a card. */
.breakout {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.map-section {
  padding: 0 1.5rem;
}

.map-toolbar {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 1.5rem 0.75rem;
}

.date-presets {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.map-frame {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  height: 78vh;
  min-height: 480px;
  position: relative;
  background: var(--paper-raised);
}

#map,
#picker-map {
  width: 100%;
  height: 100%;
}

.map-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  flex-wrap: wrap;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.4rem;
}

.legend-dot.window { background: var(--accent); }
.legend-dot.rifled { background: var(--ink); }
.legend-dot.unknown { background: #a1a1aa; }

.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
}

.breakdown-heading {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  font-family: "Manrope", sans-serif;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.breakdown-row {
  display: grid;
  grid-template-columns: 100px 1fr 30px;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.88rem;
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-label {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breakdown-bar-track {
  background: none;
  height: 5px;
  align-self: center;
}

.breakdown-bar {
  display: block;
  height: 100%;
  background: var(--ink);
}

.breakdown-count {
  text-align: right;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .breakdown-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.maplibregl-popup-content {
  font-family: "Manrope", sans-serif;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  box-shadow: 0 8px 24px rgba(10, 10, 10, 0.12);
  padding: 0.75rem 0.9rem;
}

.popup-title {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.popup-meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ---------- report confirmation ---------- */

.confirmation-box {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-top: 1.5rem;
}

.police-callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
}

/* ---------- admin ---------- */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 1.5rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--paper-raised);
}

.tag.flagged { background: var(--accent-soft); color: var(--accent); }
.tag.removed { background: var(--rule); color: var(--ink-soft); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .stat-line {
    gap: 1.5rem;
  }

  .map-frame {
    height: 52vh;
  }
}
