﻿:root {
  --brand: #e95f3d;
  --brand-dark: #b83f27;
  --bg: #f6f2eb;
  --ink: #26211d;
  --muted: #756d64;
  --line: #dacfc2;
  --paper: #fffaf3;
  --visited: #e95f3d;
  --unvisited: #f1dcc9;
  --hover: #3f8c7a;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("assets/fonts/LINESeedSansTH_W_Rg.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("assets/fonts/LINESeedSansTH_W_Bd.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("assets/fonts/LINESeedSansTH_W_XBd.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "LINE Seed Sans TH", "Segoe UI", Tahoma, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 18px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.summary {
  display: grid;
  place-items: center;
  min-width: 150px;
  min-height: 88px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 40px rgba(73, 53, 37, 0.08);
  margin-top: 14px;
}

.summary span:first-child {
  color: var(--brand);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.summary span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: stretch;
}

.map-area,
.province-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.82);
  box-shadow: 0 18px 50px rgba(73, 53, 37, 0.08);
}

.map-area {
  position: relative;
  height: min(calc(76vh + 96px), 916px);
  min-height: 680px;
  padding: 0;
}

.map-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
}

.map-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

.map-toolbar strong {
  font-size: 18px;
}

.map-toolbar span {
  color: var(--muted);
  font-size: 14px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-format {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.92);
}

.share-format button {
  min-width: 46px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.share-format button.is-active {
  color: #fff;
  background: var(--ink);
}

.share-format button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

#shareButton,
#resetButton {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(184, 63, 39, 0.35);
  border-radius: 8px;
  color: var(--brand-dark);
  background: #fff5ef;
  cursor: pointer;
}

#shareButton {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

#shareButton:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

#shareButton:disabled {
  cursor: progress;
  opacity: 0.72;
}

#resetButton:hover {
  border-color: var(--brand);
  background: #ffe6db;
}



.map-zoom-controls {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-zoom-controls button {
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  color: var(--brand-dark);
  background: transparent;
  box-shadow: none;
  font-size: 22px;
  font-weight: 400;
  cursor: pointer;
}

.map-zoom-controls button:hover {
  color: var(--brand);
  background: transparent;
}

.map-zoom-controls button:active {
  transform: scale(0.96);
}

.map-legend {
  position: absolute;
  right: clamp(34px, 7vw, 92px);
  bottom: clamp(92px, 16vh, 176px);
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.legend-swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 2px solid #fffaf3;
  box-shadow: 0 0 0 1px rgba(38, 33, 29, 0.12);
}

.legend-visited {
  background: var(--visited);
}

.legend-unvisited {
  background: var(--unvisited);
}
#thailandMap {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 590px;
}

.province {
  fill: var(--unvisited);
  stroke: #fffaf3;
  stroke-width: 1.2;
  cursor: pointer;
  transition: fill 160ms ease, stroke 160ms ease, filter 160ms ease;
}

.province:hover,
.province:focus-visible {
  stroke: #3f8c7a;
  outline: none;
  filter: drop-shadow(0 4px 8px rgba(49, 82, 73, 0.25));
}

.province:focus {
  outline: none;
}

.province.visited {
  fill: var(--visited);
}

.province.visited:hover,
.province.visited:focus-visible {
  fill: var(--visited);
}

.province-panel {
  display: flex;
  flex-direction: column;
  height: min(calc(76vh + 96px), 916px);
  min-height: 680px;
  max-height: min(calc(76vh + 96px), 916px);
  padding: 16px;
}

.search-box {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.search-box input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(233, 95, 61, 0.16);
}

.progress-block {
  margin-bottom: 14px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.progress-label strong {
  color: var(--ink);
}

.progress-track {
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaded0;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #3f8c7a);
  transition: width 180ms ease;
}


.list-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.list-mode button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.list-mode button.is-active {
  color: #fff;
  background: var(--brand);
}

.next-province {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(233, 95, 61, 0.24);
  border-radius: 8px;
  background: #fff5ef;
}

.next-province span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.next-province strong {
  min-width: 0;
  font-size: 18px;
  line-height: 1.15;
}

.next-province button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(184, 63, 39, 0.35);
  border-radius: 8px;
  color: var(--brand-dark);
  background: #fffdf8;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.next-province button:disabled {
  cursor: default;
  opacity: 0.55;
}

.province-empty {
  padding: 18px 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.province-list {
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0 4px 0 0;
  overflow: auto;
  list-style: none;
}

.province-toggle {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.province-toggle:hover {
  border-color: var(--line);
  background: #fff7ef;
}

.province-toggle.is-visited {
  border-color: rgba(233, 95, 61, 0.28);
  background: #fff0e9;
}

.checkmark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #cdbfaf;
  border-radius: 6px;
  color: transparent;
  background: #fffdf8;
  font-size: 14px;
  font-weight: 800;
}

.is-visited .checkmark {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.province-name {
  display: grid;
  gap: 1px;
}

.province-name strong {
  font-size: 15px;
  line-height: 1.15;
}

.province-name span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .topbar,
  .map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .summary {
    width: 100%;
    min-height: 72px;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions button {
    flex: 1;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .map-area {
    height: min(68vh, 620px);
    min-height: 460px;
  }

  .province-panel {
    height: min(62vh, 540px);
    min-height: 430px;
    max-height: min(62vh, 540px);
  }

  .map-zoom-controls {
    left: 22px;
    bottom: 24px;
  }

  .map-legend {
    right: 22px;
    bottom: 38px;
    font-size: 14px;
  }

  #thailandMap {
    height: 100%;
    min-height: 340px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .map-area {
    padding: 0;
  }

  .province-panel {
    padding: 12px;
  }

  .map-area {
    height: min(64vh, 520px);
    min-height: 390px;
  }

  .province-panel {
    height: min(58vh, 460px);
    min-height: 360px;
    max-height: min(58vh, 460px);
  }

  .map-zoom-controls {
    left: 18px;
    bottom: 20px;
  }

  .map-zoom-controls button {
    min-width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .map-legend {
    right: 18px;
    bottom: 28px;
    gap: 8px;
  }

  #thailandMap {
    height: 100%;
    min-height: 260px;
  }

  .site-footer {
    flex-wrap: wrap;
    padding-top: 14px;
  }
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-brand {
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  padding: 4px 8px;
}

.footer-brand:hover {
  color: var(--ink);
  background: rgba(233, 95, 61, 0.09);
}

.policy-page {
  max-width: 860px;
}

.policy-content {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.82);
  box-shadow: 0 18px 50px rgba(73, 53, 37, 0.08);
  padding: 28px;
  color: var(--ink);
  line-height: 1.75;
}

.policy-content h2 {
  margin: 24px 0 6px;
  font-size: 20px;
}

.policy-content p {
  margin: 0 0 12px;
  color: var(--muted);
}

.policy-updated {
  padding-top: 12px;
  font-size: 13px;
}

