/* TripToClip studio editor — dark, calm workspace with a golden-hour accent. */
@font-face { font-family: "Outfit"; src: url("../fonts/Outfit.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../fonts/Caveat.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #0d1116;
  --panel: #141a21;
  --raised: #1b232c;
  --raised-2: #222c37;
  --line: #2a3541;
  --line-2: #364352;
  --ink: #edf1f5;
  --ink-2: #c3ccd5;
  --muted: #8592a0;
  --accent: #ff5a8a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 90, 138, .16);
  --accent-2: #2f8bff;
  --brand-gradient: linear-gradient(90deg, #0a6cff 0%, #00d4f0 32%, #ffd21a 55%, #ff7a1a 74%, #ff2d78 100%);
  --sel: #22d3ee;
  --sel-soft: rgba(34, 211, 238, .14);
  --ok: #5fd39a;
  --warn: #f2c14e;
  --err: #ff7a7a;
  --radius: 12px;
  --serif: "Outfit", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: only dark;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.studio-app {
  display: grid; height: 100vh;
  grid-template-columns: 372px 1fr;
  grid-template-rows: 58px 50px 1fr 96px;
  grid-template-areas: "top top" "steps steps" "side stage" "time time";
}

/* ---- Top bar ------------------------------------------------------------------------------ */
.topbar { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); min-width: 0; }
.logo { display: flex; flex: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #f6b44b, #ef6a4b); position: relative; box-shadow: 0 2px 10px rgba(246,180,75,.25); }
.logo .brand-mark { width: 32px; height: 32px; display: block; border-radius: 9px; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.logo-mark-old::after { content: ""; position: absolute; left: 7px; bottom: 7px; width: 16px; height: 9px; border-left: 3px solid #1b1306; border-bottom: 3px solid #1b1306; border-radius: 0 0 0 8px; transform: skewX(-12deg); }
.trip-title { width: 220px; flex: 0 1 220px; min-width: 120px; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 6px 10px; font: 700 1.15rem var(--serif); color: var(--ink); }
.trip-title:hover, .trip-title:focus { border-color: var(--line); background: var(--raised); outline: none; }
.scene-tabs { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; border-left: 1px solid var(--line); padding-left: 14px; }
.scene-label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); flex: none; }
.scene-tab-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; min-width: 0; padding: 4px 0; }
.scene-tab { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); cursor: pointer; flex: none; max-width: 240px; user-select: none; }
.scene-tab:hover { border-color: var(--line-2); }
.scene-tab.active { border-color: var(--accent); background: var(--accent-soft); }
.scene-tab.drop { box-shadow: -3px 0 0 var(--sel); }
.scene-tab .n { width: 20px; height: 20px; border-radius: 50%; background: var(--raised-2); color: var(--ink-2); font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.scene-tab.active .n { background: var(--accent); color: var(--accent-ink); }
.scene-tab svg { flex: none; }
.scene-tab .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .86rem; }
.scene-tab .d { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; flex: none; }
.scene-tab .more { border: 0; background: none; color: var(--muted); padding: 0 4px; cursor: pointer; border-radius: 6px; font-size: 1rem; line-height: 1; }
.scene-tab .more:hover { color: var(--ink); background: var(--raised-2); }
.scene-tab input { background: var(--bg); border: 1px solid var(--sel); border-radius: 6px; padding: 1px 6px; width: 150px; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; }
.save-status { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.save-status.ok::before { content: "● "; color: var(--ok); }
.save-status.busy::before { content: "● "; color: var(--warn); }
.save-status.err { color: var(--err); }
.account-slot { display: flex; align-items: center; gap: 8px; font-size: .84rem; }
.account-slot a { color: var(--ink-2); text-decoration: none; }
.account-slot a:hover { color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--raised-2); color: var(--ink-2); font-size: .76rem; font-weight: 600; white-space: nowrap; }

/* ---- Buttons ------------------------------------------------------------------------------ */
.primary-btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; cursor: pointer; white-space: nowrap; box-shadow: 0 4px 16px rgba(246,180,75,.18); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.primary-btn:hover { filter: brightness(1.06); }
.primary-btn.big { width: 100%; padding: 13px 16px; font-size: 1rem; }
.ghost-btn { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-2); border-radius: 10px; padding: 6px 12px; cursor: pointer; white-space: nowrap; flex: none; }
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
.btn2 { background: var(--raised); border: 1px solid var(--line); color: var(--ink); border-radius: 9px; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: .86rem; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.btn2:hover:not(:disabled) { border-color: var(--line-2); background: var(--raised-2); }
.btn2:disabled { opacity: .4; cursor: default; }
.btn2.danger:hover { border-color: var(--err); color: var(--err); }
.btn2.small { padding: 4px 9px; font-size: .78rem; border-radius: 7px; }
.btn2.on { border-color: var(--sel); color: var(--sel); background: var(--sel-soft); }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; flex: none; }
.icon-btn:hover:not(:disabled) { border-color: var(--line-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.link-btn { background: none; border: 0; color: var(--ink-2); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* ---- Step bar ----------------------------------------------------------------------------- */
.stepbar { grid-area: steps; display: flex; align-items: center; justify-content: center; gap: 16px; border-bottom: 1px solid var(--line); background: var(--bg); padding: 0 14px; position: relative; }
.steps-path { flex: 0 1 640px; min-width: 0; margin-right: 150px; } /* the five steps (core/progress.js, progress.css); room for the shape picker */
.steps-path .tc-go { min-height: 44px; padding: 4px 2px; }
/* Look & music's own Studio steps (Look, Titles, Camera, Music), above the panel */
.sub-steps { display: flex; gap: 4px; margin: 0 0 14px; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; }
.sub-step { flex: 1 1 0; min-width: 0; min-height: 34px; padding: 5px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-step:hover { color: var(--ink); background: var(--raised); }
.sub-step.on { background: var(--raised-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.shape-pick { position: absolute; right: 14px; display: flex; align-items: center; gap: 8px; }
.shape-pick select { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; width: auto; }
.shape-icon { width: 18px; height: 12px; border: 2px solid var(--ink-2); border-radius: 3px; }

/* ---- Side panel --------------------------------------------------------------------------- */
.side { grid-area: side; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel { flex: 1; overflow-y: auto; padding: 20px 18px; scrollbar-width: thin; }
.panel-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.panel-foot:empty { display: none; }
.panel-foot:has(> .next-export:only-child) { display: none; } /* Studio's last step: shown on phones only (roadmap 114) */
.panel h2 { font: 700 1.55rem/1.15 var(--serif); margin: 0 0 4px; }
.panel .lead { color: var(--muted); margin: 0 0 18px; }
.sec { margin: 0 0 22px; }
.sec-title { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.sec-title .val { letter-spacing: 0; text-transform: none; color: var(--ink); font-size: .84rem; }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { text-align: left; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; color: var(--ink); display: block; }
.choice:hover { border-color: var(--line-2); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice b { display: block; margin: 6px 0 2px; }
.choice span { color: var(--muted); font-size: .8rem; line-height: 1.35; display: block; }
.choice .ic { font-size: 1.2rem; }
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.stat small { display: block; color: var(--muted); font-size: .72rem; }
.stat b { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.field { margin: 0 0 12px; }
.field > label, .lbl { display: block; font-size: .78rem; color: var(--ink-2); margin: 0 0 5px; font-weight: 600; }
input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--sel); outline: none; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=color] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; margin: 6px 0; color: var(--ink-2); }
.hint-text { color: var(--muted); font-size: .8rem; margin: 4px 0 0; line-height: 1.4; }
.callout { background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--sel); border-radius: 10px; padding: 10px 12px; color: var(--ink-2); font-size: .84rem; margin: 0 0 14px; }
.callout.warn { border-left-color: var(--warn); }
.callout.err { border-left-color: var(--err); color: #ffd6d6; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; width: 100%; }
.seg button { flex: 1; background: none; border: 0; border-radius: 8px; padding: 6px 8px; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: .84rem; }
.seg button.on { background: var(--raised-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); position: relative; padding: 0; }
.sw.on { border-color: var(--ink); }
.sw.custom { background: conic-gradient(#ef5b3b, #f6b44b, #5fd39a, #4fa3f7, #b07cf2, #ef5b3b); overflow: hidden; }
.sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.sw.same { background: var(--raised-2); }
.sw.same::after { content: "="; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink); font-weight: 700; }
.icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.icon-choice { background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--ink-2); font-size: .72rem; text-align: center; }
.icon-choice:hover { border-color: var(--line-2); color: var(--ink); }
.icon-choice.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.icon-choice img { width: 26px; height: 26px; }
.theme-grid, .look-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-card, .look-card { background: var(--raised); border: 1px solid var(--line); border-radius: 11px; padding: 6px; cursor: pointer; text-align: left; color: var(--ink); }
.theme-card:hover, .look-card:hover { border-color: var(--line-2); }
.theme-card.on, .look-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-card img, .look-card img { width: 100%; aspect-ratio: 16/10; border-radius: 7px; display: block; background: var(--bg); object-fit: cover; }
.theme-card b, .look-card b { display: block; font-size: .82rem; margin: 6px 2px 0; }
.theme-card span, .look-card span { display: block; font-size: .72rem; color: var(--muted); margin: 0 2px 2px; line-height: 1.3; }
.theme-dialog .theme-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

/* Points (route step) */
.points { display: flex; flex-direction: column; }
.point { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 9px; border: 1px solid transparent; }
.point:hover { background: var(--raised); }
.point.sel { border-color: var(--sel); background: var(--sel-soft); }
.point .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-2); flex: none; margin-left: 7px; }
.point.stop .dot { background: var(--accent); border-color: var(--accent); width: 16px; height: 16px; margin-left: 5px; }
.point .nm { flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; padding: 3px 6px; border-radius: 6px; }
.point .nm:hover { border-color: var(--line); }
.point .tag { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.point .x, .point .more { visibility: hidden; }
.point:hover .x, .point:hover .more, .point.sel .more { visibility: visible; }
.seg-chip { display: flex; align-items: center; gap: 8px; margin: 0 0 0 13px; padding: 3px 0 3px 16px; border-left: 2px dashed var(--line-2); min-height: 32px; flex-wrap: wrap; }
.seg-chip > button { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px 3px 6px; color: var(--ink-2); cursor: pointer; font-size: .78rem; }
.seg-chip > button:hover { border-color: var(--line-2); color: var(--ink); }
.seg-chip img { width: 18px; height: 18px; }
.seg-chip .warn { color: var(--warn); font-size: .74rem; }
.seg-chip .sw { width: 14px; height: 14px; border: 0; }
.empty-state { text-align: center; padding: 18px 12px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 12px; }
.empty-state b { color: var(--ink); display: block; font-size: 1rem; margin-bottom: 4px; }
.empty-state .big-ic { font-size: 1.8rem; display: block; margin-bottom: 6px; }

/* Photos */
.photo-group { margin: 0 0 18px; }
.photo-group h4 { margin: 0 0 8px; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.photo-row { display: flex; gap: 10px; align-items: flex-start; background: var(--raised); border: 1px solid var(--line); border-radius: 11px; padding: 8px; margin: 0 0 8px; }
.photo-row .thumbwrap { position: relative; flex: none; }
.photo-row img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; display: block; background: var(--bg); cursor: pointer; }
.photo-row .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.photo-row .cap { font: 1.15rem "Caveat", var(--sans); padding: 4px 8px; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 11px; padding: 12px; text-align: center; color: var(--ink-2); cursor: pointer; display: block; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---- Stage -------------------------------------------------------------------------------- */
.stage-area { grid-area: stage; min-width: 0; min-height: 0; position: relative; background: radial-gradient(ellipse at center, #141a22, #0b0e12); }
.stage-outer { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 60px 18px 52px; }
.stage { position: relative; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px var(--line); background: #2a323b; }
.map, .overlay, .draw-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.overlay { pointer-events: none; z-index: 1; }
.stage .maplibregl-marker { z-index: 2; }
.draw-layer { z-index: 3; cursor: crosshair; touch-action: none; }
.stage.mode-draw .maplibregl-canvas { cursor: crosshair; }
.stage.mode-move .maplibregl-canvas { cursor: grab; }
.map-toolbar { position: absolute; left: 50%; transform: translateX(-50%); top: 10px; z-index: 5; display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(13,17,22,.88); backdrop-filter: blur(6px); border: 1px solid var(--line); flex-wrap: wrap; max-width: calc(100% - 24px); }
.map-toolbar:empty { display: none; }
.map-toolbar button { background: none; border: 0; color: var(--ink-2); padding: 6px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .82rem; white-space: nowrap; }
.map-toolbar button:hover:not(:disabled) { background: var(--raised); color: var(--ink); }
.map-toolbar button.on { background: var(--sel-soft); color: var(--sel); box-shadow: inset 0 0 0 1px rgba(79,209,197,.45); }
.map-toolbar button:disabled { opacity: .35; }
.map-toolbar .sep { width: 1px; background: var(--line); margin: 4px; }
.map-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5; background: rgba(13,17,22,.9); color: var(--ink-2); padding: 7px 14px; border-radius: 99px; font-size: .8rem; white-space: nowrap; border: 1px solid var(--line); pointer-events: none; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.map-hint:empty { display: none; }
.map-hint b { color: var(--ink); }
.pt-handle { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--sel); box-shadow: 0 1px 6px rgba(0,0,0,.5); cursor: grab; }
.pt-handle.stop { width: 18px; height: 18px; border-color: var(--accent); }
.pt-handle.sel { box-shadow: 0 0 0 5px rgba(79,209,197,.45), 0 1px 6px rgba(0,0,0,.5); }
.via-handle { width: 12px; height: 12px; transform: rotate(45deg); background: #fff; border: 3px solid #2b8fd6; border-radius: 2px; box-shadow: 0 1px 5px rgba(0,0,0,.5); cursor: grab; }
.via-handle.dragging { opacity: .85; pointer-events: none; }
.pt-handle.ghost { width: 12px; height: 12px; background: var(--sel); border-color: #fff; opacity: .9; pointer-events: none; }
.via-handle { width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid #6aa0ff; cursor: grab; }

/* ---- Timeline ----------------------------------------------------------------------------- */
.timeline-area { grid-area: time; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-top: 1px solid var(--line); background: var(--panel); }
.play-btn { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 1.1rem; cursor: pointer; flex: none; box-shadow: 0 6px 20px rgba(246,180,75,.25); }
.time-box { font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 96px; font-size: .9rem; }
.time-sep { color: var(--muted); margin: 0 4px; }
.timeline { flex: 1; height: 80px; position: relative; cursor: pointer; user-select: none; min-width: 0; outline: none; }
.tl-ruler { position: absolute; left: 0; right: 0; top: 0; height: 14px; border-bottom: 1px solid var(--line); }
.tl-ruler span { position: absolute; top: 0; font-size: .64rem; color: var(--muted); transform: translateX(-50%); }
.tl-track { position: absolute; left: 0; right: 0; height: 18px; border-radius: 6px; background: rgba(255,255,255,.035); }
.tl-track.t1 { top: 18px; } .tl-track.t2 { top: 39px; } .tl-track.t3 { top: 60px; }
.tl-tag { position: absolute; left: 4px; font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); line-height: 18px; pointer-events: none; z-index: 1; }
.tl-block { position: absolute; top: 0; height: 100%; border-radius: 6px; font-size: .68rem; line-height: 18px; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #0d1116; font-weight: 700; display: flex; align-items: center; gap: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.tl-block img { width: 13px; height: 13px; flex: none; }
.tl-block.active { box-shadow: inset 0 0 0 2px #fff; }
.tl-mark { position: absolute; top: 2px; width: 14px; height: 14px; margin-left: -7px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: .58rem; color: #0d1116; font-weight: 800; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.tl-mark.photo { background: #c39bf5; border-radius: 50%; }
.tl-mark.note { background: #4fd1c5; }
.tl-mark.sum { background: #5fd39a; }
.tl-head { position: absolute; top: 12px; bottom: 0; width: 2px; background: #fff; border-radius: 1px; pointer-events: none; box-shadow: 0 0 8px rgba(255,255,255,.6); z-index: 2; }
.tl-head::before { content: ""; position: absolute; top: -5px; left: -5px; width: 12px; height: 8px; background: #fff; clip-path: polygon(0 0, 100% 0, 50% 100%); }
/* Detailed timeline switched off (Admin → Features): just the scenes, centred under the ruler. */
.timeline.tl-simple .tl-track.t1 { top: calc(14px + (100% - 14px - 26px) / 2); height: 26px; }
.timeline.tl-simple .tl-block { line-height: 26px; }
.pace { display: flex; flex-direction: column; gap: 2px; font-size: .7rem; color: var(--muted); }
.pace select { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: .84rem; width: auto; }

/* ---- Menus, dialogs, toast ---------------------------------------------------------------- */
.menu { position: fixed; z-index: 150; min-width: 230px; max-width: 320px; background: var(--raised); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.menu > button { display: flex; width: 100%; align-items: center; gap: 10px; background: none; border: 0; padding: 8px 10px; border-radius: 8px; color: var(--ink); cursor: pointer; text-align: left; font-size: .86rem; }
.menu > button:hover { background: var(--raised-2); }
.menu > button.danger { color: var(--err); }
.menu .menu-title { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; }
.menu .menu-note { font-size: .74rem; line-height: 1.35; color: var(--muted); padding: 0 10px 6px; max-width: 250px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .icon-grid { padding: 4px; }
.dlg-backdrop { position: fixed; inset: 0; background: rgba(5,7,10,.7); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.dlg { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6); width: min(1000px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.dlg.small { width: min(540px, 100%); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; flex: 1; font: 700 1.4rem var(--serif); }
.dlg-body { padding: 18px 20px; overflow-y: auto; }
.dlg-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.dlg-foot .grow { flex: 1; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.btn-secondary { background: var(--raised); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--err); border: 1px solid var(--err); }
.btn-small { padding: 6px 12px; font-size: .84rem; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 116px; transform: translateX(-50%); background: var(--raised-2); color: var(--ink); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 12px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: min(90vw, 560px); }
.toast.err { border-color: var(--err); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.progress { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.flash { padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; }
.flash-success { background: rgba(95,211,154,.12); color: var(--ok); }
.mini { color: var(--muted); font-size: .78rem; }
.f { margin-bottom: 10px; }
.f > label { display: block; font-size: .78rem; color: var(--ink-2); margin: 0 0 4px; font-weight: 600; }
.fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.fieldset legend { font-weight: 700; font-size: .84rem; padding: 0 6px; }
.photo-dlg { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
/* The preview stays in view while the settings beside it scroll, so a photo can be dragged and zoomed after using them. */
.photo-side { position: sticky; top: 0; align-self: start; }
.photo-preview { background: linear-gradient(135deg, #3d4c56, #26313a); border-radius: 12px; aspect-ratio: 16/10; overflow: hidden; }
.photo-preview canvas { width: 100%; height: 100%; display: block; }
.photo-preview canvas.croppable { cursor: grab; touch-action: none; }
.photo-preview canvas.croppable:active { cursor: grabbing; }
.crop-btns { display: flex; gap: 6px; align-items: flex-end; padding-bottom: 4px; }
.crop-zoom { display: flex; gap: 6px; align-items: center; }
.crop-zoom input { flex: 1; min-width: 0; }
.phase-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 8px 0 2px; background: var(--bg); }
.phase-bar span { display: block; height: 100%; }
.phase-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .72rem; color: var(--muted); }
.phase-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.tiny-btn { border: 1px solid var(--line); background: var(--raised); color: var(--ink-2); border-radius: 7px; font-size: .78rem; padding: 4px 9px; cursor: pointer; }
.tiny-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--line-2); }
.tiny-btn:disabled { opacity: .35; }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
.item-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.item-head .name { flex: 1; min-width: 0; font-weight: 600; }
.item-body { padding: 4px 10px 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--raised-2); color: var(--ink-2); }
.badge-ext { position: absolute; top: 3px; right: 3px; font-size: .6rem; background: var(--warn); color: #000; border-radius: 4px; padding: 0 4px; }

@media (pointer: coarse) {
  .pt-handle { width: 22px; height: 22px; }
  .pt-handle.stop { width: 26px; height: 26px; }
  .point .x, .point .more { visibility: visible; }
}

/* ---- Phones and small tablets: map on top, draggable settings sheet below ---------------- */
.mobile-scenebar, .more-btn, .lbl-short, .sheet-handle { display: none; }
@media (max-width: 900px) {
  html, body { overflow: hidden; overscroll-behavior: none; max-width: 100%; }
  .studio-app { --sheet-h: 45dvh; position: fixed; inset: 0; height: 100vh; height: 100dvh; min-height: 0; grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(120px, 1fr) auto auto var(--sheet-h) auto;
    grid-template-areas: "top" "stage" "handle" "time" "side" "steps"; overflow: hidden; }
  .studio-app.sheet-anim { transition: grid-template-rows .22s ease; }

  /* Top bar: one row — scene picker, undo, more, export */
  .topbar { flex-wrap: nowrap; gap: 6px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); }
  .logo, .trip-title, .scene-tabs, .save-status, #redo, .account-slot { display: none; }
  .topbar-right { margin-left: 0; gap: 6px; flex: none; }
  .more-btn { display: inline-flex; }
  .icon-btn { width: 38px; height: 38px; }
  .primary-btn { padding: 9px 14px; }
  .lbl-long { display: none; } .lbl-short { display: inline; }
  .mobile-scenebar { display: flex; flex: 1; min-width: 0; }
  .m-scene { flex: 1; min-width: 0; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--raised); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
  .m-scene .n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; flex: none; }
  .m-scene .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-scene .of { color: var(--muted); font-size: .78rem; font-weight: 500; flex: none; }
  .m-scene .chev { color: var(--muted); flex: none; }

  /* Map preview fills its space; tools float down the right-hand edge like a maps app */
  .stage-area { height: auto; min-height: 0; }
  .stage-outer { padding: 6px; }
  .map-toolbar { top: 8px; right: 8px; left: auto; transform: none; flex-direction: column; flex-wrap: nowrap; padding: 4px; gap: 2px; border-radius: 14px; }
  .map-toolbar button { width: 42px; height: 42px; padding: 0; justify-content: center; font-size: 1.05rem; }
  .map-toolbar .tl { display: none; }
  .map-toolbar .sep, .map-toolbar hr { width: 26px; height: 1px; margin: 2px auto; }
  .map-hint { white-space: normal; text-align: center; font-size: .72rem; bottom: 8px; left: 8px; right: 62px; transform: none; width: auto; max-width: none; border-radius: 10px; padding: 5px 10px; }
  .map-hint:empty { display: none; }

  /* Sheet: grab handle, slim timeline, then settings that scroll */
  .sheet-handle { display: flex; grid-area: handle; justify-content: center; align-items: center; height: 22px; background: var(--panel); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; touch-action: none; cursor: ns-resize; margin-top: -10px; position: relative; z-index: 5; box-shadow: 0 -6px 16px rgba(0,0,0,.25); }
  .sheet-handle span { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); }
  .timeline-area { flex-wrap: nowrap; gap: 8px; padding: 2px 10px 6px; overflow: hidden; border-top: 0; background: var(--panel); position: relative; z-index: 5; }
  .play-btn { width: 40px; height: 40px; font-size: .95rem; flex: none; }
  .time-box { display: flex; flex-direction: column; align-items: center; font-size: .7rem; line-height: 1.15; flex: none; min-width: 34px; }
  .time-box .time-sep { display: none; }
  #time-total { color: var(--muted); }
  .timeline { flex: 1; min-width: 0; height: 70px; order: 0; overflow: hidden; }
  .pace { display: none; }
  .side { grid-area: side; position: relative; border: 0; min-height: 0; display: block; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--panel); }
  .studio-app[data-sheet="min"] .side { visibility: hidden; }
  .panel { overflow: visible; padding: 8px 16px 6px; }
  .panel h2 { font-size: 1.2rem; margin-bottom: 8px; }
  .panel .lead { display: none; }
  .panel-foot { position: static; padding: 6px 16px 16px; border: 0; background: none; }
  .panel-foot .primary-btn.big { padding: 10px; font-size: .92rem; }

  /* Steps: the five along the bottom, like a tab bar */
  .stepbar { grid-area: steps; padding: 0 6px env(safe-area-inset-bottom); border-top: 1px solid var(--line); border-bottom: 0; background: var(--bg); justify-content: stretch; }
  .steps-path { flex: 1 1 auto; width: 100%; margin-right: 0; }
  .steps-path .tc-go { min-height: 48px; gap: 7px; }
  .sub-steps { margin-bottom: 10px; }
  .shape-pick { display: none; }

  .dlg-backdrop { padding: 0; align-items: stretch; }
  .dlg { width: 100%; max-height: 100dvh; border-radius: 0; }
  .photo-dlg { grid-template-columns: 1fr; }
  .photo-side { position: static; }
  .menu { max-width: calc(100vw - 16px); max-height: 70dvh; overflow-y: auto; }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .theme-dialog .theme-grid { grid-template-columns: 1fr 1fr; }
}
/* Landscape phones: sheet beside nothing — keep it compact */
@media (max-width: 900px) and (max-height: 560px) {
  .timeline { height: 52px; }
}

/* Title font picker */
.font-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.font-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2, rgba(255,255,255,.03)); color: var(--ink); cursor: pointer; text-align: left; min-width: 0; }
.font-card:hover { border-color: var(--accent); }
.font-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.font-sample { font-size: 20px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* Music track list */
.track-list { display: flex; flex-direction: column; gap: 6px; }
.track { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.track:hover { border-color: var(--accent); }
.track.chosen { border-color: var(--accent); background: rgba(247, 183, 51, .08); }
.track .tick { color: var(--accent); font-weight: 700; }
.track .tiny-btn.on { background: var(--accent); color: #111; }
.track .ghost { opacity: .35; }
.track .now { display: none; color: var(--accent); font-size: 18px; animation: track-pulse 1s ease-in-out infinite alternate; }
.track.playing .now { display: inline; }
@keyframes track-pulse { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .track .now { animation: none; } }

/* Share panel (after export) */
.share-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.share-panel h3 { margin: 0 0 10px; }
.share-native { width: 100%; justify-content: center; margin-bottom: 10px; }
.share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.share-btn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; min-width: 0; }
.share-btn:hover { border-color: var(--line-2); }
.share-icon { width: 18px; height: 18px; flex: none; color: var(--muted); }
.share-instagram .share-icon { color: #e4405f; }
.share-tiktok .share-icon { color: var(--ink); filter: drop-shadow(1px 0 0 #fe2c55) drop-shadow(-1px 0 0 #25f4ee); }
.share-youtube .share-icon { color: #ff0033; }
.share-facebook .share-icon { color: #1877f2; }
.share-x .share-icon { color: var(--ink); }
.share-whatsapp .share-icon { color: #25d366; }
.share-label { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.share-caption { width: 100%; box-sizing: border-box; resize: vertical; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: .9rem; }
.share-status:empty { display: none; }
.warn-text { color: var(--warn, #e8bf5c); }
@media (max-width: 600px) { .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Per-part speed */
.speed-pill { background: none; border: 1px dashed var(--line-2); border-radius: 99px; padding: 2px 9px; color: var(--muted); font-size: .74rem; cursor: pointer; }
.speed-pill:hover, .speed-pill.open { color: var(--ink); border-color: var(--accent); }
.speed-pill.changed { color: var(--accent); border-style: solid; border-color: var(--accent); }
.speed-row { flex-basis: 100%; display: flex; align-items: center; gap: 8px; padding: 4px 0 6px; flex-wrap: wrap; }
.speed-row input[type=range] { flex: 1; min-width: 120px; accent-color: var(--accent); }
.speed-end { font-size: 1rem; }
.speed-val { font-size: .76rem; color: var(--ink-2); min-width: 120px; }

/* Map style picker */
.style-search { width: 100%; box-sizing: border-box; margin-bottom: 8px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { border: 1px solid var(--line); background: var(--raised); color: var(--ink-2); border-radius: 99px; padding: 5px 11px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.style-count:empty { display: none; }
.chip-n { margin-left: 5px; font-size: .7rem; opacity: .65; }
/* Studio's Photos step on a trip of several days: the day shown, and every place's photos */
.ph-days { margin: 4px 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
.ph-days .lbl { display: block; margin-bottom: 6px; }
.ph-day { width: 100%; max-width: 100%; }
.ph-trip { margin-top: 10px; }
.ph-trip .mini { margin-bottom: 6px; }
.ph-trip-rows { display: flex; flex-direction: column; gap: 6px; max-height: 168px; overflow-y: auto; }
.ph-trip-day { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ph-trip-d { min-width: 48px; font-size: .74rem; font-weight: 700; color: var(--muted); }
.ph-trip-day.on .ph-trip-d { color: var(--ink); }

/* Clip dialog and sound */
.clip-video { width: 100%; max-height: 46vh; background: #000; border-radius: 10px; display: block; object-fit: contain; }
.clip-video-src { position: absolute; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.clip-track { position: relative; height: 8px; border-radius: 4px; background: var(--raised-2); margin: 10px 0 4px; overflow: hidden; }
.clip-sel { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; }
.clip-info { margin: 2px 0 10px; }
.clip-controls { display: grid; gap: 10px; margin-bottom: 10px; }
.clip-controls label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--ink-2); }
.clip-controls input[type=range] { width: 100%; accent-color: var(--accent); }
.clip-sound { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0 8px; cursor: pointer; }
.clip-sound input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.clip-progress { height: 6px; border-radius: 3px; background: var(--raised-2); overflow: hidden; margin-top: 8px; }
.clip-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.sound-toggle.on { color: var(--accent); border-color: var(--accent); }

/* In-app modals (replace prompt/confirm) */
.modal-back { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 11, 14, 0); backdrop-filter: blur(0); transition: background .16s, backdrop-filter .16s; }
.modal-back.in { background: rgba(8, 11, 14, .55); backdrop-filter: blur(3px); }
.modal-card { width: 100%; max-width: 440px; background: #1b222a; color: #eef1f3; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.45); padding: 22px 22px 18px; transform: translateY(10px) scale(.98); opacity: 0; transition: transform .16s ease-out, opacity .16s; font-family: "Inter", system-ui, sans-serif; }
.modal-back.in .modal-card { transform: none; opacity: 1; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; font: 700 1.25rem/1.2 "Outfit", "Inter", system-ui, sans-serif; letter-spacing: -0.01em; color: #fff; }
.modal-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: #f6b44b; font-size: 1.05rem; flex: none; }
.modal-label { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #9aa6b0; margin: 4px 0 6px; }
.modal-input { width: 100%; box-sizing: border-box; font: 500 1.08rem "Inter", system-ui, sans-serif; color: #fff; background: #11171c; border: 1.5px solid #34404a; border-radius: 12px; padding: 13px 14px; outline: none; transition: border-color .12s, box-shadow .12s; }
.modal-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.modal-hint, .modal-message { color: #b6c0c8; font-size: .92rem; line-height: 1.45; margin: 8px 0 0; }
.modal-message { margin: 0; }
.modal-error { color: #ff8f7d; font-size: .85rem; margin: 6px 0 0; min-height: 0; }
.modal-error:empty { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-btn { font: 700 .95rem "Inter", system-ui, sans-serif; border-radius: 12px; padding: 11px 18px; border: 1px solid transparent; cursor: pointer; }
.modal-btn.primary { background: var(--btn-bg, var(--accent)); color: #fff; }
.modal-btn.primary:hover { filter: brightness(1.06); }
.modal-btn.danger { background: #d9463b; color: #fff; }
.modal-btn.ghost { background: transparent; color: #cfd6dc; border-color: #34404a; }
.modal-btn.ghost:hover { border-color: #52606b; color: #fff; }
@media (max-width: 600px) {
  .modal-back { align-items: flex-end; padding: 0; }
  .modal-card { max-width: none; border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); transform: translateY(40px); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-btn { width: 100%; padding: 14px; font-size: 1rem; }
}

/* ---- Menu button (all screen sizes) ---- */
.more-btn { display: inline-flex; }
.burger { display: inline-flex; flex-direction: column; gap: 3px; }
.burger i { display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; }

/* ---- Trip Builder mode: guided panel; Studio's step tabs and drawing tools are hidden ---- */
.studio-app:is([data-mode="builder"], [data-mode="quick"]) .stepbar,
.studio-app:is([data-mode="builder"], [data-mode="quick"]) .map-toolbar,
.studio-app:is([data-mode="builder"], [data-mode="quick"]) .shape-pick,
.studio-app:is([data-mode="builder"], [data-mode="quick"]) .map-hint { display: none !important; }
@media (min-width: 901px) {
  .studio-app:is([data-mode="builder"], [data-mode="quick"]) { grid-template-rows: 58px 0 minmax(0, 1fr) 96px; grid-template-columns: 420px 1fr; }
  .studio-app:is([data-mode="builder"], [data-mode="quick"]) .side { width: auto; }
}
@media (max-width: 900px) {
  .studio-app:is([data-mode="builder"], [data-mode="quick"]) { grid-template-rows: auto minmax(120px, 1fr) auto auto var(--sheet-h) 0; }
  .studio-app:is([data-mode="builder"], [data-mode="quick"]) .side { padding-bottom: env(safe-area-inset-bottom); }
}
/* Quick mode lists every place in the panel, so the scene tabs are hidden (their space is kept for the layout). */
.studio-app[data-mode="quick"] .scene-tabs,
.studio-app[data-mode="quick"] .mobile-scenebar > * { visibility: hidden; }
.q-day { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 8px 0 0; }
.builder { padding-bottom: 6px; }
.b-path { margin: -4px 0 12px; } /* the five steps (core/progress.js) */
.b-days { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: -4px 0 14px; }
.b-day { background: none; border: 1px solid var(--line); padding: 3px 10px; min-height: 30px; border-radius: 99px; font: inherit; font-size: .74rem; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.b-day:hover { border-color: var(--line-2); color: var(--ink); }
.b-day.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.b-title { font: 800 1.55rem/1.15 var(--serif); letter-spacing: -0.02em; margin: 0 0 6px; }
.b-sub { color: var(--ink-2); margin: 0 0 16px; font-size: .95rem; line-height: 1.45; }
.b-label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.b-input, .b-search { width: 100%; box-sizing: border-box; font: 500 1.05rem var(--sans); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line-2); border-radius: 12px; padding: 13px 14px; outline: none; }
.b-input:focus, .b-search:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.b-stepper { display: inline-flex; align-items: center; gap: 14px; background: var(--bg); border: 1.5px solid var(--line-2); border-radius: 14px; padding: 6px; }
.b-step-btn { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--raised-2); color: var(--ink); font-size: 1.4rem; cursor: pointer; }
.b-step-btn:disabled { opacity: .35; cursor: default; }
.b-step-val { font: 800 1.6rem var(--serif); min-width: 90px; text-align: center; }
.b-step-val small { font: 600 .9rem var(--sans); color: var(--muted); }
.b-place { margin-top: 10px; }
.b-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.b-result { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); font: inherit; cursor: pointer; }
.b-result:hover { border-color: var(--accent); }
.b-result b { display: block; }
.b-result .mini { display: block; }
.b-chosen { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); margin-bottom: 10px; }
.b-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); flex: none; }
.b-suggest { display: block; width: 100%; text-align: left; background: var(--raised); border: 1px dashed var(--line-2); border-radius: 12px; padding: 11px 14px; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; margin-bottom: 4px; }
.b-suggest:hover { border-color: var(--accent); }
.b-stops { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; }
.b-stop { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.b-num { width: 24px; height: 24px; border-radius: 50%; background: var(--raised-2); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex: none; }
.b-mode { margin-top: 4px; background: transparent; color: var(--muted); border: 0; font: inherit; font-size: .8rem; padding: 0; cursor: pointer; }
.b-privacy { margin-top: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); }
.b-media { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: var(--raised); }
.b-media-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.b-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.b-thumb { position: relative; width: 58px; height: 58px; border-radius: 8px; overflow: hidden; background: #000; }
.b-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b-thumb i { position: absolute; left: 4px; bottom: 3px; font-style: normal; font-size: .7rem; color: #fff; text-shadow: 0 1px 2px #000; }
.b-drop { display: block; text-align: center; padding: 14px; border: 1.5px dashed var(--line-2); border-radius: 12px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.b-drop:hover { border-color: var(--accent); color: var(--ink); }
.b-cards { grid-template-columns: 1fr; }
.b-final { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.b-watch { flex: 1; justify-content: center; }
.b-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.b-back { background: none; border: 0; color: var(--ink-2); font: inherit; font-weight: 700; padding: 10px 6px; cursor: pointer; }
.b-next { flex: 1; max-width: 300px; margin-left: auto; }

/* Airport picker */
.airport-dlg { max-width: 640px; }
.ap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ap-title { margin-bottom: 6px; }
.ap-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; color: var(--ink); font: inherit; cursor: pointer; }
.ap-item b { display: block; font-size: .88rem; line-height: 1.2; }
.ap-item .mini { display: block; }
.ap-item.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ap-code { font: 800 .95rem var(--serif); letter-spacing: .04em; min-width: 40px; text-align: center; padding: 6px 4px; border-radius: 8px; background: var(--raised-2); }
.ap-item.on .ap-code { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 600px) { .ap-cols { grid-template-columns: 1fr; } }

/* Background jobs pill (clips being made / uploaded) */
.job-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 8px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--raised); color: var(--ink); font: inherit; font-size: .8rem; font-weight: 600; white-space: nowrap; cursor: default; flex: none; }
.job-pill[hidden] { display: none; }
.job-pill.done { color: var(--ok, #6cc596); border-color: rgba(108, 197, 150, .5); }
.job-pill.failed { color: #ff8f7d; border-color: rgba(255, 143, 125, .5); }
.job-ring { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--accent) var(--p, 0%), var(--raised-2) 0); position: relative; flex: none; animation: job-spin 1.6s linear infinite; }
.job-pill.busy .job-ring { animation: none; }
.job-ring::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--raised); }
.job-text small { color: var(--muted); }
@keyframes job-spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .job-pill { height: 38px; padding: 0 10px 0 8px; }
  .job-pill .job-text { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
}

/* Earth View: space around the globe */
.map, .demo-map { background: #060b18; }

/* Music: "More options" and "Browse by" disclosures keep the rarer controls out of the way */
details.more { margin: 8px 0 12px; }
details.more > summary { display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 2px; cursor: pointer; color: var(--accent); font-size: .85rem; font-weight: 600; }
details.more > summary .val { color: var(--muted); font-weight: 400; font-size: .8rem; }
details.more > summary { list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '›'; display: inline-block; width: 1em; transition: transform .15s; }
details.more > summary .val { margin-left: auto; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more[open] > summary { margin-bottom: 8px; }
details.more > .seg { margin-bottom: 14px; }
.fit-chip { min-height: 34px; }
/* Music browse-by switch */
.browse-row { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; }
.browse-row .seg { flex: 1; }
.browse-row .seg button { padding: 6px 8px; font-size: .8rem; }

/* TripToClip mark in the top bar */
.logo .logo-img { display: block; height: 24px; width: auto; }

/* Back to the start */
.restart-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--raised); color: var(--ink); cursor: pointer; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.restart-btn svg { width: 18px; height: 18px; }
.restart-btn:hover { border-color: var(--accent); color: var(--accent); }
.time-box { cursor: pointer; }
@media (max-width: 900px) { .restart-btn { width: 44px; height: 44px; } }

/* GPX import */
.b-gpx { display: flex; gap: 12px; align-items: center; margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 12px; cursor: pointer; }
.b-gpx:hover { border-color: var(--accent); }
button.b-gpx { width: 100%; margin-top: 10px; background: none; color: inherit; font: inherit; text-align: left; }
.b-gpx > span:first-child { font-size: 1.3rem; }
.b-gpx small { color: var(--muted); }
.gpx-group { display: grid; gap: 6px; margin: 12px 0; }
.gpx-opt { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.gpx-opt input { margin-top: 3px; accent-color: var(--accent); }

/* Add a cruise */
.cruise-dlg { max-width: 640px; }
.cruise-dlg .row > .f { flex: 1; min-width: 0; }
.cruise-dlg input[type=text], .cruise-dlg input[type=date], .cruise-dlg select { width: 100%; }
.cruise-ports { margin: 4px 0 8px; padding-left: 22px; display: grid; gap: 4px; }
.cruise-ports:empty { display: none; }
.cruise-ports li { display: block; }
.cruise-ports li .mini { opacity: .75; }
.cruise-dlg .check { display: flex; gap: 6px; align-items: center; margin: 4px 0; font-weight: 500; }
.cruise-dlg .seg-row { display: grid; gap: 4px; margin-top: 6px; }

/* Paste a photo from the clipboard */
.paste-row { display: flex; justify-content: flex-end; margin-top: 6px; }
button.b-paste { font: inherit; color: inherit; cursor: pointer; background: none; width: 100%; margin-top: 8px; box-shadow: none; }

/* Place search results: flag, name, where it is, numbered pins on the map */
.flag { width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.18); flex: none; object-fit: cover; vertical-align: -2px; }
.flag-none { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; box-shadow: none; }
.res-list { display: grid; gap: 6px; margin-top: 6px; }
.res-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2, transparent); color: inherit; font: inherit; }
.res-pick { cursor: pointer; }
.res-row:hover, .res-row.hl { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.res-main { display: flex; gap: 8px; align-items: flex-start; min-width: 0; flex: 1; }
.res-main .flag { margin-top: 2px; }
.res-num { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 11px/20px var(--sans, sans-serif); text-align: center; }
.res-text { display: grid; min-width: 0; }
.res-text .mini { overflow: hidden; text-overflow: ellipsis; }
.res-rel { font-size: .8rem; color: var(--accent); font-weight: 600; }
.res-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; padding-left: 28px; }
.res-pin-wrap { padding-bottom: 7px; } /* the marker's bottom edge is the tip of the tail */
.res-pin-wrap.hl { z-index: 5; }
.res-pin { width: 26px; height: 26px; border-radius: 50%; background: var(--accent, #ef5b3b); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45); color: #fff; font: 700 12px/1 sans-serif; padding: 0; cursor: pointer; display: grid; place-items: center; position: relative; transition: transform .12s; }
.res-pin::after { content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #fff; border-bottom: 0; }
.res-pin-wrap.hl .res-pin { background: #1b6fd6; transform: scale(1.25); transform-origin: 50% 100%; }
.res-ref { position: relative; background: #14202c; color: #fff; font: 600 11px/1 sans-serif; padding: 4px 7px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.4); white-space: nowrap; }
.mini-map { height: 240px; border-radius: 10px; overflow: hidden; margin-top: 8px; border: 1px solid var(--line); }
.place-dlg { max-width: 600px; }
.ex-chosen { margin-top: 8px; min-height: 1.2em; }
.cruise-port { display: flex; gap: 6px; align-items: center; }
.cruise-ex { list-style: none; margin: 2px 0 4px 26px; padding: 0; display: grid; gap: 2px; }
.cruise-ex li { display: flex; gap: 4px; align-items: center; font-size: .9rem; }
.ex-stops { margin: 0 0 8px; padding-left: 22px; display: grid; gap: 4px; }
.ex-stops:empty { display: none; }
.ex-stops li { display: flex; gap: 6px; align-items: center; }
.crossing-choice { align-items: center; }
.crossing-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft, rgba(255,255,255,.08)); }
.crossing-ic img { width: 24px; height: 24px; }
.along-add { margin-top: 14px; }
.along-add .row { gap: 8px; flex-wrap: wrap; }
.photo-group h4 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.photo-group.just-added { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow .3s; }

/* Drag to reorder, and videos waiting for a section to be chosen */
.drag-handle { cursor: grab; touch-action: none; user-select: none; color: var(--ink-2, #9aa5b1); font-size: 18px; line-height: 1; padding: 6px 4px; }
.photo-row { position: relative; }
.photo-row .drag-handle { align-self: center; }
.photo-row.dragging, .b-thumb.dragging { opacity: .6; outline: 2px dashed var(--accent); }
.b-thumb { position: relative; }
.b-thumb .drag-handle { position: absolute; right: 2px; top: 2px; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; padding: 3px 5px; font-size: 14px; }
.pending-row { display: flex; gap: 8px; align-items: center; padding: 8px 10px; margin: 6px 0; border: 1px solid #d4a21a; border-radius: 10px; background: rgba(212,162,26,.12); }
.pending-ic { color: #d4a21a; font-size: 16px; }
.stage.over-photo, .stage.over-photo canvas { cursor: grab; }
.stage.dragging-photo, .stage.dragging-photo canvas { cursor: grabbing; }
.layout-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.layout-chip { font-size: .85rem; }
.warn-text { color: #d4a21a; }
.b-layout { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: .9rem; }
.b-layout select { flex: 1; min-width: 0; }


/* Export dialog: the one-line summary and the quicker options offered on slow devices */
.export-facts { font-size: 1.05rem; font-weight: 600; margin: 0 0 6px; }
.export-choices { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.export-choices .btn { width: 100%; justify-content: center; }

/* Export: the two choices (share a link, download a video), big enough to tap on a phone */
.pick-lead { margin: 0 0 10px; font-weight: 600; }
.export-pick { display: grid; gap: 10px; }
.pick-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.pick-card:hover:not(:disabled), .pick-card:focus-visible { border-color: var(--accent); background: var(--raised-2); outline: none; }
.pick-card:disabled { opacity: .5; cursor: not-allowed; }
.pick-icons { display: grid; grid-template-columns: repeat(2, 22px); gap: 6px; flex: none; }
.pick-icons .share-icon { width: 22px; height: 22px; }
.pick-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pick-text strong { font-size: 1.08rem; }
.pick-text > span { color: var(--ink-2); font-size: .88rem; line-height: 1.35; }
.pick-text > .pick-tag { align-self: flex-start; margin-top: 3px; padding: 1px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: .74rem; font-weight: 600; }
.pick-text > .pick-tag.ok { color: #3bb273; border-color: rgba(59, 178, 115, .5); background: rgba(59, 178, 115, .1); }
.pick-cost { margin: 12px 0 4px; font-size: .9rem; color: var(--ink-2); }
.pick-settings { margin-top: 12px; font-size: .88rem; }
.pick-settings summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.pick-settings .mini { margin: 8px 0 4px; }
.pick-icons .ic-whatsapp { color: #25d366; }
.pick-icons .ic-facebook { color: #1877f2; }
.pick-icons .ic-messages { color: #34c759; }
.pick-icons .ic-email { color: var(--ink-2); }
.pick-icons .ic-instagram { color: #e4405f; }
.pick-icons .ic-tiktok { color: var(--ink); filter: drop-shadow(1px 0 0 #fe2c55) drop-shadow(-1px 0 0 #25f4ee); }
.pick-icons .ic-youtube { color: #ff0033; }
.video-access { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.video-line { margin: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Share-a-link dialog */
.share-link-row { display: flex; gap: 8px; margin-bottom: 10px; }
.share-link { flex: 1; min-width: 0; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; }
a.share-btn { text-decoration: none; justify-content: center; }

/* Export: share-now section while rendering, the tucked-away progress pill, the finished preview */
.share-now-sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.share-now-sec h3 { margin: 0 0 4px; }
.export-pill { display: inline-flex; }
.export-preview { width: 100%; max-height: 42vh; border-radius: 8px; background: #000; margin: 6px 0; }
.toast-action { margin-left: 10px; background: var(--accent); color: #111; border: 0; border-radius: 8px; padding: 4px 12px; font: inherit; font-weight: 700; cursor: pointer; }

/* Export: which graphics chip, and how to switch to a faster one */
.gpu-line { margin: 4px 0; }
.gpu-help { font-size: .85rem; margin: 2px 0 8px; }
.gpu-help summary { cursor: pointer; color: var(--accent); }
.gpu-help ol { margin: 6px 0 0 18px; padding: 0; display: grid; gap: 4px; }

/* Saving the finished video online: hard to miss while it runs */
.upload-box { margin: 10px 0; }
.upload-box .progress { margin: 8px 0 4px; }
.callout.ok { border-color: #3bb273; background: rgba(59, 178, 115, .12); }

/* Admin debug panel */
.debug-btn { position: fixed; left: 10px; bottom: 10px; z-index: 300; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--raised-2); cursor: pointer; font-size: 16px; }
.debug-panel { position: fixed; left: 10px; bottom: 52px; z-index: 300; width: 340px; max-height: 70vh; overflow: auto; background: rgba(10, 14, 24, .94); color: #dfe6f2; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font: 12px/1.45 ui-monospace, Consolas, monospace; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.dbg-head { font-weight: 700; margin: 6px 0 4px; display: flex; justify-content: space-between; color: #fff; }
.dbg-head small { font-weight: 400; color: #8a97ab; }
.dbg-row { display: flex; justify-content: space-between; gap: 10px; }
.dbg-row span { color: #8a97ab; white-space: nowrap; }
.dbg-row b { font-weight: 600; text-align: right; word-break: break-word; }

/* ---- Mode chooser (modes.js): Guide me and Do it myself side by side on computers, stacked on phones; the other ways
   under "Other ways" ---- */
.mode-back { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(8, 11, 14, 0); transition: background .16s, backdrop-filter .16s; overflow-y: auto; }
.mode-back.in { background: rgba(8, 11, 14, .66); backdrop-filter: blur(4px); }
/* Starting a trip: a plain backdrop, so the empty editor isn't seen behind the choice. */
.mode-back.cover, .mode-back.cover.in { background: radial-gradient(120% 70% at 50% 0%, #1d2733 0%, #0d1116 60%) #0d1116; backdrop-filter: none; }
.mode-sheet { position: relative; width: 100%; max-width: 760px; background: #161d25; border: 1px solid rgba(255,255,255,.08); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.5); padding: 30px 28px 22px; transform: translateY(12px) scale(.98); opacity: 0; transition: transform .18s ease-out, opacity .18s; margin: auto; }
.mode-back.in .mode-sheet { transform: none; opacity: 1; }
.mode-sheet::before { content: ""; position: absolute; left: 28px; right: 28px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand-gradient); }
.mode-sheet h2 { font: 800 1.7rem/1.15 var(--serif); letter-spacing: -0.02em; margin: 0 40px 6px 0; }
.mode-sub { color: var(--ink-2); margin: 0 0 20px; }
.mode-close { position: absolute; top: 14px; right: 14px; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-cards.one { grid-template-columns: minmax(0, 360px); justify-content: center; }
.mode-card { display: flex; flex-direction: column; gap: 12px; text-align: left; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .12s, transform .12s, background .12s; }
.mode-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.mode-card.on, .mode-card.suggested { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--raised)); }
.mode-art { display: block; border-radius: 12px; background: linear-gradient(160deg, #18212b, #121820); padding: 10px 14px; }
.mode-art svg { display: block; width: 100%; height: auto; max-height: 130px; }
.mode-text { display: flex; flex-direction: column; gap: 4px; }
.mode-text b { font: 800 1.2rem var(--serif); display: flex; align-items: center; gap: 8px; }
.mode-text > span { color: var(--ink-2); font-size: .92rem; line-height: 1.4; }
.mode-now { font: 700 .66rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border-radius: 99px; padding: 2px 8px; }
.mode-other { margin-top: 14px; }
.mode-other > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.mode-other > summary::-webkit-details-marker { display: none; }
.mode-other > summary::before { content: '›'; display: inline-block; width: 1em; font-size: 1.1rem; transition: transform .15s; }
.mode-other[open] > summary::before { transform: rotate(90deg); }
.mode-other > summary:hover { color: var(--ink); }
.mode-other-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.mode-card.small { flex-direction: row; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; border-width: 1px; }
.mode-card.small .mode-art { flex: none; width: 78px; padding: 4px 6px; border-radius: 9px; }
.mode-card.small .mode-text b { font-size: 1rem; }
.mode-card.small .mode-text > span { font-size: .84rem; line-height: 1.35; }
.mode-foot { margin: 18px 0 0; color: var(--muted); font-size: .85rem; text-align: center; }
@media (max-width: 640px) {
  .mode-back { align-items: flex-end; padding: 0; }
  .mode-back.cover { align-items: center; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .mode-sheet { border-radius: 22px 22px 0 0; padding: 22px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 100dvh; overflow-y: auto; }
  .mode-sheet h2 { font-size: 1.4rem; }
  .mode-sub { margin-bottom: 14px; font-size: .9rem; }
  .mode-cards, .mode-other-list { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { flex-direction: row; align-items: center; padding: 10px; gap: 12px; }
  .mode-card.small .mode-art { width: 72px; }
  .mode-art { flex: none; width: 96px; padding: 6px 8px; }
  .mode-text b { font-size: 1.08rem; }
  .mode-text > span { font-size: .86rem; }
  .mode-foot { margin-top: 14px; }
}

/* Photo style: the developing and handwriting effects as buttons with the effect playing in them. */
.effect-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.effect-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; text-align: left; color: var(--ink, #e8ecf3);
  background: var(--raised, #1b2230); border: 1px solid var(--line, rgba(255, 255, 255, .12)); border-radius: 12px; cursor: pointer; opacity: .72;
  transition: box-shadow .18s, border-color .18s, opacity .18s, transform .12s; }
.effect-card:hover { opacity: 1; }
.effect-card:active { transform: scale(.98); }
.effect-card.on { opacity: 1; border-color: #e0218a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -2px 0 rgba(0, 0, 0, .35), 0 0 0 1px #e0218a, 0 6px 16px rgba(224, 33, 138, .22); }
.effect-card:focus-visible { outline: 2px solid #e0218a; outline-offset: 2px; }
.effect-stage { display: flex; align-items: center; justify-content: center; height: 76px; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #2b3446, #151b26); overflow: hidden; }
.effect-text b { display: block; font-size: .9rem; }
.effect-text small { display: block; color: var(--muted, #9aa6b8); font-size: .78rem; margin-top: 2px; }
.effect-tick { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font: 800 13px/1 var(--sans, system-ui);
  color: #fff; background: #e0218a; box-shadow: 0 2px 6px rgba(224, 33, 138, .5); transform: scale(0); transition: transform .18s cubic-bezier(.2, .9, .3, 1.4); }
.effect-card.on .effect-tick { transform: scale(1); }
.demo-print { flex: none; width: 46px; height: 54px; padding: 4px 4px 12px; background: #f6f3ea; border-radius: 2px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transform: rotate(-4deg); }
.demo-print-img { display: block; width: 100%; height: 100%;
  background: radial-gradient(circle at 72% 30%, #ffd36b 0 12%, transparent 13%), linear-gradient(180deg, #7ec8f0 0 48%, #2f8f9d 48% 62%, #4d7f3a 62% 100%);
  animation: demo-develop 4.2s ease-in-out infinite; }
@keyframes demo-develop {
  0%, 8% { filter: brightness(1.9) contrast(.35) saturate(0) sepia(.5) blur(1.2px); opacity: .35; }
  70%, 92% { filter: none; opacity: 1; }
  100% { filter: brightness(1.9) contrast(.35) saturate(0) sepia(.5) blur(1.2px); opacity: .35; }
}
.demo-hand { flex: none; width: 96px; padding: 6px 8px 5px; font: 700 21px/1 'Caveat', cursive; white-space: nowrap; overflow: hidden; background: #f6f3ea; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transform: rotate(2deg); }
.demo-hand span { display: inline-block; animation: demo-write 3.6s steps(28, end) infinite; clip-path: inset(0 100% 0 0); }
@keyframes demo-write { 0%, 6% { clip-path: inset(0 100% 0 0); } 60%, 90% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 0); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .demo-print-img, .demo-hand span { animation: none; clip-path: none; } }

/* ---- Looping demos on choices (editor/demos.js): layouts, looks, transitions, photo arrivals and music moods -------
   They only move while on screen (.demo-on) and stand still for reduced motion. */
.demo:not(.demo-on), .demo:not(.demo-on) * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .demo, .demo * { animation: none !important; } }
.effect-cards.compact { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.effect-card.compact { gap: 5px; padding: 6px 6px 7px; border-radius: 10px; }
.effect-card.compact .effect-stage { height: 50px; border-radius: 6px; }
.effect-card.compact .effect-text b { font-size: .76rem; font-weight: 600; line-height: 1.2; }
.effect-card.compact .effect-tick { top: 3px; right: 3px; width: 18px; height: 18px; font-size: 11px; }
.layout-cards { margin: 4px 0 6px; }
.fan-opts details.more { margin: 0 0 6px; }
/* Photo layouts: little prints landing on a little map */
.dl, .ar { position: relative; display: block; width: 100%; height: 100%; background: linear-gradient(160deg, #dfe8d8, #c4d9e6); }
.dl-pinboard { background: linear-gradient(160deg, #c99f6e, #b48855); }
.dl-road { position: absolute; left: 6%; right: 6%; top: 47%; height: 3px; border-radius: 2px; background: #e0218a; opacity: .5; transform: rotate(-8deg); }
.dl-p, .ar-p { position: absolute; display: block; aspect-ratio: 5 / 6; padding: 2px 2px 4px; box-sizing: border-box; background: #f6f3ea; border-radius: 1px; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.dl-p::before, .ar-p::before { content: ""; display: block; width: 100%; height: 100%; background: radial-gradient(circle at 72% 30%, #ffd36b 0 14%, transparent 15%), linear-gradient(180deg, #7ec8f0 0 50%, #4d7f3a 50%); }
.dl-p { left: var(--x); top: var(--y); width: 19%; transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s));
  animation: dl-in 4.8s cubic-bezier(.2, .8, .3, 1.15) infinite backwards; animation-delay: calc(var(--i) * .45s); }
.dl-p::before { filter: hue-rotate(calc(var(--i) * 65deg)); }
.dl-grid .dl-p, .dl-strip .dl-p { padding: 1px; aspect-ratio: 4 / 3; }
.dl-grid .dl-p { width: 30%; }
@keyframes dl-in {
  0% { opacity: 0; transform: translate(-50%, -120%) rotate(0deg) scale(calc(var(--s) * 1.4)); }
  12%, 78% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s)); }
  90%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s)); }
}
.dl-sequence .dl-p { animation-name: dl-seq; animation-duration: 4.5s; animation-delay: calc(var(--i) * 1.5s); }
@keyframes dl-seq {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r)) scale(calc(var(--s) * .8)); }
  6%, 30% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s)); }
  36%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s)); }
}
.dl-place { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #e0218a; box-shadow: 0 0 0 3px rgba(224, 33, 138, .3); }
.dl-pin { position: absolute; z-index: 1; left: var(--x); top: var(--y); width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: #e53935; box-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  animation: dl-pin 4.8s infinite backwards; animation-delay: calc(var(--i) * .45s); }
@keyframes dl-pin { 0%, 10% { opacity: 0; } 14%, 78% { opacity: 1; } 90%, 100% { opacity: 0; } }
/* Showcase looks: the route drawing itself across the look's map */
.look-card { position: relative; }
.look-card .lk { position: relative; display: block; margin: 0; aspect-ratio: 16 / 10; border-radius: 7px; overflow: hidden; background: var(--bg); }
.look-card .lk img { width: 100%; height: 100%; border-radius: 0; aspect-ratio: auto; }
.lk-run { position: absolute; inset: 0; width: 100%; height: 100%; animation: lk-fade 4.5s ease-in-out infinite; }
.lk-line { stroke-dasharray: 100 100; animation: lk-draw 4.5s ease-in-out infinite; }
.lk-trav { offset-path: path('M14 84 C40 70 58 52 84 54 S126 44 140 26'); offset-rotate: 0deg; offset-distance: 100%; animation: lk-ride 4.5s ease-in-out infinite; }
@supports not (offset-path: path('M0 0')) { .lk-trav { transform: translate(140px, 26px); } }
@keyframes lk-draw { 0% { stroke-dashoffset: 100; } 72%, 100% { stroke-dashoffset: 0; } }
@keyframes lk-ride { 0% { offset-distance: 0%; } 72%, 100% { offset-distance: 100%; } }
@keyframes lk-fade { 0%, 90% { opacity: 1; } 100% { opacity: 0; } }
.look-card .effect-tick { display: grid; margin: 0; top: 11px; right: 11px; color: #fff; font-size: 13px; line-height: 1; }
.look-card.on { border-color: #e0218a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -2px 0 rgba(0, 0, 0, .35), 0 0 0 1px #e0218a, 0 6px 16px rgba(224, 33, 138, .22); }
.look-card.on .effect-tick { transform: scale(1); }
/* Scene transitions: flying across, a cross-fade or a cut between two little maps */
.tr { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; }
.tr-map { position: absolute; inset: 0; display: block; }
.tr-a { background: radial-gradient(ellipse at 28% 62%, #a6d49b 0 24%, transparent 25%), linear-gradient(160deg, #d6e7c9, #a9cde3); }
.tr-b { background: radial-gradient(ellipse at 72% 38%, #f1c27d 0 22%, transparent 23%), linear-gradient(200deg, #f3e3c8, #9cc9df); }
.tr-pin { position: absolute; left: 50%; top: 55%; width: 10px; height: 10px; margin: -10px 0 0 -5px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #e0218a; box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.tr-fly .tr-world { position: absolute; top: 0; bottom: 0; left: 0; width: 200%; display: block; transform-origin: 50% 50%; animation: tr-fly 4.2s ease-in-out infinite; }
.tr-fly .tr-map { right: auto; width: 50%; }
.tr-fly .tr-b { left: 50%; }
@keyframes tr-fly {
  0%, 16% { transform: translateX(0) scale(1); opacity: 1; }
  40% { transform: translateX(-25%) scale(.55); }
  64%, 88% { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 0; }
}
.tr-fade .tr-a { animation: tr-fade 4.2s ease-in-out infinite; }
@keyframes tr-fade { 0%, 28% { opacity: 1; } 56%, 90% { opacity: 0; } 100% { opacity: 1; } }
.tr-cut .tr-a { animation: tr-cut 4.2s steps(1, end) infinite; }
@keyframes tr-cut { 0% { opacity: 1; } 45% { opacity: 0; } 95%, 100% { opacity: 1; } }
/* Photo arrivals */
.ar-p { left: 50%; top: 52%; width: 30%; transform: translate(-50%, -50%) rotate(-4deg); animation: 3.4s ease-out infinite both; }
.ar-drop .ar-p { animation-name: ar-drop; }
.ar-fade .ar-p { animation-name: ar-fade; }
.ar-slide .ar-p { animation-name: ar-slide; }
.ar-zoom .ar-p { animation-name: ar-zoom; }
.ar-toss .ar-p { animation-name: ar-toss; }
.ar-none .ar-p { animation-name: ar-none; animation-timing-function: steps(1, end); }
@keyframes ar-drop { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-4deg) scale(1.7); } 18% { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg) scale(.94); } 24%, 80% { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg) scale(1); } 92%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-4deg) scale(1); } }
@keyframes ar-fade { 0% { opacity: 0; } 26%, 80% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes ar-slide { 0% { opacity: 1; transform: translate(-260%, -50%) rotate(-4deg); } 22%, 80% { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg); } 92%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-4deg); } }
@keyframes ar-zoom { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-4deg) scale(.1); } 22%, 80% { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg) scale(1); } 92%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-4deg) scale(1); } }
@keyframes ar-toss { 0% { opacity: 1; transform: translate(-230%, 40%) rotate(-140deg); } 24%, 80% { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg); } 92%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-4deg); } }
@keyframes ar-none { 0% { opacity: 0; } 12% { opacity: 1; } 88%, 100% { opacity: 0; } }
/* Music moods: an equaliser at the mood's pace */
.md { display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; height: 100%; box-sizing: border-box; padding: 9px 0 8px; }
.md i { display: block; width: 7px; height: 100%; border-radius: 3px; background: linear-gradient(to top, var(--c2), var(--c1)); transform-origin: 50% 100%; transform: scaleY(.7);
  animation: md-eq var(--spd) ease-in-out infinite alternate; animation-delay: calc(var(--i) * var(--spd) / -2.5); }
.md i:nth-child(2n) { transform: scaleY(.45); }
.md-playful i { animation-timing-function: cubic-bezier(.3, 1.7, .5, 1); }
.md-epic i { width: 9px; }
@keyframes md-eq { from { transform: scaleY(var(--lo)); } to { transform: scaleY(1); } }
/* Studio's Simple / Full switch (studioView.js) and the steps' "More options" */
.panel { position: relative; }
.view-switch { position: absolute; z-index: 2; top: 22px; right: 18px; display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 99px; background: var(--raised); }
.view-switch + * > h2:first-child { padding-right: 124px; }
.sub-steps + .view-switch { top: 78px; } /* under Look & music's tabs (Look, Titles, Camera, Music) */
.view-switch button { min-height: 28px; padding: 3px 11px; border: 0; border-radius: 99px; background: none; color: var(--muted); font: 600 .75rem var(--sans); cursor: pointer; }
.view-switch button:hover { color: var(--ink); }
.view-switch button.on { background: var(--raised-2); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.view-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
details.step-more { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line); }
.studio-app[data-mode="studio"][data-view="simple"] .pace { display: none !important; }
.browse-by-box { flex: 1; display: flex; }
.browse-by-box .seg { flex: 1; }
@media (max-width: 900px) { .view-switch { top: 6px; right: 16px; } .sub-steps + .view-switch { top: 58px; } .view-switch button { min-height: 32px; } .view-switch + * > h2:first-child { min-height: 34px; } }

/* ---- Photos put where they were taken (editor/photoDrop.js) ----------------------------------- */
.ap-bulk { margin: 0 0 14px; display: grid; gap: 8px; }
.ap-bulk-empty { margin: 12px 0 0; text-align: left; }
.ap-zone { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; cursor: pointer; text-align: left; color: var(--ink);
  border: 1.5px dashed color-mix(in srgb, var(--sel) 55%, var(--line-2)); background: linear-gradient(140deg, var(--sel-soft), var(--accent-soft)); transition: border-color .15s, transform .15s; }
.ap-zone:hover, .ap-zone.over { border-color: var(--sel); transform: translateY(-1px); }
.ap-zone:focus-within { outline: 2px solid var(--sel); outline-offset: 2px; }
.ap-zone-t { display: grid; gap: 2px; min-width: 0; }
.ap-zone-t b { font: 700 1rem var(--serif); }
.ap-zone-t small { color: var(--ink-2); font-size: .8rem; line-height: 1.35; }
.ap-zone-ic { position: relative; flex: none; width: 46px; height: 38px; }
.ap-zone-ic i { position: absolute; width: 28px; height: 22px; border-radius: 5px; border: 2px solid #fff; background: linear-gradient(160deg, #2f8bff, #00b8d9); box-shadow: 0 4px 10px rgba(0,0,0,.35); }
.ap-zone-ic i:nth-child(1) { left: 0; top: 10px; transform: rotate(-12deg); background: linear-gradient(160deg, #ff8a3d, #ff4f7b); }
.ap-zone-ic i:nth-child(2) { left: 17px; top: 9px; transform: rotate(10deg); background: linear-gradient(160deg, #5fd39a, #0aa6c9); }
.ap-zone-ic i:nth-child(3) { left: 9px; top: 2px; }
.ap-waiting { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(242,193,78,.6); background: rgba(242,193,78,.14); color: #ffe9b0; font: inherit; font-size: .84rem; font-weight: 650; cursor: pointer; }
.ap-q { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--warn); color: #1b1300; font-weight: 800; font-size: .8rem; }
.b-media.over { border-color: var(--accent); background: var(--accent-soft); }
.ap-card { position: fixed; left: 50%; bottom: 172px; transform: translateX(-50%); z-index: 190; display: flex; align-items: flex-start; gap: 10px; width: max-content; max-width: min(92vw, 520px);
  padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--raised-2); border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0,0,0,.5); animation: ap-in .25s cubic-bezier(.2,.8,.2,1) both; }
@keyframes ap-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.ap-card-ic { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); border: 2px solid #fff; }
.ap-card-body { min-width: 0; }
.ap-card-t { margin: 0; font-weight: 600; line-height: 1.4; }
.ap-card-warn { margin: 4px 0 0; color: var(--warn); font-size: .8rem; }
.ap-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ap-card-x { flex: none; margin: -4px -4px 0 0; }
.ap-spin { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--sel); animation: ap-spin .8s linear infinite; }
@keyframes ap-spin { to { transform: rotate(360deg); } }
.ap-drophint { position: fixed; inset: 0; z-index: 150; pointer-events: none; display: flex; align-items: center; justify-content: center; background: rgba(5,7,10,.45); box-shadow: inset 0 0 0 4px var(--sel); }
.ap-drophint div { display: grid; gap: 4px; text-align: center; padding: 18px 26px; border-radius: 16px; background: var(--raised-2); border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.ap-drophint b { font: 700 1.2rem var(--serif); }
.ap-drophint span { color: var(--ink-2); }
.ap-sheet .dlg-body { display: grid; gap: 12px; }
.ap-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ap-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 12px; border: 1px solid rgba(242,193,78,.45); background: rgba(242,193,78,.06); }
.ap-row-body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.ap-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-row small { color: var(--ink-2); font-size: .8rem; line-height: 1.35; }
.ap-row .ap-hint { color: var(--ok); }
.ap-thumb { flex: none; width: 64px; height: 64px; border-radius: 9px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #18212b; border: 1px solid var(--line); }
.ap-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-nothumb { color: var(--muted); font-weight: 700; font-size: .78rem; letter-spacing: .06em; }
.ap-thumb.vid .ap-nothumb { font-size: 1.2rem; color: var(--ink); }
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ap-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); border-radius: 99px; padding: 5px 11px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.ap-chip:hover { border-color: var(--line-2); }
.ap-chip.sug { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--raised)); }
.ap-chip.leave { color: var(--ink-2); }
.ap-strip { display: flex; gap: 6px; overflow-x: auto; }
.ap-strip .ap-thumb { width: 48px; height: 48px; }
.ap-more { align-self: center; color: var(--muted); font-weight: 700; }
.ap-places { display: grid; gap: 6px; }
.ap-place { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; }
.ap-place:hover, .ap-place:focus-visible { border-color: var(--accent); }
.ap-place.sug { border-color: var(--ok); }
.ap-place-t { display: grid; flex: 1; min-width: 0; }
.ap-place-t small { color: var(--muted); font-size: .78rem; }
.ap-tag { flex: none; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.ap-search { display: grid; gap: 4px; }
.ap-busy { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
@media (max-width: 900px) {
  .ap-card { bottom: calc(124px + env(safe-area-inset-bottom)); }
  .ap-zone { padding: 12px; gap: 12px; }
  .ap-thumb { width: 52px; height: 52px; }
}

/* A problem with its one-tap fixes (editor/fixes.js): inline beside its cause, or a card at the bottom */
.problem .problem-title { display: block; color: var(--ink); }
.problem .problem-detail { color: var(--ink-2); }
.problem-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.problem-btn { white-space: normal; text-align: left; }
.problem-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.problem-btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.res-list .problem, .seg-chip .problem { margin: 6px 0 2px; }
.seg-chip .problem { flex-basis: 100%; color: var(--ink-2); font-size: .8rem; }
.problem-card { position: fixed; left: 50%; bottom: 116px; transform: translateX(-50%); z-index: 210; width: min(92vw, 520px); box-sizing: border-box;
  background: var(--raised-2); color: var(--ink); border: 1px solid var(--line-2); border-left: 3px solid var(--warn); border-radius: 12px;
  padding: 12px 40px 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: .86rem; }
.problem-card.err { border-left-color: var(--err); }
.problem-card .problem { margin: 0; }
.problem-close { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: .9rem; }
.problem-close:hover { background: var(--raised); color: var(--ink); }
.has-problem .toast { bottom: calc(126px + var(--problem-h, 0px)); }
@media (max-width: 900px) {
  .problem-card { bottom: calc(70px + env(safe-area-inset-bottom)); width: calc(100vw - 32px); }
  .problem-btn { min-height: 40px; padding: 8px 12px; font-size: .84rem; }
  .has-problem .toast { bottom: calc(80px + env(safe-area-inset-bottom) + var(--problem-h, 0px)); }
}

/* ---- Phones first (roadmap 114; shared patterns in phone.css) ------------------------------------------------------
   The main button is pinned to the bottom of the settings sheet (#panel-foot is a .rr-bar). In Studio it sits right
   above the five steps, which stay the way between steps (the button names the next one); in Quick and Day by day,
   which have no step bar, it is the last thing on the screen, clear of the home indicator. */
@media (max-width: 900px) {
  .panel-foot.rr-bar { padding: 8px 16px 10px; border-top: 1px solid var(--line); }
  .panel-foot:has(> .next-export:only-child) { display: block; }
  .panel-foot .primary-btn.big { min-height: 46px; padding: 10px; }
  .studio-app:is([data-mode="builder"], [data-mode="quick"]) .side { padding-bottom: 0; }
  .studio-app:is([data-mode="builder"], [data-mode="quick"]) .panel-foot.rr-bar { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .dlg-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  /* An open box (e.g. "Which airports?" after building the route from photos) sits over the photos' result card,
     which waits behind its backdrop rather than covering the box's choices. */
  .dlg-backdrop { z-index: 195; }
  .menu { z-index: 196; } /* still above a box it was opened from */
  /* Typing (the keyboard covers the bottom of the screen, core/phone.js): the editor is lifted above it, the map gives
     up its room and the timeline steps aside, so the field and the main button stay in view. */
  html.rr-kb-open .studio-app { height: auto; bottom: var(--rr-kb, 0px); grid-template-rows: auto minmax(0, 1fr) auto 0 minmax(0, var(--sheet-h)) auto; }
  html.rr-kb-open .timeline-area { display: none; }
}
/* Boxes on a phone are bottom sheets (phone.css), with their buttons along the bottom. */
@media (max-width: 760px) {
  .dlg-head { padding: 8px 10px 8px 18px; }
  .dlg-head h2 { font-size: 1.25rem; }
  .dlg-body { padding: 14px 16px; }
  .dlg-foot { padding-left: 16px; padding-right: 16px; }
  .dlg-foot .btn { min-height: 46px; justify-content: center; }
  .modal-card.rr-sheet { transform: none; }
  .modal-card .rr-grab { margin: -12px 0 6px; }
  .mode-sheet.rr-sheet { padding-top: 12px; }
  .mode-sheet .rr-grab { margin: 0 0 8px; }
  .mode-sheet.rr-sheet::before { display: none; }
  .mode-back.cover .mode-sheet { border-radius: 22px; padding-bottom: 18px; }
  .mode-back.cover .mode-sheet.rr-sheet::before { display: block; }
  /* Menus too: a sheet along the bottom, its choices within thumb reach (a tap elsewhere closes it, as before). */
  .menu.rr-sheet { left: 0 !important; right: 0; top: auto !important; bottom: var(--rr-kb, 0px); width: auto; min-width: 0; max-width: none; max-height: 72dvh;
    padding: 4px 8px max(10px, env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; border-bottom: 0; box-shadow: 0 -18px 50px rgba(0, 0, 0, .55);
    animation: rr-sheet-up .26s cubic-bezier(.2, .8, .2, 1) both; overscroll-behavior: contain; }
  .menu .rr-grab { margin: 0 0 2px; }
  .menu .menu-note { max-width: none; }
  /* The photo's box has many buttons: three to a row, "Done" last (bottom right), the note above them. */
  .dlg:has(.photo-dlg) .dlg-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .dlg:has(.photo-dlg) .dlg-foot > .mini { grid-column: 1 / -1; text-align: center; }
  .dlg:has(.photo-dlg) .dlg-foot .btn { padding: 6px 8px; font-size: .82rem; line-height: 1.15; white-space: normal; text-align: center; }
}
/* Every control at least 44 × 44 px to a finger (tests/browser/phone_targets_test.py). */
@media (max-width: 760px), (pointer: coarse) {
  .icon-btn, .restart-btn, .play-btn { width: 44px; height: 44px; }
  .m-scene, .job-pill { height: 44px; }
  .primary-btn, .btn, .btn2, .btn2.small, .ghost-btn, .chip, .b-day, .sub-step, .seg button, .modal-btn, .share-btn, .ap-item, .ap-chip, .ap-place, .res-row,
  .speed-pill, .fit-chip, .link-btn, .seg-chip > button, .b-back, .b-mode, .b-drop, .drop, .b-gpx, .b-suggest, .b-result, .icon-choice, .track, .problem-btn, .menu > button,
  .scene-tab, .view-switch button, .check, .ap-waiting, details.more > summary, summary.sec-title, .dlg summary, .tiny-btn { min-height: 44px; }
  .tiny-btn, .scene-tab .more, .problem-close { min-width: 44px; min-height: 44px; }
  .btn2, .btn, .ap-chip, .chip, .b-day, .speed-pill, .link-btn { display: inline-flex; align-items: center; justify-content: center; }
  .seg { flex-wrap: wrap; }
  .seg button { min-width: 44px; }
  .sw { width: 44px; height: 44px; }
  .swatches { gap: 6px; }
  input[type=text], input[type=number], input[type=search], input[type=date], input[type=email], input[type=password], select, textarea,
  .b-input, .b-search, .style-search, .modal-input, .trip-title { min-height: 44px; font-size: 16px; } /* 16 px: no zooming in on focus */
  input[type=range] { height: 44px; margin: 0; }
  input[type=color] { min-width: 44px; height: 44px; }
  .map-toolbar button { min-width: 44px; min-height: 44px; }
  .time-box { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  /* The timeline's photo and sign marks: a tap there lands on the timeline, which goes to that moment. */
  .tl-mark { pointer-events: none; }
  .sheet-handle::before { content: ""; position: absolute; left: 0; right: 0; top: -22px; bottom: 0; } /* up over the map's edge, not the play button */
  .view-switch button { padding: 4px 14px; }
  .point .nm { min-height: 44px; }
  .problem-close { top: 0; right: 0; }
}
