/* Disney Family Tracker */
:root {
  --purple: #5b3fd6; --purple-2: #7c5cd6; --pink: #e85d9a; --gold: #f0b030;
  --bg: #f7f5ff; --card: #ffffff; --text: #241d3d; --muted: #6f6a85;
  --border: #e5e0f5; --danger: #d63f3f; --ok: #2fa25c;
  --nav-h: 62px; --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow: 0 4px 18px rgba(60, 40, 140, .12);
}
[data-theme="dark"] {
  --bg: #171326; --card: #221c38; --text: #f0edff; --muted: #a49ec2;
  --border: #37305a; --shadow: 0 4px 18px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); user-select: none; }
.hidden { display: none !important; }
input, select, button { font: inherit; }
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #5b3fd6 0%, #8a4fd0 55%, #e85d9a 100%); z-index: 100; padding: 20px; }
.onboard-card { background: var(--card); border-radius: 24px; padding: 28px 24px; max-width: 380px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.35); text-align: center; max-height: 92vh; overflow-y: auto; }
.onboard-castle { font-size: 58px; }
.onboard-card h1 { margin: 6px 0 4px; font-size: 26px; }
.subtitle { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.onboard-step { text-align: left; }
.onboard-step label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
.onboard-step input { width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); outline: none; }
.onboard-step input:focus { border-color: var(--purple); }
.hint { color: var(--muted); font-weight: 400; font-size: 12px; }
.role-row { display: flex; gap: 8px; }
.role-btn { flex: 1; padding: 12px; border: 2px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); cursor: pointer; }
.role-btn.selected { border-color: var(--purple); background: rgba(91,63,214,.12); font-weight: 700; }
.privacy-note { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 14px; }
.btn-primary { width: 100%; padding: 14px; border: none; border-radius: 14px; margin-top: 16px; background: linear-gradient(90deg, var(--purple), var(--pink)); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: var(--shadow); }
.btn-secondary { padding: 11px 16px; border: 2px solid var(--purple); border-radius: 12px; background: transparent; color: var(--purple); font-weight: 600; cursor: pointer; width: 100%; margin-top: 8px; }
[data-theme="dark"] .btn-secondary { color: #b8a8ff; border-color: #b8a8ff; }
.btn-ghost { padding: 10px 16px; border: none; background: transparent; color: var(--muted); cursor: pointer; width: 100%; }
.btn-danger { width: 100%; padding: 16px; border: none; border-radius: 14px; background: var(--danger); color: #fff; font-weight: 800; font-size: 16px; cursor: pointer; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.tab { display: none; flex: 1; overflow-y: auto; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 10px); }
.tab.active { display: block; }
#tab-map { padding-bottom: 0; position: relative; }
.tab-header { padding: 14px 16px 4px; }
.tab-header h2 { margin: 0; font-size: 21px; }
.section { padding: 10px 16px; }
.section h3 { font-size: 14px; margin: 10px 0 8px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; background: var(--card); border-top: 1px solid var(--border); z-index: 50; }
.nav-btn { flex: 1; border: none; background: none; color: var(--muted); font-size: 20px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; position: relative; }
.nav-btn span { font-size: 10px; font-weight: 600; }
.nav-btn.active { color: var(--purple); }
[data-theme="dark"] .nav-btn.active { color: #b8a8ff; }
.badge { position: absolute; top: 6px; right: 22%; background: var(--pink); color: #fff; font-size: 10px; font-style: normal; border-radius: 10px; padding: 1px 5px; min-width: 16px; }
#map { position: absolute; inset: 0; z-index: 1; }
.map-topbar { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); left: 10px; right: 10px; z-index: 20; display: flex; gap: 8px; }
.map-topbar select { flex: 1; padding: 10px 12px; border-radius: 12px; border: none; background: var(--card); color: var(--text); box-shadow: var(--shadow); font-weight: 700; }
.map-topbar button { width: 44px; border-radius: 12px; border: none; background: var(--card); box-shadow: var(--shadow); font-size: 18px; cursor: pointer; }
.layers-panel { position: absolute; top: 64px; right: 10px; z-index: 21; background: var(--card); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.map-actions { position: absolute; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); right: 10px; left: 10px; z-index: 20; display: flex; gap: 8px; justify-content: flex-end; }
.fab { border: none; border-radius: 50px; background: var(--card); color: var(--text); box-shadow: var(--shadow); padding: 13px 15px; font-size: 17px; cursor: pointer; }
.fab-wide { background: linear-gradient(90deg, var(--purple), var(--pink)); color: #fff; font-weight: 700; font-size: 14px; margin-right: auto; }
.pin-chooser { position: absolute; bottom: calc(var(--nav-h) + var(--safe-b) + 70px); left: 10px; right: 10px; z-index: 22; background: var(--card); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); text-align: center; }
.pin-chooser p { margin: 2px 0 8px; font-size: 13px; }
#pin-type-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
#pin-type-row button { border: 2px solid var(--border); background: var(--bg); color: var(--text); border-radius: 10px; padding: 8px 10px; font-size: 13px; cursor: pointer; }
#pin-type-row button.selected { border-color: var(--purple); background: rgba(91,63,214,.12); }
.waitbar { position: absolute; top: 64px; left: 10px; z-index: 19; background: var(--card); border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow); font-size: 12px; max-width: 220px; }
.kid-marker { display: flex; flex-direction: column; align-items: center; }
.kid-dot { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.kid-label { background: rgba(0,0,0,.72); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-top: 2px; white-space: nowrap; }
.kid-stale .kid-dot { opacity: .55; filter: grayscale(.6); }
.poi-marker { font-size: 18px; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.pin-marker { font-size: 24px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.card-list { display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); cursor: pointer; }
.card .avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; flex-shrink: 0; }
.card .info { flex: 1; min-width: 0; }
.card .info b { display: block; font-size: 15px; }
.card .info small { color: var(--muted); font-size: 12px; }
.card .meta { text-align: right; font-size: 11px; color: var(--muted); }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; font-size: 14.5px; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--purple); }
.airtag-note { margin-top: 10px; line-height: 1.45; }
.airtag-note a { color: var(--purple); }
.danger-zone { margin-top: 16px; }
#tab-chat { display: none; flex-direction: column; }
#tab-chat.active { display: flex; }
.chat-log { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.35; user-select: text; }
.msg small { display: block; font-size: 10.5px; opacity: .7; margin-top: 2px; }
.msg.mine { align-self: flex-end; background: linear-gradient(90deg, var(--purple), var(--purple-2)); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: none; color: var(--muted); font-size: 12px; }
.quick-status-row { display: flex; gap: 6px; overflow-x: auto; padding: 6px 12px; }
.quick-status-row button { flex-shrink: 0; border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 20px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; }
.chat-input-row { display: flex; gap: 8px; padding: 8px 12px calc(var(--nav-h) + var(--safe-b) + 8px); }
.chat-input-row input { flex: 1; padding: 12px 14px; border: 2px solid var(--border); border-radius: 22px; background: var(--card); color: var(--text); outline: none; }
.chat-input-row .btn-primary { width: 48px; margin: 0; padding: 0; border-radius: 50%; }
.wait-row { display: flex; justify-content: space-between; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.wait-min { font-weight: 800; padding: 3px 10px; border-radius: 10px; color: #fff; font-size: 13px; }
.itin-add-row { display: flex; gap: 6px; margin-top: 8px; }
.itin-add-row input[type="time"] { width: 105px; }
.itin-add-row input { padding: 10px; border: 2px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); }
.itin-add-row input[type="text"] { flex: 1; min-width: 0; }
.itin-add-row .btn-secondary { width: auto; margin: 0; }
.itin-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.itin-row.done { opacity: .5; text-decoration: line-through; }
.itin-row b { font-variant-numeric: tabular-nums; }
.itin-row span { flex: 1; }
.itin-row button { border: none; background: none; font-size: 16px; cursor: pointer; }
.stub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stub { background: var(--card); border: 1px dashed var(--border); border-radius: 12px; padding: 14px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.alert-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--danger); color: #fff; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px; font-weight: 700; font-size: 14px; text-align: center; animation: slidedown .25s ease; }
.alert-banner.warn { background: var(--gold); color: #402d00; }
@keyframes slidedown { from { transform: translateY(-100%); } }
.sos-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(120, 10, 10, .93); display: flex; align-items: center; justify-content: center; padding: 24px; }
.sos-card { background: #fff; color: #222; border-radius: 20px; padding: 26px; text-align: center; max-width: 340px; width: 100%; }
.sos-icon { font-size: 52px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.15); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(20, 12, 50, .55); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--card); border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + var(--safe-b)); width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto; }
.modal h3 { margin: 0 0 12px; }
.modal label { display: block; font-weight: 600; font-size: 13px; margin: 10px 0 4px; }
.modal input[type="text"] { width: 100%; padding: 11px 13px; border: 2px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); }
.emoji-row, .color-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.emoji-row button { font-size: 22px; background: var(--bg); border: 2px solid var(--border); border-radius: 10px; padding: 6px 9px; cursor: pointer; }
.emoji-row button.selected { border-color: var(--purple); }
.color-row button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.color-row button.selected { border-color: var(--text); }
.name-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.name-chips button { border: 2px solid var(--border); background: var(--bg); color: var(--text); border-radius: 18px; padding: 7px 13px; font-size: 13.5px; cursor: pointer; }
.name-chips button.selected { border-color: var(--purple); background: rgba(91,63,214,.12); font-weight: 700; }
.resort-card { background: linear-gradient(135deg, rgba(91,63,214,.10), rgba(232,93,154,.10)); border: 2px solid var(--purple); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.resort-head { font-size: 16px; margin-bottom: 6px; }
.resort-list { margin: 0; padding-left: 4px; list-style: none; }
.resort-list li { font-size: 13px; margin: 6px 0; line-height: 1.4; }
.day-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.day-chip { flex-shrink: 0; border: 2px solid var(--border); background: var(--card); color: var(--text); border-radius: 12px; padding: 8px 12px; font-size: 12px; font-weight: 700; text-align: center; cursor: pointer; line-height: 1.5; }
.day-chip.selected { border-color: var(--purple); background: rgba(91,63,214,.12); }
.pb-detail { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-top: 8px; box-shadow: var(--shadow); }
.pb-head b { font-size: 15.5px; }
.pb-head small { display: block; color: var(--muted); margin: 2px 0 8px; }
.pb-buy { background: rgba(240,176,48,.14); border-left: 3px solid var(--gold); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 8px; line-height: 1.4; }
.pb-timeline { margin: 8px 0; }
.pb-row { display: flex; gap: 10px; padding: 5px 0; font-size: 13.5px; border-bottom: 1px dashed var(--border); }
.pb-row:last-child { border-bottom: none; }
.pb-row b { min-width: 52px; font-variant-numeric: tabular-nums; color: var(--purple); }
[data-theme="dark"] .pb-row b { color: #b8a8ff; }
.pb-list { font-size: 12.5px; color: var(--muted); margin: 8px 0; line-height: 1.5; }
.pb-list.swap { color: var(--text); }
.pb-flag { background: rgba(214,63,63,.10); border-left: 3px solid var(--danger); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; margin: 6px 0; line-height: 1.4; }
.pb-rules { margin-top: 10px; font-size: 14px; }
.pb-rules summary { cursor: pointer; font-weight: 600; }
.waitbar b { font-size: 12px; }
.upnext-row { padding: 3px 0; font-size: 12px; line-height: 1.35; }
.upnext-row b { color: var(--purple); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .upnext-row b { color: #b8a8ff; }
.popup-note { font-size: 12px; color: #555; display: inline-block; margin-top: 3px; line-height: 1.35; }
.popup-act { display: inline-block; margin-top: 6px; font-weight: 700; color: #5b3fd6; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.album-cell { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; cursor: pointer; box-shadow: var(--shadow); }
.album-cell img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 2; }
.album-cell span { position: absolute; bottom: 4px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; z-index: 3; }
.photo-marker { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.lightbox-img { width: 100%; border-radius: 14px; display: block; position: relative; z-index: 2; }
.memory-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; background: linear-gradient(135deg, rgba(91,63,214,.25), rgba(232,93,154,.25)); }
.memory-hero { position: relative; min-height: 120px; display: flex; align-items: center; justify-content: center; font-size: 64px; background: linear-gradient(135deg, rgba(91,63,214,.15), rgba(232,93,154,.15)); border-radius: 14px; overflow: hidden; }
.memory-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--card); }
.memory-marker { display: flex; align-items: center; justify-content: center; font-size: 22px; background: linear-gradient(135deg, rgba(91,63,214,.4), rgba(232,93,154,.4)); overflow: hidden; }
.memory-marker img { width: 100%; height: 100%; object-fit: cover; }
#tab-more details input { padding: 9px 11px; border: 2px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); margin: 2px 0 8px; }
#tab-more details summary { cursor: pointer; }
body.kidmode .nav-btn span { font-size: 13px; }
body.kidmode .bottom-nav { height: calc(78px + var(--safe-b)); }
body.kidmode .fab, body.kidmode .btn-primary, body.kidmode .btn-danger { font-size: 19px; padding: 18px; }
body.kidmode .nav-btn[data-tab="plan"], body.kidmode .nav-btn[data-tab="more"] { display: none; }
