/* Echo slideshow app, after reference/design-mock.png: night-blue glass panels, one vivid blue,
   the preview as the one bright thing on the page. Colours sampled from the mock. */

:root {
  color-scheme: dark;
  --night: #07142a;            /* page */
  --night-deep: #050f1d;
  --glass: #0d1b28;            /* cards */
  --glass-top: #112233;        /* top of a card's gloss */
  --glass-panel: #12212f;      /* the tabbed panel, a step up */
  --well: #14212e;             /* insets: song row, option tiles */
  --well-hover: #192a3a;
  --rim: rgba(150, 185, 255, 0.09);
  --rim-strong: rgba(150, 185, 255, 0.16);
  --sheen: rgba(255, 255, 255, 0.05);
  --ink: #f1f5fb;
  --ink-2: #c3cedd;
  --ink-3: #8593a8;
  --ink-4: #5b6a80;
  --blue: #1b66ff;             /* the one accent */
  --blue-hi: #3a82ff;
  --blue-deep: #0b2f62;        /* chosen option fill */
  --blue-glow: rgba(27, 102, 255, 0.45);
  --track: #304356;
  --warn: #f2b65c;
  --bad: #ff7d7d;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --gap: 16px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  font-family: 'Heebo', 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { background: var(--night-deep); }
body {
  margin: 0; min-height: 100dvh; color: var(--ink);
  background:
    radial-gradient(ellipse 90% 50% at 50% -8%, #12253d 0%, rgba(18, 37, 61, 0) 70%),
    linear-gradient(180deg, #0a1829 0%, var(--night) 40%, var(--night-deep) 100%);
  padding-bottom: env(safe-area-inset-bottom);
}
button, input, a, output { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.pic { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; flex: none; }

/* Surfaces: one recipe, a soft top sheen, a hairline rim, a quiet drop. */
.panel, .card, .screen {
  background: linear-gradient(180deg, var(--glass-top) 0%, var(--glass) 55%);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--sheen), 0 0 0 1px var(--rim), 0 12px 30px -18px rgba(0, 0, 0, 0.8);
  min-width: 0;
}

/* Header ----------------------------------------------------------------------------------- */
.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  max-width: 1240px; margin: 0 auto; padding: 28px 20px 22px;
  padding-top: max(28px, env(safe-area-inset-top));
}
.top .export { justify-self: start; }
.top .gloss-btn { justify-self: end; }
.top-end { justify-self: end; display: flex; align-items: center; gap: 10px; }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.1; text-align: center; text-wrap: balance; }

/* Buttons ---------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-md);
  border: 0; cursor: pointer; text-decoration: none; font-weight: 600; white-space: nowrap;
  transition: background-color 160ms var(--ease), transform 120ms var(--ease), opacity 160ms, box-shadow 160ms;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  color: #fff;
  background: linear-gradient(180deg, #3079ff 0%, #1760fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 22px -10px var(--blue-glow);
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #4187ff 0%, #226bff 100%); }
.btn.secondary { background: var(--well); box-shadow: inset 0 0 0 1px var(--rim-strong); }
.btn.secondary:hover:not(:disabled) { background: var(--well-hover); }
.btn.quiet { background: transparent; color: var(--ink-2); }
.btn.quiet:hover { color: var(--ink); background: var(--well); }
.btn.wide { width: 100%; }
.export { min-height: 56px; padding: 0 26px; font-size: 19px; font-weight: 700; border-radius: 16px; }
.export svg.i { width: 26px; height: 26px; }
.export.busy { background: var(--well); box-shadow: inset 0 0 0 2px var(--blue); font-variant-numeric: tabular-nums; }

.gloss-btn {
  width: 56px; height: 56px; border-radius: 16px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(180deg, #1c2c40 0%, #142233 100%); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 0 1px var(--rim), 0 8px 18px -12px rgba(0, 0, 0, 0.9);
  transition: transform 120ms var(--ease), background-color 160ms;
}
.gloss-btn svg.i { width: 28px; height: 28px; stroke-width: 2.2; }
.gloss-btn:hover { background: linear-gradient(180deg, #213349 0%, #182739 100%); }
.gloss-btn:active { transform: scale(0.96); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0;
  cursor: pointer; background: transparent; color: var(--ink-2); transition: background-color 160ms, color 160ms;
}
.icon-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.glass-btn {
  display: grid; place-items: center; border: 0; cursor: pointer; color: #fff;
  background: rgba(14, 24, 38, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: background-color 160ms, transform 120ms var(--ease);
}
/* No backdrop blur on anything over the picture: it would be recomputed on every video frame. */
.glass-btn:hover { background: rgba(14, 24, 38, 0.9); }

/* Layout ----------------------------------------------------------------------------------- */
.layout { display: grid; gap: var(--gap); padding: 0 16px 40px; max-width: 1240px; margin: 0 auto; }
.stage { grid-area: stage; min-width: 0; }
.tabs-panel { grid-area: panel; }
.strip-panel { grid-area: strip; }
.cards { grid-area: cards; display: grid; gap: var(--gap); }
.col { display: contents; }
/* Phone order: the music first, then length, transitions, shape, loop. */
.c-music { order: 1; } .c-length { order: 2; } .c-transitions { order: 3; } .c-format { order: 4; } .c-loop { order: 5; }
.layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "strip" "panel" "cards"; }

@media (min-width: 980px) {
  :root { --gap: 18px; }
  .layout {
    padding: 0 20px 48px;
    grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
    grid-template-areas: "stage panel" "strip strip" "cards cards";
  }
  /* The tabbed panel is exactly as tall as the preview; its photo grid scrolls inside. */
  .tabs-panel { height: 0; min-height: 100%; display: flex; flex-direction: column; }
  .tabs-panel .pane { flex: 1; min-height: 0; overflow-y: auto; }
  #pane-photos { display: flex; flex-direction: column; overflow: hidden; }
  #pane-photos .grid-scroll { flex: 1; min-height: 0; overflow-y: auto; margin-top: 10px; padding-bottom: 2px; scrollbar-width: thin; scrollbar-color: #2b3d52 transparent; }
  #pane-photos .grid-scroll .grid, #pane-photos .grid-scroll .grid-empty { margin-top: 0; }
  .cards { grid-template-columns: 1fr 1fr; align-items: start; }
  .tab { min-height: 68px; }
  .add-photos { min-height: 50px; }
  .tabs-panel .tile img { aspect-ratio: 1 / 0.86; }
  .col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
}

/* Preview ---------------------------------------------------------------------------------- */
.screen { padding: 10px; border-radius: var(--r-xl); background: linear-gradient(180deg, #13243a 0%, #0c1826 100%); }
.frame {
  position: relative; border-radius: var(--r-md); overflow: hidden; background: #000;
  aspect-ratio: var(--ar, 16 / 9); display: grid; place-items: center; margin-inline: auto;
}
/* Tall and square videos: as wide as fits, but never taller than most of the screen. */
.frame.tall { width: min(100%, calc(min(66vh, 620px) * var(--arn, 1))); }
#view { display: block; width: 100%; height: 100%; }
.frame:fullscreen { border-radius: 0; height: 100%; width: 100%; aspect-ratio: auto; }
.frame:fullscreen #view { object-fit: contain; }
.empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 24px; text-align: center;
  background: radial-gradient(ellipse at 50% 35%, #142a47 0%, #060d18 78%);
}
.empty svg.big { width: 40px; height: 40px; color: var(--blue-hi); margin-bottom: 6px; stroke-width: 1.6; }
.empty-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.empty-sub { color: var(--ink-3); margin-bottom: 10px; }

/* Overlays sit where the design puts them: full screen top left, the count top right. */
.fs { position: absolute; top: 12px; left: 12px; width: 48px; height: 48px; border-radius: 12px; }
.counter {
  position: absolute; top: 14px; right: 14px; direction: ltr; padding: 6px 14px; border-radius: 10px;
  background: rgba(14, 24, 38, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.nav { position: absolute; top: 50%; width: 46px; height: 56px; border-radius: 12px; transform: translateY(-50%); }
.nav:active { transform: translateY(-50%) scale(0.95); }
.nav svg.i { width: 26px; height: 26px; stroke-width: 2.4; }
.nav.prev { inset-inline-start: 10px; }
.nav.next { inset-inline-end: 10px; }

.transport {
  position: absolute; inset-inline: 12px; bottom: 12px; display: flex; align-items: center; gap: 14px;
  padding: 8px 16px 8px 12px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 32, 48, 0.8), rgba(10, 18, 30, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.play {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center;
  cursor: pointer; background: transparent; color: #fff; flex: none; transition: transform 120ms var(--ease), opacity 160ms;
}
.play svg.i { width: 22px; height: 22px; stroke-width: 2.6; }
.play .i-play { transform: translateX(1px); }
.play:active:not(:disabled) { transform: scale(0.94); }
.play:disabled { opacity: 0.35; cursor: not-allowed; }
.play .i-pause, .playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
.clock { font-size: 15px; font-weight: 500; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Sliders: blue fill from the start side (right, in Hebrew), white knob. */
input[type=range] {
  flex: 1; min-width: 0; height: 36px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none; direction: rtl; --fill: 0%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(to left, #0a72ff 0%, #2d86ff var(--fill), var(--track) var(--fill));
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(27, 102, 255, 0.18);
}
input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: var(--track); }
input[type=range]::-moz-range-progress { height: 8px; border-radius: 4px; background: #1b6bff; }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; }
input[type=range]:disabled { opacity: 0.4; cursor: not-allowed; }
.transport input[type=range]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -6px; }

/* Tabs panel ------------------------------------------------------------------------------- */
.tabs-panel { padding: 10px; background: linear-gradient(180deg, #15263a 0%, var(--glass-panel) 40%); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 10px; }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 78px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--ink-2);
  cursor: pointer; font-size: 16px; font-weight: 500; transition: background-color 160ms, color 160ms, box-shadow 160ms;
}
.tab svg.i { width: 30px; height: 30px; stroke-width: 1.9; }
.tab:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); }
.tab[aria-selected=true] {
  color: #fff; background: var(--blue-deep);
  box-shadow: inset 0 0 0 2px var(--blue), 0 0 18px -4px var(--blue-glow);
}
.pane { min-width: 0; }

.add-photos { min-height: 56px; font-size: 18px; border-radius: 12px; position: relative; }
.add-photos svg.i { width: 26px; height: 26px; stroke-width: 2.4; }
.add-photos .count {
  position: absolute; inset-inline-end: 14px; font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.18); font-variant-numeric: tabular-nums;
}
.add-photos .count:empty { display: none; }
.drop { border-radius: 12px; transition: box-shadow 160ms var(--ease); }
body.dragging .drop, body.dragging .grid-empty { box-shadow: 0 0 0 2px var(--blue-hi); }

.grid {
  list-style: none; margin: 10px 0 0; padding: 2px; display: grid; gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid:empty { display: none; }
.grid-empty {
  margin-top: 10px; padding: 28px 16px; text-align: center; color: var(--ink-3); font-size: 14px;
  border: 2px dashed rgba(150, 185, 255, 0.18); border-radius: var(--r-md);
}
.tile {
  position: relative; border-radius: var(--r-sm); overflow: hidden; background: var(--well);
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.tile img { width: 100%; height: auto; aspect-ratio: 1 / 0.92; object-fit: cover; display: block; pointer-events: none; }
.tile.loading { aspect-ratio: 1 / 0.92; }
.tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); pointer-events: none; }
.tile.selected::after { box-shadow: inset 0 0 0 3px var(--blue); }
.check {
  position: absolute; top: 7px; inset-inline-start: 7px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--blue); color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.check svg.i { width: 15px; height: 15px; stroke-width: 3; }
.tile .remove {
  position: absolute; top: 0; inset-inline-end: 0; width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; padding: 0; opacity: 0; visibility: hidden; transition: opacity 160ms, visibility 0s 160ms;
}
.tile .remove span {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(8, 14, 24, 0.78); transition: background-color 160ms;
}
.tile .remove svg.i { width: 14px; height: 14px; stroke-width: 2.8; }
/* Hidden means untouchable too: an invisible button would still catch nearby taps on a phone. */
@media (hover: hover) {
  .tile:hover .remove { opacity: 1; visibility: visible; transition: opacity 160ms; }
}
.tile:focus-within .remove, .tile.selected .remove { opacity: 1; visibility: visible; transition: opacity 160ms; }
.tile .remove:hover span { background: #c42a40; }
.tile.placeholder, .thumb.placeholder { opacity: 0.25; }
.tile.loading { cursor: default; background: linear-gradient(100deg, var(--well) 30%, #1d2e40 50%, var(--well) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -300% 0; } }
.ghost {
  position: fixed; z-index: 50; pointer-events: none; border-radius: var(--r-sm); overflow: hidden;
  box-shadow: 0 0 0 3px var(--blue), 0 14px 32px rgba(0, 0, 0, 0.55); opacity: 0.95;
}
.ghost img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.sorting { cursor: grabbing; user-select: none; }

.soon { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 40px 16px; }
.soon-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--well); color: var(--blue-hi); margin-bottom: 8px; box-shadow: inset 0 0 0 1px var(--rim-strong); }
.soon-icon svg.i { width: 30px; height: 30px; }
.soon-title { font-size: 18px; font-weight: 700; }
.soon-sub { color: var(--ink-3); max-width: 34ch; }
.soon .btn { margin-top: 12px; }
.titles-form { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea {
  min-height: 44px; padding: 8px 14px; border: 0; border-radius: var(--r-md); font: inherit; font-size: 16px; color: var(--ink);
  background: var(--well); box-shadow: inset 0 0 0 1px var(--rim-strong); transition: box-shadow 160ms;
}
.field input:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field input:placeholder-shown, .field textarea:placeholder-shown { direction: rtl; } /* the Hebrew examples read right to left */
.field textarea { resize: vertical; line-height: 1.45; min-height: 150px; }
.field-sub { font-size: 13px; color: var(--ink-3); }

/* Strip ------------------------------------------------------------------------------------ */
.strip-panel { display: flex; align-items: center; gap: 10px; padding: 10px; }
.add-tile {
  flex: none; width: 92px; height: 142px; border-radius: var(--r-md); cursor: pointer; color: #fff;
  background: transparent; border: 2px dashed rgba(200, 215, 240, 0.4); display: grid; place-items: center;
  transition: border-color 160ms, background-color 160ms;
}
.add-tile svg.i { width: 40px; height: 40px; stroke-width: 2.4; }
.add-tile:hover { border-color: var(--blue-hi); background: rgba(27, 102, 255, 0.08); }
.strip {
  flex: 1; min-width: 0; list-style: none; margin: 0; padding: 4px; display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.thumb {
  position: relative; flex: none; width: 118px; height: 142px; border-radius: var(--r-md); overflow: hidden;
  scroll-snap-align: start; cursor: pointer; background: var(--well);
  touch-action: pan-x; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: box-shadow 200ms var(--ease), opacity 200ms;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); pointer-events: none; transition: box-shadow 200ms var(--ease); }
.thumb.current::after { box-shadow: inset 0 0 0 4px var(--blue); }
.thumb.current { box-shadow: 0 0 18px -2px var(--blue-glow); }
.thumb .secs {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); direction: ltr;
  padding: 2px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; line-height: 22px;
  background: rgba(8, 14, 24, 0.72); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.strip.rendering .thumb { opacity: 0.3; }
.strip.rendering .thumb.rendered { opacity: 1; }
.strip-more {
  flex: none; width: 40px; height: 142px; border-radius: var(--r-md); border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #1a2a3d, #122031); box-shadow: inset 0 0 0 1px var(--rim);
  display: grid; place-items: center;
}
.strip-more svg.i { width: 26px; height: 26px; stroke-width: 2.4; }

/* Cards ------------------------------------------------------------------------------------ */
.card { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; letter-spacing: -0.005em; margin-bottom: 16px; }
.card-head svg.i { width: 30px; height: 30px; stroke-width: 2; }
.hint { font-size: 13px; color: var(--ink-3); margin-top: 8px; text-wrap: pretty; }
.status { font-size: 13px; color: var(--ink-2); }
.status:not(:empty) { margin-top: 8px; }
.status.error { color: var(--bad); }

/* Song */
.song-card {
  display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-md);
  background: var(--well); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.song-thumb {
  width: 76px; height: 64px; flex: none; border-radius: 8px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, #1d4fb8, #0b2450); color: #cfe0ff;
}
.song-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; grid-area: 1 / 1; }
.song-thumb svg.i { grid-area: 1 / 1; }
.song-thumb.has-img svg.i { display: none; }
.song-thumb:not(.has-img) img { display: none; }
.song-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.song-name { font-size: 17px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-name small { color: var(--ink-3); font-size: 13px; margin-inline-start: 6px; font-variant-numeric: tabular-nums; }
.wave { display: block; width: 100%; height: 34px; }
.remove-song svg.i { width: 26px; height: 26px; }
.volume-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.volume-row .icon-btn { color: #fff; }
.volume-row .icon-btn svg.i { width: 28px; height: 28px; }
.volume-row .v-off, .volume-row.muted .v-on { display: none; }
.volume-row.muted .v-off { display: block; }
.volume-pct { width: 44px; text-align: end; font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Length */
.hold-row { display: flex; align-items: center; gap: 16px; }
.hold-value { display: flex; flex-direction: column; align-items: center; line-height: 1.1; min-width: 46px; }
.hold-value b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hold-value span { font-size: 15px; color: var(--ink-2); }
.c-length.fitted .hold-value b { color: var(--ink-2); }
.summary { margin-top: 10px; font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; text-wrap: pretty; }
.summary .warn { display: block; margin-top: 4px; color: var(--warn); }

/* Switches */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; cursor: pointer; }
.switch-row.plain { justify-content: flex-start; margin-top: 4px; }
.switch-row.disabled { cursor: not-allowed; opacity: 0.5; }
.switch-text { display: flex; flex-direction: column; }
.switch-title { font-size: 17px; font-weight: 500; }
.switch-sub { font-size: 13px; color: var(--ink-3); }
.switch {
  -webkit-appearance: none; appearance: none; flex: none; width: 66px; height: 38px; margin: 0; border-radius: 999px;
  background: #2a3a4d; position: relative; cursor: pointer; transition: background-color 200ms var(--ease);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}
.switch::after {
  content: ''; position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 220ms var(--ease);
}
.switch:checked { background: linear-gradient(180deg, #2f7bff, #1760fb); }
.switch:checked::after { transform: translateX(-28px); }
.switch:disabled { cursor: not-allowed; }

/* Option tiles (transitions, shape) */
.tiles { display: grid; gap: 10px; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 104px; padding: 12px 6px; border-radius: var(--r-md); border: 0; cursor: pointer; color: var(--ink-2);
  background: linear-gradient(180deg, #172534 0%, #132130 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: background-color 160ms, box-shadow 160ms var(--ease), transform 120ms var(--ease), color 160ms;
}
.tile-opt .pic { color: #aebbd0; }
.tile-opt:hover:not(:disabled) { color: var(--ink); background: linear-gradient(180deg, #1b2b3c 0%, #162535 100%); }
.tile-opt:active:not(:disabled) { transform: scale(0.97); }
.tile-opt[aria-checked=true] {
  color: #fff; background: linear-gradient(180deg, #0d3770 0%, var(--blue-deep) 100%);
  box-shadow: inset 0 0 0 2px var(--blue), 0 0 20px -6px var(--blue-glow);
}
.tile-opt[aria-checked=true] .pic { color: #8fbcff; }
.tile-opt:disabled { opacity: 0.4; cursor: not-allowed; }
.opt-name { font-size: 16px; font-weight: 500; }
.opt-num { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.1; }
.c-format .tile-opt { min-height: 124px; }
.c-format .opt-name { margin-top: -4px; }
.soon-tag { font-size: 12px; color: var(--ink-3); }

.echo-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 10px 14px; text-align: start;
  border: 0; border-radius: var(--r-md); cursor: pointer; color: var(--ink-2); background: transparent;
  box-shadow: inset 0 0 0 1px var(--rim-strong); transition: background-color 160ms, box-shadow 160ms, color 160ms;
}
.echo-opt svg.i { color: #8fbcff; }
.echo-opt:hover:not(:disabled) { background: rgba(255, 255, 255, 0.03); color: var(--ink); }
.echo-opt[aria-checked=true] { color: #fff; background: var(--blue-deep); box-shadow: inset 0 0 0 2px var(--blue); }
.echo-opt:disabled { opacity: 0.45; cursor: not-allowed; }
.echo-text { display: flex; flex-direction: column; }
.echo-title { font-weight: 600; }
.echo-sub { font-size: 13px; color: var(--ink-3); }
.echo-opt[aria-checked=true] .echo-sub { color: var(--ink-2); }
.wall-opt { margin-top: 8px; padding-inline-start: 10px; }
.style-thumb { width: 72px; height: 41px; flex: none; border-radius: 7px; object-fit: cover; background: #000; box-shadow: 0 0 0 1px var(--rim-strong); }
.echo-style { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; padding: 4px; border-radius: 12px; background: var(--night-deep); }
.seg { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-3); cursor: pointer; font-weight: 500; }
.seg[aria-checked=true] { background: var(--well-hover); color: #fff; box-shadow: inset 0 0 0 1px var(--rim-strong); }

/* Dialogs ---------------------------------------------------------------------------------- */
dialog {
  width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-xl); color: var(--ink);
  background: linear-gradient(180deg, #15263a 0%, #0e1b2a 100%);
  box-shadow: 0 0 0 1px var(--rim-strong), 0 24px 60px rgba(0, 0, 0, 0.6);
}
dialog::backdrop { background: rgba(2, 6, 14, 0.74); backdrop-filter: blur(4px); }
dialog[open] { animation: rise 260ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.sheet { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.sheet h2 { font-size: 22px; font-weight: 700; }
.sheet .maker { text-align: center; font-size: 12px; color: var(--ink-4); margin-top: 8px; }
.progress { height: 10px; border-radius: 5px; background: var(--night-deep); overflow: hidden; margin-top: 12px; box-shadow: inset 0 0 0 1px var(--rim); }
.bar { height: 100%; width: 100%; background: linear-gradient(to left, #1b66ff, #4a8fff); transform-origin: right; transform: scaleX(0); transition: transform 600ms var(--ease); }
.pct { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
#result { width: 100%; border-radius: var(--r-md); background: #000; margin-top: 4px; max-height: 50vh; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* Phones ----------------------------------------------------------------------------------- */
@media (max-width: 979px) {
  .top { padding: 16px 16px 14px; padding-top: max(16px, env(safe-area-inset-top)); gap: 8px; }
  h1 { font-size: clamp(16px, 5vw, 22px); white-space: nowrap; }
  .export { min-height: 46px; padding: 0 12px; font-size: 16px; border-radius: 13px; gap: 6px; }
  .export svg.i { width: 22px; height: 22px; }
  .gloss-btn { width: 46px; height: 46px; border-radius: 13px; }
  .gloss-btn svg.i { width: 24px; height: 24px; }
  .screen { padding: 6px; border-radius: var(--r-lg); }
  .frame { border-radius: 12px; }
  .frame.tall { width: min(100%, calc(min(60vh, 560px) * var(--arn, 1))); }
  .fs { top: 8px; left: 8px; width: 40px; height: 40px; border-radius: 10px; }
  .fs svg.i { width: 20px; height: 20px; }
  .counter { top: 8px; right: 8px; padding: 4px 10px; font-size: 14px; }
  .nav { width: 36px; height: 44px; border-radius: 10px; }
  .nav svg.i { width: 22px; height: 22px; }
  .nav.prev { inset-inline-start: 6px; }
  .nav.next { inset-inline-end: 6px; }
  .transport { inset-inline: 6px; bottom: 6px; gap: 10px; padding: 4px 12px 4px 6px; border-radius: 12px; }
  .play { width: 36px; height: 36px; }
  .play svg.i { width: 18px; height: 18px; }
  .clock { font-size: 13px; }
  .strip-panel { padding: 8px; gap: 8px; }
  .add-tile { width: 64px; height: 100px; }
  .add-tile svg.i { width: 30px; height: 30px; }
  .thumb { width: 84px; height: 100px; }
  .thumb .secs { font-size: 13px; padding: 1px 8px; bottom: 6px; }
  .strip { gap: 8px; }
  .strip-more { width: 32px; height: 100px; }
  .tab { min-height: 68px; font-size: 15px; }
  .tab svg.i { width: 26px; height: 26px; }
  .card { padding: 16px; }
  .card-head { font-size: 18px; margin-bottom: 14px; }
  .card-head svg.i { width: 26px; height: 26px; }
  .tiles.four { gap: 8px; }
  .tile-opt { min-height: 92px; }
  .opt-name { font-size: 15px; }
  .song-thumb { width: 60px; height: 52px; }
}
@media (max-width: 350px) {
  .export span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-property: opacity, background-color, color !important; }
}

/* Per-photo text -------------------------------------------------------------------------- */
.tile .cap-btn {
  position: absolute; bottom: 0; inset-inline-start: 0; width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.tile .cap-btn span {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(8, 14, 24, 0.72); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); transition: background-color 160ms;
}
.tile .cap-btn svg.i { width: 15px; height: 15px; stroke-width: 2.6; }
.tile .cap-btn:hover span { background: var(--blue-deep); }
.tile.has-cap .cap-btn span { background: var(--blue); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9); }
.thumb .cap-mark {
  display: none; position: absolute; top: 4px; inset-inline-start: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}
.thumb.has-cap .cap-mark { display: block; }
.photo-cap {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px 12px; align-items: end;
  margin-top: 10px; padding: 12px; border-radius: var(--r-md); background: var(--well); box-shadow: inset 0 0 0 1px var(--rim-strong);
}
.photo-cap[hidden] { display: none; }
.photo-cap-thumb { width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover; align-self: center; }
.photo-cap-field input { background: var(--glass); }
.photo-cap-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.photo-cap .status { grid-column: 1 / -1; margin: 0; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.cap-list-wrap { display: flex; flex-direction: column; gap: 6px; padding: 14px 2px 8px; border-top: 1px solid var(--rim); margin-top: 6px; }
.cap-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cap-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 44px; gap: 10px; align-items: center; }
.cap-row-pic { position: relative; width: 56px; height: 56px; }
.cap-row-pic img { width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover; display: block; }
.cap-row-num {
  position: absolute; bottom: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--night); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 1px var(--rim-strong); font-variant-numeric: tabular-nums;
}
.cap-row.has-cap .cap-row-num { background: var(--blue); }
.cap-row input {
  min-width: 0; min-height: 44px; padding: 8px 12px; border: 0; border-radius: var(--r-md); font: inherit; font-size: 16px; color: var(--ink);
  background: var(--well); box-shadow: inset 0 0 0 1px var(--rim-strong);
}
.cap-row input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.cap-row input::placeholder { color: var(--ink-3); }
.cap-row input:placeholder-shown { direction: rtl; }
.cap-row-clear[hidden] { visibility: hidden; display: inline-grid; }

/* A caption's size and place (11/10/2026): four size steps, and the photo in the show's shape with a
   3x3 pad of places over it and the text drawn where it will be. Every target is 44 px or more. */
.cap-look { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 14px; padding-top: 6px; min-width: 0; }
.cap-look-part { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cap-size { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--night-deep); }
.cap-size .seg { min-height: 54px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; font-size: 13px; line-height: 1.15; }
.cap-size .seg[aria-checked=true] { background: var(--blue-deep); box-shadow: inset 0 0 0 2px var(--blue); }
.cap-size-a { font-size: var(--a); font-weight: 700; line-height: 1; }
.cap-pos { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cap-stage {
  position: relative; width: min(100%, calc(300px * var(--arn, 1.7778)), 440px); aspect-ratio: var(--ar, 16 / 9); margin-inline: auto;
  border-radius: 10px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--rim-strong); container-type: size;
}
.cap-stage-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.78); }
.cap-ghost {
  position: absolute; max-width: 86%; color: #fbf8f2; font-weight: 700; line-height: 1.2; white-space: normal; overflow-wrap: anywhere;
  font-size: calc(var(--capf, 0.034) * var(--cs, 1) * min(100cqw, 100cqh) * 1.45); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none; unicode-bidi: plaintext;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cap-ghost.upper { text-transform: uppercase; letter-spacing: 0.04em; }
.cap-ghost.example { opacity: 0.55; }
.cap-ghost[data-h=left] { left: 7%; text-align: left; }
.cap-ghost[data-h=right] { right: 7%; text-align: right; }
.cap-ghost[data-h=center] { left: 50%; transform: translateX(-50%); text-align: center; }
.cap-ghost[data-v=top] { top: 9%; }
.cap-ghost[data-v=bottom] { bottom: 9%; }
.cap-ghost[data-v=middle] { top: 50%; transform: translateY(-50%); }
.cap-ghost[data-v=middle][data-h=center] { transform: translate(-50%, -50%); }
.cap-pad { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.cap-pad button { position: relative; min-width: 44px; min-height: 44px; border: 0; padding: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cap-pad button::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.75), 0 0 6px rgba(0, 0, 0, 0.6); transition: transform 0.2s var(--ease), background 0.2s;
}
.cap-pad button:hover::after { background: rgba(255, 255, 255, 0.35); }
.cap-pad button:active::after { transform: scale(1.3); }
/* The chosen place: outlined, its dot gone (the text itself is there). */
.cap-pad button[aria-checked=true] { background: rgba(27, 102, 255, 0.14); box-shadow: inset 0 0 0 2px var(--blue); border-radius: 8px; }
.cap-pad button[aria-checked=true]::after { display: none; }
.cap-auto {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 6px 14px; border: 0; border-radius: var(--r-md);
  background: var(--glass); color: var(--ink-2); cursor: pointer; box-shadow: inset 0 0 0 1px var(--rim-strong); flex-wrap: wrap;
}
.cap-auto-title { font-weight: 600; }
.cap-auto-sub { font-size: 13px; color: var(--ink-3); }
.cap-auto[aria-checked=true] { color: #fff; background: var(--blue-deep); box-shadow: inset 0 0 0 2px var(--blue); }
.cap-auto[aria-checked=true] .cap-auto-sub { color: var(--ink-2); }
.cap-pos-hint { margin: 0; }
.cap-row.with-look { grid-template-columns: 56px minmax(0, 1fr) 44px 44px; }
.cap-row-look[hidden] { visibility: hidden; display: inline-grid; }

/* Paid download (stage 11) ----------------------------------------------------------------- */
/* The locked part of the scrub bar: greyed past the free part, a lock where it starts. */
.scrub-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; --lock: 100%; }
.scrub-wrap input[type=range] { width: 100%; }
.scrub-wrap.locked input[type=range]::-webkit-slider-runnable-track {
  background:
    linear-gradient(to left, #0a72ff 0%, #2d86ff var(--fill), var(--track) var(--fill), var(--track) var(--lock), transparent var(--lock)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 3px, rgba(255, 255, 255, 0.05) 3px 6px);
}
.scrub-wrap.locked input[type=range]::-moz-range-track {
  background: linear-gradient(to left, var(--track) var(--lock), rgba(255, 255, 255, 0.1) var(--lock));
}
.scrub-lock {
  position: absolute; inset-inline-start: var(--lock); top: 50%; transform: translate(50%, -50%);
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; pointer-events: none;
  background: #0e1a28; color: var(--ink-2); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.scrub-lock svg.i { width: 13px; height: 13px; stroke-width: 2.4; }

.paywall {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 3;
  background: radial-gradient(ellipse at 50% 45%, rgba(6, 13, 24, 0.72) 0%, rgba(4, 9, 17, 0.9) 75%);
  backdrop-filter: blur(3px);
}
.paywall-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; max-width: 360px; }
.paywall-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(27, 102, 255, 0.16); color: var(--blue-hi); box-shadow: inset 0 0 0 1px rgba(58, 130, 255, 0.35); }
.paywall-icon svg.i { width: 24px; height: 24px; stroke-width: 2.2; }
.paywall-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.paywall-sub { color: var(--ink-2); font-size: 15px; text-wrap: balance; margin-bottom: 6px; }
.paywall .btn { min-height: 50px; font-size: 17px; font-weight: 700; }
.paywall-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 4px; border: 0; background: none;
  color: var(--blue-hi); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn svg.i { width: 16px; height: 16px; }
.link-btn:hover { color: #6ea4ff; }

.paybar { margin-top: 10px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--glass); box-shadow: 0 0 0 1px var(--rim); }
.paybar-note { font-size: 15px; color: var(--ink-2); text-wrap: pretty; }
.paybar-note b { color: var(--ink); }
.paybar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.paybar-cta { min-height: 50px; font-size: 17px; font-weight: 700; flex: 1 1 auto; }
.paybar.paid .paybar-note::before, .paybar.locked .paybar-note::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-inline-end: 8px; border-radius: 50%; background: #3ccf8e; vertical-align: 2px; }
.paybar.locked .paybar-note::before { background: var(--ink-3); }

.buy-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.buy-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: 15px; }
.buy-list svg.i { width: 20px; height: 20px; flex: none; color: #3ccf8e; stroke-width: 2.6; margin-top: 1px; }
.buy-rule { font-size: 14px; color: var(--warn); margin-top: 4px; }
.buy-price { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.buy-price b { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; }
.buy-price s { font-size: 18px; color: var(--ink-3); }
.coupon .link-btn { padding: 0; }
.coupon-row { display: flex; gap: 8px; margin-top: 4px; }
.coupon-row input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border: 0; border-radius: 12px; font: inherit; font-weight: 600; letter-spacing: 0.06em;
  background: var(--night-deep); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rim-strong); text-transform: uppercase;
}
.coupon-row input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.coupon-row input::placeholder { text-transform: none; letter-spacing: 0; color: var(--ink-3); direction: rtl; }
.status.ok { color: #3ccf8e; }
.buy-fields { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.export-q { font-size: 17px; color: var(--ink); text-wrap: pretty; }

/* Exported: the project no longer changes; its editing controls rest. */
body.locked .tabs-panel, body.locked .strip-panel, body.locked .cards { opacity: 0.5; pointer-events: none; user-select: none; }
@media (max-width: 979px) {
  .paywall { padding: 8px; }
  .paywall-card { gap: 4px; }
  .paywall-icon { display: none; }
  .paywall-title { font-size: 17px; }
  .paywall-sub { font-size: 13px; margin-bottom: 2px; }
  .paywall .btn { min-height: 42px; font-size: 15px; padding: 0 16px; }
  .paywall .link-btn { min-height: 30px; font-size: 13px; }
  .frame.tall .paywall-icon { display: grid; }
  .paybar { margin-top: 8px; padding: 10px 12px; }
  .export .lbl-long { display: none; }
  .paybar-note { font-size: 14px; }
}
