@import url('https://fonts.googleapis.com/css2?family=Gowun+Dodum&family=Montserrat:wght@600;700;800&display=swap');

:root {
    --ink: #2f3038;
    --muted: #777783;
    --paper: #fffdf9;
    --cream: #f7efe8;
    --rose: #ef796f;
    --rose-light: #fee4df;
    --lavender: #ded8f5;
    --purple: #715caa;
    --sage: #b7ceb7;
    --blue: #a8d6dc;
    --line: #e9e1da;
    --shadow: 0 18px 45px rgba(75, 57, 45, .10);
}

* {
    box-sizing: border-box;
}

html {
    background: #e9e2dc;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: "Gowun Dodum", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

button,
a {
    font: inherit;
}

button {
    color: inherit;
}

.app-shell {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    background: var(--paper);
    box-shadow: 0 0 70px rgba(46, 39, 34, .13);
}

.hero {
    position: relative;
    overflow: hidden;
    padding: max(26px, env(safe-area-inset-top)) 22px 28px;
    border-radius: 0 0 38px 38px;
    background:
        radial-gradient(circle at 12% 20%, rgba(255,255,255,.8) 0 2px, transparent 3px),
        radial-gradient(circle at 84% 30%, rgba(255,255,255,.8) 0 3px, transparent 4px),
        linear-gradient(145deg, #f8e7de 0%, #eee7f6 100%);
}

.hero::after {
    position: absolute;
    right: -38px;
    bottom: -55px;
    width: 150px;
    height: 150px;
    border: 28px solid rgba(255,255,255,.32);
    border-radius: 50%;
    content: "";
}

.hero__topline,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.eyebrow {
    color: var(--purple);
    font-family: Montserrat, sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.ghost-button,
.round-button {
    border: 1px solid rgba(113, 92, 170, .22);
    background: rgba(255,255,255,.56);
}

.ghost-button {
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
}

.hero__names {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    margin-top: 24px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(32px, 9vw, 44px);
    font-weight: 400;
    letter-spacing: -.08em;
}

.hero h1 i {
    color: var(--rose);
    font-size: .58em;
    font-style: normal;
}

.pixel-person {
    position: relative;
    width: 26px;
    height: 34px;
    image-rendering: pixelated;
}

.pixel-person::before {
    position: absolute;
    top: 0;
    left: 6px;
    width: 15px;
    height: 14px;
    border: 3px solid #533e38;
    border-radius: 5px 5px 7px 7px;
    background: #f5c9ad;
    box-shadow: inset 0 4px #49372f;
    content: "";
}

.pixel-person::after {
    position: absolute;
    top: 15px;
    left: 4px;
    width: 19px;
    height: 16px;
    border-radius: 4px 4px 2px 2px;
    background: var(--purple);
    box-shadow: -4px 4px #533e38, 4px 4px #533e38;
    content: "";
}

.pixel-person--dahee::after {
    clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
    background: var(--rose);
}

.hero__date {
    margin: 9px 0 0;
    color: var(--muted);
    text-align: center;
}

.countdown {
    width: fit-content;
    margin: 14px auto 0;
    padding: 7px 14px;
    border-radius: 999px;
    color: #fff;
    background: var(--ink);
    font-family: Montserrat, sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.hero__chips {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 22px;
}

.hero__chips span {
    padding: 9px 6px;
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 13px;
    background: rgba(255,255,255,.46);
    font-size: 11px;
    text-align: center;
}

main {
    padding: 25px 18px calc(102px + env(safe-area-inset-bottom));
}

.view {
    display: none;
    animation: fade-up .32s ease both;
}

.view.is-active {
    display: block;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-heading {
    margin: 2px 2px 18px;
}

.section-heading--compact {
    margin-top: 28px;
}

.section-heading h2 {
    margin: 3px 0 0;
    font-size: 23px;
    font-weight: 400;
    letter-spacing: -.05em;
}

.round-button {
    flex: 0 0 auto;
    width: 39px;
    height: 39px;
    border-radius: 50%;
    font-size: 20px;
}

.alert-card,
.today-card,
.safety-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    border-radius: 22px;
}

.alert-card {
    padding: 15px;
    border: 1px solid #f7c9c1;
    background: #fff7f3;
}

.alert-card__icon {
    display: grid;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--rose);
    font-family: Montserrat, sans-serif;
    font-weight: 800;
}

.alert-card strong,
.safety-card strong {
    font-size: 14px;
}

.alert-card p,
.safety-card p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.today-card {
    position: relative;
    overflow: hidden;
    flex-direction: column;
    margin-top: 14px;
    padding: 23px;
    color: #fff;
    background: #3f4d4a;
    box-shadow: var(--shadow);
}

.today-card::after {
    position: absolute;
    right: -24px;
    bottom: -32px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(183, 206, 183, .18);
    content: "";
}

.today-card .eyebrow {
    color: #d9ead9;
}

.today-card h3 {
    margin: 6px 0 7px;
    font-size: 23px;
    font-weight: 400;
}

.today-card p {
    margin: 0;
    color: rgba(255,255,255,.72);
    font-size: 13px;
    line-height: 1.7;
}

.primary-button {
    position: relative;
    z-index: 1;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    color: var(--ink);
    background: #fff;
    font-size: 13px;
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.mini-stats div {
    padding: 14px 7px;
    border: 1px solid var(--line);
    border-radius: 17px;
    text-align: center;
}

.mini-stats strong,
.mini-stats span {
    display: block;
}

.mini-stats strong {
    color: var(--purple);
    font-family: Montserrat, sans-serif;
    font-size: 18px;
}

.mini-stats span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.highlight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.highlight-card {
    min-height: 162px;
    padding: 18px;
    border-radius: 24px;
    background: var(--blue);
}

.highlight-card:last-child {
    grid-column: 1 / -1;
    min-height: 130px;
}

.highlight-card--lake { background: #cbd9c7; }
.highlight-card--alpine { background: #ddd5f0; }

.highlight-card span,
.highlight-card strong,
.highlight-card small {
    display: block;
}

.highlight-card span {
    font: 800 9px Montserrat, sans-serif;
    letter-spacing: .1em;
}

.highlight-card strong {
    margin-top: 26px;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.35;
}

.highlight-card small {
    margin-top: 9px;
    color: rgba(47,48,56,.64);
    font: 600 10px Montserrat, sans-serif;
}

.date-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -18px 18px;
    padding: 2px 18px 8px;
    scrollbar-width: none;
}

.date-strip::-webkit-scrollbar {
    display: none;
}

.date-button {
    flex: 0 0 57px;
    padding: 9px 4px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fff;
    text-align: center;
}

.date-button span,
.date-button strong {
    display: block;
}

.date-button span {
    color: var(--muted);
    font-size: 10px;
}

.date-button strong {
    margin-top: 3px;
    font: 700 16px Montserrat, sans-serif;
}

.date-button.is-active {
    border-color: var(--ink);
    color: #fff;
    background: var(--ink);
    box-shadow: 0 8px 18px rgba(47,48,56,.2);
}

.day-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
}

.day-head h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 400;
}

.day-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.day-badge,
.status-badge,
.save-state,
.progress-pill {
    border-radius: 999px;
    font-size: 10px;
}

.day-badge {
    padding: 6px 10px;
    color: #5b4b90;
    background: var(--lavender);
}

.day-note {
    margin-bottom: 14px;
    padding: 13px 15px;
    border-left: 3px solid var(--rose);
    border-radius: 0 14px 14px 0;
    color: #6b5854;
    background: #fff5f1;
    font-size: 12px;
    line-height: 1.6;
}

.timeline {
    position: relative;
}

.timeline::before {
    position: absolute;
    top: 18px;
    bottom: 24px;
    left: 19px;
    width: 1px;
    background: var(--line);
    content: "";
}

.event-card {
    position: relative;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    margin-bottom: 11px;
}

.event-icon {
    z-index: 1;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 5px solid var(--paper);
    border-radius: 50%;
    background: var(--rose-light);
    font-size: 15px;
}

.event-body {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: #fff;
}

.event-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.event-time {
    color: var(--purple);
    font: 700 11px Montserrat, sans-serif;
}

.status-badge {
    padding: 4px 8px;
    background: #edf3ec;
}

.status-badge--fixed { color: #35634d; background: #e2f0e4; }
.status-badge--check { color: #9b5d35; background: #fff0d9; }

.event-body h4 {
    margin: 7px 0 4px;
    font-size: 16px;
    font-weight: 400;
}

.event-body > p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.event-actions {
    display: flex;
    gap: 7px;
    margin-top: 11px;
}

.event-actions a,
.plan-link {
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--ink);
    background: var(--cream);
    font-size: 10px;
    text-decoration: none;
}

.plan-box {
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px dashed var(--line);
}

.plan-tabs {
    display: flex;
    gap: 6px;
}

.plan-tab {
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font: 700 9px Montserrat, sans-serif;
}

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

.plan-copy {
    margin: 9px 0 0;
    color: #5d5c65;
    font-size: 11px;
    line-height: 1.6;
}

.save-state,
.progress-pill {
    padding: 6px 10px;
    color: var(--muted);
    background: var(--cream);
}

.map-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(#eaf5f5, #f9f4ec);
    box-shadow: var(--shadow);
}

.trip-map {
    display: block;
    width: 100%;
    height: min(64vh, 690px);
}

.island {
    fill: #f8f0df;
    stroke: #d7c8ad;
    stroke-width: 2;
    filter: url(#paperShadow);
}

.route-line,
.flight-hop {
    fill: none;
    stroke-linecap: round;
}

.route-line {
    stroke: url(#routeGradient);
    stroke-width: 5;
    stroke-dasharray: 1;
}

.flight-hop {
    stroke: #8a82a8;
    stroke-width: 2;
    stroke-dasharray: 5 8;
}

.map-stop circle {
    fill: #fff;
    stroke: var(--rose);
    stroke-width: 4;
}

.map-stop text {
    fill: var(--ink);
    font-family: "Gowun Dodum", sans-serif;
    font-size: 12px;
    paint-order: stroke;
    stroke: rgba(255,255,255,.92);
    stroke-width: 5px;
    stroke-linejoin: round;
}

.travelers {
    offset-path: path("M230 118 C220 143 209 171 218 205 C225 245 225 284 198 326 C176 360 158 397 143 441 C128 483 112 524 92 566");
    offset-distance: 0%;
}

.trip-map.is-animating .travelers {
    animation: travel-route 8s cubic-bezier(.4,0,.2,1) forwards;
}

.trip-map.is-animating .route-line {
    animation: draw-route 7s ease forwards;
}

@keyframes travel-route {
    0% { offset-distance: 0%; }
    100% { offset-distance: 100%; }
}

@keyframes draw-route {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

.map-person rect,
.map-person path {
    fill: var(--purple);
    stroke: #3e354f;
    stroke-width: 1;
}

.map-person--dahee rect,
.map-person--dahee path {
    fill: var(--rose);
}

.map-person circle {
    fill: #fff;
}

.map-legend {
    display: flex;
    gap: 14px;
    padding: 0 18px 17px;
    color: var(--muted);
    font-size: 10px;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 50%;
}

.legend-dot--fixed { background: var(--rose); }
.legend-dot--idea { background: var(--purple); }

.route-list {
    margin-top: 16px;
}

.route-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
}

.route-item__number {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--ink);
    font: 700 10px Montserrat, sans-serif;
}

.route-item strong,
.route-item small {
    display: block;
}

.route-item strong {
    font-size: 13px;
    font-weight: 400;
}

.route-item small,
.route-item > span:last-child {
    color: var(--muted);
    font-size: 10px;
}

.progress-track {
    height: 8px;
    margin-bottom: 19px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--cream);
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--rose), var(--purple));
    transition: width .25s ease;
}

.check-group {
    margin-bottom: 18px;
}

.check-group h3 {
    margin: 0 0 8px 4px;
    font-size: 14px;
    font-weight: 400;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.check-item input {
    position: absolute;
    opacity: 0;
}

.check-mark {
    display: grid;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid #cbc3bd;
    border-radius: 8px;
    color: transparent;
    transition: .2s ease;
}

.check-item input:checked + .check-mark {
    border-color: var(--purple);
    color: #fff;
    background: var(--purple);
}

.check-label strong,
.check-label small {
    display: block;
}

.check-label strong {
    font-size: 13px;
    font-weight: 400;
}

.check-label small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.check-item input:checked ~ .check-label strong {
    color: var(--muted);
    text-decoration: line-through;
}

.safety-card {
    margin-top: 22px;
    padding: 17px;
    background: #edf4ed;
}

.safety-card > span {
    font-size: 26px;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 12px;
}

.quick-links a {
    padding: 10px 5px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ink);
    font-size: 10px;
    text-align: center;
    text-decoration: none;
}

.bottom-nav {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 9px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(47,48,56,.08);
    background: rgba(255,253,249,.92);
    backdrop-filter: blur(18px);
}

.bottom-nav button {
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 10px;
}

.bottom-nav span {
    display: block;
    height: 25px;
    font-size: 20px;
}

.bottom-nav button.is-active {
    color: var(--purple);
}

.toast {
    position: fixed;
    z-index: 40;
    bottom: calc(84px + env(safe-area-inset-bottom));
    left: 50%;
    max-width: calc(100% - 40px);
    padding: 10px 16px;
    border-radius: 999px;
    color: #fff;
    background: rgba(47,48,56,.94);
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: .24s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (min-width: 521px) {
    body { padding: 24px 0; }
    .app-shell { min-height: calc(100vh - 48px); border-radius: 34px; overflow: hidden; }
    .bottom-nav { bottom: 24px; border-radius: 0 0 34px 34px; }
    .hero { border-radius: 0 0 38px 38px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
