/* =====================================================================
   Motio — components for onboarding, home, wallpaper, paywall, settings
   Consumes Dark Pro tokens from theme.css.
   ===================================================================== */

/* ---------- Shared bits ---------- */
.pro-tag { display: inline-block; margin-left: 6px; padding: 3px 5px; border-radius: 4px; border: 1px solid var(--accent); color: var(--accent); font: 600 9px/1 var(--font-mono); letter-spacing: .1em; font-style: normal; vertical-align: 2px; }
.pro-chip { height: 30px; padding: 0 11px; display: inline-flex; align-items: center; gap: 5px; border-radius: 8px; border: 1px solid var(--accent); color: var(--accent); font: 600 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.pro-chip.on { background: var(--accent); color: var(--accent-fg); }
.pro-chip .i { width: 14px; height: 14px; stroke-width: 2.6; }
.nav-actions { display: flex; align-items: center; gap: 4px; }
.foot-note { margin: 14px 20px 0; font: 500 12px/1.5 var(--font-mono); color: var(--muted); }
.foot-note a { color: var(--accent); }
.btn-line { height: 50px; display: grid; place-items: center; border-radius: var(--btn-radius); border: 1px solid var(--border-strong); font-weight: 600; font-size: 16px; }
.chev { width: 18px; height: 18px; color: var(--muted); }
.success .actions .ghost { display: grid; place-items: center; }

/* ---------- Alerts (system + in-app) ---------- */
.alert-wrap { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; background: rgb(0 0 0 / .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.alert-wrap.on { opacity: 1; pointer-events: auto; }
.alert { width: 270px; border-radius: 14px; overflow: hidden; background: oklch(26% .004 260 / .94); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); text-align: center; transform: scale(1.1); transition: transform .25s cubic-bezier(.2,.9,.3,1.2); }
.alert-wrap.on .alert { transform: none; }
.alert-body { padding: 20px 16px 16px; }
.alert-body b { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; }
.alert-body p { margin-top: 6px; font-size: 13px; line-height: 1.4; color: oklch(85% 0 0); }
.alert-btns { display: flex; border-top: 1px solid oklch(100% 0 0 / .12); }
.alert-btns.col { flex-direction: column; }
.alert-btns button { flex: 1; min-height: 44px; font-size: 17px; color: var(--alert-tint, var(--accent)); }
.alert-btns button + button { border-left: 1px solid oklch(100% 0 0 / .12); }
.alert-btns.col button + button { border-left: 0; border-top: 1px solid oklch(100% 0 0 / .12); }
.alert-btns .strong { font-weight: 600; }
.alert-btns .danger { color: oklch(66% .21 25); font-weight: 600; }
.alert.system { --alert-tint: oklch(70% .15 250); }

/* ---------- Onboarding ---------- */
.ob { flex: 1; overflow: hidden; }
.ob-track { height: 100%; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.ob-track::-webkit-scrollbar { display: none; }
.ob-slide { flex: 0 0 100%; scroll-snap-align: start; display: flex; flex-direction: column; padding: 0 24px; }
.ob-art { height: 430px; flex: none; display: grid; place-items: center; position: relative; }
.ob-slide .eyebrow { margin-top: 8px; }
.ob-slide .h1 { font-size: 30px; line-height: 1.08; }
.ob-slide .lede { font-size: 16px; max-width: 320px; }
.ob-card { position: relative; width: 236px; height: 330px; border-radius: 12px; overflow: hidden; outline: 1px solid var(--border); }
.ob-card::after, .ob-preview::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent calc(33.33% - .5px), rgb(255 255 255 / .22) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgb(255 255 255 / .22) 0 calc(66.66% + .5px), transparent 0),
  linear-gradient(transparent calc(33.33% - .5px), rgb(255 255 255 / .22) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgb(255 255 255 / .22) 0 calc(66.66% + .5px), transparent 0); }
.ob-card .corner { position: absolute; width: 18px; height: 18px; border: 2px solid var(--accent); z-index: 2; }
.ob-card .corner.tl { left: 10px; top: 46px; border-right: 0; border-bottom: 0; }
.ob-card .corner.tr { right: 10px; top: 46px; border-left: 0; border-bottom: 0; }
.ob-card .corner.bl { left: 10px; bottom: 10px; border-right: 0; border-top: 0; }
.ob-card .corner.br { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }
.ob-preview { position: relative; width: 300px; height: 250px; border-radius: 8px; overflow: hidden; outline: 1px solid var(--border); }
.ob-strip { position: relative; width: 268px; height: 46px; margin-top: 26px; }
.ob-strip-frames { position: absolute; inset: 0; display: flex; border-radius: 6px; overflow: hidden; }
.ob-strip-frames .frame { flex: 1; box-shadow: inset -1px 0 0 rgb(0 0 0 / .2); }
.ob-strip::before { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / .55); border-radius: 6px; }
.ob-win { position: absolute; top: -3px; bottom: -3px; width: 72px; left: 40px; border: 3px solid var(--fg); border-left-width: 12px; border-right-width: 12px; border-radius: 6px; box-shadow: 0 0 0 999px transparent; animation: obwin 4.5s ease-in-out infinite; backdrop-filter: brightness(1.8); -webkit-backdrop-filter: brightness(1.8); }
.ob-key { position: absolute; left: 50%; top: -22px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; }
.ob-key .i { width: 12px; height: 12px; stroke-width: 2.4; }
.ob-key::after { content: ""; position: absolute; top: 20px; left: 8.5px; width: 3px; height: 50px; background: var(--accent); border-radius: 2px; }
@keyframes obwin { 0%, 100% { left: 30px; } 50% { left: 166px; } }
.art-2 { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ob-lock { position: relative; width: 210px; height: 410px; border-radius: 34px; overflow: hidden; border: 6px solid oklch(22% .004 260); display: flex; flex-direction: column; align-items: center; padding-top: 44px; color: #fff; }
.ob-lock .ob-date { font-size: 12px; font-weight: 600; opacity: .9; }
.ob-lock .ob-time { font: 300 66px/1 -apple-system, "SF Pro Display", system-ui, sans-serif; letter-spacing: -.02em; margin-top: 2px; }
.ob-lock .badge-live { top: auto; bottom: 18px; left: 50%; transform: translateX(-50%); }
.ob-foot { flex: none; padding: 14px 24px 40px; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.dots { display: flex; gap: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--border-strong); transition: width .25s, background .25s; }
.dots i.on { width: 22px; background: var(--accent); }
.ob-foot .btn-primary { width: 100%; }

/* ---------- Home ---------- */
.new-card { display: block; margin: 0 16px; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.new-card-strip { height: 74px; display: flex; position: relative; overflow: hidden; }
.new-card-strip .frame { flex: 1; box-shadow: inset -1px 0 0 rgb(0 0 0 / .25); }
.new-card-strip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 38%; width: 24%; border: 2px solid var(--accent); border-left-width: 8px; border-right-width: 8px; border-radius: 4px; box-shadow: 0 0 0 999px rgb(0 0 0 / .45); }
.new-card-body { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.new-plus { width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; }
.new-plus .i { stroke-width: 2.6; }
.new-card-body div { flex: 1; min-width: 0; }
.new-card-body b { display: block; font-size: 17px; font-weight: 600; }
.new-card-body small { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }

.quota { display: block; margin: 12px 16px 0; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); }
.quota-top { display: flex; justify-content: space-between; align-items: baseline; }
.quota-bar { display: flex; gap: 4px; margin: 12px 0; }
.quota-bar i { flex: 1; height: 6px; border-radius: 2px; background: var(--surface-2); }
.quota-bar i.used { background: var(--fg); }
.quota-bar.full i.used { background: oklch(66% .21 25); }
.quota-cta { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--accent); }
.quota-cta .i { width: 16px; height: 16px; }

.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px; }
.ctile { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; text-align: left; }
.ctile .frame { position: absolute; inset: 0; }
.ctile .badge-live { left: 8px; top: 8px; height: 22px; padding: 0 7px 0 5px; font-size: 10px; }
.ctile .badge-live .i { width: 14px; height: 14px; }
.ctile .c-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 9px; background: linear-gradient(transparent, rgb(0 0 0 / .65)); color: #fff; }
.ctile .c-meta b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctile .c-meta span { font: 500 11px/1.4 var(--font-mono); opacity: .8; }
.ctile.fresh::after { content: "NEW"; position: absolute; right: 8px; top: 8px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 4px; background: var(--accent); color: var(--accent-fg); font: 700 10px/1 var(--font-mono); letter-spacing: .1em; }
.empty-state { margin: 8px 16px 0; padding: 36px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius); text-align: center; color: var(--muted); font-size: 14px; line-height: 1.45; }
.empty-state b { display: block; color: var(--fg); font-size: 16px; margin-bottom: 4px; }

.sheet.detail { padding: 10px 16px 28px; background: var(--surface); border: 1px solid var(--border); }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 0 auto 14px; }
.detail-top { display: flex; gap: 16px; align-items: flex-end; }
.detail-card { position: relative; width: 150px; height: 200px; flex: none; border-radius: 10px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; transition: transform .25s; }
.detail-card.pressing { transform: scale(1.04); }
.detail-card .frame { position: absolute; inset: 0; }
.detail-card .badge-live { left: 8px; top: 8px; }
.detail-card .press-hint { font-size: 10px; height: 22px; padding: 0 8px; bottom: 8px; }
.detail-card.pressing .press-hint { opacity: 0; }
.detail-meta { min-width: 0; padding-bottom: 4px; display: flex; flex-direction: column; gap: 6px; }
.detail-meta b { font-size: 19px; font-weight: 600; }
.detail-meta span { font: 500 12px/1.6 var(--font-mono); color: var(--muted); white-space: pre-line; }
.detail-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 0 10px; border-radius: 10px; background: var(--surface-2); font-size: 12px; font-weight: 500; }
.act .i { width: 22px; height: 22px; }
.act.primary { background: var(--accent); color: var(--accent-fg); }
.act.danger { color: oklch(68% .2 25); }

/* ---------- Wallpaper ---------- */
.lock { position: relative; width: 252px; height: 520px; margin: 4px auto 0; border-radius: 40px; overflow: hidden; border: 7px solid oklch(22% .004 260); outline: 1px solid var(--border); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; --zoom: 1.15; --px: 0px; --py: 0px; }
.lock:active { cursor: grabbing; }
.lock-frame { position: absolute; inset: -20%; transform: translate(var(--px), var(--py)) scale(var(--zoom)); }
.lock-ui { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding-top: 46px; color: #fff; pointer-events: none; text-shadow: 0 1px 12px rgb(0 0 0 / .25); }
.lock-island { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 76px; height: 22px; border-radius: 12px; background: #000; }
.lock-date { font-size: 13px; font-weight: 600; }
.lock-time { font: var(--clock-weight, 300) 78px/1 -apple-system, "SF Pro Display", system-ui, sans-serif; letter-spacing: -.02em; }
.lock-bottom { margin-top: auto; width: 100%; display: flex; justify-content: space-between; padding: 0 24px 26px; }
.lock-btn { width: 40px; height: 40px; border-radius: 50%; background: rgb(0 0 0 / .3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: grid; place-items: center; }
.lock-btn .i { width: 18px; height: 18px; }
.lock .badge-live { top: auto; bottom: 34px; left: 50%; transform: translateX(-50%); }
.lock-hint { display: block; margin-top: 12px; text-align: center; font: 500 11px/1 var(--font-mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.lock.guides::after { content: ""; position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, transparent calc(33.33% - .5px), rgb(255 255 255 / .35) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgb(255 255 255 / .35) 0 calc(66.66% + .5px), transparent 0),
  linear-gradient(transparent calc(33.33% - .5px), rgb(255 255 255 / .35) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgb(255 255 255 / .35) 0 calc(66.66% + .5px), transparent 0); }
.zoom-row { display: flex; align-items: center; gap: 12px; margin: 0 20px; color: var(--muted); }
.zoom-row .i { width: 18px; height: 18px; }
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 28px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--fill, 30%), var(--surface-2) 0); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9.5px; border-radius: 50%; background: var(--fg); box-shadow: 0 1px 4px rgb(0 0 0 / .4); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--surface-2); }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--fg); }
.steps { list-style: none; margin: 0 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.steps li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; }
.steps li + li { border-top: 1px solid var(--border); }
.step-n { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font: 600 12px/1 var(--font-mono); color: var(--muted); }
.step-n .i { width: 14px; height: 14px; stroke-width: 3; display: none; }
.steps li.done .step-n { background: var(--success); border-color: var(--success); color: oklch(15% 0 0); }
.steps li.done .step-n .i { display: block; }
.steps li.done .step-n em { display: none; }
.step-n em { font-style: normal; }
.steps b { display: block; font-size: 15px; font-weight: 600; }
.steps small { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); line-height: 1.35; }

/* ---------- Paywall ---------- */
.pw-hero { position: relative; height: 250px; display: grid; place-items: center; }
.fan { position: relative; width: 300px; height: 220px; }
.fan-card { position: absolute; top: 10px; left: 50%; width: 140px; height: 196px; margin-left: -70px; border-radius: 12px; overflow: hidden; outline: 1px solid oklch(100% 0 0 / .12); box-shadow: 0 20px 40px -18px rgb(0 0 0 / .8); }
.fan-card:nth-child(1) { transform: translateX(-92px) rotate(-9deg) scale(.88); opacity: .7; }
.fan-card:nth-child(3) { transform: translateX(92px) rotate(9deg) scale(.88); opacity: .7; }
.fan-card:nth-child(2) { z-index: 2; outline: 2px solid var(--accent); outline-offset: 0; }
.fan-card .badge-live { left: 8px; top: 8px; }
.title-block.center { text-align: center; }
.title-block.center .lede { margin-left: auto; margin-right: auto; max-width: 300px; }
.compare { width: calc(100% - 32px); margin: 0 16px; border-collapse: collapse; font-size: 14px; }
.compare th { font: 600 10px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 0 6px 10px; }
.compare th.pro { color: var(--accent); }
.compare td { padding: 11px 6px; border-top: 1px solid var(--border); text-align: center; font: 500 13px/1.2 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.compare td:first-child { text-align: left; font: 500 14px/1.2 var(--font-body); color: var(--fg); }
.compare td.pro { color: var(--fg); font-weight: 600; }
.compare .i { width: 16px; height: 16px; stroke-width: 2.6; vertical-align: -3px; }
.plans { display: flex; flex-direction: column; gap: 8px; margin: 22px 16px 0; }
.plan { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); text-align: left; transition: border-color .15s, background .15s; }
.plan[aria-checked="true"] { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 7%, transparent); }
.plan[aria-checked="true"] .radio { border: 7px solid var(--accent); }
.plan-text { flex: 1; }
.plan-text b { display: block; font-size: 16px; font-weight: 600; }
.plan-text small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.plan-price { font: 600 17px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 11px; color: var(--muted); font-weight: 500; }
.plan-tag { position: absolute; top: -9px; right: 14px; height: 18px; padding: 0 7px; display: grid; place-items: center; border-radius: 4px; background: var(--accent); color: var(--accent-fg); font: 700 9px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; font-style: normal; }
.pw-dock { flex-direction: column; align-items: stretch; gap: 10px; padding-bottom: 30px; }
.pw-dock .fine { text-align: center; font-size: 12px; color: var(--muted); }
.pw-dock .fine a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Settings ---------- */
.pro-banner { display: flex; align-items: center; gap: 14px; margin: 4px 16px 0; padding: 16px; border-radius: var(--radius); border: 1px solid var(--accent); background: color-mix(in oklch, var(--accent) 8%, var(--surface)); }
.pro-banner .logo { width: 44px; height: 44px; border-radius: 10px; }
.pro-banner .logo .i { width: 26px; height: 26px; }
.pro-banner div { flex: 1; min-width: 0; }
.pro-banner b { display: block; font-size: 16px; font-weight: 600; }
.pro-banner small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.pro-banner.is-pro { border-color: var(--border); background: var(--surface); }
.row-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; text-align: left; font-size: 16px; }
.row-link + .row-link, .tgl + .row-link, .row-link + .tgl { border-top: 1px solid var(--border); }
.row-link span:first-child { flex: 1; }
.row-link .val { color: var(--muted); }
.tgl.locked .switch { opacity: .5; }
.version { margin: 26px 0 0; text-align: center; font: 500 11px/1.6 var(--font-mono); color: var(--muted); letter-spacing: .06em; }

/* =====================================================================
   Differentiators — Smart Moment, Perfect Loop, Motion Brush,
   Wallpaper-Ready check. All on-device features.
   ===================================================================== */

/* ---------- Preview layers (brush still / seam crossfade) ---------- */
.preview > .frame.seam, .result-card > .frame.seam { opacity: 0; }
.preview > .frame, .result-card > .frame { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }

/* ---------- Tool row ---------- */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 16px 0; }
.tool { position: relative; height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; border: 1px solid var(--border); font: 600 10px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg); transition: border-color .15s, background .15s; }
.tool .i { width: 20px; height: 20px; }
.tool .pro-tag { position: absolute; top: 5px; right: 5px; margin: 0; font-size: 8px; padding: 2px 4px; }
.tool[aria-pressed="true"], .tool.on { border-color: var(--accent); color: var(--accent); background: color-mix(in oklch, var(--accent) 8%, transparent); }
.tool.on::after { content: ""; position: absolute; top: 7px; left: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.tool.busy .i { animation: spin 1s linear infinite; }

/* ---------- Smart Moment heatmap ---------- */
.heat { position: relative; display: flex; align-items: flex-end; gap: 1px; height: 30px; margin: 30px 36px 8px; }
.heat i { flex: 1; min-height: 2px; border-radius: 1px 1px 0 0; background: var(--surface-2); transition: background .2s; }
.heat i.in { background: color-mix(in srgb, var(--accent) 50%, var(--surface-2)); }
.heat i.hot.in { background: var(--accent); }
.peak { position: absolute; top: -20px; width: 18px; height: 18px; margin-left: -9px; border-radius: 4px; background: var(--fg); color: var(--bg); font: 700 10px/18px var(--font-mono); text-align: center; cursor: pointer; }
.peak::after { content: ""; position: absolute; left: 50%; bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: var(--fg); }
.peak.best { background: var(--accent); color: var(--accent-fg); }
.peak.best::after { border-top-color: var(--accent); }
.mini-btn { height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border); font: 600 11px/1 var(--font-mono); color: var(--accent); letter-spacing: .02em; }
.sharp { display: inline-block; margin-left: 6px; padding: 3px 6px; border-radius: 4px; font: 600 10px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; vertical-align: 2px; }
.sharp.ok { background: color-mix(in oklch, var(--success) 18%, transparent); color: var(--success); }
.sharp.meh { background: color-mix(in oklch, oklch(80% .15 75) 18%, transparent); color: oklch(80% .15 75); }

/* ---------- Wallpaper-Ready check ---------- */
.ready-chip { position: absolute; z-index: 2; right: 10px; top: 12px; height: 26px; padding: 0 9px 0 6px; display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; background: var(--success); color: oklch(15% 0 0); font: 700 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; transition: opacity .2s, transform .2s; }
.ready-chip .i { width: 14px; height: 14px; stroke-width: 3; }
.ready-chip.off { opacity: 0; transform: scale(.8); }
.ready-pill { font: 700 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; padding: 5px 7px; border-radius: 4px; }
.ready-pill.ok { background: color-mix(in oklch, var(--success) 18%, transparent); color: var(--success); }
.ready-pill.warn { background: color-mix(in oklch, oklch(80% .15 75) 18%, transparent); color: oklch(80% .15 75); }
.check { margin: 0 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.check-row + .check-row { border-top: 1px solid var(--border); }
.ck { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.ck .i { width: 13px; height: 13px; stroke-width: 3; }
.check-row.ok .ck, .ready-banner .ck { background: var(--success); color: oklch(15% 0 0); }
.check-row.warn .ck { background: oklch(80% .15 75); color: oklch(15% 0 0); }
.check-row.warn .ck .i { display: none; }
.check-row.warn .ck::after { content: "!"; font: 800 13px/1 var(--font-mono); }
.ck-text { flex: 1; min-width: 0; }
.ck-text b { display: block; font-size: 15px; font-weight: 600; }
.ck-text small { display: block; margin-top: 2px; font: 500 12px/1.35 var(--font-mono); color: var(--muted); }
.meter { position: relative; width: 70px; height: 6px; border-radius: 3px; background: var(--surface-2); flex: none; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--success); transition: width .4s, background .3s; }
.check-row.warn .meter i { background: oklch(80% .15 75); }
.meter-limit { position: absolute; top: -3px; bottom: -3px; left: 62%; width: 2px; background: var(--fg); opacity: .5; }
.check-fix { padding: 12px 16px 14px; border-top: 1px solid var(--border); background: color-mix(in oklch, oklch(80% .15 75) 7%, transparent); }
.check-fix p { font-size: 13px; line-height: 1.4; color: var(--muted); }
.check-fix q { color: var(--fg); }
.btn-fix { margin-top: 10px; height: 40px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; background: var(--fg); color: var(--bg); font-weight: 600; font-size: 15px; }
.btn-fix .i { width: 18px; height: 18px; }
.btn-fix.busy .i { animation: spin 1s linear infinite; }
.ready-banner { display: flex; gap: 12px; align-items: flex-start; margin: 14px 16px 0; padding: 12px 14px; border-radius: var(--radius); border: 1px solid color-mix(in oklch, var(--success) 40%, transparent); background: color-mix(in oklch, var(--success) 8%, transparent); }
.ready-banner.warn { border-color: color-mix(in oklch, oklch(80% .15 75) 40%, transparent); background: color-mix(in oklch, oklch(80% .15 75) 8%, transparent); }
.ready-banner.warn .ck { background: oklch(80% .15 75); }
.ready-banner b { display: block; font-size: 14px; font-weight: 600; }
.ready-banner small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.trouble-toggle { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 32px); margin: 14px 16px 0; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 15px; text-align: left; }
.trouble-toggle .i { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.trouble-toggle[aria-expanded="true"] .i { transform: rotate(90deg); }
.trouble { list-style: none; margin: 8px 16px 0; padding: 4px 16px; border-left: 2px solid var(--accent); }
.trouble li { padding: 8px 0; }
.trouble b { display: block; font-size: 14px; font-weight: 600; }
.trouble small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); line-height: 1.35; }

/* ---------- Motion Brush ---------- */
.brush-stage { position: relative; margin: 4px 16px 0; height: 400px; border-radius: 4px; overflow: hidden; outline: 1px solid var(--border); touch-action: none; user-select: none; -webkit-user-select: none; cursor: none; }
.brush-stage > .frame, .brush-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#bMove { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
#bOverlay { transition: opacity .2s; }
#bOverlay.hide { opacity: 0; }
.brush-stage .badge-live, .brush-stage .preview-tc { pointer-events: none; }
.brush-cursor { position: absolute; z-index: 3; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .4); pointer-events: none; opacity: 0; transition: opacity .15s; }
.brush-stage:hover .brush-cursor, .brush-cursor.on { opacity: 1; }
.dot-s, .dot-l { flex: none; border-radius: 50%; background: var(--muted); }
.dot-s { width: 6px; height: 6px; }
.dot-l { width: 16px; height: 16px; }
.qs button { font: 600 13px/1 var(--font-body); }

/* =====================================================================
   Tools — Muxer and Extract, linked from Home
   ===================================================================== */

/* ---------- Home: tools list + privacy note ---------- */
.tool-list { margin: 0 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tool-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; min-height: 64px; }
.tool-row + .tool-row { border-top: 1px solid var(--border); }
.tool-ico { width: 40px; height: 40px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.tool-ico .i { width: 21px; height: 21px; }
.tool-row .opt-text b { font-size: 16px; }
.tool-row:active { background: var(--surface); }
.tool-list + .quota { margin-top: 12px; }
.privacy { display: flex; gap: 10px; align-items: flex-start; margin: 26px 20px 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.privacy .i { width: 18px; height: 18px; color: var(--success); margin-top: 1px; }
.privacy b { color: var(--fg); font-weight: 600; }

/* ---------- Muxer: slots ---------- */
.mux-slots { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px; }
.slot { position: relative; height: 188px; border-radius: var(--radius); overflow: hidden; border: 1.5px dashed var(--border-strong); text-align: left; transition: border-color .15s; }
.slot .frame { position: absolute; inset: 0; opacity: 0; transition: opacity .2s; }
.slot.filled { border: 1px solid var(--border); }
.slot.filled .frame { opacity: 1; }
.slot.matched { border-color: var(--success); }
.slot-tag { position: absolute; z-index: 2; left: 8px; top: 8px; height: 22px; padding: 0 7px 0 5px; display: inline-flex; align-items: center; gap: 4px; border-radius: 5px; background: var(--badge-bg); color: var(--fg); font: 700 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.slot-tag .i { width: 13px; height: 13px; }
.slot.filled .slot-tag { color: var(--accent); }
.slot-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.slot-empty .i { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--surface-2); color: var(--fg); stroke-width: 2.4; }
.slot.filled .slot-empty { display: none; }
.slot-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 10px 9px; background: linear-gradient(transparent, rgb(0 0 0 / .65)); color: #fff; opacity: 0; }
.slot.filled .slot-meta { opacity: 1; }
.slot-meta b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-meta span { font: 500 11px/1.4 var(--font-mono); opacity: .8; }
.mux-join { position: absolute; z-index: 3; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-fg); box-shadow: 0 0 0 4px var(--bg); }
.mux-join .i { width: 16px; height: 16px; stroke-width: 3; }

.pair-hint { display: flex; align-items: center; gap: 12px; margin: 12px 16px 0; padding: 10px 12px; border-radius: var(--radius); border: 1px solid color-mix(in oklch, var(--success) 40%, transparent); background: color-mix(in oklch, var(--success) 8%, transparent); }
.pair-hint .frame { width: 36px; height: 48px; flex: none; border-radius: 5px; }
.pair-hint div:not(.frame) { flex: 1; min-width: 0; }
.pair-hint b { display: block; font-size: 14px; font-weight: 600; }
.pair-hint small { display: block; margin-top: 2px; font: 500 12px/1.3 var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Muxer: preview + picker ---------- */
.mux-card { background: #000; }
.mux-photo { position: absolute; inset: 0; z-index: 1; background: #000; }
.mux-photo .frame { position: absolute; inset: 0; transition: inset .3s cubic-bezier(.2,.8,.2,1); }
.mux-photo.fit .frame { inset: 31% 0; }
.check-row .switch, .check-row .mini-btn { flex: none; }
.picker { padding-top: 10px; }
.pick-grid { max-height: 470px; overflow-y: auto; border-radius: 14px; scrollbar-width: none; }
.pick-grid::-webkit-scrollbar { display: none; }
.match-tag { position: absolute; left: 6px; top: 6px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 4px; background: var(--success); color: oklch(15% 0 0); font: 700 8px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Extract: picker tiles ---------- */
.tile .badge-live { left: 6px; top: 6px; height: 20px; padding: 0 6px 0 4px; font-size: 9px; }
.tile .badge-live .i { width: 13px; height: 13px; }
.src-tag { position: absolute; left: 6px; bottom: 6px; height: 16px; padding: 0 5px; display: grid; place-items: center; border-radius: 4px; background: var(--accent); color: var(--accent-fg); font: 700 8px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- Extract: options ---------- */
.xlist { margin: 0 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.xopt + .xopt { border-top: 1px solid var(--border); }
.xhead { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; min-height: 62px; text-align: left; }
.xhead .ico { width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); background: var(--surface-2); display: grid; place-items: center; transition: background .15s, color .15s; }
.xhead .ico .i { width: 20px; height: 20px; }
.xopt.on .xhead .ico { background: var(--accent); color: var(--accent-fg); }
.box { width: 22px; height: 22px; flex: none; border-radius: 6px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: var(--accent-fg); transition: background .15s, border-color .15s; }
.box .i { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.xopt.on .box { background: var(--accent); border-color: var(--accent); }
.xopt.on .box .i { opacity: 1; }
.xbody { display: none; padding: 0 16px 14px 64px; }
.xopt.on .xbody { display: block; }
.xbody .seg { margin: 0 0 10px; }
.xbody .tgl { padding: 0; min-height: 40px; font-size: 15px; }
.xframe { margin-top: 4px; }
.xstrip { position: relative; height: 44px; margin: 14px 0 12px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: ew-resize; }
.xstrip-frames { position: absolute; inset: 0; display: flex; border-radius: var(--radius-sm); overflow: hidden; }
.xstrip-frames .frame { flex: 1; box-shadow: inset -1px 0 0 rgb(0 0 0 / .18); }
.xmark { position: absolute; top: -5px; bottom: -5px; width: 20px; margin-left: -10px; border-radius: 5px; border: 3px solid var(--accent); box-shadow: 0 0 0 1px rgb(0 0 0 / .35), 0 2px 8px rgb(0 0 0 / .4); pointer-events: none; }
.xframe .cover-row { margin: 0; }
.xframe .cover { width: 48px; height: 64px; }
.xframe .cover-row b { font-size: 14px; }
.xframe .cover-row b .val { font-size: 14px; }

/* ---------- Extract: done ---------- */
.xfiles { list-style: none; width: 100%; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius); text-align: left; }
.xfiles li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.xfiles li + li { border-top: 1px solid var(--border); }
.xfiles .i { width: 20px; height: 20px; color: var(--accent); }
.xfiles b { flex: 1; min-width: 0; font: 600 14px/1.2 var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xfiles span { font: 500 12px/1 var(--font-mono); color: var(--muted); }
.tile .badge-live.icon-only { width: 22px; height: 22px; padding: 0; justify-content: center; }

/* =====================================================================
   Rewarded ads — optional unlock on the paywall (Free only)
   ===================================================================== */
.reward { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.reward .btn-line { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.reward .btn-line .i { width: 18px; height: 18px; }
.reward-left { font: 500 11px/1 var(--font-mono); color: var(--muted); letter-spacing: .04em; }
.content.with-reward { padding-bottom: 210px; }
.att-sheet { text-align: center; padding: 10px 24px 30px; }
.att-sheet .att-ico { width: 52px; height: 52px; margin: 6px auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--success); }
.att-sheet h2 { font-size: 20px; margin-bottom: 8px; }
.att-sheet p { font-size: 14px; line-height: 1.45; color: var(--muted); margin-bottom: 20px; }
.att-sheet .btn-primary { width: 100%; }
.ad-screen { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; background: #000; color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s; }
.ad-screen.on { opacity: 1; pointer-events: auto; }
.ad-top { display: flex; align-items: center; gap: 10px; padding: 64px 16px 0; }
.ad-tag { height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 4px; background: oklch(80% .15 75); color: #111; font: 700 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.ad-count { flex: 1; font: 500 13px/1 var(--font-mono); color: rgb(255 255 255 / .75); }
.ad-close { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .16); color: #fff; }
.ad-close .i { width: 18px; height: 18px; }
.ad-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: radial-gradient(circle at 50% 40%, oklch(40% .12 260), #000 70%); }
.ad-body b { font-size: 24px; }
.ad-body small { font: 500 12px/1 var(--font-mono); color: rgb(255 255 255 / .6); }
.ad-bar { height: 3px; margin: 0 16px 40px; background: rgb(255 255 255 / .2); border-radius: 2px; overflow: hidden; }
.ad-bar i { display: block; height: 100%; width: 0; background: #fff; }
