:root {
  color-scheme: light;
  --ink: #282044;
  --subtle: #5d5472;
  --line: #e9e1f0;
  --paper: #fbf8ff;
  --card: #fff;
  --purple: #51348c;
  --lavender: #eee3ff;
  --pink: #fce0f2;
  --display: Georgia, 'Times New Roman', serif;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 88px; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #7250af; outline-offset: 4px; }
.shell { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: fixed; z-index: 5; top: 8px; left: 8px; background: #fff; padding: 10px 16px; transform: translateY(-160%); }
.skip:focus { transform: none; }
.top { position: sticky; top: 0; z-index: 2; background: #fbf8ff; border-bottom: 1px solid var(--line); }
.top-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; gap: 10px; align-items: center; font-weight: 760; text-decoration: none; }
.mark { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border-radius: 9px; background: var(--purple); color: var(--pink); font-size: 24px; line-height: 1; }
.share { display: inline-flex; align-items: center; gap: 7px; background: white; color: var(--ink); border: 1px solid #dcd0ea; border-radius: 8px; padding: 8px 13px; font-size: .875rem; font-weight: 700; }
.share:hover { background: var(--lavender); }
.hero { overflow: hidden; position: relative; isolation: isolate; margin-top: 28px; border-radius: 22px; background: linear-gradient(112deg,#f9d9eb 4%,#e8d9fa 48%,#d5e6ff 96%); color: var(--ink); padding: clamp(32px,6vw,76px); min-height: 395px; display: flex; align-items: center; }
.hero-copy { position: relative; z-index: 1; }
.hero h1, .trip-hero h1 { font: 400 clamp(3.8rem,9vw,7.75rem)/.87 var(--display); letter-spacing: -.075em; margin: 0; }
.hero p { color: #4e4065; max-width: 34ch; margin: 23px 0 23px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .875rem; color: #4e4065; }
.hero-stats strong { color: var(--purple); font-size: 1.15rem; margin-right: 3px; }
.globe-art { position: absolute; right: clamp(15px,9vw,145px); top: 50%; transform: translateY(-50%); width: min(38vw,370px); aspect-ratio: 1; }
.globe { position: absolute; inset: 4%; border: 1px solid #8d69c48c; border-radius: 50%; background: radial-gradient(circle at 60% 34%,#fff0f88c 0%,transparent 66%); transform: rotate(-22deg); }
.globe::before, .globe::after, .globe i { content: ''; position: absolute; border: 1px solid #9470c97a; border-radius: 50%; inset: 0 23%; }
.globe::after { inset: 0 42%; }
.globe i:nth-child(1) { inset: 17% 4%; }
.globe i:nth-child(2) { inset: 32% 0; }
.globe i:nth-child(3) { inset: 46% 0; }
.globe i:nth-child(4) { inset: -3% 48%; border: 0; background: #9470c97a; width: 1px; }
.globe i:nth-child(5) { inset: 33% -19%; transform: rotate(-15deg); border-color: #fce0f2b0; }
.globe-star, .small-star { position: absolute; color: var(--pink); font-size: clamp(2.25rem,6vw,5rem); top: -6%; right: -6%; line-height: 1; }
.small-star { top: 82%; right: auto; left: -3%; font-size: 1.5rem; }
.destinations { padding-block: 45px 56px; }
.destination-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.destination-head h2, .day-head h2 { margin: 0; line-height: 1.15; font: 400 clamp(1.9rem,4vw,2.65rem)/1.1 var(--display); letter-spacing: -.04em; }
.search { display: flex; gap: 9px; align-items: center; width: min(100%, 340px); min-height: 46px; padding: 0 13px; background: white; border: 1px solid #dccdeb; border-radius: 9px; color: var(--subtle); }
.search span { font-size: 1.45rem; line-height: 1; }
.search:focus-within { outline: 2px solid #7250af; outline-offset: 2px; }
.search input { min-width: 0; width: 100%; padding: 9px 0; border: 0; outline: none; background: transparent; color: var(--ink); }
.country-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; align-items: stretch; }
.country { --accent: #eee2fa; min-width: 0; border-radius: 14px; border: 1px solid var(--line); background: var(--card); padding: 17px; }
.country:target { outline: 2px solid #7250af; outline-offset: 3px; }
.country header { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0 0 7px; }
.country h3 { margin: 0; font-size: 1.1rem; line-height: 1.2; }
.country-mark { flex: none; display: grid; place-items: center; width: 39px; aspect-ratio: 1; border-radius: 8px; background: var(--accent); color: var(--purple); font-size: .875rem; font-weight: 770; }
.country ul, .day ul, .day ol, .day-nav ul { margin: 0; padding: 0; list-style: none; }
.country li + li { border-top: 1px solid var(--line); }
.country li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 6px 11px 3px; text-decoration: none; }
.country li a:hover { color: #593891; }
.country li a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.country strong { display: block; font-weight: 680; }
.country small { display: block; font-size: .875rem; color: var(--subtle); }
.footer { border-top: 1px solid var(--line); padding-block: 22px 28px; color: var(--subtle); font-size: .875rem; }
.breadcrumb { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; color: var(--subtle); font-size: .875rem; padding-block: 22px 15px; }
.breadcrumb a { color: var(--purple); text-underline-offset: 3px; }
.trip-hero { padding: clamp(24px,5vw,48px); border-radius: 17px; background: linear-gradient(112deg,#f9daee,#e8dcfa 55%,#deebff); color: var(--ink); }
.trip-hero h1 { font-size: clamp(2.7rem,7vw,5.7rem); line-height: .98; margin-top: 12px; overflow-wrap: anywhere; }
.trip-hero p { margin: 11px 0 0; color: #554770; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags a { background: #eee3ff; color: #48306f; text-decoration: none; font-size: .875rem; font-weight: 680; padding: 3px 9px; border-radius: 5px; }
.tags a:hover { background: var(--pink); }
.detail-grid { display: grid; grid-template-columns: minmax(185px,230px) minmax(0,1fr); align-items: start; gap: 24px; padding-block: 24px 56px; }
.day-nav { position: sticky; top: 92px; padding: 14px; max-height: calc(100dvh - 112px); overflow: auto; background: white; border: 1px solid var(--line); border-radius: 12px; }
.day-nav h2 { margin: 0 0 6px; font-size: 1rem; }
.day-nav a { display: block; padding: 5px 7px; border-radius: 6px; color: var(--purple); font-size: .875rem; text-decoration: none; }
.day-nav a:hover { background: var(--lavender); text-decoration: underline; }
.day { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.day + .day { margin-top: 16px; }
.day:target { border-color: #865abf; }
.day-head { display: flex; align-items: center; cursor: pointer; list-style: none; gap: 10px; padding: 15px 19px; background: #f2eafa; }
.day-head h2 { font-size: 1.65rem; flex: 1; }
.day-count { font-size: .875rem; color: var(--subtle); white-space: nowrap; }
.agenda-row { display: grid; grid-template-columns: minmax(104px,23%) minmax(0,1fr); gap: 15px; padding: 14px 19px; }
.agenda-row + .agenda-row { border-top: 1px solid var(--line); }
.time, .activity, .plan, dd { min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }
.time { color: #5f428c; font-weight: 650; font-size: .875rem; padding-top: 2px; }
.agenda-row:has(.time:empty) { grid-template-columns: minmax(0,1fr); }
.time:empty { display: none; }
.activity dl { display: flex; flex-wrap: wrap; gap: 7px 19px; margin: 7px 0 0; }
.activity dl:first-child { margin-top: 0; }
.activity dl div { max-width: 100%; }
.activity dt { font-size: .875rem; color: var(--subtle); font-weight: 650; }
.activity dd { margin: 0; }
.plan { font-weight: 580; }
.source-link { color: #563695; text-underline-offset: 3px; }
.empty { margin: 14px 19px; color: var(--subtle); }
.toast { z-index: 3; position: fixed; bottom: 14px; right: 20px; margin: 0; padding: 10px 14px; border-radius: 8px; color: white; background: var(--purple); box-shadow: 0 6px 22px #37265c26; }
@media (max-width: 890px) {
  .country-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .globe-art { right: 5%; }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 32px); }
  .hero { min-height: 335px; }
  .globe-art { opacity: .33; width: 46vw; right: -2%; top: 38%; }
  .destination-head { align-items: start; flex-direction: column; }
  .search { width: 100%; }
  .detail-grid { grid-template-columns: minmax(0,1fr); gap: 13px; }
  .day-nav { position: static; max-height: 180px; }
  .day-nav ul { display: flex; flex-wrap: wrap; gap: 3px 6px; }
}
@media (max-width: 430px) {
  .country-grid { grid-template-columns: minmax(0,1fr); }
  .agenda-row { grid-template-columns: minmax(0,1fr); gap: 4px; padding-inline: 13px; }
  .day-head { padding-inline: 13px; }
}

.hero {
  border: 1px solid #ebdaee;
  box-shadow: 0 16px 38px #a691ce19;
}
.hero h1 { color: #362252; }
.hero-stats span {
  padding: 5px 12px;
  border: 1px solid #ffffffb0;
  border-radius: 999px;
  background: #ffffff82;
}
.globe::before, .globe::after, .globe i { border-color: #9470c97a; }
.globe i:nth-child(5) { border-color: #875dbc91; }
.globe-star, .small-star {
  color: #7753ad;
  text-shadow: 0 0 22px #fff;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.filters button, .outline-button {
  background: white;
  border: 1px solid #ded1ed;
  color: var(--purple);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 650;
}
.filters button:hover, .outline-button:hover { background: var(--lavender); }
.filters button:active, .outline-button:active { transform: translateY(1px); }
.filters button[aria-pressed="true"] {
  border-color: #7045a8;
  background: #7045a8;
  color: white;
}
.country-grid { align-items: start; }
.country {
  border-top: 5px solid var(--accent);
  box-shadow: 0 6px 18px #6542820c;
}
.country:nth-child(3n + 1) { --accent: #f9deef; }
.country:nth-child(3n + 2) { --accent: #eaddfa; }
.country:nth-child(3n + 3) { --accent: #dceaff; }
.country li a { border-radius: 6px; transition: background 150ms; }
.country li a:hover { background: color-mix(in srgb, var(--accent) 44%, white); }
.country:only-child { grid-column: span 2; }
.schedule-tools { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.day:nth-of-type(3n + 1) { --day-bg: #f8e6f1; }
.day:nth-of-type(3n + 2) { --day-bg: #eee5fa; }
.day:nth-of-type(3n + 3) { --day-bg: #e7efff; }
.day-head { background: var(--day-bg, #eee5fa); }
.day-head:hover { background: color-mix(in srgb, var(--day-bg, #eee5fa) 83%, #c9abe5); }
.day-head:focus-visible { outline-offset: -4px; }
.day-head::-webkit-details-marker { display: none; }
.day-head::after {
  content: '+';
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #54338a;
  background: #ffffffa6;
  font-size: 1.15rem;
}
.day[open] > .day-head::after { content: '−'; }
@media (max-width: 430px) {
  .country:only-child { grid-column: auto; }
  .day-head h2 { font-size: 1.36rem; }
  .filters { gap: 6px; }
  .filters button { padding-inline: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .country li a { transition: none; }
}

.top-actions, .planner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.primary-button {
  display: inline-flex;
  align-items: center;
  background: #7045a8;
  color: white;
  border: 1px solid #7045a8;
  border-radius: 8px;
  padding: 8px 13px;
  font-size: .875rem;
  font-weight: 720;
  text-decoration: none;
}
.primary-button:hover { background: #573389; }
a.outline-button { display: inline-block; text-decoration: none; }
.trip-edit { margin-top: 12px; }

.visit-stat { margin-block: 18px; max-width: 360px; }
.visit-stat p { margin: 0 0 5px; color: var(--ink); font-weight: 650; }
.visit-stat strong { font-size: 1.45rem; color: #593494; }
.visit-stat progress { display: block; width: 100%; height: 10px; accent-color: #7045a8; }
.visit-stat small { display: block; margin-top: 5px; color: var(--subtle); font-size: .875rem; }
.visit-settings {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.visit-settings summary { padding: 12px 16px; cursor: pointer; color: var(--purple); font-weight: 670; }
.visit-panel { padding: 2px 16px 12px; }
.visit-panel label, .planner label { display: flex; flex-direction: column; gap: 4px; font-weight: 610; }
#visit-list {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,205px),1fr));
  max-height: 240px;
  overflow: auto;
  gap: 4px 8px;
}
#visit-list label { display: block; padding: 3px 5px; font-weight: 500; }
#visit-list label:has(:checked) { background: var(--lavender); border-radius: 5px; }
#visit-list input { accent-color: #7045a8; }
.visit-panel p { margin-bottom: 0; color: var(--subtle); font-size: .875rem; }

.planner { padding-bottom: 44px; }
.planner-bar, .planner-section, .share-box {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}
.planner-meta {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}
.planner-meta, .share-box {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  min-width: 0;
}
.planner-section { justify-content: space-between; align-items: center; }
.planner-section h2 { margin: 0; font: 400 2rem/1 var(--display); }
.planner-status { min-height: 1.5em; color: var(--purple); font-weight: 610; }
.planner input, .planner select, .planner textarea, #visit-search {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fdfaff;
  border: 1px solid #d8c9e9;
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  font-weight: 450;
}
#visit-search { max-width: 340px; }
.planner textarea { resize: vertical; }
.planner-bar label, .share-box label { flex: 1 1 240px; max-width: 100%; }
.danger { color: #922952; }
.danger:hover { background: #fae7f0; }
@media (max-width: 490px) {
  .top-inner { align-items: center; gap: 8px; }
  .top-actions { justify-content: end; }
  .brand { gap: 7px; }
  .top-actions button, .top-actions a { padding-inline: 8px; }
  .planner-meta { grid-template-columns: minmax(0,1fr); }
}

.country header h3 { width: 100%; }
.country-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.country-heading:hover .country-mark {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent);
}
.country-heading:hover .country-name { color: var(--purple); }

.flag-bubble {
  position: fixed;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 60px;
  aspect-ratio: 1;
  border: 1px solid #fff;
  border-radius: 50%;
  color: #433064;
  background:
    radial-gradient(circle at 26% 21%, #fff 0 5%, #ffffffad 6% 13%, transparent 14%),
    linear-gradient(145deg, #ffe1f3 6%, #e8d7ff 51%, #cce7ff 100%);
  box-shadow: 0 5px 18px #9065b642, inset 0 0 9px #fff8;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 28px;
  line-height: 1;
  pointer-events: none;
  animation: flag-float 1.15s ease-out both;
}
@keyframes flag-float {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.42); }
  18% { opacity: 1; transform: translate(-46%, -77%) scale(1.05) rotate(6deg); }
  75% { opacity: 1; transform: translate(-59%, -137%) scale(.96) rotate(-8deg); }
  100% { opacity: 0; transform: translate(-60%, -165%) scale(1.22) rotate(-10deg); }
}
@keyframes flag-fade {
  0%, 100% { opacity: 0; }
  15%, 75% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .flag-bubble {
    transform: translate(-50%, -100%);
    animation-name: flag-fade;
  }
}

.hero h1 {
  max-width: 9ch;
  font-size: clamp(3.2rem, 7.8vw, 6.8rem);
}
@media (max-width: 650px) {
  .hero h1 { font-size: clamp(2.55rem, 9.5vw, 4.7rem); }
  .top-inner { min-height: 68px; }
  .brand { line-height: 1.2; }
}
.brand .mark { flex: none; }

.tags a[data-flag] { transition: background 150ms, box-shadow 150ms; }
.tags a[data-flag]:hover { box-shadow: 0 0 0 2px #ffffffaa; }
@media (prefers-reduced-motion: reduce) {
  .tags a[data-flag] { transition: none; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.planner-grid {
  overflow: auto;
  margin: 10px 0 16px;
  background: white;
  border: 1px solid #dacbe9;
  border-radius: 9px;
}
.entry-table {
  width: 100%;
  min-width: 850px;
  table-layout: fixed;
  border-spacing: 0;
  font-size: .875rem;
}
.entry-table th {
  background: #eee3fb;
  color: #472773;
  text-align: left;
  font-weight: 720;
}
.entry-table th:nth-child(1) { width: 14%; }
.entry-table th:nth-child(2) { width: 11%; }
.entry-table th:nth-child(3) { width: 19%; }
.entry-table th:nth-child(4) { width: 22%; }
.entry-table th:nth-child(5) { width: 15%; }
.entry-table th:nth-child(6) { width: 10%; }
.entry-table th:nth-child(7) { width: 9%; }
.entry-table th, .entry-table td { border-inline-end: 1px solid #eadff4; }
.entry-table th:last-child, .entry-table td:last-child { border-inline-end: 0; }
.entry-table th { padding: 8px 9px; }
.entry-table td { padding: 0; border-top: 1px solid #eadff4; vertical-align: top; }
.entry-table tbody tr:nth-child(even) { background: #faf6ff; }
.entry-table tbody tr:focus-within { background: #f4eaff; }
.entry-table input, .entry-table textarea {
  display: block;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: .875rem;
  min-height: 41px;
  padding: 10px 9px;
}
.entry-table textarea { line-height: 1.45; }
.entry-table input:focus-visible, .entry-table textarea:focus-visible { outline-offset: -2px; }
.entry-table [data-delete-entry] {
  margin: 5px 7px;
  padding: 4px 8px;
  font-size: .81rem;
}
.entry-table-readonly { min-width: 670px; }
.entry-table-readonly td {
  padding: 8px 9px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.entry-table-readonly th:nth-child(4) { width: 30%; }
.entry-table-readonly th:nth-child(5) { width: 16%; }
