:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #68736c;
  --line: #dce3dd;
  --panel: #ffffff;
  --panel-soft: #f5f8f6;
  --green: #246b4a;
  --green-strong: #154d35;
  --amber: #a36218;
  --blue: #2f6f9f;
  --danger: #ad3d32;
  --shadow: 0 16px 40px rgba(23, 32, 27, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  background: #eef3ef;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  color: inherit;
  background: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  min-height: 100vh;
}

.map-stage {
  position: relative;
  container-type: inline-size;
  min-height: 100vh;
  background: #d9e7dc;
}

.topbar {
  position: absolute;
  z-index: 10;
  top: 18px;
  left: 18px;
  right: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 470px);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 227, 221, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  min-width: 0;
  height: 56px;
}

.brand-lockup > div {
  display: grid;
  align-content: center;
  min-width: 0;
}

.brand-logo {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

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

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

h1 {
  font-size: 24px;
  line-height: 1.2;
}

.brand-title-accent {
  color: var(--green-strong);
}

.topbar-meta {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.topbar-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  align-items: stretch;
  justify-self: end;
  width: 100%;
  min-width: 0;
  gap: 8px;
}

.topbar-meta span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 700;
  background: #e7f3ec;
  border: 1px solid #cfe3d6;
  border-radius: 8px;
}

.map-canvas {
  width: 100%;
  height: 100vh;
}

.map-empty {
  display: grid;
  place-content: center;
  height: 100%;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(90deg, rgba(36, 107, 74, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(36, 107, 74, 0.08) 1px, transparent 1px),
    #eef6f0;
  background-size: 42px 42px;
}

.map-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 20px;
}

.side-panel {
  display: grid;
  grid-template-rows: minmax(180px, 34vh) minmax(0, 1fr);
  gap: 12px;
  height: 100vh;
  padding: 14px;
  overflow: hidden;
  background: var(--panel-soft);
  border-left: 1px solid var(--line);
}

.course-list-panel,
.detail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

input,
select,
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.topbar-search input,
.topbar-search button {
  height: 44px;
}

input,
select {
  min-width: 0;
  width: 100%;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(47, 111, 159, 0.24);
  outline-offset: 1px;
}

#refreshButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  background: var(--green);
}

#currentLocationButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: #e7f3ec;
  border-color: #cfe3d6;
}

#currentLocationButton .location-icon {
  width: 21px;
  height: 21px;
  fill: currentColor;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#currentLocationButton.is-busy .location-icon {
  animation: location-spin 0.85s linear infinite;
}

#currentLocationButton:disabled {
  cursor: default;
  opacity: 0.66;
}

@keyframes location-spin {
  to {
    transform: rotate(360deg);
  }
}

.course-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.region-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

.region-select-wrap::after {
  position: absolute;
  right: 2px;
  width: 6px;
  height: 6px;
  content: "";
  border-right: 1.5px solid var(--green-strong);
  border-bottom: 1.5px solid var(--green-strong);
  pointer-events: none;
  transform: rotate(45deg) translateY(-3px);
}

.panel-title-group #regionSelect {
  appearance: none;
  width: auto;
  min-width: 56px;
  max-width: 116px;
  min-height: 32px;
  height: 32px;
  padding: 0 17px 0 0;
  color: var(--green-strong);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  background: transparent;
  border: 0;
  border-radius: 4px;
}

.panel-title-group #regionSelect::-ms-expand {
  display: none;
}

.panel-title-group #regionSelect:hover,
.panel-title-group #regionSelect:focus {
  background: #edf7f1;
}

.panel-heading h2 {
  font-size: 17px;
  white-space: nowrap;
}

.panel-heading span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.course-list {
  display: grid;
  gap: 7px;
  min-height: 0;
  align-content: start;
  padding: 8px;
  overflow: auto;
}

.course-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: auto;
  padding: 10px 11px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.course-item:hover,
.course-item.active {
  border-color: #87b99e;
  background: #f2f8f4;
}

.course-item strong {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.course-item .course-meta,
.course-item .small-muted {
  display: block;
  line-height: 1.35;
}

.course-item .small-muted {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.course-meta,
.small-muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.detail-panel {
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

.empty-detail {
  display: grid;
  place-content: center;
  gap: 6px;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
}

.empty-detail strong {
  color: var(--ink);
}

.detail-header {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-header h2 {
  font-size: 22px;
  line-height: 1.25;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge.warning {
  color: var(--amber);
  background: #fff4df;
  border-color: #f1d8a9;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.info-tile {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.info-tile.disabled {
  opacity: 0.62;
}

.nav-tile {
  background: #eef7fb;
  border-color: #cce4ef;
}

.nav-tile:hover {
  border-color: #7eb5cf;
  background: #e5f3f8;
}

.info-tile strong.nav-action {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: normal;
}

.nav-action-text {
  min-width: 0;
}

.nav-app-icon {
  display: inline-grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.nav-app-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.inavi-air-icon {
  color: #fff;
  background: #1f7a45;
  border-color: #13532f;
}

.kakao-map-icon {
  color: #211c00;
  background: #fee500;
  border-color: #f0d400;
}

.info-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.info-tile strong {
  display: block;
  margin-top: 4px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.info-tile .nav-app-icon {
  display: inline-grid;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.info-tile .kakao-map-icon {
  color: #211c00;
}

.info-tile .nav-action-text {
  display: inline;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.data-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.data-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: #edf3ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-tab {
  min-height: 36px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.data-tab.active {
  color: var(--green-strong);
  background: #fff;
  box-shadow: 0 1px 4px rgba(23, 32, 27, 0.08);
}

.data-panel {
  display: grid;
  gap: 10px;
}

.data-panel[hidden] {
  display: none;
}

.message {
  padding: 11px;
  color: var(--muted);
  background: #f7f8f7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.message.error {
  color: var(--danger);
  background: #fff2f0;
  border-color: #f2c8c2;
}

.restaurant-list,
.forecast-list {
  display: grid;
  gap: 8px;
}

.restaurant-item,
.forecast-item {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.restaurant-item a {
  color: var(--green-strong);
  font-weight: 800;
  text-decoration: none;
}

.restaurant-item .address-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.restaurant-item .address-link:hover {
  color: var(--green-strong);
}

.restaurant-item .phone-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.restaurant-item .phone-link:hover {
  color: var(--green-strong);
}

.weather-now {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.weather-now .info-tile:first-child {
  background: #eef7fb;
  border-color: #cce4ef;
}

.weather-tile {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
}

.weather-tile .weather-icon {
  grid-row: 1 / span 2;
}

.info-tile .weather-icon,
.forecast-item .weather-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--green-strong);
  background: #e7f3ec;
  border: 1px solid #cfe3d6;
  border-radius: 8px;
}

.weather-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.weather-icon-temperature {
  color: #9a4f16;
  background: #fff4df;
  border-color: #f1d8a9;
}

.weather-icon-rain,
.weather-icon-snow {
  color: var(--blue);
  background: #eef7fb;
  border-color: #cce4ef;
}

.weather-icon-wind {
  color: #5d6670;
  background: #f1f4f6;
  border-color: #d9e0e5;
}

.weather-icon-sunny {
  color: #a36218;
  background: #fff7d9;
  border-color: #ecd681;
}

.forecast-main {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.forecast-main strong {
  display: block;
  line-height: 1.25;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 54vh) auto;
  }

  .map-stage {
    min-height: 54vh;
  }

  .map-canvas {
    height: 54vh;
  }

  .side-panel {
    grid-template-rows: auto auto;
    height: auto;
    min-height: 46vh;
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }

  .course-list-panel {
    max-height: 320px;
  }
}

@container (max-width: 720px) {
  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    justify-content: stretch;
    gap: 10px;
    padding: 10px;
  }

  .brand-lockup {
    width: 44px;
    height: 44px;
    gap: 0;
  }

  .brand-lockup > div {
    display: none;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .topbar-search {
    grid-template-columns: minmax(0, 1fr) 42px 42px;
    gap: 6px;
  }

  .topbar-search input,
  .topbar-search button {
    height: 42px;
    min-height: 42px;
  }
}

@media (max-width: 640px) {
  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    justify-content: stretch;
    gap: 10px;
    padding: 10px;
  }

  .topbar-search,
  .topbar-meta {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .brand-lockup {
    width: 44px;
    height: 44px;
    gap: 0;
  }

  .brand-lockup > div {
    display: none;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .topbar-search {
    grid-template-columns: minmax(0, 1fr) 42px 42px;
    gap: 6px;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .info-grid,
  .weather-now {
    grid-template-columns: 1fr;
  }
}
