:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #13273a;
  background: #edf3f5;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; background: #edf3f5; }

button, a { font: inherit; }

button { cursor: pointer; }

button:focus-visible, a:focus-visible {
  outline: 3px solid #e08a36;
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  background: #f8fbfc;
}

.app-header { padding: 32px 20px 20px; background: linear-gradient(140deg, #173b5c, #256b81); color: #fff; }
.eyebrow { margin: 0 0 6px; color: #c8e8e8; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.75rem, 7vw, 2.35rem); letter-spacing: -.04em; }
.header-summary { margin: 8px 0 0; color: #dceff0; }

main { padding: 18px 16px 28px; }
.view-heading { margin: 0 0 14px; font-size: 1.15rem; }
.day-card { margin: 0 0 16px; border: 1px solid #dce6e9; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 3px 14px rgba(18, 48, 64, .06); }
.day-card h2 { margin: 0; padding: 15px 16px; background: #e9f5f3; color: #174958; font-size: 1rem; }
.place-list { margin: 0; padding: 0; list-style: none; }
.place-row { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 0; border-top: 1px solid #edf1f2; background: #fff; color: inherit; text-align: left; }
.place-row:hover { background: #f5fbfa; }
.place-count { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #d5ebe8; color: #174958; font-size: .8rem; font-weight: 800; }
.place-name { font-weight: 750; }
.place-meta { display: block; margin-top: 2px; color: #667a83; font-size: .82rem; }
.saved-place-row { display: flex; align-items: stretch; border-top: 1px solid #edf1f2; }
.saved-place-row .place-row { border-top: 0; }
.text-button { flex: 0 0 auto; margin: 8px 10px 8px 0; padding: 0 4px; border: 0; background: transparent; color: #a94632; font-size: .85rem; font-weight: 750; }
.add-place-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding: 14px; border: 1px solid #dce6e9; border-radius: 14px; background: #fff; box-shadow: 0 3px 14px rgba(18, 48, 64, .06); }
.add-place-form h3, .add-place-form label:first-of-type, .add-place-form .action-button { grid-column: 1 / -1; }
.add-place-form h3 { margin: 0; color: #174958; font-size: .95rem; }
.add-place-form label { display: grid; gap: 4px; color: #49626c; font-size: .78rem; font-weight: 700; }
.add-place-form input { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid #c9d9dd; border-radius: 8px; color: inherit; font: inherit; }
.add-place-form .action-button { min-height: 40px; background: #174958; color: #fff; }

.map-intro, .empty-state { margin: 0 0 14px; color: #557079; }
.map-schematic { position: relative; min-height: 390px; overflow: hidden; border: 1px solid #c9e1e2; border-radius: 22px; background: linear-gradient(135deg, #e5f4e9 0 50%, #cdebf2 50%); }
.map-schematic::before { content: "Dalian coast"; position: absolute; right: 18px; bottom: 20px; color: #37778a; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; transform: rotate(-20deg); }
.map-schematic::after { content: ""; position: absolute; inset: 16% 8%; border: 2px dashed rgba(37, 107, 129, .35); border-radius: 50% 35% 45% 30%; transform: rotate(-11deg); }
.map-place { position: absolute; z-index: 1; width: 44px; min-height: 44px; padding: 4px; border: 2px solid #fff; border-radius: 50%; background: #d96842; color: #fff; box-shadow: 0 2px 8px rgba(22, 48, 61, .28); font-size: .7rem; font-weight: 800; line-height: 1; }
.map-place.is-selected { background: #173b5c; transform: scale(1.12); }
.map-place:hover { background: #a94632; }

.detail-sheet { margin-top: -18px; position: relative; z-index: 2; border: 1px solid #dce6e9; border-radius: 22px; padding: 20px; background: #fff; box-shadow: 0 5px 20px rgba(20, 47, 62, .14); }
.detail-sheet h2 { margin: 0; font-size: 1.35rem; }
.area-tag { display: inline-block; margin: 8px 0; padding: 4px 9px; border-radius: 999px; background: #e9f5f3; color: #174958; font-size: .8rem; font-weight: 750; }
.detail-note { margin: 4px 0 16px; color: #49626c; line-height: 1.55; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.action-button, .action-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 12px; border: 1px solid #2d6c7f; border-radius: 10px; background: #fff; color: #174958; font-weight: 750; text-align: center; text-decoration: none; }
.action-button:hover, .action-link:hover { background: #edf8f6; }
.favourite-button { grid-column: span 2; border-color: #d96842; color: #a94632; }
.favourite-button.is-favourite { background: #fff3ed; }

.bottom-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, 1fr); min-height: calc(64px + env(safe-area-inset-bottom)); padding: 4px max(8px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid #d6e2e5; background: rgba(255,255,255,.96); box-shadow: 0 -2px 12px rgba(20, 47, 62, .08); backdrop-filter: blur(10px); }
.nav-button { min-height: 52px; display: grid; place-content: center; gap: 2px; border: 0; border-radius: 11px; background: transparent; color: #58717b; font-size: .76rem; font-weight: 750; }
.nav-button > span:first-child { font-size: 1.15rem; line-height: 1; }
.nav-button.is-active { background: #e7f4f1; color: #174958; }
.toast { position: fixed; z-index: 10; right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 16px; max-width: 360px; margin: auto; padding: 11px 14px; border-radius: 10px; background: #173b5c; color: #fff; box-shadow: 0 5px 18px rgba(10, 35, 50, .25); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (min-width: 681px) {
  .app-shell { width: 680px; margin: 0 auto; box-shadow: 0 0 40px rgba(18, 48, 64, .14); }
  .bottom-nav { width: 680px; right: auto; left: 50%; transform: translateX(-50%); }
}

@media (max-width: 360px) { .detail-actions { grid-template-columns: 1fr; } .favourite-button { grid-column: auto; } }
