:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #5e6a66;
  --paper: #f7f4ec;
  --panel: #ffffff;
  --sea: #136f63;
  --sea-dark: #0b4f49;
  --clay: #a94f2b;
  --gold: #c6932f;
  --stone: #d9d2c3;
  --line: #d8dfd8;
  --shadow: 0 14px 34px rgba(23, 33, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(19, 111, 99, 0.1), transparent 34%),
    linear-gradient(45deg, rgba(169, 79, 43, 0.08), transparent 42%), var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", sans-serif;
}

a {
  color: var(--sea-dark);
}

button,
input {
  font: inherit;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 40px clamp(18px, 5vw, 72px) 28px;
  min-height: 310px;
  background:
    linear-gradient(90deg, rgba(247, 244, 236, 0.95), rgba(247, 244, 236, 0.74)),
    repeating-linear-gradient(
      115deg,
      rgba(19, 111, 99, 0.16) 0 2px,
      transparent 2px 22px
    ),
    #d6e4dc;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-title p {
  margin: 0 0 10px;
  color: var(--clay);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  font-size: 1.04rem;
  line-height: 1.24;
  margin-bottom: 10px;
}

.lede {
  max-width: 820px;
  margin-bottom: 0;
  color: #30403d;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.status-panel {
  width: 180px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(19, 111, 99, 0.2);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-panel span,
.status-panel small {
  display: block;
  color: var(--muted);
}

.status-panel strong {
  display: block;
  margin: 6px 0 2px;
  color: var(--sea-dark);
  font-size: 2.6rem;
}

.quick-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px clamp(18px, 5vw, 72px);
  background: rgba(247, 244, 236, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.quick-nav a {
  flex: 0 0 auto;
  padding: 9px 12px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
}

.quick-nav a:hover,
.quick-nav a:focus-visible {
  border-color: rgba(19, 111, 99, 0.35);
  outline: none;
}

main {
  padding: 0 clamp(18px, 5vw, 72px) 48px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin: 22px 0;
}

.search-box {
  display: grid;
  gap: 7px;
}

.search-box span,
.local-stats span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.search-box input {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
}

.local-stats {
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px 12px;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.local-stats strong {
  color: var(--clay);
  font-size: 1.5rem;
}

.local-stats button,
.done-button {
  border: 1px solid rgba(19, 111, 99, 0.28);
  border-radius: 8px;
  background: #f3faf7;
  color: var(--sea-dark);
  cursor: pointer;
  font-weight: 800;
}

.local-stats button {
  grid-column: 1 / -1;
  min-height: 34px;
}

.section-band {
  padding: 34px 0;
  border-top: 1px solid rgba(23, 33, 31, 0.1);
}

.section-title {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 22px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.grid.seven {
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  overflow-x: auto;
  padding-bottom: 8px;
}

.card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 100%;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(23, 33, 31, 0.06);
}

.card p {
  color: #33423f;
  line-height: 1.68;
  margin-bottom: 0;
}

.card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3efe3;
  color: #4b453a;
  font-size: 0.76rem;
  font-weight: 800;
}

.badge.a {
  background: #e9f6f2;
  color: var(--sea-dark);
}

.badge.b {
  background: #fff3d7;
  color: #75531b;
}

.badge.c {
  background: #f4e5dc;
  color: #72351d;
}

.done-button {
  min-height: 38px;
}

.done-button[data-done="true"] {
  background: var(--sea);
  color: #fff;
}

.route-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.6fr);
  gap: 18px;
  align-items: start;
}

.sea-map {
  position: sticky;
  top: 68px;
  min-height: 520px;
  padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 22%, rgba(255, 255, 255, 0.9), transparent 0 3px),
    linear-gradient(140deg, rgba(19, 111, 99, 0.9), rgba(7, 57, 79, 0.92));
  color: #fff;
  border-radius: 8px;
}

.sea-map::before,
.sea-map::after {
  content: "";
  position: absolute;
  inset: auto auto 24px -36px;
  width: 180px;
  height: 120px;
  background: rgba(247, 244, 236, 0.9);
  clip-path: polygon(15% 10%, 82% 0, 100% 56%, 72% 100%, 20% 82%, 0 42%);
}

.sea-map::after {
  inset: 86px -42px auto auto;
  width: 150px;
  height: 160px;
  opacity: 0.88;
  transform: rotate(-20deg);
}

.map-title {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.route-rail {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 11px;
  margin-top: 26px;
}

.route-dot {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: #fff;
}

.route-dot span:first-child {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: var(--sea-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.route-dot span:last-child {
  font-weight: 800;
  line-height: 1.25;
}

.stack {
  display: grid;
  gap: 14px;
}

.compact .card {
  gap: 8px;
  padding: 15px;
}

.source-key {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.source-key span {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.empty-state {
  padding: 20px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.app-footer {
  display: grid;
  gap: 10px;
  padding: 26px clamp(18px, 5vw, 72px);
  color: #f7f4ec;
  background: var(--ink);
}

.app-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-footer p {
  max-width: 940px;
  margin-bottom: 0;
  color: #cfd8d5;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .app-header,
  .toolbar,
  .section-title,
  .route-layout,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .status-panel {
    width: 100%;
  }

  .sea-map {
    position: relative;
    top: auto;
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  .app-header {
    min-height: 250px;
    padding-top: 28px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .local-stats {
    grid-template-columns: 1fr auto;
  }

  .grid.seven {
    grid-template-columns: repeat(7, 78vw);
  }
}
