@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green:   #1b8c4e;
  --yellow:  #c47d00;
  --red:     #c0392b;
  --danger:  #7b0000;
  --bg:      #f5f7f5;
  --card:    #ffffff;
  --card2:   #f0f4f0;
  --border:  #d4e0d4;
  --text:    #1a2e1a;
  --muted:   #6b856b;
  --accent:  #2e7d32;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* HEADER */
header {
  position: relative;
  text-align: center;
  padding: 3rem 1rem 2rem;
  background: linear-gradient(180deg, #e8f5e9 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.settings-shell {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 20;
}

.settings-toggle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(20, 46, 20, 0.08);
}

.settings-toggle:hover {
  border-color: var(--accent);
  background: #eef7ee;
}

.settings-popover {
  margin-top: 0.5rem;
  width: min(92vw, 360px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  text-align: left;
  box-shadow: 0 14px 30px rgba(20, 46, 20, 0.16);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.logo-icon { font-size: 2.4rem; }

.logo-text {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -1px;
}

.tagline {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

/* MAIN */
main {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.results-main {
  max-width: 860px;
}

.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}

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

.planner-link {
  display: inline-block;
  margin-left: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.98rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  background: #fff;
  min-height: 42px;
}

.planner-link:hover {
  border-color: var(--accent);
}

/* SEARCH CARD */
.disclaimer-banner {
  background: #fff8e8;
  border: 1px solid #ead7a6;
  color: #6e560f;
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  font-size: 0.84rem;
  line-height: 1.45;
}

.search-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.search-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.search-row {
  display: flex;
  gap: 0.75rem;
}

.date-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.date-row label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.season-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
}

.season-banner label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

.settings-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.settings-group {
  margin-top: 0.5rem;
}

.settings-group-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 0.65rem;
}

.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  min-width: 0;
}

.settings-wide {
  grid-column: 1 / -1;
}

.settings-help {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}

.settings-grid select {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid #c8d6c8;
  background-color: #fff;
  background-image:
    linear-gradient(180deg, #ffffff 0%, #f7faf7 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231a2e1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, right 0.45rem center;
  background-size: 100% 100%, 14px;
  color: var(--text);
  border-radius: 999px;
  padding: 0.42rem 1.6rem 0.42rem 0.68rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.settings-grid input {
  border: 1.5px solid #c8d6c8;
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.42rem 0.68rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
}

.settings-grid input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.settings-grid select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.settings-saved-note {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
}

.season-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.season-row label {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
}

#seasonSelect {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid #c8d6c8;
  background-color: #fff;
  background-image:
    linear-gradient(180deg, #ffffff 0%, #f7faf7 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231a2e1a' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, right 0.55rem center;
  background-size: 100% 100%, 16px;
  color: var(--text);
  border-radius: 999px;
  padding: 0.5rem 2rem 0.5rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

#seasonSelect:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.12);
}

#seasonSelect:hover {
  border-color: #9fbe9f;
}

#seasonSelect:active {
  transform: translateY(1px);
}

#locationInput {
  flex: 1;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

#locationInput:focus {
  border-color: var(--accent);
}

#locationInput::placeholder {
  color: var(--muted);
}

#checkBtn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
  white-space: nowrap;
}

#checkBtn:hover { background: #43a047; }
#checkBtn:active { transform: scale(0.97); }

#nearMeBtn {
  background: #ffffff;
  color: var(--accent);
  border: 1.5px solid #9fbe9f;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, border-color 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

#nearMeBtn:hover {
  background: #eef7ee;
  border-color: var(--accent);
}

#nearMeBtn:active {
  transform: scale(0.97);
}

#hikeDateInput {
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  font-family: inherit;
}

#hikeDateInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* FEATURED HIKES */
.featured-section { display: flex; flex-direction: column; gap: 0.75rem; }

.featured-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.place-organizer {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto minmax(140px, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

.place-organizer label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#placeContinent,
#placeCountry {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid #c8d6c8;
  background-color: #fff;
  background-image:
    linear-gradient(180deg, #ffffff 0%, #f7faf7 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231a2e1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, right 0.45rem center;
  background-size: 100% 100%, 14px;
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 1.65rem 0.45rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

#placeContinent:hover,
#placeCountry:hover {
  border-color: #9fbe9f;
}

#placeContinent:focus,
#placeCountry:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

#placeContinent:active,
#placeCountry:active {
  transform: translateY(1px);
}

.place-count {
  justify-self: end;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 760px) {
  .place-organizer {
    grid-template-columns: 1fr 1fr;
  }

  .place-count {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 700px) { .featured-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .featured-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 380px) { .featured-grid { grid-template-columns: 1fr; } }

.hike-tab {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: center;
  font-family: inherit;
}

.hike-tab:hover {
  border-color: var(--accent);
  background: var(--card2);
  transform: translateY(-2px);
}

.hike-tab:active { transform: scale(0.97); }

.hike-tab.hidden-by-place {
  display: none;
}

.hike-tab.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.14);
}

.ht-icon  { font-size: 2rem; line-height: 1; }
.ht-name  { font-size: 0.88rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.ht-loc   { font-size: 0.75rem; color: var(--muted); }
.ht-season {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 700;
  background: #eef7ee;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.ht-reco {
  font-size: 0.66rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.25;
}

/* LOADING */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

/* ERROR */
.error-card {
  background: #fdecea;
  border: 1px solid #f5c6c3;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--red);
}

.error-icon { font-size: 1.5rem; }

/* RESULT CARD */
.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* VERDICT BADGE */
.verdict-badge {
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.verdict-badge.great    { background: #e8f5e9; color: var(--green);  border: 1.5px solid var(--green); }
.verdict-badge.okay     { background: #fff8e1; color: var(--yellow); border: 1.5px solid var(--yellow); }
.verdict-badge.bad      { background: #fdecea; color: var(--red);    border: 1.5px solid var(--red); }
.verdict-badge.dangerous { background: #fce4e4; color: var(--danger); border: 1.5px solid var(--danger); }

/* VERDICT MESSAGE */
.verdict-message {
  font-size: 1.05rem;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: var(--card2);
  border-left: 4px solid var(--accent);
}

.verdict-message.great    { border-color: var(--green); }
.verdict-message.okay     { border-color: var(--yellow); }
.verdict-message.bad      { border-color: var(--red); }
.verdict-message.dangerous { border-color: var(--danger); }

.recommend-box {
  background: #eef7ee;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.recommend-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.55rem;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.r-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.r-value {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 700;
  margin-top: 0.18rem;
}

/* RESULT TOP */
.result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.location-info {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.loc-pin { font-size: 1.3rem; margin-top: 2px; }

.location-info h2 {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
}

.location-info p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

.season-context {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* HERO */
.weather-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #e8f5e9, #f1f8f1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 2rem;
  gap: 1rem;
}

.hero-left { display: flex; flex-direction: column; gap: 0.3rem; }

.hero-temp {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  letter-spacing: -2px;
}

  .hero-temp-c {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0;
    margin-top: 0.15rem;
  }

.hero-feels {
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-range {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.hero-icon { font-size: 3.5rem; line-height: 1; }

.hero-condition {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

/* DETAIL GRID */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

@media (max-width: 620px) {
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .search-row  { flex-direction: column; }
  .date-row { flex-direction: column; align-items: flex-start; }
  .season-row { flex-direction: column; align-items: flex-start; }
  .weather-hero { flex-direction: column; text-align: center; }
  .recommend-grid { grid-template-columns: 1fr; }
  #checkBtn { width: 100%; }
  #locationInput { width: 100%; }
  #nearMeBtn { width: 100%; }
}

@media (max-width: 520px) {
  .season-banner {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .settings-shell {
    top: 0.65rem;
    right: 0.65rem;
  }

  .settings-toggle {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 760px) {
  .settings-popover {
    width: min(94vw, 400px);
  }
}

.detail-item {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.d-label { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.d-value { font-size: 1rem; font-weight: 700; color: var(--text); }

/* WARNINGS */
.warnings-list {
  background: #fdecea;
  border: 1px solid #f5c6c3;
  border-radius: 12px;
  padding: 1.25rem;
}

.warnings-list h3 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--red); }
.warnings-list ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.warnings-list li { color: #8b2020; font-size: 0.92rem; padding-left: 0.25rem; }
.warnings-list li::before { content: "• "; }

/* TIPS */
.tips-list {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.tips-list h3 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--accent); }
.tips-list ul  { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.tips-list li  { color: var(--text); font-size: 0.92rem; padding-left: 0.25rem; }
.tips-list li::before { content: "• "; color: var(--accent); }

/* STRONG RISK STATE */
.result-card.not-recommended {
  border-color: #f1b7b3;
  background: #fff7f7;
}

.result-card.not-recommended .weather-hero,
.result-card.not-recommended .recommend-box,
.result-card.not-recommended .detail-item,
.result-card.not-recommended .tips-list,
.result-card.not-recommended .chart-section,
.result-card.not-recommended .reviews-section {
  background: #fff1f1;
  border-color: #efc0bd;
}

.result-card.not-recommended .recommend-title,
.result-card.not-recommended .chart-title,
.result-card.not-recommended .tips-list h3 {
  color: #a52318;
}

.result-card.not-recommended .d-label,
.result-card.not-recommended .hero-feels,
.result-card.not-recommended .hero-range,
.result-card.not-recommended .hero-condition,
.result-card.not-recommended .reviews-note,
.result-card.not-recommended .tips-list li {
  color: #7a3230;
}

.result-card.not-recommended .tips-list li::before {
  color: #a52318;
}

/* ELEVATION NOTE */
.elevation-note {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

.disclaimer-note {
  margin: 0.55rem auto 0;
  max-width: 920px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #5f6f5f;
}

/* UTIL */
.hidden { display: none !important; }

/* CHART */
.chart-section {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.forecast-chart {
  width: 100%;
  overflow: hidden;
}

.planner-save-row {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.save-cal-btn {
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.save-cal-btn:hover {
  background: #1b5e20;
}

.save-cal-note {
  font-size: 0.82rem;
  color: #666;
  margin: 0;
}

.planner-calendar-wrap {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.planner-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.7rem;
}

.planner-calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 0.55rem;
}

.planner-day-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 0.55rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease;
}

.planner-day-btn:hover {
  border-color: var(--accent);
}

.planner-day-btn.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.14);
}

.planner-day-btn.risk-good {
  border-left: 4px solid #1b8c4e;
}

.planner-day-btn.risk-caution {
  border-left: 4px solid #c47d00;
}

.planner-day-btn.risk-bad {
  border-left: 4px solid #c0392b;
  background: #fff8f8;
}

.planner-day-week {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.planner-day-date {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 700;
}

.planner-day-risk {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
  margin-top: 0.1rem;
}

.planner-date-row {
  margin-top: 0;
}

.trip-basics-grid {
  align-items: end;
}

.planner-miles-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  font-family: inherit;
}

.planner-miles-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.trip-basics-note {
  margin-top: 0.6rem;
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .planner-calendar-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .planner-link {
    margin-left: 0;
    margin-top: 0.6rem;
  }
}

@media (max-width: 540px) {
  header {
    padding: 2.2rem 0.9rem 1.4rem;
  }

  .logo-text {
    font-size: 2.1rem;
  }

  .tagline {
    font-size: 0.92rem;
  }

  main {
    padding: 1.25rem 0.75rem;
    gap: 1rem;
  }

  .search-card,
  .result-card {
    padding: 1.2rem;
  }

  .weather-hero {
    padding: 1.2rem;
  }

  .hero-temp {
    font-size: 3.1rem;
  }

  .result-top {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width: 430px) {
  .planner-calendar-grid {
    grid-template-columns: 1fr;
  }

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

  .planner-day-btn {
    padding: 0.65rem;
  }

  .chart-section,
  .warnings-list,
  .tips-list,
  .reviews-section {
    padding: 0.9rem;
  }
}

.more-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.more-btn {
  align-self: flex-start;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.52rem 0.95rem;
  font-weight: 700;
  font-size: 0.86rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.more-btn:hover {
  border-color: var(--accent);
}

.more-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.more-btn:active {
  transform: translateY(1px);
}

.more-panel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 760px) {
  .more-grid {
    grid-template-columns: 1fr;
  }
}

.reviews-section {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.reviews-section h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.reviews-note {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 0.65rem;
}

.credibility-panel {
  background: #f6fbf6;
  border: 1px solid #cfe3cf;
  border-radius: 10px;
  padding: 0.7rem;
  margin-bottom: 0.65rem;
}

.credibility-panel h4 {
  font-size: 0.88rem;
  color: #2f4f2f;
  margin-bottom: 0.35rem;
}

.credibility-panel ul {
  list-style: none;
  display: grid;
  gap: 0.28rem;
}

.credibility-panel li {
  font-size: 0.81rem;
  color: #355335;
}

.credibility-panel li::before {
  content: "✓ ";
  color: #2e7d32;
}

.review-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.review-links a {
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.review-links a:hover {
  border-color: var(--accent);
}

.reviews-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.reviews-section li {
  color: var(--text);
  font-size: 0.9rem;
}

.reviews-section li::before {
  content: "• ";
  color: var(--accent);
}

.known-cautions {
  background: #fff7e8;
  border: 1px solid #ef9a2d;
  border-radius: 12px;
  padding: 1rem;
}

.known-cautions h3 {
  margin-bottom: 0.35rem;
  color: #8a3900;
}

.known-cautions-note {
  font-size: 0.84rem;
  color: #7a5130;
  margin-bottom: 0.65rem;
}

.known-cautions ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.hike-summary-box {
  background: #eef7ff;
  border: 1px solid #8bb8e8;
  border-radius: 12px;
  padding: 0.9rem;
}

.hike-summary-box .r-label {
  color: #234867;
}

.hike-summary-box .r-value {
  color: #0a2f4f;
  font-weight: 800;
}

.summary-controls {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.summary-controls label {
  font-size: 0.78rem;
  color: #234867;
  font-weight: 700;
}

.pace-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pace-btn {
  border: 1px solid #8bb8e8;
  background: #ffffff;
  color: #274766;
  border-radius: 999px;
  padding: 0.35rem 0.62rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.pace-btn:hover {
  border-color: #4b8fd1;
}

.pace-btn.active {
  background: #2d77bf;
  border-color: #2d77bf;
  color: #fff;
}

.summary-custom-wrap {
  display: grid;
  grid-template-columns: auto 120px;
  align-items: center;
  gap: 0.45rem;
}

.summary-custom-wrap label {
  font-size: 0.76rem;
  color: #234867;
}

.summary-custom-wrap input {
  border: 1px solid #8bb8e8;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
}

.summary-custom-wrap input:disabled {
  background: #f0f4f8;
  border-color: #c2d6ea;
  color: #7a8a99;
}

@media (max-width: 520px) {
  .summary-custom-wrap {
    grid-template-columns: 1fr;
  }
}

.known-caution {
  border: 1px solid #e0c39b;
  border-left: 6px solid #b0bec5;
  border-radius: 10px;
  background: #fff;
  padding: 0.65rem 0.7rem;
}

.known-caution.low {
  border-left-color: #2e7d32;
}

.known-caution.moderate {
  border-left-color: #f9a825;
}

.known-caution.high {
  border-left-color: #ef6c00;
}

.known-caution.critical {
  border-left-color: #c62828;
}

.known-caution-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.known-caution-top strong {
  color: var(--text);
  font-size: 0.9rem;
}

.known-caution-level {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #5d4037;
  background: #fff3e0;
  border: 1px solid #e0c39b;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  flex-shrink: 0;
}

.known-caution-detail {
  color: var(--text);
  font-size: 0.83rem;
  margin-bottom: 0.2rem;
}

.known-caution-action {
  color: #6d4c41;
  font-size: 0.8rem;
  font-weight: 700;
}

.safety-lifeline {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.lifeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.lifeline-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lifeline-card h4 {
  font-size: 0.92rem;
  color: var(--text);
}

.lifeline-card p {
  font-size: 0.84rem;
  color: var(--muted);
}

.lifeline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.route-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.map-embed {
  width: 100%;
  min-height: 250px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.lifeline-status {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 700;
}

.source-badge {
  font-size: 0.72rem;
  color: var(--text-muted, #666);
  margin-top: 0.5rem;
}
.source-badge a, .satellite-link {
  color: var(--accent, #2e7d32);
  text-decoration: underline dotted;
  font-weight: 600;
}
.source-badge a:hover, .satellite-link:hover {
  text-decoration: underline;
}
.source-note {
  font-size: 0.75rem;
  font-weight: normal;
  font-style: italic;
}

.lifeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.lifeline-list li {
  font-size: 0.82rem;
  color: var(--text);
}

.lifeline-list li::before {
  content: "• ";
  color: var(--accent);
}

.lifeline-list.compact li {
  line-height: 1.35;
}

.lifeline-fields {
  display: grid;
  gap: 0.25rem;
}

.lifeline-fields.two-col {
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.lifeline-fields label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.lifeline-fields input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
  font-family: inherit;
}

.lifeline-fields input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.essentials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

.essential-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  align-items: start;
  font-size: 0.84rem;
  color: var(--text);
}

.essential-item input {
  margin-top: 0.15rem;
}

@media (max-width: 760px) {
  .lifeline-grid {
    grid-template-columns: 1fr;
  }

  .lifeline-fields.two-col {
    grid-template-columns: 1fr;
  }
}
