/* TRIP. — 종이 지도 느낌의 에디토리얼 스타일 */
:root {
  --paper: #f6f0e4;
  --paper-2: #efe7d6;
  --card: #fffdf8;
  --ink: #1c1b19;
  --muted: #6f6a5f;
  --line: #e0d7c4;
  --accent: #e4572e;
  --accent-ink: #fff;
  --ok: #1f9d6b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(40, 30, 10, .16), 0 2px 6px rgba(40, 30, 10, .08);
  --panel-w: 380px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, white); outline-offset: 2px; }

.muted { color: var(--muted); font-size: 13px; }
.only-mobile { display: none; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 15px;
  transition: transform .15s, background .15s, color .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--ink); color: var(--paper); box-shadow: 0 6px 0 -2px var(--accent); }
.btn.primary:hover { box-shadow: 0 8px 0 -2px var(--accent); }
.btn.ghost { border-color: var(--line); background: var(--card); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { padding: 7px 13px; font-size: 13px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--card); display: grid; place-items: center; font-size: 16px; flex: none;
}
.icon-btn:hover { border-color: var(--ink); }
.pill {
  border: 0; background: var(--card); border-radius: 999px; padding: 9px 14px; font-weight: 700; font-size: 13px;
  box-shadow: var(--shadow);
}
.pill[aria-pressed="true"] { background: #2b7bd6; color: #fff; }
.chip {
  border: 1.5px solid var(--ink); background: var(--card); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px;
  transition: background .15s, color .15s, transform .15s;
}
.chip:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }

/* ── 토스트 ── */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px); z-index: 5000;
  background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: min(92vw, 560px); text-align: center;
  box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
body.in-viewer #toast { bottom: auto; top: 16px; transform: translate(-50%, -24px); }
body.in-viewer #toast.show { transform: translate(-50%, 0); }

/* ═════════ 시작 화면 ═════════ */
#landing { min-height: 100dvh; padding: 22px clamp(18px, 4vw, 56px) 36px; max-width: 1240px; margin: 0 auto; }
.lp-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(18px, 4vw, 44px); }
.logo { font-weight: 900; font-size: 28px; letter-spacing: -.04em; }
.logo i { color: var(--accent); font-style: normal; }
.lp-tag { font-size: 12px; font-weight: 700; padding: 5px 12px; border: 1.5px solid var(--ink); border-radius: 999px; }

.lp-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.eyebrow { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: .06em; margin-bottom: 14px; }
.lp-hero h1 { font-size: clamp(38px, 6.2vw, 72px); line-height: 1.06; font-weight: 900; letter-spacing: -.045em; }
.lp-hero h1 em {
  font-style: normal; position: relative; white-space: nowrap;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 38%, transparent) 62% 92%, transparent 92%);
}
.lead { margin-top: 22px; font-size: 17px; color: #3b3830; max-width: 34em; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps b {
  flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-size: 14px;
}
.steps span { font-size: 14.5px; color: #3b3830; }
.steps strong { display: block; font-size: 15.5px; color: var(--ink); }
.steps em { font-style: normal; font-weight: 800; }
.samples { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.samples-label { font-weight: 800; font-size: 14px; margin-right: 4px; }
.hint { margin-top: 10px; font-size: 13px; color: var(--muted); max-width: 34em; }

.lp-card {
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 22px; padding: clamp(16px, 2.4vw, 26px);
  box-shadow: 8px 8px 0 var(--ink);
}
.prompt-box { border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); margin-bottom: 20px; }
.prompt-box summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; font-weight: 800; cursor: pointer;
}
.prompt-box summary::-webkit-details-marker { display: none; }
.prompt-box summary > span::after { content: " ▾"; color: var(--muted); }
.prompt-box:not([open]) summary > span::after { content: " ▸"; }
#prompt-text {
  margin: 0; padding: 4px 14px 14px; max-height: 230px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font: 12.5px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #3b3830; border-top: 1px dashed var(--line); padding-top: 12px;
}
.prompt-actions { padding: 0 14px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field-label { display: block; font-weight: 800; margin-bottom: 8px; }
.drop { position: relative; }
.drop textarea {
  width: 100%; height: 190px; resize: vertical; border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  padding: 12px 14px; font: 13px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.drop textarea:focus { outline: none; border-color: var(--ink); }
.drop-over {
  position: absolute; inset: 0; border-radius: 14px; border: 2.5px dashed var(--accent); background: color-mix(in srgb, var(--accent) 12%, white);
  display: none; place-items: center; font-weight: 800; color: var(--accent);
}
.drop.over .drop-over { display: grid; }
.import-msg { margin: 12px 0 0; padding: 11px 14px; border-radius: 12px; font-size: 14px; background: #fdebe5; border: 1.5px solid #f2b8a6; color: #8a2b10; }
.import-msg ul { margin: 6px 0 0; padding-left: 18px; }
#landing .row { margin-top: 16px; }
.vw-box { margin-top: 20px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); padding: 10px 14px; }
.vw-box summary { cursor: pointer; font-weight: 800; font-size: 14.5px; }
.vw-box summary em { font-style: normal; font-size: 12px; font-weight: 800; color: #fff; background: var(--ok); border-radius: 999px; padding: 1px 9px; margin-left: 6px; }
.vw-box summary em:empty { display: none; }
.vw-box p { margin: 8px 0 0; }
.vw-box .row { margin-top: 10px; flex-wrap: nowrap; }
.vw-box input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; background: #fff; font: 13px ui-monospace, Menlo, Consolas, monospace; }
.vw-box input:focus { outline: none; border-color: var(--ink); }
.library { margin-top: 24px; border-top: 1.5px dashed var(--line); padding-top: 16px; }
.library h3 { font-size: 14px; margin-bottom: 10px; }
.library ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lib-item { display: flex; align-items: center; gap: 8px; }
.lib-open {
  flex: 1; min-width: 0; text-align: left; border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: 9px 12px;
}
.lib-open:hover { border-color: var(--ink); }
.lib-open strong { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-open span { font-size: 12px; color: var(--muted); }
.lp-foot { margin-top: 40px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ═════════ 지도 화면 ═════════ */
#viewer { height: 100dvh; display: grid; grid-template-columns: var(--panel-w) minmax(0, 1fr); background: var(--paper); }
#panel {
  display: flex; flex-direction: column; min-height: 0; background: var(--card); border-right: 1.5px solid var(--ink); z-index: 1200;
}
.panel-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 8px; }
.panel-title { min-width: 0; flex: 1; }
.panel-title h2 { font-size: 19px; line-height: 1.25; font-weight: 900; letter-spacing: -.03em; word-break: keep-all; }
.panel-title p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stats { display: flex; gap: 8px; padding: 4px 14px 10px; flex-wrap: wrap; }
.stat { background: var(--paper); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700; }
.day-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 14px 10px; border-bottom: 1.5px solid var(--line); scrollbar-width: none; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; gap: 6px;
}
.day-tab i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink)); }
.day-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stop-list { flex: 1; overflow-y: auto; padding: 6px 10px 18px; overscroll-behavior: contain; }
.day-head { display: flex; align-items: baseline; gap: 8px; padding: 14px 6px 6px; position: sticky; top: 0; background: linear-gradient(var(--card) 80%, transparent); z-index: 2; }
.day-head strong { font-size: 14px; font-weight: 900; color: var(--c); }
.day-head span { font-size: 12.5px; color: var(--muted); }
.today-badge { font-size: 11px; font-weight: 800; background: var(--accent); color: #fff; padding: 1px 8px; border-radius: 999px; }
.stop-item {
  position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 10px; width: 100%; text-align: left;
  border: 1.5px solid transparent; background: transparent; border-radius: 12px; padding: 9px 8px; margin: 1px 0;
  transition: background .15s, border-color .15s;
}
.stop-item::before { /* 타임라인 선 */
  content: ""; position: absolute; left: 22px; top: 40px; bottom: -12px; width: 2px; background: repeating-linear-gradient(var(--line) 0 4px, transparent 4px 8px);
}
.stop-item.last::before { display: none; }
.stop-item:hover { background: var(--paper); }
.stop-item.active { background: var(--paper); border-color: var(--c); }
.stop-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; position: relative; z-index: 1;
}
.stop-item.visited .stop-num { background: var(--ok); }
.stop-item.visited .stop-num::after { content: "✓"; }
.stop-item.visited .stop-num span { display: none; }
.stop-main { min-width: 0; }
.stop-line1 { display: flex; align-items: baseline; gap: 8px; }
.stop-time { font-size: 12.5px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.stop-name { font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.stop-name::after { content: ""; }
.stop-item.now .stop-name::after {
  content: "지금"; margin-left: 8px; font-size: 10.5px; font-weight: 800; background: var(--accent); color: #fff; padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
  animation: blink 1.6s ease-in-out infinite;
}
.stop-sub { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 1px; }
.stop-flag { color: #b4540a; font-weight: 700; }
.warn-box { margin: 0 14px 8px; border: 1.5px solid #f0d9a8; background: #fff7e0; border-radius: 12px; padding: 8px 12px; font-size: 12.5px; }
.warn-box summary { cursor: pointer; font-weight: 800; color: #8a5a0a; }
.warn-box ul { margin: 6px 0 0; padding-left: 16px; max-height: 120px; overflow: auto; color: #5c4a1c; }
.panel-foot { display: flex; gap: 8px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1.5px solid var(--line); }

#stage { position: relative; min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; background: #e8e1d0; }
#map.placing { cursor: crosshair; }
.leaflet-container { font-family: var(--font); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; margin-bottom: 150px !important; margin-right: 14px !important; }
.leaflet-control-zoom a { border-radius: 10px !important; }
.leaflet-control-attribution { font-size: 10px !important; background: rgba(255, 253, 248, .8) !important; }

#hud-top { position: absolute; z-index: 1000; top: 14px; left: 14px; right: 14px; display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
#hud-top > * { pointer-events: auto; }
.status-chip {
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow); padding: 8px 8px 8px 16px; font-size: 13.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 10px; max-width: min(100%, 520px);
}
.status-chip .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-chip button { border: 0; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 12.5px; flex: none; }

/* 장소 카드 */
.card {
  position: absolute; z-index: 1000; top: 14px; right: 14px; width: min(380px, calc(100% - 28px)); max-height: calc(100% - 190px); overflow: auto;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); padding: 16px 16px 14px;
}
#hud-top { z-index: 1001; }
.card.pop { animation: pop .42s cubic-bezier(.2, 1.2, .3, 1); }
.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.badge { background: var(--c, var(--ink)); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.card-time { font-size: 13px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-top .icon-btn { margin-left: auto; width: 30px; height: 30px; font-size: 13px; }
.card h2 { font-size: 22px; line-height: 1.22; font-weight: 900; letter-spacing: -.035em; }
.card .photo { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin-top: 10px; background: var(--paper-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { background: var(--paper); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
.card .addr { margin-top: 10px; font-size: 13.5px; color: #3b3830; }
.card .note { margin-top: 8px; font-size: 14px; white-space: pre-wrap; background: var(--paper); border-radius: 12px; padding: 10px 12px; }
.card .from { margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.card .warn { margin-top: 10px; font-size: 13.5px; background: #fff7e0; border: 1.5px solid #f0d9a8; border-radius: 12px; padding: 10px 12px; color: #6b4a08; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.links .lbl { font-size: 12px; color: var(--muted); font-weight: 700; margin-right: 2px; }
.links a, .links button {
  font-size: 12.5px; font-weight: 800; padding: 5px 11px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none;
}
.links a:hover, .links button:hover { border-color: var(--ink); }
.card-nav { display: flex; gap: 8px; margin-top: 14px; }
.card-nav .btn { flex: 1; padding: 8px 10px; font-size: 14px; }
.travel-hud { display: flex; align-items: center; gap: 12px; }
.travel-hud .ico { font-size: 28px; animation: bob 1s ease-in-out infinite; }
.travel-hud .t1 { font-size: 12px; font-weight: 800; color: var(--muted); }
.travel-hud .t2 { font-size: 18px; font-weight: 900; letter-spacing: -.03em; }
.travel-hud .t3 { font-size: 13px; color: var(--muted); font-weight: 600; }
.intro-sub { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.intro-actions { margin-top: 14px; display: flex; gap: 8px; }
.intro-actions .btn { flex: 1; }

/* 컨트롤 */
.controls {
  position: absolute; z-index: 1000; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 22px; box-shadow: 5px 5px 0 var(--ink);
  padding: 10px 14px; display: grid; gap: 8px; width: max-content; max-width: calc(100% - 28px);
}
.controls .row { justify-content: center; gap: 8px; margin: 0; }
.ctl {
  min-width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); font-size: 16px; font-weight: 800;
  display: inline-grid; place-items: center; padding: 0 10px; transition: transform .12s, background .12s;
}
.ctl:hover { border-color: var(--ink); transform: translateY(-1px); }
.ctl.txt { border-radius: 999px; font-size: 13px; }
.ctl.play { width: 54px; height: 54px; background: var(--accent); color: #fff; border-color: var(--ink); font-size: 20px; padding-left: 3px; }
.ctl.play.on { background: var(--ink); padding-left: 0; }
.seg { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--paper); }
.controls .pill { box-shadow: none; background: var(--paper); padding: 7px 12px; }
.controls .pill[aria-pressed="true"] { background: #2b7bd6; }

/* 지도 위 마커 */
.pin-wrap { background: none; border: 0; }
.pin {
  position: relative; width: 30px; height: 30px; border-radius: 50%; transform: scale(1);
  background: var(--c); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); display: grid; place-items: center;
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1), filter .2s; animation: drop .5s cubic-bezier(.2, 1.3, .4, 1) backwards;
}
.pin span { color: #fff; font-weight: 800; font-size: 13px; font-family: var(--font); line-height: 1; }
.pin-wrap.is-visited .pin { filter: saturate(.55) brightness(1.05); }
.pin-wrap.is-active { z-index: 900 !important; }
.pin-wrap.is-active .pin { transform: scale(1.35); }
.pin-wrap.is-active .pin::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid var(--c); opacity: 0; animation: ring 1.6s ease-out infinite;
}
.mover-wrap { background: none; border: 0; }
.mover {
  width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); display: grid; place-items: center; font-size: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); animation: bob .7s ease-in-out infinite;
}
.me-wrap { background: none; border: 0; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2b7bd6; border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(43, 123, 214, .6); animation: me 2s infinite; }
.route-done { filter: drop-shadow(0 0 5px rgba(255, 255, 255, .9)); }

/* 모달 */
.modal { position: fixed; inset: 0; z-index: 4000; background: rgba(28, 27, 25, .45); display: grid; place-items: center; padding: 18px; }
.modal-box { background: var(--card); border: 1.5px solid var(--ink); border-radius: 20px; padding: 22px; width: min(420px, 100%); box-shadow: 6px 6px 0 var(--ink); display: grid; gap: 10px; }
.modal-box h3 { font-size: 18px; font-weight: 900; }
.bar { height: 10px; border-radius: 999px; background: var(--paper-2); overflow: hidden; margin: 6px 0 10px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

/* 애니메이션 */
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-18px) scale(.5); } to { opacity: 1; transform: none; } }
@keyframes ring { 0% { transform: scale(.7); opacity: .85; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes me { 0% { box-shadow: 0 0 0 0 rgba(43, 123, 214, .55); } 70% { box-shadow: 0 0 0 16px rgba(43, 123, 214, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 123, 214, 0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ═════════ 모바일 ═════════ */
@media (max-width: 900px) {
  .lp-grid { grid-template-columns: 1fr; }
  .lp-card { box-shadow: 5px 5px 0 var(--ink); }
}
@media (max-width: 820px) {
  .only-mobile { display: inline-flex; }
  #viewer { grid-template-columns: 1fr; }
  #panel {
    position: fixed; inset: 0 auto 0 0; width: min(92vw, 400px); transform: translateX(-102%); transition: transform .3s cubic-bezier(.3, .9, .3, 1);
    box-shadow: var(--shadow); z-index: 3000;
  }
  #panel.open { transform: none; }
  .panel-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .leaflet-control-zoom { display: none; }
  #hud-top { top: calc(12px + env(safe-area-inset-top)); left: 10px; right: 10px; }
  .card {
    top: auto; right: 10px; left: 10px; width: auto; bottom: calc(160px + env(safe-area-inset-bottom)); max-height: 40dvh; border-radius: 18px; box-shadow: 4px 4px 0 var(--ink);
    padding: 14px 14px 12px;
  }
  .card h2 { font-size: 19px; }
  .controls { bottom: calc(26px + env(safe-area-inset-bottom)); width: calc(100% - 20px); padding: 8px 10px; border-radius: 18px; box-shadow: 3px 3px 0 var(--ink); }
  .controls .row.opts { gap: 6px; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .controls .row.opts::-webkit-scrollbar { display: none; }
  .controls .row.opts > * { flex: none; }
  .ctl { height: 40px; min-width: 40px; }
  .ctl.play { width: 50px; height: 50px; }
  .leaflet-control-attribution { margin-bottom: 0; }
}
