/* jomijo - the APP SCREEN styles every app ships a copy of (keep the copies identical; the accent comes from --accent) */
:root {
  --bg: #0b1020; --panel: #121a33; --panel-2: #18223f; --line: #26314f; --ink: #eef2ff; --muted: #9aa5c4;
  --accent: #8b5cf6; --accent-2: #a78bfa; --ok: #22c55e; --bad: #f87171; --warn: #fbbf24;
  --r: 16px; --font: "Inter", "SF Pro Text", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.top { display: flex; align-items: center; gap: 14px; padding: 12px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(11, 16, 32, 0.92); backdrop-filter: blur(10px); z-index: 5; }
.top h1 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.top h1 img { border-radius: 7px; }
.home { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 600; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); }
.home:hover { color: var(--ink); border-color: var(--muted); }
.home-ico { font-size: 16px; }

.wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 24px; max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; align-items: start; }
@media (max-width: 860px) { .wrap { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 12px; } }

/* the preview */
.stage { position: sticky; top: 76px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
@media (max-width: 860px) { .stage { position: static; } }
.frame { position: relative; border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); line-height: 0; }
.frame canvas { display: block; width: 100%; height: 100%; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
.hint { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.frame[data-shape="portrait"] { aspect-ratio: 9 / 16; height: min(72vh, 760px); max-width: 100%; }
.frame[data-shape="landscape"] { aspect-ratio: 16 / 9; width: 100%; }
@media (max-width: 860px) { .frame[data-shape="portrait"] { height: min(62vh, 640px); } }
/* the 3-2-1 and the REC badge sit on top of the canvas, so they are never in the video */
.over { position: absolute; inset: 0; display: grid; place-items: center; font: 800 clamp(90px, 22vw, 180px)/1 var(--font); color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6); background: rgba(3, 6, 18, 0.25); pointer-events: none; }
.recdot { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 999px; background: #ef4444; color: #fff; font: 700 13px/1.4 var(--font); font-variant-numeric: tabular-nums; pointer-events: none; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .recdot { animation: none; } }
/* while filming: only Stop works */
body.recording .controls, body.recording .tabs, body.recording .tabpanel .field, body.recording #camTools { opacity: 0.4; pointer-events: none; }
.btn.stop { background: #ef4444; border-color: #ef4444; }
.controls { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; }
.controls input[type=range] { flex: 1; accent-color: var(--accent); }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 86px; text-align: right; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; flex: none; }
.round.ghost { background: var(--panel-2); }

/* the panel */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 6px 18px 20px; min-width: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -18px 16px; padding: 0 10px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 14px 10px 12px; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
@media (max-width: 460px) { .tabs { gap: 0; padding: 0 4px; } .tabs button { padding: 13px 8px 11px; font-size: 14px; } }
.now { display: grid; gap: 2px; padding: 12px 14px; background: var(--panel-2); border-radius: var(--r); margin-bottom: 14px; }
.now strong { font-size: 16px; }
.field { display: grid; gap: 6px; margin: 0 0 14px; min-width: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 10px; }
@media (max-width: 460px) { .row2, .row3 { grid-template-columns: 1fr; } }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { display: grid; justify-items: start; gap: 2px; text-align: left; padding: 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; font-weight: 700; }
.seg button small { color: var(--muted); font-weight: 500; font-size: 12px; }
.seg button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); }
.shape-ico { display: inline-block; border: 2px solid currentColor; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.shape-ico.v { width: 10px; height: 16px; } .shape-ico.h { width: 18px; height: 11px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; }
.swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 600; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.big { width: 100%; padding: 15px; font-size: 16px; border-radius: 14px; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.ghost { background: none; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.note { padding: 10px 12px; border-radius: 12px; background: var(--panel-2); }
.note.warn { color: var(--warn); }
.msg { font-size: 13px; color: var(--ok); }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps > li { counter-increment: s; position: relative; padding-left: 40px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); font-weight: 800; font-size: 14px; }
.steps > li > strong { display: block; margin: 3px 0 10px; }
.ais { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.ai { padding: 7px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 600; }
.ai:hover { border-color: var(--accent); }
#promptOut { margin-top: 10px; }
.chk { padding: 12px 14px; border-radius: 12px; margin: 10px 0; background: var(--panel-2); border-left: 4px solid var(--muted); }
.chk ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.chk.bad { border-color: var(--bad); } .chk.bad strong { color: var(--bad); }
.chk.ok { border-color: var(--ok); } .chk.warn { border-color: var(--warn); }

.mine { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.mine li { display: flex; align-items: center; gap: 6px; }
.mine li.muted { padding: 10px 0; }
.mine-open { flex: 1; min-width: 0; display: grid; text-align: left; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; }
.mine-open strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine li.on .mine-open { border-color: var(--accent); }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; flex: none; }

/* the "video ready" dialog */
.exp { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.exp::backdrop { background: rgba(3, 6, 18, 0.72); backdrop-filter: blur(4px); }
.exp h2 { margin: 0 0 14px; font-size: 20px; }
.exp video { width: 100%; max-height: 52vh; border-radius: 14px; background: #000; display: block; }
.exp[data-state="done"] .error-only, .exp[data-state="error"] .done-only { display: none; }
#noCam { margin-top: 4px; }

/* affiliate cards (ads.js) */
.slot { margin: 14px 0 0; }
.ad-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.ad-card:hover { border-color: var(--accent); }
.ad-art { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; background: var(--bg); overflow: hidden; }
.ad-art img { width: 100%; height: 100%; object-fit: cover; }
.ad-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ad-title { font-size: 15px; }
.ad-text { color: var(--muted); font-size: 13px; }
.ad-cta { flex: none; padding: 8px 12px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.ad-tag { position: absolute; top: 6px; right: 8px; font-size: 10px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.ad-card.ad-big { flex-direction: column; text-align: center; padding: 18px; gap: 10px; }
.ad-card.ad-big .ad-art { width: 72px; height: 72px; font-size: 40px; border-radius: 18px; }
.ad-card.ad-big .ad-title { font-size: 17px; }
.ad-card.ad-big .ad-cta { padding: 10px 18px; font-size: 14px; }
.ad-card.ad-line { padding: 8px 12px; }
.ad-card.ad-line .ad-art { width: 32px; height: 32px; font-size: 18px; border-radius: 8px; }
.ad-card.ad-line .ad-title { font-size: 13px; }
.ad-card.ad-line .ad-cta { padding: 6px 10px; font-size: 12px; }
@media (max-width: 460px) { .ad-card:not(.ad-big) .ad-text { display: none; } }
