:root {
  --bg: #f6f7f4; --surface: #ffffff; --soft: #eef2ee; --border: #dfe5e0;
  --text: #18221c; --muted: #64746b; --primary: #15803d; --primary-soft: #e6f4ea;
  --hs: #e11d48; --hs-soft: #ffe4e8; --star: #f59e0b; --star-soft: #fffbeb;
  --done-bg: #f3f5f4; --radius: 14px; --shadow: 0 2px 10px rgba(15, 23, 20, 0.06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
a { text-decoration: none; color: inherit; }
button, input { font-family: inherit; }

.app-shell { height: 100%; display: flex; flex-direction: column; }
.topbar { flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 15px; }
.brand-dot { width: 28px; height: 28px; border-radius: 9px; background: var(--hs); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tab-bar { display: flex; align-items: center; gap: 4px; background: var(--soft); padding: 3px; border-radius: 999px; overflow-x: auto; max-width: 100%; }
.tab-btn { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; transition: 0.15s; }
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.badge { background: var(--hs); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; }

.top-actions { display: flex; align-items: center; gap: 6px; }
.pill-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.pill-btn:hover { background: var(--soft); }
.pill-btn.active-mode { border-color: var(--hs); background: var(--hs-soft); color: var(--hs); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
.sync-dot.offline { background: #f59e0b; }

.btn-primary { border: 0; background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; padding: 10px 16px; border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary:hover { opacity: 0.92; }
.btn-primary.full { width: 100%; }

.workspace { flex: 1; display: flex; min-height: 0; overflow: hidden; }
.map-section { position: relative; flex: 1.4; min-height: 280px; background: #e8ede9; overflow: hidden; user-select: none; touch-action: none; }
.map-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.map-canvas:active { cursor: grabbing; }
.map-canvas.crosshair { cursor: crosshair !important; }

.map-ctrl { position: absolute; top: 10px; left: 10px; z-index: 10; display: flex; flex-direction: column; gap: 4px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.95); color: var(--text); font-weight: 800; font-size: 16px; cursor: pointer; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.icon-btn.text-sm { font-size: 14px; }
.icon-btn.text-xs { font-size: 11px; }
.icon-btn:hover { background: var(--soft); }

.map-expand-btn { display: none; position: absolute; top: 10px; right: 10px; z-index: 10; border: 1px solid var(--border); background: rgba(255,255,255,0.95); color: var(--text); font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; box-shadow: var(--shadow); cursor: pointer; }
.map-banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 15; background: rgba(24, 34, 28, 0.92); color: #fff; font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 999px; box-shadow: 0 4px 16px rgba(0,0,0,0.18); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 110px); white-space: nowrap; }
.banner-cancel { border: 0; background: rgba(255,255,255,0.2); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; cursor: pointer; }

.pin-bar { position: absolute; bottom: 12px; left: 12px; right: 12px; z-index: 18; max-width: 640px; margin: 0 auto; background: rgba(255,255,255,0.98); border: 1px solid var(--border); border-radius: 16px; padding: 9px 11px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pin-bar-main { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; cursor: pointer; }
.pin-bar-thumb { width: 56px; height: 38px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--soft); border: 1px solid var(--border); }
.pin-bar-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.pin-bar-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pin-bar-info strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-bar-info span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-bar-btns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.side-panel { flex: 1; max-width: 485px; min-width: 350px; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.summary-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.summary-stats-btn { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; border: 1px solid transparent; background: transparent; padding: 3px 6px 3px 0; border-radius: 12px; cursor: pointer; transition: 0.14s; }
.summary-stats-btn:hover { background: var(--bg); border-color: var(--border); padding-left: 6px; }
.summary-caret { font-size: 11.5px; font-weight: 700; color: var(--primary); margin-left: 2px; }
.stat-chip { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--soft); color: var(--text); font-variant-numeric: tabular-nums; }
.done-chip { background: var(--primary-soft); color: var(--primary); }
.star-chip { background: var(--star-soft); color: #b45309; border: 1px solid #fde68a; }

.day-alert { font-size: 12px; font-weight: 600; color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; padding: 8px 10px; line-height: 1.4; }

.sm-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 8px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; transition: 0.12s; }
.sm-btn:hover { background: var(--soft); }
.sm-btn.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.sm-btn.green { border-color: #16a34a; background: #16a34a; color: #fff; }
.sm-btn.tiktok { border-color: #27272a; background: #18181b; color: #fff; }
.sm-btn.review { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.sm-btn.ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 3px 6px; }
.sm-btn.icon-only { padding: 3px 6px; font-size: 11.5px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; cursor: pointer; transition: 0.12s; }
.chip-btn:hover { background: var(--soft); border-color: #b7c4ba; }
.chip-btn.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 700; }

.stops-list { display: flex; flex-direction: column; gap: 7px; }
.stop-card { display: flex; flex-direction: column; gap: 6px; padding: 9px 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); transition: opacity 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s; cursor: pointer; }
.stop-card:hover { border-color: #b9c9be; }
.stop-card.is-next { border-color: var(--primary); box-shadow: 0 2px 10px rgba(21,128,61,0.10); }
.stop-card.is-selected { border-color: #2563eb; box-shadow: 0 2px 12px rgba(37,99,235,0.14); }
.stop-card.is-done { background: var(--done-bg); opacity: 0.48; border-style: dashed; }
.stop-card.is-done .stop-name { text-decoration: line-through; color: var(--muted); }

.stop-top { display: flex; align-items: center; gap: 7px; }
.check-btn { width: 27px; height: 27px; border-radius: 50%; border: 2px solid #cbd5ce; background: var(--surface); color: transparent; font-weight: 900; font-size: 13px; flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.15s; }
.check-btn:hover { border-color: var(--primary); }
.check-btn.checked { background: var(--primary); border-color: var(--primary); color: #fff; }

.stop-num { font-size: 10px; font-weight: 800; color: #fff; width: 19px; height: 19px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stop-time-btn { border: 1px solid var(--border); background: var(--soft); color: var(--text); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 7px; cursor: pointer; flex-shrink: 0; font-variant-numeric: tabular-nums; transition: 0.12s; }
.stop-time-btn:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.stop-time-btn.empty { color: var(--muted); border-style: dashed; }

.stop-title-wrap { flex: 1; min-width: 0; cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 2px 4px; border-radius: 8px; transition: background 0.12s; }
.stop-title-wrap:hover { background: var(--soft); }
.stop-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-star-mini { font-size: 11px; font-weight: 800; color: #b45309; flex-shrink: 0; }
.stop-order-btns { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

.stop-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-left: 34px; flex-wrap: wrap; }
.stop-route-btn { border: 1px solid transparent; background: var(--bg); color: var(--muted); font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 8px; cursor: pointer; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; transition: 0.12s; }
.stop-route-btn:hover { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.stop-route-btn.done-meta { background: var(--primary-soft); color: var(--primary); }
.stop-links { display: flex; align-items: center; gap: 4px; }

.quick-add-wrap { padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; }
.section-mini-lbl { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.extra-sub-lbl { margin-top: 4px; color: #0f766e; }
.chip-btn.extra-chip { border-color: #99f6e4; background: #f0fdfa; color: #115e59; }
.chip-btn.extra-chip:hover { background: #ccfbf1; border-color: #5eead4; }
.other-badge { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; flex-shrink: 0; }

.ab-result { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.ab-route-head { display: flex; align-items: center; gap: 6px; }
.ab-tag { flex: 1; font-size: 12.5px; font-weight: 800; padding: 6px 9px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-tag.from { border-color: var(--hs); color: var(--hs); }
.ab-tag.to { border-color: var(--primary); color: var(--primary); }
.ab-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.ab-streets { font-size: 12px; color: var(--muted); line-height: 1.4; }

.history-list { display: flex; flex-direction: column; gap: 6px; }
.hist-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); font-size: 12.5px; }
.hist-time { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; margin-top: 1px; }
.hist-actor { font-weight: 800; color: var(--primary); white-space: nowrap; }
.hist-detail { flex: 1; color: var(--text); line-height: 1.35; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 20, 0.50); display: flex; align-items: center; justify-content: center; padding: 14px; }
.modal-card { width: 100%; max-width: 360px; background: var(--surface); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 50px rgba(0,0,0,0.24); position: relative; }
.place-card { max-width: 540px; max-height: 88vh; padding: 16px; gap: 10px; overflow: hidden; }
.place-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.place-head-left { min-width: 0; flex: 1; }
.modal-title { margin: 0; font-size: 16.5px; font-weight: 800; line-height: 1.25; }
.pm-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.icon-close-btn { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 18px; font-weight: 700; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.icon-close-btn:hover { background: var(--soft); }

.pm-tabs { display: flex; gap: 4px; background: var(--soft); padding: 3px; border-radius: 12px; flex-shrink: 0; }
.pm-tab { flex: 1; border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 7px 6px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: 0.14s; }
.pm-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.pm-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 2px; min-height: 160px; }
.pm-body > * { flex-shrink: 0; }

.photo-strip { display: flex; gap: 9px; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; min-height: 132px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.photo-tile { position: relative; flex: 0 0 218px; width: 218px; height: 123px; border-radius: 12px; overflow: hidden; background: var(--soft); border: 1px solid var(--border); cursor: pointer; scroll-snap-align: start; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; transition: transform 0.2s; }
.photo-tile:hover img { transform: scale(1.03); }
.photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,0.72)); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-dur { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.74); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }

.skel-box { background: linear-gradient(90deg, #edf1ee 25%, #e2e8e4 50%, #edf1ee 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.star-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: var(--star-soft); border: 1px solid #fde68a; border-radius: 12px; padding: 9px 12px; }
.star-left { display: flex; align-items: center; gap: 7px; }
.star-score { font-size: 18px; font-weight: 900; color: #92400e; font-variant-numeric: tabular-nums; }
.star-icons { font-size: 14px; letter-spacing: 1px; color: var(--star); }
.star-note { font-size: 11.5px; color: #92400e; font-weight: 600; }

.rev-box { font-size: 12.5px; padding: 9px 11px; border-radius: 11px; line-height: 1.45; }
.rev-box.pro { background: var(--primary-soft); color: #14532d; }
.rev-box.tip { background: #fff7ed; color: #9a3412; }

.review-highlights { display: flex; flex-direction: column; gap: 7px; }
.rev-quote { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; display: flex; flex-direction: column; gap: 4px; }
.rev-quote-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; font-weight: 800; }
.rev-quote-stars { color: var(--star); letter-spacing: 1px; }
.rev-quote-txt { font-size: 12.5px; color: var(--text); line-height: 1.4; }

.media-list { display: flex; flex-direction: column; gap: 8px; }
.media-row-card { display: flex; gap: 10px; align-items: stretch; padding: 7px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); transition: 0.14s; }
.media-row-card:hover { border-color: var(--primary); background: #fafcfa; }
.media-row-thumb { position: relative; width: 136px; flex-shrink: 0; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--soft); }
.media-row-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.play-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,0.68); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; padding-left: 2px; }
.media-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.media-row-title { font-size: 12.5px; font-weight: 700; line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.media-row-meta { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.vid-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.vid-card { display: flex; flex-direction: column; border-radius: 13px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); transition: 0.14s; }
.vid-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.vid-cover { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--soft); overflow: hidden; }
.vid-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.vid-info { padding: 8px 9px; display: flex; flex-direction: column; gap: 4px; }

.sched-box { background: var(--bg); border: 1px solid var(--border); border-radius: 13px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sched-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.time-edit-wrap { display: inline-flex; align-items: center; gap: 6px; }
.time-inp { border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; padding: 5px 8px; border-radius: 9px; outline: none; }
.time-inp:focus { border-color: var(--primary); }

.leg-card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.leg-card.highlight { border-color: #2563eb; background: #f8fbff; }
.leg-endpoints { font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.leg-arrow { color: var(--primary); font-weight: 900; }
.leg-streets { font-size: 12px; color: var(--muted); line-height: 1.4; }
.leg-btn-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.day-leg-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: 0.12s; }
.day-leg-row:hover { border-color: var(--primary); background: var(--bg); }
.day-leg-time { font-size: 11.5px; font-weight: 800; color: var(--primary); background: var(--primary-soft); padding: 3px 7px; border-radius: 7px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.day-leg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.day-leg-title { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-leg-meta { font-size: 11px; color: var(--muted); }

.links-section { display: flex; flex-direction: column; gap: 7px; padding-top: 4px; border-top: 1px dashed var(--border); }
.rev-links { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.rev-link-btn { text-align: center; padding: 9px 10px; border-radius: 11px; font-size: 12.5px; font-weight: 700; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.rev-link-btn.gmap { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.rev-link-btn.tiktok { background: #18181b; border-color: #18181b; color: #fff; }
.rev-link-btn.yt { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.rev-link-btn.dir { background: var(--primary); border-color: var(--primary); color: #fff; }
.rev-link-btn:hover { opacity: 0.9; }

.pm-action-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pm-action-row .sm-btn { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }

.pm-lightbox { position: absolute; inset: 0; z-index: 10; background: rgba(15, 23, 20, 0.95); color: #fff; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.lb-top { display: flex; align-items: center; justify-content: space-between; }
.lb-counter { font-size: 12.5px; font-weight: 700; color: #d1d5db; }
.lb-img-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.lb-img-wrap img { max-width: 100%; max-height: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }
.lb-caption { font-size: 12.5px; text-align: center; color: #f3f4f6; line-height: 1.4; }
.lb-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.modal-sub { margin: 0; font-size: 12px; color: var(--muted); }
.field-inp { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; outline: none; }
.field-inp:focus { border-color: var(--primary); background: var(--surface); }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.pill-btn.ai-pill { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; font-weight: 800; }
.pill-btn.ai-pill:hover { background: #dbeafe; }
.sm-btn.ai-btn { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; font-weight: 800; }
.sm-btn.ai-btn:hover { background: #dbeafe; }
.party-stats-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.party-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.night-pill { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; flex-shrink: 0; background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.night-pill.n2 { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.night-pill.n0 { background: var(--soft); color: var(--muted); border-color: var(--border); }
.party-price-tag { font-size: 11.5px; font-weight: 800; color: var(--primary); background: var(--primary-soft); padding: 2px 7px; border-radius: 7px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.party-sub-meta { font-size: 11.5px; color: var(--muted); line-height: 1.35; flex: 1; min-width: 0; }
.party-sub-meta.bought { color: var(--primary); font-weight: 600; }
.party-night-hdr { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 2px 0; display: flex; align-items: center; justify-content: space-between; }
.rt-search-bar { display: flex; align-items: center; gap: 6px; }
.rt-search-inp { flex: 1; min-width: 0; padding: 8px 11px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 13px; outline: none; font-family: inherit; }
.rt-search-inp:focus { border-color: #2563eb; background: var(--surface); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.ai-submit { padding: 8px 13px; font-size: 12.5px; border-radius: 12px; white-space: nowrap; }
.ai-result-box { background: #f8fbff; border: 1px solid #bfdbfe; border-radius: 14px; padding: 11px 12px; display: flex; flex-direction: column; gap: 7px; }
.ai-result-box.loading { background: var(--bg); border-color: var(--border); }
.ai-result-box.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; font-size: 12.5px; font-weight: 600; }
.ai-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ai-item-title { font-size: 14px; font-weight: 800; color: var(--text); }
.ai-model-tag { font-size: 10px; font-weight: 700; color: #1d4ed8; background: #dbeafe; padding: 2px 7px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.ai-price-big { font-size: 18px; font-weight: 900; color: #15803d; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ai-unit-sub { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ai-detail-line { font-size: 12px; color: var(--text); line-height: 1.4; }
.ai-sources { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-src-link { font-size: 11px; font-weight: 700; color: #1d4ed8; background: var(--surface); border: 1px solid #bfdbfe; border-radius: 8px; padding: 3px 7px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-src-link:hover { background: #eff6ff; }
.ai-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.live-matches { display: flex; flex-direction: column; gap: 7px; }
.live-match-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: 0.12s; }
.live-match-row:hover { border-color: var(--primary); background: var(--bg); }
.live-match-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.live-match-title { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-match-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-edit-card { max-width: 440px; }
.form-grid { display: flex; flex-direction: column; gap: 9px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.price-inp-row { display: flex; align-items: center; gap: 5px; }
.price-inp-row .field-inp { min-width: 0; }
.ai-mini-hint { font-size: 12px; padding: 8px 10px; border-radius: 10px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; line-height: 1.4; }
@media (max-width: 900px) { .form-row-2 { grid-template-columns: 1fr; } }

.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; background: rgba(24, 34, 28, 0.94); color: #fff; font-size: 12.5px; font-weight: 700; padding: 9px 16px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .workspace { flex-direction: column; }
  .map-section { flex: none; height: 40vh; min-height: 220px; border-bottom: 1px solid var(--border); }
  .map-section.expanded { height: 74vh; }
  .map-expand-btn { display: inline-flex; }
  .side-panel { max-width: none; min-width: 0; border-left: 0; flex: 1; }
  .brand-name { display: none; }
  .place-card { max-height: 92vh; padding: 13px; }
  .vid-grid { grid-template-columns: 1fr; }
  .photo-strip { min-height: 112px; }
  .photo-tile { flex: 0 0 185px; width: 185px; height: 104px; }
  .media-row-thumb { width: 112px; }
}
.icon-btn.locate-btn { font-size: 16px; color: #2563eb; }
.icon-btn.locate-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.icon-btn.locate-btn.loading { opacity: 0.65; }
.icon-btn.locate-btn.active:hover { background: #1d4ed8; }
.gps-pill { position: absolute; bottom: 12px; left: 12px; z-index: 12; border: 1px solid #bfdbfe; background: rgba(239, 246, 255, 0.96); color: #1d4ed8; font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; box-shadow: var(--shadow); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gps-pill:hover { background: #dbeafe; }
.rev-link-btn.dir-prev { background: var(--primary-soft); border-color: #bbf7d0; color: #14532d; }
.rev-link-btn.dir-map { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; grid-column: 1 / -1; cursor: pointer; }
.rev-link-btn.full-span { grid-column: 1 / -1; }
.chip-btn.gps-chip { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; font-weight: 700; }
.chip-btn.gps-chip.active { border-color: #2563eb; background: #2563eb; color: #fff; }

.map-stage { position: absolute; inset: 0; overflow: hidden; perspective: 1200px; perspective-origin: 50% 50%; pointer-events: none; }
.map-tiles { position: absolute; left: 50%; top: 50%; transform-origin: 50% 50%; will-change: transform; display: block; pointer-events: none; }
.map-canvas { position: relative; z-index: 2; background: transparent; }
.map-canvas.tilting { cursor: move !important; }
.map-expand-btn { top: auto; bottom: 12px; right: 12px; z-index: 12; }
.map-style-wrap { position: absolute; top: 10px; right: 10px; z-index: 12; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; max-width: calc(100% - 62px); }
.map-style-bar { display: flex; align-items: center; gap: 2px; padding: 3px; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); flex-wrap: wrap; justify-content: flex-end; }
.style-btn { border: 0; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 5px 8px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: 0.14s; }
.style-btn:hover { background: var(--soft); color: var(--text); }
.style-btn.active { background: var(--text); color: #fff; }
.style-btn.mode-3d { margin-left: 2px; border: 1px solid var(--border); color: var(--primary); }
.style-btn.mode-3d.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.map-cam-bar { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); }
.cam-btn { border: 0; background: var(--soft); color: var(--text); height: 24px; min-width: 24px; padding: 0 5px; border-radius: 999px; font-size: 12px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.cam-btn:hover { background: #dfe7e1; }
.compass-btn { padding: 0 7px; font-size: 11px; }
.compass-needle { display: inline-block; color: #e11d48; font-size: 10px; transition: transform 0.08s linear; }
.cam-sep { width: 1px; height: 14px; background: var(--border); margin: 0 2px; }
.cam-lbl { font-size: 11px; font-weight: 700; color: var(--muted); }
.pitch-slider { width: 62px; accent-color: #2563eb; cursor: pointer; height: 14px; margin: 0; }
.cam-val { font-size: 11px; font-weight: 800; color: #2563eb; min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .cam-lbl { display: none; } .pitch-slider { width: 48px; } .style-btn { padding: 4px 6px; font-size: 11px; } }

/* MOBILE CLEANUP & GOOGLE MAPS BOTTOM-SHEET UX (v12) */
.mob-layer-bar { display: none; align-items: center; gap: 5px; }
.mob-pill-btn {
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.94); color: var(--text);
  backdrop-filter: blur(8px); font-size: 11.5px; font-weight: 800; padding: 6px 10px;
  border-radius: 999px; box-shadow: var(--shadow); cursor: pointer; white-space: nowrap;
}
.mob-pill-btn.mode-3d.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.quick-add-details { gap: 0; }
.quick-add-summary {
  list-style: none; cursor: pointer; font-size: 12px; font-weight: 800; color: var(--primary);
  background: var(--primary-soft); border: 1px solid #bbf7d0; border-radius: 11px;
  padding: 8px 11px; display: flex; align-items: center; justify-content: space-between;
}
.quick-add-summary::-webkit-details-marker { display: none; }
.quick-add-summary::after { content: '▾'; font-size: 12px; opacity: 0.8; }
.quick-add-details[open] .quick-add-summary::after { content: '▴'; }
.quick-add-inner { display: flex; flex-direction: column; gap: 7px; padding-top: 9px; }

@media (max-width: 900px) {
  .topbar { padding: 6px 10px; gap: 6px; }
  .brand { order: 1; }
  .brand-dot { width: 26px; height: 26px; border-radius: 8px; font-size: 10.5px; }
  .brand-name { display: none; }
  .top-actions { order: 2; gap: 5px; }
  #btn-export-png { display: none; }
  .pill-btn { padding: 5px 9px; font-size: 11.5px; }
  .tab-bar { order: 3; width: 100%; padding: 2px; gap: 2px; scrollbar-width: none; }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn { padding: 5px 10px; font-size: 12px; }

  .map-section { flex: none; height: 44vh; min-height: 225px; border-bottom: 0; }
  .map-section.expanded { height: 70vh; }
  .map-ctrl { top: 8px; left: 8px; gap: 4px; }
  .icon-btn { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px); }
  #btn-center { display: none; }

  .map-style-wrap { top: 8px; right: 8px; max-width: calc(100% - 54px); gap: 5px; }
  .mob-layer-bar { display: flex; }
  .map-style-wrap:not(.open) .map-style-bar,
  .map-style-wrap:not(.open) .map-cam-bar { display: none; }
  .map-style-wrap.open .map-style-bar,
  .map-style-wrap.open .map-cam-bar { box-shadow: 0 8px 24px rgba(15, 23, 20, 0.16); }

  .map-expand-btn { display: inline-flex; bottom: 16px; right: 8px; padding: 5px 10px; font-size: 11.5px; background: rgba(255, 255, 255, 0.94); }
  .gps-pill { bottom: 16px; left: 8px; max-width: calc(100% - 120px); font-size: 11px; padding: 5px 9px; }

  .side-panel {
    max-width: none; min-width: 0; border-left: 0; flex: 1;
    border-radius: 18px 18px 0 0; margin-top: -10px; position: relative; z-index: 6;
    box-shadow: 0 -4px 18px rgba(15, 23, 20, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }
  .side-panel::before {
    content: ''; display: block; width: 36px; height: 4px; border-radius: 999px;
    background: #d4dcd6; margin: 7px auto 1px; flex-shrink: 0;
  }
  .panel-body { padding: 8px 11px 16px; gap: 9px; }
  .stop-card { padding: 8px 10px; gap: 5px; }
  .stop-bottom { padding-left: 28px; }
  .pin-bar { left: 8px; right: 8px; bottom: 14px; padding: 7px 9px; }
  .pitch-slider { width: 58px; }
  .style-btn { padding: 5px 7px; font-size: 11px; }
}

/* SYMMETRICAL ZERO-SCROLL MODAL & CRISP SVG ICON SYSTEM (v13) */
html, body, .app-shell { height: 100%; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.ic { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.sm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.pm-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pm-tab { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 4px; font-size: 12px; }
.pm-body.overview-fit { gap: 8px; overflow-y: auto; scrollbar-width: none; }
.pm-body.overview-fit::-webkit-scrollbar { display: none; }

.star-bar.compact { padding: 7px 11px; border-radius: 11px; }
.star-bar.compact .star-score { font-size: 15.5px; }
.star-bar.compact .star-icons { font-size: 13px; }
.star-bar.compact .star-note { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 54%; }

.meta-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.meta-tile {
  background: var(--bg); border: 1px solid var(--border); border-radius: 11px;
  padding: 6px 7px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-width: 0;
}
.meta-tile-top { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.meta-tile-val { font-size: 11.5px; font-weight: 800; color: var(--text); width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-tile.price .meta-tile-val { color: var(--primary); }
.meta-tile.dist .meta-tile-val { color: #1d4ed8; }

.rev-compact {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 7px 10px; display: flex; flex-direction: column; gap: 4px;
}
.rev-compact-row { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.32; }
.rev-compact-row span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rev-compact-row.pro { color: #14532d; }
.rev-compact-row.tip { color: #9a3412; }

.pm-action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pm-action-grid .sm-btn {
  width: 100%; padding: 8px 6px; font-size: 12px; border-radius: 11px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.links-section.sym { gap: 6px; padding-top: 6px; }
.dir-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ext-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rev-link-btn {
  padding: 8px 8px; border-radius: 11px; font-size: 12px; font-weight: 800;
  gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rev-link-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev-link-btn.dir-map { width: 100%; padding: 8px 10px; }

@media (max-width: 900px) {
  .modal-backdrop { padding: 8px; align-items: center; }
  .place-card { max-height: 92dvh; padding: 12px; gap: 8px; border-radius: 20px; }
  .place-head { gap: 8px; }
  .modal-title { font-size: 15.5px; }
  .pm-sub { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .photo-strip { min-height: 104px; padding-bottom: 3px; }
  .photo-tile { flex: 0 0 176px; width: 176px; height: 99px; }
  .stop-bottom { gap: 6px; }
  .stop-links { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: 4px; }
  .stop-links .sm-btn { padding: 4px 7px; font-size: 11px; }
}

/* QUICK-PREVIEW CARD (v14) & MANDATORY CONFIRMATION MODAL + AUDIT TAGS (v15) */
.pin-bar {
  position: absolute; bottom: 12px; left: 12px; right: 12px; z-index: 20;
  max-width: 440px; margin: 0 auto; background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 16px;
  padding: 9px 10px; box-shadow: 0 10px 28px rgba(15, 23, 20, 0.18);
  display: flex; flex-direction: column; align-items: stretch; gap: 7px; flex-wrap: nowrap;
  animation: pinSlideUp 0.18s ease-out;
}
@keyframes pinSlideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.pin-bar-top { display: flex; align-items: flex-start; gap: 8px; }
.pin-bar-thumb { width: 68px; height: 48px; border-radius: 10px; }
.pin-bar-info { flex: 1; }
.pin-bar-title-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.pin-bar-title-row strong { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-bar-star { font-size: 11px; font-weight: 800; color: #b45309; background: var(--star-soft); border: 1px solid #fde68a; padding: 1px 5px; border-radius: 6px; flex-shrink: 0; }
.pin-bar-meta { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-bar-desc { font-size: 11px; color: #14532d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-close-btn { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 16px; font-weight: 700; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.pin-bar-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pin-bar-btns .sm-btn { width: 100%; padding: 6px 4px; font-size: 11.5px; border-radius: 9px; font-weight: 800; }
.map-section.has-preview .map-expand-btn, .map-section.has-preview .gps-pill { opacity: 0; pointer-events: none; }

#confirm-modal { z-index: 58; }
.confirm-card { max-width: 410px; gap: 10px; }
.cfm-diff-box { background: var(--bg); border: 1px solid var(--border); border-radius: 13px; padding: 10px 11px; display: flex; flex-direction: column; gap: 6px; }
.cfm-diff-box.danger { background: #fef2f2; border-color: #fecaca; }
.cfm-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; line-height: 1.38; }
.cfm-lbl { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; flex-shrink: 0; }
.cfm-val { font-weight: 700; color: var(--text); text-align: right; word-break: break-word; }
.cfm-val.change { color: #1d4ed8; }
.cfm-val.danger { color: #b91c1c; }
.cfm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.cfm-actions .pill-btn, .cfm-actions .btn-primary { width: 100%; justify-content: center; padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.btn-primary.danger { background: #dc2626; }

.hist-row { flex-direction: column; gap: 4px; }
.hist-row-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hist-tag { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--soft); color: var(--text); border: 1px solid var(--border); }
.hist-tag.add { background: var(--primary-soft); color: var(--primary); border-color: #bbf7d0; }
.hist-tag.edit { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.hist-tag.del { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.hist-tag.done { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.hist-tag.preset { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }

/* FIXED POPUP ASPECT RATIO & FEATURE-SCOPED FOOTER (v16) */
.place-card {
  max-width: 520px; width: 100%; height: min(596px, 86dvh); max-height: 86dvh;
  padding: 16px; gap: 10px; overflow: hidden;
}
.pm-tab { outline: none; }
.pm-tab:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.pm-body { flex: 1; min-height: 0; overflow-y: auto; gap: 11px; scrollbar-width: thin; }
.pm-footer {
  flex-shrink: 0; padding-top: 9px; border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 7px;
}
.pm-foot-stack { display: flex; flex-direction: column; gap: 7px; }
.pm-foot-stack .sm-btn {
  width: 100%; padding: 8.5px 10px; font-size: 12.5px; border-radius: 11px; font-weight: 800;
}
.pm-action-single { display: grid; grid-template-columns: 1fr; }
.rev-link-btn.dir-map-inline { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; cursor: pointer; }
.photo-strip { padding-bottom: 2px; min-height: 124px; scrollbar-width: none; -ms-overflow-style: none; }
.photo-strip::-webkit-scrollbar { display: none; }

/* THEME TOGGLE BUTTON & FULL DARK MODE (v16) */
.pill-btn.theme-pill {
  width: 30px; height: 30px; padding: 0; justify-content: center; flex-shrink: 0; color: var(--text);
}
.pill-btn.theme-pill.is-dark {
  background: rgba(251, 191, 36, 0.16); border-color: rgba(251, 191, 36, 0.40); color: #fcd34d;
}
#member-name { max-width: 96px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111a2b;
  --soft: #1a253a;
  --border: #25334a;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #22c55e;
  --primary-soft: rgba(34, 197, 94, 0.16);
  --hs: #fb7185;
  --hs-soft: rgba(225, 29, 72, 0.18);
  --star: #fbbf24;
  --star-soft: rgba(245, 158, 11, 0.16);
  --done-bg: #0e1624;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
:root[data-theme="dark"] .brand-dot { background: #e11d48; }
:root[data-theme="dark"] .tab-btn.active,
:root[data-theme="dark"] .pm-tab.active {
  background: #23324d; color: #ffffff; box-shadow: 0 1px 6px rgba(0,0,0,0.35);
}
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .sm-btn.primary,
:root[data-theme="dark"] .rev-link-btn.dir {
  background: #16a34a; border-color: #16a34a; color: #ffffff;
}
:root[data-theme="dark"] .btn-primary.danger { background: #dc2626; border-color: #dc2626; }
:root[data-theme="dark"] .sm-btn.green { background: #16a34a; border-color: #16a34a; color: #ffffff; }
:root[data-theme="dark"] .map-section { background: #0f172a; }
:root[data-theme="dark"] .map-style-bar,
:root[data-theme="dark"] .map-cam-bar,
:root[data-theme="dark"] .icon-btn,
:root[data-theme="dark"] .mob-pill-btn,
:root[data-theme="dark"] .map-expand-btn,
:root[data-theme="dark"] .pin-bar {
  background: rgba(17, 26, 43, 0.94); border-color: #2b3b55; color: var(--text);
}
:root[data-theme="dark"] .style-btn.active { background: #f1f5f9; color: #0b1220; }
:root[data-theme="dark"] .style-btn.mode-3d.active,
:root[data-theme="dark"] .mob-pill-btn.mode-3d.active { background: #2563eb; border-color: #3b82f6; color: #fff; }
:root[data-theme="dark"] .cam-btn:hover { background: #25334a; }
:root[data-theme="dark"] .cam-val { color: #60a5fa; }
:root[data-theme="dark"] .icon-btn.locate-btn { color: #60a5fa; }
:root[data-theme="dark"] .icon-btn.locate-btn.active { background: #2563eb; border-color: #3b82f6; color: #fff; }
:root[data-theme="dark"] .side-panel { box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45); }
:root[data-theme="dark"] .side-panel::before { background: #334155; }
:root[data-theme="dark"] .check-btn { border-color: #475569; background: var(--bg); }
:root[data-theme="dark"] .check-btn.checked { background: #16a34a; border-color: #16a34a; color: #fff; }
:root[data-theme="dark"] .stop-card:hover { border-color: #3b4f70; }
:root[data-theme="dark"] .stop-card.is-next { border-color: #22c55e; box-shadow: 0 2px 12px rgba(34, 197, 94, 0.16); }
:root[data-theme="dark"] .stop-card.is-selected { border-color: #3b82f6; box-shadow: 0 2px 14px rgba(59, 130, 246, 0.24); }
:root[data-theme="dark"] .chip-btn:hover { border-color: #3b4f70; }
:root[data-theme="dark"] .chip-btn.active { border-color: #22c55e; color: #86efac; }
:root[data-theme="dark"] .chip-btn.extra-chip,
:root[data-theme="dark"] .other-badge {
  background: rgba(20, 184, 166, 0.15); border-color: rgba(45, 212, 191, 0.35); color: #5eead4;
}
:root[data-theme="dark"] .extra-sub-lbl { color: #5eead4; }
:root[data-theme="dark"] .gps-pill,
:root[data-theme="dark"] .pill-btn.ai-pill,
:root[data-theme="dark"] .sm-btn.ai-btn,
:root[data-theme="dark"] .chip-btn.gps-chip,
:root[data-theme="dark"] .rev-link-btn.gmap,
:root[data-theme="dark"] .rev-link-btn.dir-map,
:root[data-theme="dark"] .rev-link-btn.dir-map-inline,
:root[data-theme="dark"] .ai-mini-hint,
:root[data-theme="dark"] .ai-src-link,
:root[data-theme="dark"] .hist-tag.edit,
:root[data-theme="dark"] .night-pill.n2 {
  background: rgba(37, 99, 235, 0.18); border-color: rgba(96, 165, 250, 0.36); color: #93c5fd;
}
:root[data-theme="dark"] .ai-result-box,
:root[data-theme="dark"] .leg-card.highlight {
  background: rgba(30, 58, 138, 0.22); border-color: rgba(96, 165, 250, 0.38);
}
:root[data-theme="dark"] .ai-model-tag { background: rgba(59, 130, 246, 0.26); color: #93c5fd; }
:root[data-theme="dark"] .ai-price-big { color: #4ade80; }
:root[data-theme="dark"] .meta-tile.dist .meta-tile-val,
:root[data-theme="dark"] .cfm-val.change { color: #60a5fa; }
:root[data-theme="dark"] .stop-route-btn:hover { background: rgba(37, 99, 235, 0.22); border-color: rgba(96, 165, 250, 0.4); color: #93c5fd; }
:root[data-theme="dark"] .day-alert,
:root[data-theme="dark"] .rev-box.tip,
:root[data-theme="dark"] .night-pill,
:root[data-theme="dark"] .hist-tag.preset {
  background: rgba(245, 158, 11, 0.14); border-color: rgba(251, 146, 60, 0.34); color: #fdba74;
}
:root[data-theme="dark"] .rev-compact-row.tip { color: #fdba74; }
:root[data-theme="dark"] .rev-box.pro,
:root[data-theme="dark"] .rev-link-btn.dir-prev,
:root[data-theme="dark"] .quick-add-summary,
:root[data-theme="dark"] .hist-tag.add,
:root[data-theme="dark"] .hist-tag.done {
  background: rgba(34, 197, 94, 0.16); border-color: rgba(74, 222, 128, 0.34); color: #86efac;
}
:root[data-theme="dark"] .rev-compact-row.pro,
:root[data-theme="dark"] .pin-bar-desc { color: #86efac; }
:root[data-theme="dark"] .sm-btn.review,
:root[data-theme="dark"] .star-bar,
:root[data-theme="dark"] .star-chip,
:root[data-theme="dark"] .pin-bar-star {
  background: rgba(245, 158, 11, 0.15); border-color: rgba(251, 191, 36, 0.36); color: #fcd34d;
}
:root[data-theme="dark"] .star-score,
:root[data-theme="dark"] .star-note,
:root[data-theme="dark"] .stop-star-mini { color: #fcd34d; }
:root[data-theme="dark"] .sm-btn.tiktok,
:root[data-theme="dark"] .rev-link-btn.tiktok {
  background: #27272a; border-color: #3f3f46; color: #ffffff;
}
:root[data-theme="dark"] .rev-link-btn.yt,
:root[data-theme="dark"] .cfm-diff-box.danger,
:root[data-theme="dark"] .ai-result-box.error,
:root[data-theme="dark"] .hist-tag.del {
  background: rgba(239, 68, 68, 0.16); border-color: rgba(248, 113, 113, 0.38); color: #fca5a5;
}
:root[data-theme="dark"] .cfm-val.danger { color: #fca5a5; }
:root[data-theme="dark"] .media-row-card:hover { background: var(--soft); border-color: var(--primary); }
:root[data-theme="dark"] .skel-box {
  background: linear-gradient(90deg, #1a253a 25%, #24334d 50%, #1a253a 75%);
  background-size: 200% 100%;
}
:root[data-theme="dark"] .modal-backdrop { background: rgba(2, 6, 23, 0.72); }
:root[data-theme="dark"] .modal-card { border: 1px solid var(--border); box-shadow: 0 24px 56px rgba(0,0,0,0.58); }
:root[data-theme="dark"] .toast { background: rgba(30, 41, 59, 0.96); border: 1px solid #334155; }
:root[data-theme="dark"] .map-banner { background: rgba(15, 23, 42, 0.95); border: 1px solid #334155; }

/* THOROUGH MOBILE AUDIT POLISH (360px - 900px, v16) */
@media (max-width: 900px) {
  .topbar {
    padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px;
    gap: 5px;
  }
  .top-actions { gap: 4px; flex-wrap: nowrap; }
  .pill-btn { padding: 5px 8px; font-size: 11.5px; }
  .pill-btn.theme-pill { width: 28px; height: 28px; padding: 0; }
  #member-name { max-width: 60px; }
  .tab-bar {
    display: flex; justify-content: space-between; gap: 2px; padding: 3px; overflow-x: auto;
  }
  .tab-btn {
    flex: 1 1 auto; justify-content: center; gap: 3px;
    padding: 6px 4px; font-size: 11.2px; letter-spacing: -0.015em;
  }
  .summary-bar { gap: 6px; flex-wrap: nowrap; }
  .summary-stats-btn { gap: 4px; padding: 2px 0; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
  .summary-caret { display: none; }
  .stat-chip { font-size: 11px; padding: 3px 7px; white-space: nowrap; }
  .panel-body { padding: 6px 10px 18px; gap: 8px; }
  .stop-links.other-links { display: flex; flex-wrap: nowrap; gap: 4px; width: 100%; }
  .stop-links.other-links .sm-btn { flex: 1; padding: 5px 4px; font-size: 11px; }
  .place-card {
    max-width: 440px; height: min(566px, 86dvh); max-height: 86dvh;
    padding: 12px; gap: 8px; border-radius: 20px;
  }
  .pm-footer { padding-top: 8px; gap: 6px; }
  .pm-foot-stack { gap: 6px; }
  .pm-foot-stack .sm-btn,
  .pm-footer .rev-link-btn { padding: 8px 8px; font-size: 12px; }
  .form-row-2 { grid-template-columns: 1fr 1fr; gap: 7px; }
  .party-edit-card { padding: 14px; }
  .field-inp, .rt-search-inp { font-size: 16px; padding: 8px 10px; }
  .time-inp { font-size: 15px; padding: 5px 7px; }
  .pin-bar { left: 8px; right: 8px; bottom: 14px; padding: 8px 9px; gap: 6px; }
  .pin-bar-btns .sm-btn { padding: 6px 3px; font-size: 11px; min-height: 30px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 380px) {
  .tab-btn { font-size: 10.5px; padding: 6px 3px; }
  .pill-btn { padding: 5px 7px; font-size: 11px; }
  #member-name { max-width: 48px; }
  .stat-chip { font-size: 10.5px; padding: 3px 6px; }
}
