:root {
  --forest: #173f2d;
  --olive: #66724a;
  --earth: #8a6747;
  --muted: #536158;
  --paper: #fffef9;
  --cream: #f5f3ea;
  --line: #cfd5cf;
  --warning: #fff6d8;
  --hka-paper-width: 297mm;
  --hka-paper-height: 210mm;
  color: #17231d;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--cream); margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--forest); }

.site-header {
  align-items: center;
  background: rgba(255, 254, 249, .97);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 110px;
  padding: 10px max(24px, calc((100vw - 1500px) / 2));
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-brand { flex: 0 0 auto; }
.site-brand img { display: block; height: auto; width: 320px; }
.site-header nav { display: flex; gap: 26px; }
.site-header nav a { font-size: 14px; font-weight: 700; text-decoration: none; }

main { margin: 0 auto; max-width: 1540px; padding: 0 20px 64px; }
.site-banner {
  border-radius: 12px;
  height: clamp(110px, 15.333vw, 230px);
  margin: 20px auto 0;
  max-width: 1500px;
  overflow: hidden;
  width: 100%;
}
.site-banner a,
.site-banner img { display: block; height: 100%; width: 100%; }
.site-banner img { object-fit: cover; object-position: center; }
.site-banner a:focus-visible { outline: 4px solid #8bb4ee; outline-offset: -4px; }
.intro { margin: 48px auto 28px; max-width: 850px; text-align: center; }
.eyebrow { color: var(--olive); font-size: 13px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.intro h1 { color: var(--forest); font-size: clamp(36px, 5vw, 66px); line-height: 1.02; margin: 12px 0 18px; }
.intro > p:last-child { color: #455148; font-size: 18px; line-height: 1.5; margin: 0; }

.trust-note {
  align-items: center;
  background: #edf3ed;
  border: 1px solid #c7d5c9;
  border-radius: 12px;
  display: flex;
  gap: 30px;
  justify-content: space-between;
  margin: 0 auto 18px;
  max-width: 1500px;
  padding: 16px 20px;
}
.trust-note strong { color: var(--forest); display: block; margin-bottom: 4px; }
.trust-note p { color: #34463b; line-height: 1.45; margin: 0; }
.trust-note a { flex: 0 0 auto; font-weight: 700; }

.hka-app { margin: 0 auto; max-width: 1500px; }
.hka-toolbar {
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1.7fr) repeat(6, minmax(120px, 1fr));
  padding: 16px;
}
.hka-field { min-width: 0; position: relative; }
.hka-field label,
.hka-field-label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 7px; }
.hka-field input,
.hka-field select,
.hka-field textarea,
.hka-field button {
  border: 1px solid #aeb8b0;
  border-radius: 7px;
  min-height: 44px;
  padding: 9px 11px;
  width: 100%;
}
.hka-field textarea { min-height: 68px; resize: vertical; }
.hka-field small { color: var(--muted); display: block; font-size: 11px; margin-top: 5px; }
.hka-inline { display: flex; gap: 8px; }
.hka-inline input { flex: 1 1 auto; }
.hka-inline button { flex: 0 0 76px; font-weight: 700; }
.hka-note-field { grid-column: span 3; }
.hka-actions { align-self: stretch; display: flex; grid-column: span 2; }
.hka-primary {
  background: var(--forest);
  border: 0;
  border-radius: 7px;
  color: white;
  font-weight: 800;
  min-height: 44px;
  padding: 10px 18px;
  width: 100%;
}
.hka-primary:hover { background: #0f3223; }
.hka-search-results {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(17, 40, 27, .18);
  left: 0;
  max-height: 260px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
}
.hka-search-results button { background: white; border: 0; border-radius: 0; min-height: 0; padding: 10px 12px; text-align: left; }
.hka-search-results button + button { border-top: 1px solid #edf0ed; }
.hka-search-results button:hover { background: #edf3ed; }

.hka-switch { align-items: center; display: flex !important; gap: 9px; margin: 0 !important; min-height: 44px; }
.hka-switch input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.hka-switch span { background: #aeb7b0; border-radius: 999px; height: 26px; position: relative; transition: .2s; width: 48px; }
.hka-switch span::after { background: white; border-radius: 50%; content: ""; height: 20px; left: 3px; position: absolute; top: 3px; transition: .2s; width: 20px; }
.hka-switch input:checked + span { background: var(--forest); }
.hka-switch input:checked + span::after { transform: translateX(22px); }
.hka-switch input:focus-visible + span { outline: 3px solid #8bb4ee; outline-offset: 2px; }

.hka-beta-note {
  background: var(--warning);
  border: 1px solid #e0c763;
  border-radius: 7px;
  color: #554200;
  margin: 16px 0;
  padding: 12px 14px;
}
.hka-coordinate-readout {
  align-items: baseline;
  background: #edf3ed;
  border: 1px solid #cad6cc;
  border-radius: 7px;
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 14px;
}
.hka-coordinate-readout span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.hka-coordinate-readout strong { color: var(--forest); font-size: 14px; }

.hka-sheet {
  background: var(--paper);
  border: 1px solid #bcc6be;
  box-shadow: 0 8px 24px rgba(30, 45, 35, .08);
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  margin: 0 auto;
  max-height: 1050px;
  max-width: 1500px;
  padding: 16px;
  width: 100%;
}
.hka-sheet.hka-landscape { aspect-ratio: 1.4142 / 1; }
.hka-sheet.hka-portrait { aspect-ratio: 1 / 1.4142; max-width: 900px; }
.hka-sheet-header { align-items: start; display: flex; gap: 20px; justify-content: space-between; padding: 0 3px 10px; }
.hka-sheet-header h2 { color: var(--forest); font-size: 28px; line-height: 1.05; margin: 0; }
.hka-sheet-header p { font-size: 12px; margin: 5px 0 0; }

.hka-north-diagram { align-items: center; display: flex; flex: 0 0 92px; flex-direction: column; height: 62px; }
.hka-north-arrow { color: #b42318; height: 49px; position: relative; text-align: center; width: 34px; }
.hka-north-arrow span { display: block; font-size: 13px; font-weight: 900; line-height: 13px; }
.hka-north-arrow i { background: currentColor; display: block; height: 26px; left: 16px; position: absolute; top: 24px; width: 2px; }
.hka-north-arrow i::before { border-bottom: 13px solid currentColor; border-left: 7px solid transparent; border-right: 7px solid transparent; content: ""; left: -6px; position: absolute; top: -5px; }
.hka-north-diagram small { color: var(--muted); font-size: 8px; white-space: nowrap; }

.hka-map { background: #e6e2d5; min-height: 0; overflow: hidden; position: relative; touch-action: none; }
.hka-tiles, .hka-overlay, .hka-features { height: 100%; inset: 0; position: absolute; width: 100%; }
.hka-tile { opacity: 0; position: absolute; transition: opacity .12s linear; user-select: none; }
.hka-tile.hka-loaded { opacity: 1; }
.hka-overlay { pointer-events: none; z-index: 4; }
.hka-features { pointer-events: none; z-index: 5; }
.hka-feature { left: 0; position: absolute; top: 0; transform: translate(-50%, -50%); }
.hka-feature-dot { background: #fff; border: 2px solid var(--forest); border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.45); display: block; height: 12px; width: 12px; }
.hka-feature-label { background: rgba(255,255,255,.92); border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.25); color: #102d20; display: block; font-size: 10px; font-weight: 700; left: 9px; max-width: 150px; padding: 2px 4px; position: absolute; top: -9px; white-space: nowrap; }
.hka-feature-water .hka-feature-dot { border-color: #12689a; }
.hka-feature-shelter .hka-feature-dot { border-color: var(--earth); border-radius: 1px; }
.hka-feature-emergency .hka-feature-dot { border-color: #a11b1b; }
.hka-zoom-controls { display: grid; left: 10px; position: absolute; top: 10px; z-index: 10; }
.hka-zoom-controls button { background: rgba(255,255,255,.92); border: 0; font-size: 22px; font-weight: 800; height: 40px; width: 40px; }
.hka-zoom-controls button + button { border-top: 1px solid var(--line); }
.hka-scale-bar { border-bottom: 2px solid #142e20; border-left: 2px solid #142e20; border-right: 2px solid #142e20; bottom: 7px; color: #142e20; font-size: 10px; font-weight: 700; left: 8px; line-height: 15px; position: absolute; text-align: center; z-index: 7; }
.hka-attribution { background: rgba(255,255,255,.88); bottom: 0; font-size: 8px; max-width: 70%; padding: 2px 4px; position: absolute; right: 0; text-align: right; z-index: 7; }
.hka-map-status { background: rgba(23,63,45,.93); bottom: 52px; color: white; left: 50%; max-width: 85%; padding: 8px 12px; position: absolute; transform: translateX(-50%); z-index: 20; }
.hka-map-status:empty { display: none; }
.hka-map-coordinate {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(23,63,45,.35);
  border-radius: 5px;
  bottom: 22px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
  left: 50%;
  max-width: calc(100% - 180px);
  overflow: hidden;
  padding: 4px 8px;
  position: absolute;
  text-align: center;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 9;
}

.hka-sheet-footer { align-items: end; display: grid; font-size: 10px; gap: 6px 18px; grid-template-columns: 1fr auto; padding: 8px 3px 0; }
.hka-sheet-footer > p:last-child { grid-column: 1 / -1; margin: 0; }
.hka-print-note { background: #f1eee2; border-left: 3px solid var(--earth); grid-column: 1 / -1; line-height: 1.35; margin: 0; padding: 5px 7px; white-space: pre-wrap; }
.hka-calibration { text-align: center; }
.hka-calibration span { display: block; margin-bottom: 3px; }
.hka-calibration i { border-top: 1px solid #111; display: block; width: 100mm; }
.hka-help { color: var(--muted); margin: 12px 2px 0; }

.content-section, .info-section { background: #fff; border: 1px solid #d4d7d0; border-radius: 18px; margin: 50px auto 0; max-width: 1180px; padding: clamp(26px, 5vw, 58px); }
.content-cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.content-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.content-card img { aspect-ratio: 16 / 9; display: block; object-fit: cover; width: 100%; }
.content-card-body { padding: 20px; }
.content-card-label { background: #efe5d9; border-radius: 999px; color: #664629; display: inline-block; font-size: 11px; font-weight: 800; margin-bottom: 10px; padding: 5px 9px; text-transform: uppercase; }
.content-card h2 { color: var(--forest); font-size: 23px; margin: 0 0 10px; }
.content-card p { line-height: 1.5; }
.content-card a { display: inline-block; font-weight: 800; margin-top: 8px; }
.content-card small { color: var(--muted); display: block; margin-top: 12px; }
.info-section h2 { color: var(--forest); font-size: clamp(28px, 4vw, 48px); margin: 0 0 24px; }
.info-section p, .info-section li { font-size: 17px; line-height: 1.62; }
.guide-section ol { display: grid; gap: 15px; padding-left: 26px; }
.contact-section { text-align: center; }
.contact-section a { font-size: 22px; font-weight: 800; }

.site-footer { background: #0d3425; color: #f4f1e7; padding: 34px max(24px, calc((100vw - 1500px) / 2)); }
.site-footer > div { align-items: center; display: flex; justify-content: space-between; }
.site-footer img { filter: brightness(0) invert(1); height: 44px; max-width: 220px; }
.site-footer p { font-size: 13px; line-height: 1.5; margin: 12px 0 0; }
.site-footer nav { display: flex; gap: 18px; margin-top: 16px; }
.site-footer a { color: #fff; font-size: 13px; }

[hidden] { display: none !important; }

@media (max-width: 1180px) {
  .hka-toolbar { grid-template-columns: repeat(3, 1fr); }
  .hka-search-field { grid-column: span 2; }
  .hka-note-field { grid-column: span 2; }
  .hka-actions { grid-column: span 1; }
}

@media (max-width: 720px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 12px 16px 14px;
    position: static;
  }
  .site-brand { align-self: center; max-width: 100%; }
  .site-brand img { height: auto; max-width: 100%; width: 320px; }
  .site-header nav { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
  .site-header nav a { background: #edf3ed; border-radius: 7px; padding: 9px 8px; text-align: center; }
  main { padding: 0 12px 42px; }
  .site-banner { border-radius: 8px; margin-top: 12px; }
  .intro { margin-top: 30px; }
  .intro h1 { font-size: 39px; }
  .trust-note { align-items: start; flex-direction: column; gap: 10px; }
  .hka-toolbar { grid-template-columns: 1fr 1fr; padding: 14px; }
  .hka-search-field, .hka-note-field, .hka-actions { grid-column: 1 / -1; }
  .hka-field select { font-size: 16px; }
  .hka-coordinate-readout { align-items: flex-start; flex-direction: column; gap: 5px; }
  .hka-sheet { aspect-ratio: auto !important; grid-template-rows: auto 620px auto; padding: 10px; }
  .hka-sheet-header h2 { font-size: 24px; }
  .hka-north-diagram { transform: scale(.86); transform-origin: top right; }
  .hka-attribution { font-size: 7px; max-width: 82%; }
  .hka-sheet-footer { grid-template-columns: 1fr; }
  .hka-calibration { display: none; }
  .content-section, .info-section { margin-top: 28px; padding: 28px 24px; }
  .info-section p, .info-section li { font-size: 16px; }
  .site-footer > div { align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media print {
  html, body { height: 0 !important; margin: 0 !important; overflow: visible !important; padding: 0 !important; }
  body.hka-printing * { visibility: hidden !important; }
  body.hka-printing #hka-sheet,
  body.hka-printing #hka-sheet * { visibility: visible !important; }
  body.hka-printing #hka-sheet {
    aspect-ratio: auto !important;
    border: 0 !important;
    box-shadow: none !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    height: var(--hka-paper-height) !important;
    left: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    max-width: none !important;
    padding: 8mm !important;
    position: fixed !important;
    top: 0 !important;
    width: var(--hka-paper-width) !important;
  }
  body.hka-printing .hka-map { min-height: 0 !important; }
  body.hka-printing .hka-zoom-controls,
  body.hka-printing .hka-map-status,
  body.hka-printing .hka-map-coordinate { display: none !important; }
  body.hka-printing .hka-sheet-header { padding-bottom: 2mm; }
  body.hka-printing .hka-sheet-header h2 { font-size: 16pt; }
  body.hka-printing .hka-sheet-header p { font-size: 8pt; }
  body.hka-printing .hka-north-diagram { transform: scale(.88); transform-origin: top right; }
  body.hka-printing .hka-sheet-footer { font-size: 7pt; gap: 1.5mm 4mm; padding-top: 2mm; }
  body.hka-printing .hka-print-note { max-height: 12mm; overflow: hidden; }
  body.hka-printing .hka-feature-label { font-size: 7pt; }
  body.hka-printing .hka-tile { transition: none; }
}
