:root {
  --night: #0f2741;
  --ink: #16283a;
  --paper: #fbfcfe;
  --sky: #dfeef8;
  --blue: #246a9a;
  --teal: #247b78;
  --amber: #efb34c;
  --danger: #c84235;
  --danger-dark: #8d2c25;
  --line: #cbd8e2;
  --muted: #5f7080;
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", Avenir, "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #d9e4eb; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.lock-screen { min-height: 100svh; display: grid; place-items: center; padding: 24px; color: white; background: var(--night); }
.lock-panel { width: min(100%, 430px); }
.passport-stamp { width: 94px; height: 94px; display: grid; grid-template-columns: 1fr 1fr; place-items: center; margin-bottom: 36px; border: 3px solid var(--amber); border-radius: 50%; transform: rotate(-7deg); color: var(--amber); }
.passport-stamp span { padding-left: 10px; font-size: 32px; font-weight: 900; }
.passport-stamp small { padding-right: 8px; font-size: 9px; font-weight: 800; line-height: 1.35; }
.lock-kicker { margin: 0 0 6px; color: #aec9dc; font-size: 12px; font-weight: 700; }
.lock-panel h1 { margin: 0; font-size: clamp(38px, 12vw, 56px); line-height: 1.08; letter-spacing: -.055em; }
.lock-panel > p:not(.lock-kicker) { margin: 16px 0 32px; color: #c6d5e1; font-size: 14px; line-height: 1.7; }
.lock-panel label { display: block; margin-bottom: 8px; color: #d6e3ec; font-size: 12px; font-weight: 750; }
.unlock-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.unlock-row input { min-width: 0; height: 52px; padding: 0 14px; color: white; background: #183854; border: 1px solid #4b6981; border-radius: 10px; font-size: 18px; }
.unlock-row button { min-width: 76px; color: var(--night); background: var(--amber); border: 0; border-radius: 10px; font-weight: 850; }
.lock-message { min-height: 20px; margin: 10px 0 0; color: #ffb0a8; font-size: 12px; }

.trip-app { width: min(100%, 620px); min-height: 100svh; margin: 0 auto; padding: 0 0 calc(88px + var(--safe-bottom)); background: var(--paper); box-shadow: 0 0 50px rgba(22,40,58,.12); }
.trip-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: calc(18px + env(safe-area-inset-top)) 20px 18px; color: white; background: var(--night); }
.trip-header p { margin: 0 0 3px; color: #a9c6da; font-size: 11px; font-weight: 750; }
.trip-header h1 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.header-action { min-width: 54px; height: 40px; color: white; background: transparent; border: 1px solid #59738a; border-radius: 20px; font-size: 12px; font-weight: 750; }

.flight-focus { padding: 14px 20px 15px; color: white; background: var(--danger); border-bottom: 5px solid var(--danger-dark); }
.flight-focus .focus-label { display: flex; justify-content: space-between; gap: 10px; color: #ffe1ba; font-size: 10px; font-weight: 850; }
.flight-focus strong { display: block; margin-top: 5px; font-size: 17px; line-height: 1.45; }
.flight-focus p { margin: 5px 0 0; color: #fff0eb; font-size: 11px; line-height: 1.5; }
.flight-focus.calm { color: var(--ink); background: var(--sky); border-bottom-color: #a9cddd; }
.flight-focus.calm .focus-label { color: var(--blue); }
.flight-focus.calm p { color: var(--muted); }

.stay-focus { display: grid; gap: 8px; padding: 12px 20px 13px; color: var(--ink); background: #edf6f3; border-bottom: 1px solid #bfd8d2; }
.stay-focus-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stay-focus-head span { color: var(--teal); font-size: 10px; font-weight: 900; }
.stay-focus-head button { padding: 4px 0; color: var(--blue); background: transparent; border: 0; font-size: 10px; font-weight: 850; }
.stay-focus-list { display: grid; gap: 7px; }
.stay-focus-item { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 0; color: var(--ink); background: transparent; border: 0; text-align: left; }
.stay-focus-item strong, .stay-focus-item small { display: block; }
.stay-focus-item strong { font-size: 14px; line-height: 1.35; }
.stay-focus-item small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.stay-focus-item > span:last-child { color: var(--blue); font-size: 11px; font-weight: 850; }
.stay-focus.empty { color: var(--muted); background: #f2f5f7; }

.schedule-section { padding: 24px 0 12px; }
.section-intro { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 0 20px; }
.section-intro p { margin: 0 0 3px; color: var(--teal); font-size: 10px; font-weight: 850; }
.section-intro h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.today-button { padding: 7px 9px; color: var(--blue); background: transparent; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; font-weight: 750; }

.day-tabs { display: flex; gap: 8px; margin: 18px 0 0; padding: 0 20px 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab { flex: 0 0 56px; min-height: 58px; display: grid; place-items: center; align-content: center; scroll-snap-align: center; color: var(--muted); background: #edf3f6; border: 0; border-radius: 14px; }
.day-tab strong { font-size: 13px; }
.day-tab small { margin-top: 2px; font-size: 9px; }
.day-tab.flight { border-bottom: 3px solid var(--danger); }
.day-tab[aria-selected="true"] { color: white; background: var(--night); box-shadow: 0 8px 18px rgba(15,39,65,.16); }

.day-view { min-height: 560px; margin-top: 7px; padding: 0 20px; }
.day-title { padding: 20px 0 15px; border-bottom: 2px solid var(--night); }
.day-title p { margin: 0 0 4px; color: var(--teal); font-size: 11px; font-weight: 800; }
.day-title h3 { margin: 0; font-size: 25px; line-height: 1.2; letter-spacing: -.035em; }
.day-alert { margin-top: 14px; padding: 13px 14px; color: white; background: var(--danger); border-left: 7px solid var(--danger-dark); }
.day-alert span { color: #ffe1ba; font-size: 10px; font-weight: 850; }
.day-alert strong { display: block; margin-top: 4px; font-size: 16px; line-height: 1.45; }

.agenda { margin: 0; padding: 8px 0 0; list-style: none; }
.agenda-item { position: relative; display: grid; grid-template-columns: 78px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid #dbe3e8; }
.agenda-item time { color: var(--blue); font-size: 12px; font-weight: 850; font-variant-numeric: tabular-nums; }
.agenda-item strong, .agenda-place { color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.4; }
.agenda-place { padding: 0; background: transparent; border: 0; border-bottom: 1px solid #8ab1cc; text-align: left; }
.agenda-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.agenda-item.required { margin: 4px -8px; padding: 12px 8px; background: #fff0e8; border: 1px solid #e8b9aa; border-left: 5px solid var(--danger); }
.agenda-item.required time { color: var(--danger-dark); }
.must-badge { display: inline-block; margin-left: 6px; padding: 2px 5px; color: white; background: var(--danger); font-size: 9px; font-weight: 850; vertical-align: 1px; }

.route-board { margin-top: 20px; padding: 16px 14px; background: #edf4f8; border-top: 4px solid var(--blue); }
.route-board > h4 { margin: 0; font-size: 15px; }
.route-board > p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.nav-route { margin-top: 15px; }
.nav-route + .nav-route { padding-top: 14px; border-top: 1px dashed #aec0cc; }
.nav-route-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.nav-route-head strong { color: var(--teal); font-size: 11px; }
.navigate-button { flex: 0 0 auto; padding: 7px 10px; color: white; background: var(--blue); border-radius: 8px; text-decoration: none; font-size: 10px; font-weight: 850; }
.route-line { display: flex; overflow-x: auto; margin: 11px 0 0; padding: 0 0 7px; list-style: none; scrollbar-width: thin; }
.route-stop { position: relative; flex: 1 0 116px; padding-right: 14px; }
.route-stop:not(:last-child)::after { content: ""; position: absolute; top: 10px; left: 25px; right: 3px; height: 2px; background: #8fa8b8; }
.route-number { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; color: white; background: var(--teal); border-radius: 50%; font-size: 10px; font-weight: 900; }
.route-place { display: block; width: 100%; margin-top: 6px; padding: 0; color: var(--ink); background: transparent; border: 0; text-align: left; }
.route-place strong { display: block; font-size: 11px; line-height: 1.35; }
.route-place small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.nav-note { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.day-note { margin-top: 14px; padding: 13px 14px; color: #34546a; background: #f5f8fa; font-size: 12px; line-height: 1.65; border-left: 3px solid var(--amber); }

.day-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px; }
.day-pager button { min-height: 44px; color: var(--night); background: white; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; font-weight: 800; }
.day-pager button:disabled { color: #a6b1b9; background: #eef2f4; }
footer { padding: 6px 20px 20px; color: var(--muted); font-size: 10px; line-height: 1.6; }
footer p { margin: 5px 0; }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 0; width: min(100%, 620px); display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 10px var(--safe-bottom); transform: translateX(-50%); background: rgba(251,252,254,.96); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
.bottom-nav button { min-height: 48px; color: var(--muted); background: transparent; border: 0; border-radius: 10px; }
.bottom-nav span, .bottom-nav small { display: block; }
.bottom-nav span { font-size: 13px; font-weight: 850; }
.bottom-nav small { margin-top: 1px; font-size: 8px; }
.bottom-nav button.active { color: white; background: var(--night); }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(6,18,29,.68); backdrop-filter: blur(3px); }
.bottom-sheet { width: min(100%, 620px); max-height: min(86svh, 760px); margin: auto auto 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); background: var(--paper); border: 0; border-radius: 20px 20px 0 0; }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 13px; background: #bcc8d0; border-radius: 2px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.sheet-head p { margin: 0; color: var(--danger); font-size: 10px; font-weight: 850; }
.sheet-head h2 { margin: 2px 0 0; font-size: 25px; }
.sheet-head button, .dialog-close { width: 42px; height: 42px; color: var(--muted); background: #edf2f5; border: 0; border-radius: 50%; font-size: 24px; }
.flight-list { margin-top: 14px; }
.flight-card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.flight-number { color: var(--danger); font-size: 18px; font-weight: 900; }
.flight-card h3 { margin: 0 0 3px; font-size: 14px; }
.flight-card p { margin: 3px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.flight-card .flight-action { color: var(--danger-dark); font-weight: 750; }
.sheet-lead { margin: 10px 0 4px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.stays-sheet .sheet-head p { color: var(--teal); }
.stay-list { margin-top: 8px; }
.stay-card { padding: 15px 0; border-top: 1px solid var(--line); }
.stay-card-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.stay-date { flex: 0 0 auto; padding: 4px 7px; color: var(--teal); background: #e0f0eb; border-radius: 7px; font-size: 9px; font-weight: 900; white-space: nowrap; }
.stay-place { min-width: 0; padding: 0; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid #8ab1cc; text-align: left; }
.stay-place strong, .stay-place small { display: block; }
.stay-place strong { font-size: 15px; line-height: 1.35; }
.stay-place small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.stay-card > p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.stay-card .room-line { color: var(--ink); font-weight: 700; }
.stay-status { display: inline-block; margin-top: 9px; padding: 3px 7px; color: white; background: var(--teal); font-size: 9px; font-weight: 850; }
.stay-card .communication-line { margin-top: 6px; padding-left: 9px; color: #34546a; border-left: 3px solid var(--amber); }
.tool-actions { display: grid; gap: 8px; margin: 16px 0 22px; }
.tool-actions button { min-height: 46px; color: var(--night); background: #e9f1f6; border: 0; border-radius: 10px; font-weight: 800; }
.place-search-label { display: block; margin-bottom: 7px; color: var(--teal); font-size: 11px; font-weight: 850; }
.place-search { width: 100%; height: 46px; padding: 0 13px; color: var(--ink); background: white; border: 1px solid #aebdca; border-radius: 10px; }
.place-results { margin-top: 10px; }
.place-result { width: 100%; display: grid; gap: 2px; padding: 12px 2px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.place-result strong { font-size: 13px; }
.place-result small { color: var(--muted); font-size: 10px; }

.place-dialog { width: min(calc(100% - 28px), 560px); max-height: 82svh; padding: 28px 20px 24px; background: var(--paper); border: 0; border-top: 7px solid var(--amber); border-radius: 8px; }
.dialog-close { position: absolute; top: 12px; right: 12px; }
.place-dialog > p { margin: 0 48px 5px 0; color: var(--teal); font-size: 11px; font-weight: 800; }
.place-dialog h2 { margin: 0 46px 20px 0; font-size: 28px; line-height: 1.2; }
.place-dialog dl { margin: 0; }
.place-dialog dt { margin-top: 14px; color: var(--teal); font-size: 10px; font-weight: 850; }
.place-dialog dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.place-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.place-actions a, .place-actions button { min-height: 43px; display: grid; place-items: center; color: var(--blue); background: #e7f0f6; border: 0; border-radius: 9px; text-decoration: none; font-size: 11px; font-weight: 850; }
.place-actions a { grid-column: 1 / -1; color: white; background: var(--blue); }
.place-context { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.place-context:empty { display: none; }
.place-context h3 { margin: 0 0 7px; font-size: 13px; }
.place-context p { margin: 5px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.place-context .status { display: inline-block; padding: 3px 6px; color: white; background: var(--teal); font-size: 9px; font-weight: 850; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(78px + var(--safe-bottom)); max-width: calc(100% - 36px); padding: 10px 14px; transform: translate(-50%, 12px); color: white; background: var(--night); border-radius: 20px; opacity: 0; pointer-events: none; transition: .18s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(36,106,154,.34); outline-offset: 2px; }
@media (min-width: 700px) {
  body { padding: 24px 0; }
  .trip-app { min-height: calc(100svh - 48px); border-radius: 22px; overflow: hidden; }
  .bottom-nav { bottom: 24px; border-radius: 0 0 22px 22px; }
  .bottom-sheet { margin-bottom: 24px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .toast { transition: none; } }
