:root {
  --bg: #0c1118;
  --bg-elevated: #121a24;
  --bg-card: #161f2c;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf4;
  --muted: #9aa7b8;
  --accent: #3d9cf9;
  --accent-dim: #2563a8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  font-family: "Instrument Sans", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(61, 156, 249, 0.12), transparent),
    radial-gradient(800px 400px at 90% 0%, rgba(120, 80, 200, 0.08), transparent),
    var(--bg);
  line-height: 1.5;
}

code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(12, 17, 24, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  box-shadow: 0 8px 24px rgba(61, 156, 249, 0.35);
}

.brand__name {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand__tag {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 1.25rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 2rem 2.5rem;
  align-items: start;
  padding: 3rem 1.5rem 2rem;
  max-width: 1180px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 52ch;
  margin: 0 0 1.5rem;
}

.lede em {
  color: #c5d4e8;
  font-style: normal;
  font-weight: 500;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__facts {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero__facts strong {
  color: #c5d4e8;
  font-weight: 600;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.92em;
}

.hero__map-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 0;
}

.hero__map-head {
  padding: 1.1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.hero__map-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero__map-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.hero__map {
  height: min(420px, 52vh);
  min-height: 280px;
  width: 100%;
  background: var(--bg);
  z-index: 0;
}

.hero__map .leaflet-container {
  font-family: inherit;
  background: var(--bg);
}

.hero__map-foot {
  margin: 0;
  padding: 0.65rem 1.25rem 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  border-top: 1px solid var(--border);
}

.hero__map-foot a {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.hero__map-foot a:hover {
  text-decoration: underline;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm) !important;
}

.leaflet-popup-content {
  margin: 0.65rem 0.85rem !important;
  font-size: 0.88rem;
  line-height: 1.45;
}

.map-popup__title {
  font-weight: 700;
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.map-popup__text {
  margin: 0 0 0.5rem;
  color: #444;
}

.map-popup__link {
  display: inline-block;
  font-weight: 600;
  color: var(--accent-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(180deg, #4aa6ff, var(--accent-dim));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(61, 156, 249, 0.35);
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--border);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.section {
  padding: 2.5rem 1.5rem;
  max-width: 1120px;
  margin: 0 auto;
}

.section--tight {
  padding-top: 0;
}

.section--crime {
  padding-top: 1rem;
}

.crime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 800px) {
  .crime-grid {
    grid-template-columns: 1fr;
  }
}

.crime-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}

.crime-card--national {
  grid-column: 1 / -1;
  border-color: rgba(61, 156, 249, 0.25);
  background: linear-gradient(135deg, rgba(61, 156, 249, 0.06), var(--bg-card));
}

.crime-card__jurisdiction {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #dbe6f5;
}

.crime-card__body {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.crime-card__link {
  display: inline-block;
  margin-right: 1rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.crime-card__link:hover {
  text-decoration: underline;
}

.crime-card__link--muted {
  font-weight: 500;
  color: #7eb8ea;
  opacity: 0.95;
}

.nowrap {
  white-space: nowrap;
}

.section--alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border-top: 1px solid var(--border);
  max-width: none;
  padding-left: max(1.5rem, calc(50vw - 560px));
  padding-right: max(1.5rem, calc(50vw - 560px));
}

.section__head {
  margin-bottom: 1.75rem;
}

.section__head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.news-heading-block {
  flex: 1;
  min-width: min(100%, 280px);
}

.news-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.news-heading-title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.section__head--split .section__sub {
  margin-top: 0.35rem;
}

.postcode-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.postcode-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.postcode-field__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.postcode-field input {
  width: 6.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.postcode-field input:focus {
  outline: 2px solid rgba(61, 156, 249, 0.45);
  outline-offset: 0;
}

.area-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-basis: 100%;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.area-presets__label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.news-local-label {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  color: #b8cfe8;
  background: rgba(61, 156, 249, 0.08);
  border: 1px solid rgba(61, 156, 249, 0.22);
  border-radius: var(--radius-sm);
  line-height: 1.45;
}

.news-local-label[hidden] {
  display: none;
}

.news-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.badge--dim {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
}

.news-disclaimer {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  line-height: 1.45;
}

.news-status {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #c9b070;
}

.news-status code {
  font-size: 0.85em;
  color: #e8dcc8;
}

.section--news {
  border-top: 1px solid var(--border);
  padding-top: 2.25rem;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.news-item {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius);
}

.news-item__article {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
  min-height: 5.5rem;
}

.news-item__article:hover {
  border-color: rgba(61, 156, 249, 0.35);
  background: rgba(22, 31, 44, 0.98);
}

.news-item--local .news-item__article {
  border-color: rgba(46, 160, 130, 0.4);
  background: rgba(18, 36, 32, 0.55);
}

.news-item__local-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6ee7c5;
  background: rgba(46, 160, 130, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.news-item__community-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.news-item__thumb-wrap {
  flex: 0 0 auto;
  width: 120px;
  min-height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  align-self: flex-start;
}

.news-item__thumb {
  display: block;
  width: 120px;
  height: 90px;
  object-fit: cover;
}

.news-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-item__title {
  display: block;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.35;
  color: #e8f1fc;
}

.news-item__article:hover .news-item__title {
  color: var(--accent);
}

.news-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.news-item__source {
  font-weight: 500;
  color: #8eb6da;
}

.news-item__time {
  font-variant-numeric: tabular-nums;
}

.news-item__snippet {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 520px) {
  .news-item__article {
    flex-direction: column;
    align-items: stretch;
  }

  .news-item__thumb-wrap,
  .news-item__thumb {
    width: 100%;
    height: auto;
    min-height: 160px;
    max-height: 200px;
  }

  .news-item__thumb {
    object-fit: cover;
    min-height: 160px;
  }
}

.section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.section__sub {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.cards {
  display: grid;
  gap: 1rem;
}

.cards--3 {
  grid-template-columns: repeat(3, 1fr);
}

.cards--2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 800px) {
  .cards--3,
  .cards--2 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.card__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.card__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.layout--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 800px) {
  .layout--split {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.panel--table {
  padding: 0;
  overflow: hidden;
}

.panel__title {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.form .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form .field span {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.form input,
.form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font: inherit;
}

.form input:focus,
.form textarea:focus {
  outline: 2px solid rgba(61, 156, 249, 0.45);
  outline-offset: 0;
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.paste-area {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.paste-area.hidden {
  display: none;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.table-head .panel__title {
  margin: 0;
}

.badge {
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.table-wrap {
  overflow: auto;
  max-height: min(420px, 55vh);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.empty-row td {
  color: var(--muted);
  font-style: italic;
}

.col-actions {
  width: 140px;
  white-space: nowrap;
}

.cell-actions {
  display: flex;
  gap: 0.35rem;
}

.btn--small {
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
}

.resource {
  display: block;
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.1s;
}

.resource:hover {
  border-color: rgba(61, 156, 249, 0.45);
  transform: translateY(-2px);
}

.resource__name {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--accent);
}

.resource__desc {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer {
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0 auto;
  max-width: 60ch;
}
