:root {
  --ink: #172026;
  --muted: #60707a;
  --line: #d7e0df;
  --paper: #f7f5ee;
  --surface: #ffffff;
  --green: #226b5f;
  --blue: #345f86;
  --amber: #c6842f;
  --rust: #9c4f35;
  --shadow: 0 18px 45px rgba(23, 32, 38, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Noto Sans KR", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 245, 238, 0.96)),
    var(--paper);
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 0;
}

.planner,
.results {
  padding: 28px;
}

.planner {
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid var(--line);
}

.brand-row,
.result-header,
.section-heading,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 31px;
}

h2 {
  font-size: 26px;
}

h3 {
  font-size: 18px;
}

.status-pill {
  padding: 7px 10px;
  border: 1px solid rgba(34, 107, 95, 0.25);
  border-radius: 999px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  background: #edf7f3;
}

.hero-visual {
  height: 180px;
  margin: 22px 0;
  border-radius: 8px;
  overflow: hidden;
  background: #dfe8e4;
  box-shadow: var(--shadow);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

label,
legend {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

select {
  width: 100%;
  height: 44px;
  margin-top: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.chip-grid label {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 600;
}

.chip-grid input {
  accent-color: var(--green);
}

button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
  cursor: pointer;
}

button.secondary {
  color: var(--blue);
  border-color: rgba(52, 95, 134, 0.35);
  background: #edf4fa;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(198, 132, 47, 0.35);
  outline-offset: 2px;
}

.results {
  display: grid;
  align-content: start;
  gap: 20px;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.view-tab {
  min-height: 40px;
  padding: 0 10px;
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  font-size: 14px;
}

.view-tab.is-active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.view-panel {
  display: none;
  align-content: start;
  gap: 20px;
}

.view-panel.is-active {
  display: grid;
}

.score-box {
  width: 86px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.score-box span {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.score-box small {
  font-size: 11px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary-item,
.place-card,
.day-plan,
.route-map-section,
.lodging-section,
.recommendation-section,
.selection-section,
.diagnosis-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(23, 32, 38, 0.06);
}

.summary-item {
  min-height: 78px;
  padding: 14px;
}

.summary-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 13px;
}

.summary-item span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

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

.day-plan {
  overflow: hidden;
}

.day-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.day-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.slot {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid #e8eeec;
}

.slot:last-child {
  border-bottom: 0;
}

.time {
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
}

.slot h4 {
  margin: 0 0 5px;
  font-size: 17px;
}

.slot p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.5;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  color: #41515a;
  background: #eef2f1;
  font-size: 12px;
  font-weight: 700;
}

.route-map-section,
.recommendation-section,
.selection-section,
.diagnosis-section {
  padding: 16px;
}

.route-map-section .section-heading,
.lodging-section .section-heading,
.recommendation-section .section-heading,
.selection-section .section-heading,
.diagnosis-section .section-heading {
  margin-bottom: 12px;
}

.route-map-section .section-heading span,
.lodging-section .section-heading span,
.recommendation-section .section-heading span,
.selection-section .section-heading span,
.diagnosis-section .section-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.route-map {
  min-height: 360px;
  border: 1px solid #dbe5e2;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(34, 107, 95, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(34, 107, 95, 0.07) 1px, transparent 1px),
    linear-gradient(135deg, #f8fbf8, #edf4f1);
  background-size: 42px 42px, 42px 42px, auto;
}

.route-map.is-live-map {
  background: #e9efec;
}

.route-map svg {
  width: 100%;
  height: 360px;
  display: block;
}

.live-map-canvas {
  width: 100%;
  height: 360px;
}

.map-area {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(96, 112, 122, 0.25);
  stroke-width: 1;
}

.map-area-label {
  fill: rgba(23, 32, 38, 0.38);
  font-size: 12px;
  font-weight: 800;
}

.route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.route-line-shadow {
  fill: none;
  stroke: rgba(23, 32, 38, 0.12);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 8;
}

.map-pin circle {
  stroke: #fff;
  stroke-width: 3;
}

.map-pin text {
  fill: #fff;
  font-size: 12px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: central;
}

.map-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #dbe5e2;
  background: rgba(255, 255, 255, 0.66);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.live-pin {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(23, 32, 38, 0.22);
  font-size: 12px;
  font-weight: 900;
}

.lodging-section {
  padding: 16px;
}

.lodging-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lodging-card {
  min-height: 190px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lodging-card h4 {
  margin: 0;
  font-size: 16px;
}

.lodging-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.lodging-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lodging-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.lodging-link:hover {
  text-decoration: underline;
}

.candidate-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.candidate-card,
.basket-item,
.diagnosis-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.candidate-card {
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.candidate-card.is-selected {
  border-color: rgba(34, 107, 95, 0.55);
  background: #f4faf7;
}

.candidate-top,
.basket-item,
.slot-actions,
.selection-actions,
.diagnosis-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.candidate-card h4,
.basket-item h4 {
  margin: 0;
  font-size: 16px;
}

.candidate-card p,
.diagnosis-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.candidate-card button,
.basket-item button,
.diagnosis-item button,
.slot-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.basket-list,
.diagnosis-list {
  display: grid;
  gap: 8px;
}

.basket-item {
  min-height: 56px;
  padding: 10px 12px;
}

.basket-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.selection-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.diagnosis-item {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.diagnosis-item strong {
  color: var(--ink);
}

.diagnosis-item.warning {
  border-color: rgba(156, 79, 53, 0.35);
  background: #fff7f3;
}

.diagnosis-item.good {
  border-color: rgba(34, 107, 95, 0.35);
  background: #f5fbf8;
}

.day-select {
  width: auto;
  min-width: 90px;
  height: 34px;
  margin: 0;
  padding: 0 8px;
  font-size: 13px;
}

.slot-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 10px;
}

.alternatives {
  display: grid;
  gap: 12px;
}

.place-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.place-card {
  min-height: 148px;
  padding: 14px;
}

.place-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.place-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.metric {
  color: var(--rust);
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .planner {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary,
  .place-list,
  .lodging-list,
  .candidate-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .planner,
  .results {
    padding: 18px;
  }

  .brand-row,
  .result-header {
    align-items: flex-start;
  }

  h1 {
    font-size: 27px;
  }

  h2 {
    font-size: 22px;
  }

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

  .view-tabs {
    grid-template-columns: 1fr;
  }

  .slot {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
