/* Shortsmith.
 *
 * One stylesheet, no framework. The whole interface is a left rail and a work
 * area, and the work area is one of four views - that is not enough structure
 * to earn a build step, and a build step is a thing that breaks between the
 * repository and the container.
 *
 * Layout is grid at the top level and flex inside it. Colours are all tokens,
 * because the caption preview has to tint itself from user-chosen values at
 * runtime and mixing hardcoded colours with those produces a panel that is
 * half themed.
 */

:root {
  --bg: #0a0c11;
  --surface: #11141c;
  --surface-2: #171b25;
  --surface-3: #1e2330;
  --line: #262c3a;
  --line-soft: #1c212c;

  --text: #e8ebf2;
  --text-dim: #a2aabd;
  --muted: #6f7891;

  --accent: #7c5cff;
  --accent-soft: #2a2450;
  --accent-line: #4a3bb0;
  --good: #2fd08a;
  --warn: #ffb454;
  --danger: #ff5f6b;

  --radius: 10px;
  --radius-lg: 14px;
  --rail: 244px;

  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

/* Scrollbars. Left alone on mobile, where they are overlays anyway. */
@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb {
    background: var(--line); border-radius: 6px;
    border: 3px solid transparent; background-clip: content-box;
  }
  ::-webkit-scrollbar-thumb:hover { background-color: #333b4d; background-clip: content-box; }
}

[hidden] { display: none !important; }

/* ── shell ──────────────────────────────────────────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  height: 100vh;
  overflow: hidden;
}

.rail {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}

.rail-brand .mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), #4a9dff);
  color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 14px rgba(124, 92, 255, .35);
}
.rail-brand b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.rail-brand span { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }

.rail-nav { flex: 1; overflow-y: auto; padding: 6px 10px 10px; }

.rail-group { margin-bottom: 4px; }
.rail-group > h6 {
  margin: 14px 8px 6px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}

.rail-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 10px; margin-bottom: 2px;
  background: none; border: 0; border-radius: 8px;
  color: var(--text-dim); font-weight: 500;
  cursor: pointer;
}
.rail-link:hover { background: var(--surface-2); color: var(--text); }
.rail-link.on { background: var(--accent-soft); color: #fff; }
.rail-link.on .ico { color: var(--accent); }
.rail-link .ico { width: 18px; flex: 0 0 18px; color: var(--muted); }
.rail-link .ico svg { display: block; width: 18px; height: 18px; }
.rail-link .tag {
  margin-left: auto; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 20px;
  background: var(--surface-3); color: var(--muted);
}
.rail-link[disabled] { opacity: .38; cursor: not-allowed; }

.rail-foot { border-top: 1px solid var(--line); padding: 12px; }

.credits {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  margin-bottom: 10px;
}
.credits-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}
.credits-top b { font-size: 15px; color: var(--text); letter-spacing: 0; text-transform: none; }
.credits-bar {
  height: 4px; margin-top: 8px; border-radius: 3px;
  background: var(--surface-3); overflow: hidden;
}
.credits-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.credits-bar i.low { background: var(--warn); }
.credits-bar i.out { background: var(--danger); }
.credits small { display: block; margin-top: 7px; font-size: 11px; color: var(--muted); }

.who { display: flex; align-items: center; gap: 9px; }
.who img, .who .avatar-fallback {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3); flex: 0 0 28px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  color: var(--muted);
}
.who div { min-width: 0; flex: 1; }
.who b { display: block; font-size: 12.5px; font-weight: 600; }
.who span { display: block; font-size: 11px; color: var(--muted); }
.who button {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 4px; border-radius: 6px;
}
.who button:hover { color: var(--danger); background: var(--surface-2); }

/* ── work area ──────────────────────────────────────────────────────────── */

.work { display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; height: 58px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: 0 0 58px;
}
.topbar h1 { font-size: 15.5px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.topbar p { margin: 0; font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }

.view { flex: 1; overflow-y: auto; padding: 22px; }
.view.flush { padding: 0; }

.stack { display: flex; flex-direction: column; gap: 16px; }

/* ── panels ─────────────────────────────────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.panel > header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
}
.panel > header h2 { font-size: 13.5px; font-weight: 650; margin: 0; }
.panel > header p { margin: 0; font-size: 12px; color: var(--muted); }
.panel > header .spacer { flex: 1; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 12px; }

/* ── controls ───────────────────────────────────────────────────────────── */

.field { display: block; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > span {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  margin-bottom: 6px;
}
.field > span em {
  margin-left: auto; font-style: normal; font-size: 11px;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.field small { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); }

input[type=text], input[type=number], select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
}
input[type=text]:focus, input[type=number]:focus, select:focus, textarea:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .16);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
select { appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%236f7891'%3E%3Cpath d='M2 4.5 6 8.5 10 4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  background-size: 12px; }

input[type=range] {
  width: 100%; -webkit-appearance: none; appearance: none;
  background: transparent; height: 18px; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 3px; background: var(--surface-3);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
}
input[type=range]::-moz-range-track { height: 4px; border-radius: 3px; background: var(--surface-3); }
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
}

input[type=color] {
  width: 34px; height: 30px; padding: 2px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 7px; cursor: pointer;
}
.colour-row { display: flex; align-items: center; gap: 8px; }
.colour-row input[type=text] { font-family: var(--mono); font-size: 12px; }

.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 12px; }
.switch:last-child { margin-bottom: 0; }
.switch input { display: none; }
.switch i {
  width: 34px; height: 19px; flex: 0 0 34px; border-radius: 12px;
  background: var(--surface-3); position: relative; transition: background .15s;
}
.switch i::after {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 13px; height: 13px; border-radius: 50%; background: #7a8299;
  transition: transform .15s, background .15s;
}
.switch input:checked + i { background: var(--accent-soft); }
.switch input:checked + i::after { transform: translateX(15px); background: var(--accent); }
.switch div { min-width: 0; }
.switch b { display: block; font-size: 12.5px; font-weight: 600; }
.switch small { display: block; font-size: 11.5px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font-weight: 600; font-size: 13px;
  padding: 9px 15px; border-radius: 8px; cursor: pointer;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #333c4f; background: var(--surface-3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 3px 12px rgba(124, 92, 255, .3);
}
.btn.primary:hover:not(:disabled) { background: #8b6dff; border-color: #8b6dff; }
.btn.ghost { background: none; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); border-color: transparent; background: none; }
.btn.danger:hover:not(:disabled) { background: rgba(255, 95, 107, .1); }
.btn.small { padding: 6px 11px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 20px; padding: 6px 12px; font-size: 12.5px; font-weight: 600;
  color: var(--text-dim); cursor: pointer;
}
.chip:hover { border-color: #333c4f; color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: #fff; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font-weight: 600; font-size: 12.5px;
  padding: 11px 12px; margin-bottom: -1px; cursor: pointer;
}
.tabs button:hover { color: var(--text-dim); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

/* ── notices ────────────────────────────────────────────────────────────── */

.note {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--radius); padding: 11px 13px;
  font-size: 12.5px; line-height: 1.5;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-dim);
}
.note b { color: var(--text); font-weight: 650; }
.note svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; }
.note.warn { background: rgba(255, 180, 84, .08); border-color: rgba(255, 180, 84, .3); color: #f0c68a; }
.note.warn b, .note.warn svg { color: var(--warn); }
.note.bad { background: rgba(255, 95, 107, .08); border-color: rgba(255, 95, 107, .3); color: #f5a4aa; }
.note.bad b, .note.bad svg { color: var(--danger); }
.note.good { background: rgba(47, 208, 138, .08); border-color: rgba(47, 208, 138, .28); color: #93e2c0; }
.note.good b, .note.good svg { color: var(--good); }

.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  max-width: min(380px, calc(100vw - 36px)); pointer-events: none;
}
.toast {
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 10px 14px;
  box-shadow: var(--shadow); font-size: 12.5px;
  animation: slide-in .2s ease-out; pointer-events: auto;
}
.toast.bad { border-left-color: var(--danger); }
.toast.good { border-left-color: var(--good); }
.toast b { display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
@keyframes slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 12px; }
.empty h3 { margin: 0 0 6px; font-size: 15px; color: var(--text-dim); font-weight: 600; }
.empty p { margin: 0 auto; max-width: 42ch; font-size: 13px; line-height: 1.6; }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .7s linear infinite; flex: 0 0 15px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── drop zone ──────────────────────────────────────────────────────────── */

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius-lg);
  padding: 52px 24px; text-align: center; cursor: pointer;
  background: var(--surface); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent-line); background: var(--surface-2); }
.drop input { display: none; }
.drop svg { width: 34px; height: 34px; color: var(--muted); margin-bottom: 12px; }
.drop h3 { margin: 0 0 5px; font-size: 15px; font-weight: 650; }
.drop p { margin: 0; color: var(--muted); font-size: 12.5px; }
.drop strong { color: var(--accent); }

/* ── the shorts editor ──────────────────────────────────────────────────── */

.editor {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 380px;
  gap: 0; height: 100%; overflow: hidden;
}
.editor-stage {
  display: flex; flex-direction: column; overflow: hidden;
  border-right: 1px solid var(--line); background: #06070a;
}
.editor-side { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
.editor-side .side-body { flex: 1; overflow-y: auto; padding: 16px; }

.stage-wrap {
  flex: 1; display: grid; place-items: center; padding: 18px; overflow: hidden;
}
.stage {
  position: relative; background: #000; border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow); max-height: 100%; max-width: 100%;
}
.stage video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* The caption overlay. Positioned in percentages of the stage so it tracks
   whatever size the stage happens to be - the same style has to look right in
   a 300px preview and a 1080px export, and the export is the authority. */
.cap-layer {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cap {
  position: absolute; left: 50%; width: 92%;
  transform: translate(-50%, -50%);
  text-align: center; line-height: 1.18;
  word-break: break-word;
}
.cap .w { display: inline-block; transition: color .07s linear, transform .07s ease-out; }
.cap .emoji { display: inline-block; }

/* The framing overlay: a draggable window over the source. */
.frame-pad { position: absolute; inset: 0; cursor: grab; }
.frame-pad.dragging { cursor: grabbing; }
.frame-pad::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
  border: 2px solid var(--accent); border-radius: 4px;
  pointer-events: none;
}

.transport {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-top: 1px solid var(--line);
  background: var(--surface); flex: 0 0 auto;
}
.transport .play {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text);
}
.transport .play:hover { border-color: var(--accent-line); }
.transport .time { font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.scrub { flex: 1; position: relative; height: 26px; cursor: pointer; }
.scrub .track {
  position: absolute; left: 0; right: 0; top: 11px; height: 4px;
  background: var(--surface-3); border-radius: 3px; overflow: hidden;
}
.scrub .track i { display: block; height: 100%; background: var(--accent); }
.scrub .marks { position: absolute; inset: 0; pointer-events: none; }
.scrub .marks b {
  position: absolute; top: 7px; width: 2px; height: 12px;
  background: rgba(255, 255, 255, .28); border-radius: 1px;
}

/* ── caption list ───────────────────────────────────────────────────────── */

.cues { display: flex; flex-direction: column; gap: 6px; }
.cue {
  display: grid; grid-template-columns: 54px 1fr auto; gap: 10px;
  align-items: start; padding: 9px 10px;
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: 9px; cursor: pointer;
}
.cue:hover { border-color: var(--line); }
.cue.on { border-color: var(--accent-line); background: var(--accent-soft); }
.cue time {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; padding-top: 2px;
}
.cue .txt { font-size: 12.5px; line-height: 1.45; word-break: break-word; }
.cue textarea {
  min-height: 0; padding: 4px 6px; font-size: 12.5px;
  background: var(--surface); border-radius: 6px;
}
.cue .spk {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  background: var(--surface-3); white-space: nowrap;
}

/* ── statement card editor ──────────────────────────────────────────────── */

.card-editor {
  display: grid; grid-template-columns: 1fr 400px; gap: 0;
  height: 100%; overflow: hidden;
}
.card-stage {
  display: grid; place-items: center; padding: 24px; overflow: auto;
  background: #06070a; border-right: 1px solid var(--line);
}
.card-stage img {
  max-width: 100%; max-height: 100%;
  border-radius: 8px; box-shadow: var(--shadow);
  background: var(--surface-2);
}

/* ── tables ─────────────────────────────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }

.pill {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-dim);
}
.pill.good { background: rgba(47, 208, 138, .14); color: var(--good); }
.pill.warn { background: rgba(255, 180, 84, .14); color: var(--warn); }
.pill.bad { background: rgba(255, 95, 107, .14); color: var(--danger); }

/* ── progress ───────────────────────────────────────────────────────────── */

.progress {
  display: flex; flex-direction: column; gap: 8px;
  padding: 13px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line);
}
.progress-top { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.progress-top b { font-weight: 600; }
.progress-top span { margin-left: auto; font-family: var(--mono);
  font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-bar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--accent);
  border-radius: 3px; transition: width .3s ease; }

/* ── modal ──────────────────────────────────────────────────────────────── */

.modal {
  position: fixed; inset: 0; z-index: 150;
  display: grid; place-items: center; padding: 20px;
  background: rgba(4, 5, 8, .7); backdrop-filter: blur(3px);
}
.modal-card {
  width: min(460px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 22px;
}
.modal-card h2 { margin: 0 0 8px; font-size: 16px; }
.modal-card > p { margin: 0 0 16px; color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.modal-cost {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--surface-2); border-radius: 8px; font-size: 12.5px;
}
.modal-cost b { font-family: var(--mono); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ── landing ────────────────────────────────────────────────────────────── */

.landing {
  min-height: 100vh; display: grid; place-items: center; padding: 40px 20px;
  background:
    radial-gradient(900px circle at 50% -10%, rgba(124, 92, 255, .18), transparent 60%),
    var(--bg);
}
.landing-inner { width: min(560px, 100%); text-align: center; }
.landing .mark {
  width: 54px; height: 54px; margin: 0 auto 22px; border-radius: 16px;
  display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, var(--accent), #4a9dff);
  box-shadow: 0 10px 34px rgba(124, 92, 255, .4);
}
.landing h1 { margin: 0 0 10px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.landing > .landing-inner > p {
  margin: 0 auto 28px; max-width: 44ch; color: var(--text-dim);
  font-size: 14.5px; line-height: 1.65;
}
.landing .cta {
  display: inline-flex; align-items: center; gap: 9px;
  background: #5865F2; color: #fff; text-decoration: none;
  padding: 12px 22px; border-radius: 10px; font-weight: 650; font-size: 14px;
  box-shadow: 0 6px 22px rgba(88, 101, 242, .34);
}
.landing .cta:hover { background: #6b76f5; }
.landing .cta svg { width: 20px; height: 15px; fill: currentColor; }
.landing .hint { margin-top: 14px; font-size: 12px; color: var(--muted); }
.landing .features {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left;
}
.landing .features li {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px;
}
.landing .features b { display: block; font-size: 20px; margin-bottom: 8px; }
.landing .features strong { display: block; font-size: 13px; margin-bottom: 3px; }
.landing .features small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.setup {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px; margin-top: 8px;
}
.setup h2 { margin: 0 0 10px; font-size: 15px; }
.setup p { color: var(--text-dim); font-size: 13px; line-height: 1.65; }
.setup code {
  font-family: var(--mono); font-size: 12px; background: var(--surface-3);
  padding: 2px 6px; border-radius: 5px; color: #b9a3ff;
}
.setup ul { padding-left: 18px; }
.setup li { margin-bottom: 5px; }

/* ── responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .editor, .card-editor { grid-template-columns: 1fr; }
  .editor-stage, .card-stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .editor { overflow-y: auto; height: auto; }
  .editor-side { overflow: visible; }
  .editor-side .side-body { overflow: visible; }
}

@media (max-width: 780px) {
  :root { --rail: 0px; }
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; inset: 0 auto 0 0; width: 244px; z-index: 120;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  .rail.open { transform: none; }
  .rail-toggle { display: grid !important; }
  .landing .features { grid-template-columns: 1fr; }
  .view { padding: 14px; }
}

.rail-toggle {
  display: none; width: 34px; height: 34px; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; color: var(--text-dim);
}
