/* CaitlyGen studio theme: black, quiet, precise. */
:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #0d0d0d;
  --surface-2: #141414;
  --surface-3: #1b1b1b;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --ink: #f4f3f1;
  --ink-2: #c9c7c3;
  --muted: #86847f;
  --faint: #55534f;
  --signal: #ff4b2b;          /* recording, live, low credit */
  --glow: #ffb38a;            /* warm studio light */
  --ok: #8fe3b0;
  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 var(--sans); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(1200px 520px at 50% -220px, rgba(255, 179, 138, .085), transparent 70%),
    radial-gradient(700px 400px at 100% 0%, rgba(255, 255, 255, .025), transparent 70%);
  background-attachment: fixed;
}
::selection { background: rgba(255, 179, 138, .3); }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid rgba(255, 179, 138, .6); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; background: rgba(5, 5, 5, .72);
  backdrop-filter: saturate(140%) blur(18px); -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; font-size: 16px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px; position: relative;
  background: conic-gradient(from 210deg, #fff, #ffb38a, #ff4b2b, #fff);
  box-shadow: 0 0 22px rgba(255, 140, 90, .35);
}
.brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 3px; background: var(--bg); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  text-decoration: none; color: var(--muted); font-size: 14px; padding: 7px 12px; border-radius: 999px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav a:hover, .nav a.on { color: var(--ink); background: var(--surface-2); }
.credit {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.credit:hover { border-color: rgba(255, 255, 255, .25); background: var(--surface); }
.ring { width: 18px; height: 18px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--surface-3); }
.ring .fill { stroke: var(--ink); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.ring.low .fill { stroke: var(--signal); }
.tag-test { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--glow); }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 40px 24px 120px; }
.fade { animation: fade .6s var(--ease) both; }
.fade-2 { animation-delay: .08s; } .fade-3 { animation-delay: .16s; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 14px; }
.display {
  font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6.4vw, 76px);
  line-height: .98; letter-spacing: -0.02em; margin: 0 0 14px;
}
.display em { font-style: italic; color: var(--glow); }
.lede { color: var(--muted); font-size: 16px; max-width: 520px; margin: 0; }
h2.section { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin: 0 0 16px; }
.title { font-family: var(--serif); font-size: clamp(32px, 4.4vw, 48px); font-weight: 400; line-height: 1.02; letter-spacing: -0.015em; margin: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 13px; }

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .028), rgba(255, 255, 255, .01));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: #0a0a0a; font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .3s var(--ease), background .2s var(--ease), opacity .2s;
  box-shadow: 0 0 0 0 rgba(255, 179, 138, 0);
}
.btn:hover { box-shadow: 0 8px 40px -8px rgba(255, 179, 138, .45); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: progress; box-shadow: none; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 0; background: transparent; color: var(--faint); cursor: pointer;
  transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--ink); background: var(--surface-3); }
.icon-btn svg, .btn svg { width: 16px; height: 16px; }

/* ---------- fields ---------- */
.field-label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
textarea.prompt {
  width: 100%; min-height: 128px; resize: none; border: 0; outline: 0; background: transparent;
  font-size: 19px; line-height: 1.5; letter-spacing: -0.01em; padding: 0;
}
textarea.prompt::placeholder, input::placeholder { color: var(--faint); }
.input {
  width: 100%; height: 46px; padding: 0 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); outline: 0;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.input:focus { border-color: var(--line-2); background: var(--surface-3); }
.hr { height: 1px; background: var(--line); margin: 22px 0; border: 0; }

/* segmented control */
.seg-ctl { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-ctl input { position: absolute; opacity: 0; pointer-events: none; }
.seg-ctl label {
  padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); cursor: pointer;
  transition: color .2s var(--ease), background .25s var(--ease);
}
.seg-ctl input:checked + label { background: var(--ink); color: #0a0a0a; font-weight: 600; }

/* switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; cursor: pointer; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch .txt { display: grid; gap: 2px; }
.switch .txt small { color: var(--faint); font-size: 13px; }
.switch input { position: absolute; opacity: 0; }
.switch .knob {
  flex: 0 0 auto; width: 40px; height: 24px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--line-2); position: relative; transition: background .25s var(--ease);
}
.switch .knob::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--muted); transition: transform .25s var(--ease), background .25s var(--ease);
}
.switch input:checked + .knob { background: var(--ink); }
.switch input:checked + .knob::after { transform: translateX(16px); background: #0a0a0a; }
.switch input:focus-visible + .knob { outline: 2px solid rgba(255, 179, 138, .6); outline-offset: 2px; }

/* ---------- composer (home) ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.composer { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
.drop {
  position: relative; display: grid; place-items: center; text-align: center; cursor: pointer; overflow: hidden;
  border-radius: var(--radius); border: 1px dashed var(--line-2); background: var(--surface);
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.drop:hover, .drop.over { border-color: rgba(255, 179, 138, .45); background: #100d0b; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .hint { display: grid; gap: 10px; justify-items: center; padding: 20px; pointer-events: none; }
.drop .hint svg { width: 26px; height: 26px; color: var(--muted); }
.drop .hint b { font-weight: 500; font-size: 15px; }
.drop .hint span { color: var(--faint); font-size: 13px; max-width: 200px; }
.drop.has { border-style: solid; border-color: var(--line); }
.drop.has .hint { display: none; }
.drop .preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.drop .swap {
  position: absolute; left: 12px; bottom: 12px; font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(10px); color: var(--ink-2); pointer-events: none; display: none;
}
.drop.has .swap { display: block; }
.drop.portrait { aspect-ratio: 9 / 16; }

.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb {
  position: relative; width: 72px; height: 72px; border-radius: 16px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line); animation: pop .35s var(--ease) both;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .2s;
}
.thumb:hover button, .thumb:focus-within button { opacity: 1; }
@media (hover: none) { .thumb button { opacity: 1; } }
.thumb.add { display: grid; place-items: center; border-style: dashed; border-color: var(--line-2); color: var(--muted); cursor: pointer; transition: border-color .2s, color .2s; }
.thumb.add:hover { border-color: rgba(255, 179, 138, .45); color: var(--ink); }
.thumb.add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mic {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 14px; color: var(--ink-2);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.mic:hover { background: var(--surface-2); }
.mic .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 rgba(255, 75, 43, .6); }
.mic.on { border-color: rgba(255, 75, 43, .5); background: rgba(255, 75, 43, .08); color: var(--ink); }
.mic.on .dot { animation: live 1.4s infinite; }
.mic.done .dot { background: var(--ok); }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255, 75, 43, .55); } 70% { box-shadow: 0 0 0 10px rgba(255, 75, 43, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 75, 43, 0); } }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.linkish:hover { color: var(--ink); }
.file-chip { position: relative; overflow: hidden; }
.file-chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

details.more summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
details.more[open] summary svg { transform: rotate(90deg); }
details.more .inner { padding-top: 14px; }

.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- library ---------- */
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.tile { text-decoration: none; display: grid; gap: 10px; }
.tile .frame {
  position: relative; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--line); transition: transform .35s var(--ease), border-color .35s var(--ease);
}
.tile:hover .frame { transform: translateY(-3px); border-color: var(--line-2); }
.tile .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.tile:hover .frame img { transform: scale(1.03); }
.tile .frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .55)); }
.tile .badge { position: absolute; left: 10px; top: 10px; z-index: 1; }
.tile .name { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meta { font-size: 12px; color: var(--faint); margin-top: -6px; font-variant-numeric: tabular-nums; }
.empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--faint); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em;
  padding: 5px 9px; border-radius: 999px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(10px);
  border: 1px solid var(--line-2); color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.badge.review::before { background: var(--glow); }
.badge.working::before { background: var(--glow); animation: blink 1.2s infinite; }
.badge.done::before { background: var(--ok); }
.badge.failed::before { background: var(--signal); }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- studio (job page) ---------- */
.studio { display: grid; grid-template-columns: 340px 1fr; gap: 48px; align-items: start; }
.stage { position: sticky; top: 92px; display: grid; gap: 16px; }
.phone {
  position: relative; aspect-ratio: 9 / 16; border-radius: 30px; overflow: hidden; background: #0b0b0b;
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 120px -40px rgba(255, 150, 100, .25), 0 0 0 8px rgba(255, 255, 255, .02);
}
.phone img, .phone video { width: 100%; height: 100%; object-fit: cover; }
.phone .veil {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .75)); backdrop-filter: blur(10px) saturate(60%);
}
.phone .veil p { margin: 14px 0 0; color: var(--ink); font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.shimmer::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 200, 170, .10) 50%, transparent 70%);
  background-size: 250% 100%; animation: sweep 2.2s linear infinite;
}
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--ink); animation: spin .9s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.facts { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 4px; }

.steps { display: flex; gap: 6px; margin: 22px 0 6px; }
.steps .s { flex: 1; display: grid; gap: 8px; }
.steps .bar { height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; position: relative; }
.steps .s.done .bar { background: var(--ink); }
.steps .s.now .bar::after {
  content: ""; position: absolute; inset: 0; width: 40%; border-radius: 3px; background: var(--glow);
  animation: slide 1.3s var(--ease) infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.steps .s span { font-size: 12px; color: var(--faint); }
.steps .s.done span, .steps .s.now span { color: var(--ink-2); }

.timeline { display: flex; height: 34px; gap: 3px; margin: 26px 0 8px; }
.timeline i {
  display: block; border-radius: 8px; background: var(--surface-3); min-width: 6px; position: relative; overflow: hidden;
  transition: flex-grow .4s var(--ease), background .2s, opacity .2s;
}
.timeline i.you { background: linear-gradient(180deg, #f4f3f1, #cfccc7); }
.timeline i.prod { background-size: cover; background-position: center; }
.timeline i.prod::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .25); }
.timeline i.hot { outline: 2px solid var(--glow); outline-offset: 1px; }
.timeline-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

.lines { margin-top: 18px; display: grid; gap: 4px; }
.line {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 14px; padding: 16px 14px; border-radius: 18px;
  border: 1px solid transparent; transition: background .25s var(--ease), border-color .25s var(--ease);
  animation: fade .4s var(--ease) both;
}
.line:hover, .line:focus-within { background: var(--surface); border-color: var(--line); }
.line .num { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 4px; }
.line textarea {
  width: 100%; resize: none; overflow: hidden; border: 0; outline: 0; background: transparent; padding: 0;
  font-size: 17px; line-height: 1.5; letter-spacing: -0.01em; min-height: 26px;
}
.line .shots { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.shot {
  height: 30px; min-width: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all .2s var(--ease);
}
.shot img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; margin-left: -5px; }
.shot:hover { border-color: var(--line-2); color: var(--ink); }
.shot.on { background: var(--ink); color: #0a0a0a; border-color: var(--ink); font-weight: 600; }
.line .tools { display: flex; flex-direction: column; gap: 2px; opacity: .0; transition: opacity .2s; }
.line:hover .tools, .line:focus-within .tools { opacity: 1; }
@media (hover: none) { .line .tools { opacity: 1; } }
.line .secs { font-size: 12px; color: var(--faint); margin-left: auto; font-variant-numeric: tabular-nums; align-self: center; }
.add-line { margin: 6px 0 0 44px; }

.dock {
  position: sticky; bottom: 20px; margin-top: 24px; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 10px 10px 10px 20px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(14, 14, 14, .94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .9);
}
.dock .est { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dock .est b { color: var(--ink); font-weight: 600; }
.dock .actions { display: flex; gap: 8px; }

.note { padding: 14px 16px; border-radius: var(--radius-sm); background: rgba(255, 75, 43, .07); border: 1px solid rgba(255, 75, 43, .25); color: #ffb3a5; font-size: 14px; }
.angle { font-size: 15px; color: var(--muted); margin: 10px 0 0; max-width: 620px; }

/* ---------- wallet ---------- */
.wallet-hero { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; }
.big-ring { width: 168px; height: 168px; transform: rotate(-90deg); }
.big-ring circle { fill: none; stroke-width: 6; }
.big-ring .track { stroke: var(--surface-3); }
.big-ring .fill { stroke: url(#g); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.amount { font-family: var(--serif); font-size: clamp(56px, 9vw, 96px); line-height: .9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.amount small { font-size: .4em; color: var(--muted); font-family: var(--sans); letter-spacing: 0; margin-left: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.inline-form { display: flex; gap: 10px; }
.rows { display: grid; }
.row-item { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); font-size: 14px; }
.row-item:first-child { border-top: 0; }
.row-item .amt { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.row-item .amt.plus { color: var(--ok); }
.row-item a { text-decoration: none; color: var(--ink-2); } .row-item a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; gap: 28px; }
  .stage { position: static; max-width: 260px; margin: 0 auto; width: 100%; }
  .composer { grid-template-columns: 1fr; }
  .composer .drop.portrait { aspect-ratio: 4 / 5; max-height: 62vh; width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .top { padding: 12px 16px; }
  .nav a.hide-sm { display: none; }
  .wrap { padding: 28px 16px 120px; }
  .panel { padding: 18px; }
  .wallet-hero { grid-template-columns: 1fr; justify-items: start; gap: 20px; }
  .big-ring { width: 120px; height: 120px; }
  .line { grid-template-columns: 22px 1fr auto; gap: 10px; padding: 14px 8px; }
  .add-line { margin-left: 32px; }
  .stage { max-width: 240px; }
  .facts { font-size: 12px; gap: 10px; }
  .facts span { white-space: nowrap; }
  .phone { border-radius: 24px; }
  .dock { border-radius: 22px; padding: 12px; }
  .dock .actions { width: 100%; } .dock .actions .btn { flex: 1; }
  .library { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- image studio ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.gimg { margin: 0; display: grid; gap: 8px; animation: fade .5s var(--ease) both; }
.gimg figcaption { font-size: 12px; color: var(--faint); }
.gframe {
  position: relative; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--line); transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.gframe img { width: 100%; height: 100%; object-fit: cover; }
.gwait { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gacts {
  position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 6px; justify-content: center;
  opacity: 0; transform: translateY(6px); transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.gacts form { margin: 0; }
.gframe:hover .gacts, .gframe:focus-within .gacts { opacity: 1; transform: none; }
@media (hover: none) { .gacts { opacity: 1; transform: none; } }
.gbtn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); cursor: pointer;
  background: rgba(10, 10, 10, .7); backdrop-filter: blur(10px); color: var(--ink); font-size: 14px;
  display: grid; place-items: center; transition: background .2s, color .2s, transform .15s var(--ease);
}
.gbtn:hover { background: var(--ink); color: #0a0a0a; }
.gbtn:active { transform: scale(.92); }
.gimg.is-me .gframe { border-color: var(--glow); box-shadow: 0 0 0 2px var(--glow); }
.gimg.is-product .gframe { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.gimg.is-me figcaption::after { content: " · presenter"; color: var(--glow); }
.gimg.is-product figcaption::after { content: " · product"; color: var(--ink); }
.dock.picked { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; width: min(620px, calc(100% - 32px)); animation: fade .35s var(--ease) both; }
.thumb.pick { padding: 0; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.thumb.pick.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.thumb.picked-from-gallery { border-color: var(--line-2); }
.flash { animation: flash .9s var(--ease); }
@keyframes flash { 30% { background: rgba(255, 75, 43, .08); border-radius: 16px; } }

/* research notes on the job page */
.research { white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0; }
.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sources a {
  font-size: 12px; text-decoration: none; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 5px 10px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s, border-color .2s;
}
.sources a:hover { color: var(--ink); border-color: rgba(255, 255, 255, .3); }
.shot .ai { font-size: 10px; color: var(--glow); }
.shot.on .ai { color: #a0522d; }
@media (max-width: 600px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* ---------- learning ---------- */
.learn-stats { display: flex; gap: 28px; }
.learn-stats div { display: grid; }
.learn-stats b { font-family: var(--serif); font-weight: 400; font-size: 56px; line-height: 1; letter-spacing: -0.02em; }
.learn-stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.lessons { display: grid; gap: 2px; margin-top: 10px; }
.lesson {
  display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; align-items: start; padding: 12px 10px;
  border-radius: 14px; border: 1px solid transparent; transition: background .2s var(--ease), border-color .2s var(--ease);
  animation: fade .4s var(--ease) both;
}
.lesson:hover, .lesson:focus-within { background: var(--surface-2); border-color: var(--line); }
.lesson .src { font-size: 11px; padding-top: 4px; color: var(--glow); }
.lesson.you .src { color: var(--ink); }
.lesson textarea { width: 100%; resize: none; overflow: hidden; border: 0; outline: 0; background: transparent; padding: 0; font-size: 15px; line-height: 1.5; }
.lesson small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.lesson .acts { display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.lesson:hover .acts, .lesson:focus-within .acts { opacity: 1; }
@media (hover: none) { .lesson .acts { opacity: 1; } }
.lesson .save { display: none; }
.lesson.dirty .save { display: inline-grid; color: var(--ok); }

/* feedback on finished videos */
.rate { display: flex; gap: 8px; }
.rate input { position: absolute; opacity: 0; pointer-events: none; }
.rate label {
  height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; color: var(--ink-2); font-size: 14px; transition: all .2s var(--ease);
}
.rate label:hover { background: var(--surface-2); }
.rate input:checked + label { background: var(--ink); color: #0a0a0a; border-color: var(--ink); font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metrics label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.learned-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; margin-top: 12px; }
.learned-chip b { color: var(--glow); font-weight: 500; }
.learned-chip:hover { color: var(--ink); }
@media (max-width: 600px) { .learn-stats b { font-size: 44px; } .metrics { grid-template-columns: 1fr 1fr 1fr; } }
.knob.is-on { background: var(--ink); }
.knob.is-on::after { transform: translateX(16px); background: #0a0a0a; }

/* ---------- director ---------- */
.director { margin-top: 30px; padding: 20px; background: linear-gradient(180deg, rgba(255, 179, 138, .06), rgba(255, 255, 255, .01)); border-color: rgba(255, 179, 138, .18); }
.dhead { display: flex; gap: 12px; align-items: center; }
.dhead b { font-weight: 600; display: block; }
.dhead small { color: var(--muted); font-size: 13px; }
.dmark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #0a0a0a;
  background: conic-gradient(from 210deg, #fff, #ffb38a, #ff4b2b, #fff); box-shadow: 0 0 24px rgba(255, 140, 90, .35); }
.dlog { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; margin: 14px 0 0; }
.dlog:empty { display: none; }
.dlog p { margin: 0; max-width: 85%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; animation: fade .3s var(--ease) both; }
.dlog .you { align-self: flex-end; background: var(--ink); color: #0a0a0a; border-bottom-right-radius: 6px; }
.dlog .dir { align-self: flex-start; background: var(--surface-3); color: var(--ink-2); border-bottom-left-radius: 6px; }
.dlog .dir.thinking { color: var(--muted); }
.dlog .dir.thinking::after { content: ""; display: inline-block; width: 18px; animation: dots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.dlog .dir.err { color: #ffb3a5; }
.dform { display: flex; gap: 8px; margin-top: 14px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); transition: border-color .2s; }
.dform:focus-within { border-color: rgba(255, 179, 138, .45); }
.dform input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.dform .btn { width: 38px; height: 38px; padding: 0; }
.dchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; transition: all .2s var(--ease); }
.chip:hover { color: var(--ink); border-color: rgba(255, 255, 255, .3); background: var(--surface-2); }

/* ---------- edit panel ---------- */
.editp { margin-top: 22px; }
.erow { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: start; padding: 10px 0; }
.elabel { font-size: 13px; color: var(--muted); padding-top: 8px; }
.seg-ctl.seg-wrap { flex-wrap: wrap; border-radius: 18px; }
.looks { display: flex; gap: 10px; flex-wrap: wrap; }
.looks input { position: absolute; opacity: 0; pointer-events: none; }
.look { display: grid; gap: 6px; justify-items: center; font-size: 12px; color: var(--muted); cursor: pointer; }
.look i { display: block; width: 52px; height: 68px; border-radius: 12px; background-size: cover; background-position: center; background-color: var(--surface-3);
  border: 2px solid transparent; transition: border-color .2s, transform .2s var(--ease); }
.look:hover i { transform: translateY(-2px); }
.looks input:checked + .look { color: var(--ink); }
.looks input:checked + .look i { border-color: var(--ink); }
.look-warm i { filter: sepia(.25) saturate(1.2) hue-rotate(-8deg); }
.look-crisp i { filter: contrast(1.15) saturate(1.25); }
.look-moody i { filter: contrast(1.2) brightness(.85) saturate(.8); }
.look-mono i { filter: grayscale(1) contrast(1.1); }
.egrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.egrid .field-label { display: grid; gap: 8px; margin: 0; }
.music { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.music form { margin: 0; }
.music .track { font-size: 14px; color: var(--ink-2); }
.music input[type=range] { accent-color: var(--glow); width: 140px; }
.free { color: var(--ok); }
@media (max-width: 600px) { .erow { grid-template-columns: 1fr; gap: 6px; } .elabel { padding-top: 0; } .egrid { grid-template-columns: 1fr; } }
.erow > .seg-ctl, .erow > .looks, .erow > .music { justify-self: start; }
.egrid .field-label > span { display: block; }

/* ---------- per-line effects ---------- */
.fxrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; opacity: .55; transition: opacity .2s; }
.line:hover .fxrow, .line:focus-within .fxrow { opacity: 1; }
@media (hover: none) { .fxrow { opacity: 1; } }
.fxsel, .fxtext {
  height: 28px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 12px; padding: 0 10px; outline: 0; cursor: pointer; transition: all .2s var(--ease);
}
.fxsel { appearance: none; -webkit-appearance: none; padding-right: 22px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 12px, calc(100% - 8px) 12px; background-size: 4px 4px; background-repeat: no-repeat; }
.fxsel:hover, .fxtext:focus { border-color: var(--line-2); color: var(--ink); }
.fxsel.set { color: var(--glow); border-color: rgba(255, 179, 138, .4); }
.fxsel option { background: #141414; color: var(--ink); }
.fxtext { cursor: text; width: 120px; color: var(--ink); }
.line .num { cursor: default; }

/* timeline extras */
.timeline i { cursor: grab; touch-action: none; }
.timeline i.dragging { opacity: .5; cursor: grabbing; }
.timeline i.drop-before { box-shadow: -4px 0 0 0 var(--glow); }
.timeline i.tx::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: linear-gradient(90deg, rgba(255, 179, 138, .9), transparent); z-index: 1; }
.timeline i[data-st]::after, .timeline i[data-fx]::after {
  content: attr(data-st) " " attr(data-fx); position: absolute; inset: auto; right: 5px; top: 50%; transform: translateY(-50%);
  font-size: 10px; line-height: 16px; height: 16px; padding: 0 5px; border-radius: 6px; font-style: normal; z-index: 1;
  color: #fff; background: rgba(0, 0, 0, .6); white-space: nowrap; }

/* background picker */
.drops { display: flex; gap: 10px; flex-wrap: wrap; }
.drops input { position: absolute; opacity: 0; pointer-events: none; }
.drop-opt { display: grid; gap: 5px; justify-items: center; font-size: 11px; color: var(--muted); cursor: pointer; }
.drop-opt i { display: block; width: 44px; height: 58px; border-radius: 10px; background-size: cover; background-position: center;
  border: 2px solid var(--line); transition: border-color .2s, transform .2s var(--ease); }
.drop-opt:hover i { transform: translateY(-2px); }
.drops input:checked + .drop-opt { color: var(--ink); }
.drops input:checked + .drop-opt i { border-color: var(--ink); }

/* music library */
.music-lib { display: grid; gap: 14px; }
.tracks { display: flex; flex-direction: column; gap: 4px; }
.trk { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 6px; border-radius: 12px; border: 1px solid transparent; transition: background .2s, border-color .2s; }
.trk:hover { background: var(--surface-2); }
.trk.on { border-color: var(--line-2); background: var(--surface-2); }
.trk form { margin: 0; flex: 1; }
.trk form button { background: none; border: 0; padding: 6px 4px; color: var(--ink-2); font-size: 14px; cursor: pointer; text-align: left; width: 100%; }
.trk.on form button { color: var(--ink); font-weight: 500; }
.trk .play { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-size: 10px; cursor: pointer; flex: 0 0 auto; }
.trk .play:hover { background: var(--ink); color: #0a0a0a; }
.vol { display: flex; align-items: center; gap: 10px; }
.vol input { accent-color: var(--glow); width: 160px; }
.gen { display: grid; gap: 8px; padding: 14px; border-radius: 16px; border: 1px dashed var(--line-2); }
.moods { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.mood:disabled { opacity: .4; cursor: progress; }

/* ---------- library & project galleries ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.proj { text-decoration: none; display: grid; gap: 8px; }
.proj-stack { position: relative; aspect-ratio: 4 / 3; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; transition: border-color .3s var(--ease), transform .3s var(--ease); display: grid; place-items: center; }
.proj:hover .proj-stack { border-color: var(--line-2); transform: translateY(-3px); }
.proj-stack img { position: absolute; top: 14%; width: 34%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--line-2); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8);
  left: calc(14% + var(--k) * 24%); transform: rotate(calc((var(--k) - 1) * 5deg)); transition: transform .4s var(--ease); }
.proj:hover .proj-stack img { transform: rotate(calc((var(--k) - 1) * 8deg)) translateY(-4px); }
.proj-empty { color: var(--faint); font-size: 13px; }
.proj-name { font-size: 16px; font-weight: 500; }
.proj-meta { font-size: 13px; color: var(--faint); margin-top: -6px; }
.proj-title { background: transparent; border: 0; outline: 0; color: var(--ink); padding: 0; width: 100%; border-bottom: 1px dashed transparent; }
.proj-title:hover, .proj-title:focus { border-bottom-color: var(--line-2); }
.crumb { text-decoration: none; color: var(--muted); } .crumb:hover { color: var(--ink); }
.proj-pick { display: flex; gap: 8px; flex: 1; justify-content: flex-end; max-width: 360px; }
.proj-pick .input { height: 40px; }

.pvideos { display: grid; gap: 18px; }
.pvideo { display: grid; grid-template-columns: 150px 1fr; gap: 22px; padding: 18px; }
.pv-frame { position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); align-self: start; }
.pv-frame img { width: 100%; height: 100%; object-fit: cover; }
.pv-body { min-width: 0; }
.pv-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pv-title { font-size: 18px; font-weight: 500; text-decoration: none; display: block; margin-bottom: 2px; }
.pv-title:hover { color: var(--glow); }
.pv-acts { display: flex; gap: 6px; align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; font-size: 18px; line-height: 1; } .menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: 38px; z-index: 5; width: 230px; padding: 14px; border-radius: 16px;
  background: #121212; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .9); animation: fade .2s var(--ease) both; }
.btn.danger { color: #ffb3a5; border-color: rgba(255, 75, 43, .35); }
.btn.danger:hover { background: rgba(255, 75, 43, .1); }

.assets { margin-top: 18px; }
.assets-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.vers { display: grid; gap: 6px; }
.ver { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 6px; border-radius: 14px; transition: background .2s; }
.ver:hover { background: var(--surface-2); }
.ver-meta { display: grid; font-size: 14px; } .ver-meta small { color: var(--faint); font-size: 12px; }
.ver-meta .tag { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ok); margin-left: 6px; }
.ver-acts { display: flex; gap: 2px; } .ver-acts form { margin: 0; }
.ver-play { position: relative; display: block; padding: 0; border: 1px solid var(--line); background: var(--surface-3); border-radius: 10px;
  overflow: hidden; cursor: pointer; aspect-ratio: 9 / 16; width: 100%; }
.ver-play img { width: 100%; height: 100%; object-fit: cover; }
.ver-play span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; background: rgba(0, 0, 0, .25);
  opacity: 0; transition: opacity .2s; }
.ver-play:hover span { opacity: 1; }
.scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.scene { margin: 0; display: grid; gap: 6px; }
.scene figcaption { font-size: 11px; color: var(--faint); }
.scene-acts { display: flex; gap: 2px; margin-top: -4px; } .scene-acts form { margin: 0; }
.viewer { padding: 0; border: 0; background: transparent; max-width: min(420px, 92vw); }
.viewer::backdrop { background: rgba(0, 0, 0, .85); backdrop-filter: blur(8px); }
.viewer video { width: 100%; max-height: 80vh; border-radius: 20px; background: #000; display: block; }
.viewer .btn { margin: 12px auto 0; display: flex; width: max-content; }
@media (max-width: 600px) {
  .pvideo { grid-template-columns: 1fr; } .pv-frame { max-width: 160px; }
  .proj-pick { max-width: none; } .projects { grid-template-columns: 1fr 1fr; gap: 14px; }
}

/* =====================================================================
   Phone first. Everything above works on desktop; these rules make the
   phone the primary experience: bottom tabs, sectioned video page,
   thumb-sized targets, no zoom-on-focus, safe areas for notches.
   ===================================================================== */
.tabbar, .jtabs, .rec-now { display: none; }

@media (max-width: 899px) {
  :root { --tabbar-h: 64px; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .top { padding-top: max(12px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left));
         padding-right: max(16px, env(safe-area-inset-right)); }
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: 40px; }

  /* bottom tab bar */
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(8, 8, 8, .86); backdrop-filter: saturate(140%) blur(20px); -webkit-backdrop-filter: saturate(140%) blur(20px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: grid; place-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--faint);
    font-size: 10.5px; letter-spacing: .01em; -webkit-tap-highlight-color: transparent; transition: color .2s; }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on svg { filter: drop-shadow(0 0 10px rgba(255, 179, 138, .45)); }
  .tabbar a:active { transform: scale(.94); }

  /* sticky things sit above the tab bar */
  .dock { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); }
  .dock.picked { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); }

  /* type and spacing */
  .hero { margin-bottom: 24px; }
  .display { font-size: clamp(38px, 11vw, 52px); }
  .lede { font-size: 15px; }
  .title { font-size: clamp(28px, 8.5vw, 38px); }

  /* 16px fields: iPhones stop zooming in when you tap them */
  .input, textarea, select, .dform input, .fxsel, .fxtext, textarea.prompt, .line textarea, .lesson textarea { font-size: 16px; }
  .input { height: 48px; }

  /* thumb-sized targets (44px+) */
  .btn { height: 48px; }
  .btn.sm { height: 42px; }
  .icon-btn { width: 42px; height: 42px; }
  .shot { height: 38px; min-width: 38px; font-size: 13px; }
  .shot img { width: 24px; height: 24px; }
  .chip { height: 38px; padding: 0 14px; font-size: 14px; }
  .fxsel, .fxtext { height: 38px; }
  .fxsel { background-position: calc(100% - 13px) 17px, calc(100% - 9px) 17px; }
  .seg-ctl label { padding: 10px 14px; }
  .mic { height: 46px; }
  .gbtn { width: 42px; height: 42px; }
  .trk .play { width: 36px; height: 36px; }
  .switch { padding: 14px 0; }
  .line .tools { flex-direction: row; }
  .fxrow { opacity: 1; }

  /* video page: one section at a time */
  .jtabs {
    display: flex; gap: 4px; position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 15; margin: 20px -16px 0;
    padding: 8px 16px; overflow-x: auto; scrollbar-width: none; background: rgba(5, 5, 5, .9);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
  }
  .jtabs::-webkit-scrollbar { display: none; }
  .jtabs button { flex: 1 0 auto; height: 38px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent;
    color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s; }
  .jtabs button[aria-selected=true] { background: var(--ink); color: #0a0a0a; }
  body.tabbed [data-tab]:not(.tab-on) { display: none !important; }
  body.tabbed details.redo > summary { display: none; }
  body.tabbed details.redo { margin-top: 0 !important; }
  body.tabbed .studio { gap: 0; }
  body.tabbed .stage { max-width: 300px; margin: 20px auto 0; }
  body.tabbed #feedback, body.tabbed .director, body.tabbed .editp, body.tabbed .assets { margin-top: 20px; }
  body.tabbed .timeline { margin-top: 20px; }
  body.tabbed .studio > section > .eyebrow { margin-bottom: 6px; }
  /* on phones, flatten the page so the title and tabs come first, then the preview, then the section */
  body.tabbed .studio { display: flex; flex-direction: column; }
  body.tabbed .studio > section { display: contents; }
  body.tabbed .studio > section > * { order: 3; }
  body.tabbed .studio > section > :is(.eyebrow, .title, .angle, .learned-chip, .steps, .jtabs) { order: 1; }
  body.tabbed .stage { order: 2; }

  /* composer: camera first */
  .composer .drop.portrait { aspect-ratio: 4 / 5; max-height: 56vh; }
  .rec-now { display: inline-flex; }

  /* galleries and lists */
  .library { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pvideo { padding: 14px; gap: 14px; }
  .pv-head { flex-wrap: wrap; }
  .ver { grid-template-columns: 52px 1fr auto; }
  .scenes { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .menu-pop { right: -6px; width: min(260px, 80vw); }
  .viewer { max-width: 94vw; }
  .viewer video { max-height: 74vh; }
}
.you-col { display: grid; gap: 10px; align-content: start; }
.dock[hidden] { display: none !important; }

/* ---------- tour button ---------- */
.tour-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2);
  font: 600 14px var(--sans); cursor: pointer; transition: background .2s, color .2s, transform .15s var(--ease); }
.tour-btn:hover { background: var(--ink); color: #0a0a0a; }
.tour-btn:active { transform: scale(.92); }

/* ---------- guided tour ---------- */
#tour { position: fixed; inset: 0; z-index: 100; pointer-events: none; animation: tfade .3s var(--ease) both; }
#tour.out { animation: tfade .25s var(--ease) reverse both; }
@keyframes tfade { from { opacity: 0; } to { opacity: 1; } }
.tour-dim { position: absolute; inset: 0; pointer-events: auto; }
.tour-hole {
  position: fixed; border-radius: 18px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .74), 0 0 0 2px rgba(255, 179, 138, .9), 0 0 40px 6px rgba(255, 140, 90, .35);
  transition: left .45s var(--ease), top .45s var(--ease), width .45s var(--ease), height .45s var(--ease), opacity .3s;
}
.tour-hole.none { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .78); }
.tour-ping { position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--glow); animation: ping 1.8s var(--ease) infinite; }
.tour-hole.none .tour-ping { display: none; }
@keyframes ping { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08); } }
.tour-card {
  position: fixed; width: min(380px, calc(100vw - 32px)); padding: 20px; border-radius: 22px; pointer-events: auto; outline: 0;
  background: linear-gradient(180deg, #161412, #0e0e0e); border: 1px solid rgba(255, 179, 138, .22);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .03);
  transition: left .45s var(--ease), top .45s var(--ease);
}
.tour-card.in { animation: cardin .45s var(--ease) both; }
@keyframes cardin { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); }
.tour-card.center.in { animation: cardinc .5s var(--ease) both; }
@keyframes cardinc { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%); } }
.tour-card.sheet { left: 16px !important; right: 16px; width: auto; }
.tour-card.sheet:not(.sheet-top) { top: auto !important; }
.tour-card h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.05; margin: 4px 0 8px; letter-spacing: -0.01em; }
.tour-body { color: var(--ink-2); font-size: 15px; line-height: 1.55; margin: 0; }
.tour-body b { color: var(--ink); }
.tour-step { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .12em; margin: 10px 0 0; }
.tour-progress { height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.tour-progress i { display: block; height: 100%; background: linear-gradient(90deg, #fff, var(--glow)); transition: width .45s var(--ease); }
.tour-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.tour-actions > span { display: flex; gap: 8px; }
.tour-skip { background: none; border: 0; color: var(--faint); font-size: 13px; cursor: pointer; padding: 8px 0; }
.tour-skip:hover { color: var(--ink); }
body.touring #cg-help { pointer-events: none; }

/* animated illustrations */
.art { height: 150px; margin: -4px -4px 14px; border-radius: 16px; background: radial-gradient(120% 90% at 50% 0%, rgba(255, 179, 138, .14), transparent 70%), #0b0b0b;
  border: 1px solid var(--line); position: relative; overflow: hidden; display: grid; place-items: center; }
.art-hello .mk { width: 54px; height: 54px; border-radius: 16px; position: relative; z-index: 2;
  background: conic-gradient(from 210deg, #fff, #ffb38a, #ff4b2b, #fff); box-shadow: 0 0 50px rgba(255, 140, 90, .55); animation: breathe 2.4s ease-in-out infinite; }
.art-hello .mk::after { content: ""; position: absolute; inset: 15px; border-radius: 6px; background: #0b0b0b; }
.art-hello i { position: absolute; width: 46px; height: 82px; border-radius: 10px; border: 1px solid var(--line-2); background: linear-gradient(160deg, #222, #111); animation: floaty 4s ease-in-out infinite; }
.art-hello i:nth-of-type(1) { left: 18%; top: 30%; transform: rotate(-12deg); animation-delay: -.6s; }
.art-hello i:nth-of-type(2) { right: 18%; top: 24%; transform: rotate(10deg); animation-delay: -1.8s; }
.art-hello i:nth-of-type(3) { left: 44%; bottom: -30px; transform: rotate(3deg); animation-delay: -3s; opacity: .6; }
@keyframes breathe { 50% { transform: scale(1.08); } }
@keyframes floaty { 50% { translate: 0 -8px; } }
.art-script { display: block; padding: 18px; place-items: initial; }
.art-script .tl { display: flex; gap: 4px; height: 22px; margin-bottom: 14px; }
.art-script .tl b { flex: 1; border-radius: 6px; background: linear-gradient(180deg, #f4f3f1, #cfccc7); animation: shuffle 3.2s var(--ease) infinite; }
.art-script .tl b.p { background: linear-gradient(135deg, #ffb38a, #ff4b2b); flex: .8; }
.art-script .tl b:nth-child(2) { animation-delay: .2s; } .art-script .tl b:nth-child(4) { animation-delay: .4s; }
@keyframes shuffle { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-5px); } }
.art-script .ln { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.art-script .ln em { font-style: normal; font-size: 10px; color: var(--faint); }
.art-script .ln span { height: 8px; border-radius: 4px; background: var(--surface-3); width: var(--w); position: relative; overflow: hidden; }
.art-script .ln span::after { content: ""; position: absolute; inset: 0; background: var(--ink-2); transform-origin: left; animation: type 2.8s steps(14) infinite; }
.art-script .ln:nth-child(3) span::after { animation-delay: .5s; } .art-script .ln:nth-child(4) span::after { animation-delay: 1s; }
@keyframes type { 0% { transform: scaleX(0); } 60%, 100% { transform: scaleX(1); } }
.art-edit { grid-template-columns: auto auto; gap: 22px; }
.art-edit .ph { width: 70px; height: 124px; border-radius: 14px; border: 1px solid var(--line-2); position: relative; overflow: hidden;
  background: linear-gradient(160deg, #3a2a22, #151515); animation: grade 4s ease-in-out infinite; }
.art-edit .cap { position: absolute; left: 0; right: 0; bottom: 30px; text-align: center; font: 800 8px var(--sans); color: #fff; animation: pop 1.2s var(--ease) infinite; }
.art-edit .cap b { color: #ffcf6a; }
.art-edit .bar { position: absolute; top: 0; left: 0; height: 3px; background: #fff; animation: fill 4s linear infinite; }
.art-edit .stk { position: absolute; top: 18px; right: 10px; color: #ffcf6a; font-size: 14px; animation: wig 1.4s ease-in-out infinite; }
.art-edit .sw { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.art-edit .sw i { width: 26px; height: 34px; border-radius: 8px; background: #2a2a2a; border: 2px solid transparent; animation: pick 4s steps(1) infinite; }
.art-edit .sw i:nth-child(1) { background: #3a2a22; } .art-edit .sw i:nth-child(2) { background: #3b3326; animation-delay: -1s; }
.art-edit .sw i:nth-child(3) { background: #1f2a33; animation-delay: -2s; } .art-edit .sw i:nth-child(4) { background: #333; animation-delay: -3s; }
@keyframes grade { 25% { filter: sepia(.4); } 50% { filter: contrast(1.3) saturate(1.4); } 75% { filter: grayscale(1); } }
@keyframes pop { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } }
@keyframes fill { from { width: 0; } to { width: 100%; } }
@keyframes wig { 50% { transform: rotate(14deg) scale(1.1); } }
@keyframes pick { 0%, 24% { border-color: #fff; } 25%, 100% { border-color: transparent; } }
.art-director { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 18px; place-items: initial; }
.art-director p { margin: 0; max-width: 80%; padding: 8px 12px; border-radius: 14px; font-size: 12px; opacity: 0; animation: chat 4.5s var(--ease) infinite; }
.art-director .u { align-self: flex-end; background: var(--ink); color: #0a0a0a; border-bottom-right-radius: 4px; }
.art-director .d { align-self: flex-start; background: var(--surface-3); color: var(--ink-2); border-bottom-left-radius: 4px; animation-delay: 1.1s; }
@keyframes chat { 0% { opacity: 0; transform: translateY(8px); } 12%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.art-render { display: block; padding: 26px 20px; place-items: initial; }
.art-render .st { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }
.art-render .pb { height: 4px; border-radius: 4px; background: var(--surface-3); margin: 10px 0 18px; overflow: hidden; }
.art-render .pb i { display: block; height: 100%; background: linear-gradient(90deg, #fff, var(--glow)); animation: fill 3.6s var(--ease) infinite; }
.art-render .env { width: 46px; height: 46px; margin: 0 auto; border-radius: 14px; display: grid; place-items: center; font-size: 22px;
  background: var(--surface-3); animation: bounce 3.6s var(--ease) infinite; }
@keyframes bounce { 0%, 80% { transform: scale(.6); opacity: 0; } 88% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- guide chat ---------- */
#cg-help {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 40;
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer; color: #0a0a0a; display: grid; place-items: center;
  background: conic-gradient(from 210deg, #fff, #ffb38a, #ff6a3d, #fff); box-shadow: 0 14px 40px -8px rgba(255, 110, 60, .55);
  transition: transform .2s var(--ease), box-shadow .3s;
}
#cg-help svg { width: 24px; height: 24px; }
#cg-help:hover { transform: translateY(-2px) scale(1.04); }
#cg-help:active { transform: scale(.94); }
#cg-help.on { transform: rotate(18deg) scale(.92); }
#cg-help.hello::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255, 179, 138, .7); animation: ping 1.8s var(--ease) infinite; }
#cg-chat {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(max(20px, env(safe-area-inset-bottom)) + 66px); z-index: 41;
  width: min(390px, calc(100vw - 32px)); height: min(600px, calc(100vh - 140px)); display: flex; flex-direction: column;
  border-radius: 24px; overflow: hidden; background: #0d0d0d; border: 1px solid var(--line-2);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 179, 138, .06);
  opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom right; transition: opacity .22s var(--ease), transform .22s var(--ease);
}
#cg-chat.in { opacity: 1; transform: none; }
#cg-chat header { display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 179, 138, .07), transparent); }
#cg-chat header > div { flex: 1; display: grid; }
#cg-chat header small { color: var(--faint); font-size: 12px; }
#cg-chat .dmark { width: 30px; height: 30px; border-radius: 10px; font-size: 14px; }
.cg-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.cg-m { max-width: 88%; font-size: 14px; line-height: 1.55; animation: fade .3s var(--ease) both; }
.cg-m p { margin: 0 0 6px; } .cg-m p:last-child { margin: 0; }
.cg-m ul, .cg-m ol { margin: 4px 0 6px; padding-left: 20px; } .cg-m li { margin: 2px 0; }
.cg-m a { color: var(--glow); }
.cg-m code { font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.cg-m.me { align-self: flex-end; background: var(--ink); color: #0a0a0a; padding: 9px 13px; border-radius: 16px 16px 5px 16px; }
.cg-m.bot { align-self: flex-start; background: var(--surface-2); color: var(--ink-2); padding: 10px 13px; border-radius: 16px 16px 16px 5px; border: 1px solid var(--line); }
.cg-m.bot b { color: var(--ink); }
.cg-think { margin: 0 0 8px; font-size: 12px; color: var(--faint); }
.cg-think summary { cursor: pointer; list-style: none; } .cg-think summary::-webkit-details-marker { display: none; }
.cg-think summary::before { content: "◦ "; color: var(--glow); }
.cg-think div { white-space: pre-wrap; max-height: 160px; overflow-y: auto; margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line-2); }
.pending .cg-think summary { animation: blink 1.2s infinite; }
.cg-dots { display: inline-flex; gap: 4px; padding: 4px 0; } .cg-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.cg-dots i:nth-child(2) { animation-delay: .2s; } .cg-dots i:nth-child(3) { animation-delay: .4s; }
.cg-err { color: #ffb3a5; }
.cg-sugs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.cg-sugs .chip { text-align: left; height: auto; min-height: 32px; padding: 6px 12px; line-height: 1.3; }
#cg-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + env(safe-area-inset-bottom) * 0); border-top: 1px solid var(--line); }
#cg-form textarea { flex: 1; resize: none; border: 1px solid var(--line-2); outline: 0; background: var(--surface-2); color: var(--ink);
  border-radius: 18px; padding: 10px 14px; font: 15px/1.4 var(--sans); max-height: 120px; }
#cg-form textarea:focus { border-color: rgba(255, 179, 138, .45); }
#cg-form .btn { width: 42px; height: 42px; padding: 0; flex: 0 0 auto; }

@media (max-width: 899px) {
  #cg-help { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); right: 16px; width: 50px; height: 50px; }
  #cg-chat { left: 0; right: 0; bottom: 0; width: auto; height: min(78vh, 640px); border-radius: 24px 24px 0 0; border-bottom: 0;
    transform: translateY(30px); transform-origin: bottom center; z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
  #cg-form textarea { font-size: 16px; }
  .tour-btn { width: 36px; height: 36px; }
  body:has(.dock:not([hidden])) #cg-help { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 92px); }
  body.tabbed:has(.dock:not(.tab-on)) #cg-help { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); }
  .tour-card h3 { font-size: 24px; }
  .art { height: 120px; }
}
@media (min-width: 900px) { body:has(.dock:not([hidden])) #cg-help { bottom: 96px; } }
#cg-chat[hidden] { display: none !important; }
.tour-card.sheet.sheet-top { top: auto; }
.tour-card.sheet-top { bottom: auto !important; }

/* ---------- Umi, the tour mascot ---------- */
.umi-row { display: flex; align-items: center; gap: 10px; margin: -2px 0 12px; }
.umi-name { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--glow); }
.umi { position: relative; width: 44px; height: 44px; animation: umi-bob 2.6s ease-in-out infinite; }
.tour-card.in .umi { animation: umi-hop .55s var(--ease), umi-bob 2.6s ease-in-out .55s infinite; }
.umi-body { position: absolute; inset: 0; border-radius: 48% 52% 46% 54% / 55% 52% 48% 45%;
  background: radial-gradient(circle at 34% 28%, #fff4ec 0 12%, transparent 13%), linear-gradient(160deg, #ffd2b8, #ff9a6b 60%, #ff6a3d);
  box-shadow: inset -4px -6px 10px rgba(180, 60, 20, .35), 0 6px 18px rgba(255, 120, 70, .35); }
.umi .eye { position: absolute; top: 40%; width: 5px; height: 7px; border-radius: 50%; background: #2a1408; animation: umi-blink 4.2s infinite; }
.umi .eye.l { left: 31%; } .umi .eye.r { right: 31%; }
.umi .blush { position: absolute; top: 58%; width: 7px; height: 4px; border-radius: 50%; background: rgba(255, 80, 80, .45); }
.umi .blush.l { left: 17%; } .umi .blush.r { right: 17%; }
.umi .mouth { position: absolute; left: 50%; top: 59%; width: 9px; height: 5px; margin-left: -4.5px; border-bottom: 2px solid #2a1408; border-radius: 0 0 8px 8px; }
.umi .arm { position: absolute; right: -6px; top: 46%; width: 12px; height: 7px; border-radius: 6px; background: #ff8f5c; transform-origin: left center; opacity: 0; }
.umi.wave .arm { opacity: 1; animation: umi-wave .9s ease-in-out 3; }
.umi.cheer .mouth { height: 7px; border: 0; background: #2a1408; border-radius: 0 0 8px 8px; }
.umi.cheer { animation: umi-hop .55s var(--ease) 3, umi-bob 2.6s ease-in-out 1.65s infinite; }
@keyframes umi-bob { 50% { transform: translateY(-3px) rotate(-2deg); } }
@keyframes umi-hop { 0% { transform: translateY(6px) scale(.9, 1.08); } 45% { transform: translateY(-7px) scale(1.04, .96); } 100% { transform: none; } }
@keyframes umi-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes umi-wave { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(-55deg); } }
.tour-btn { position: relative; }

/* ---------- apprentice ---------- */
.appr-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; text-decoration: none;
  border: 1px solid rgba(255, 179, 138, .25); background: linear-gradient(180deg, rgba(255, 179, 138, .07), transparent); transition: border-color .2s, transform .2s var(--ease); }
.appr-link:hover { border-color: rgba(255, 179, 138, .5); transform: translateY(-2px); }
.appr-link span:nth-child(2) { display: grid; } .appr-link small { color: var(--muted); font-size: 12px; }
.app-status { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: start; }
.app-status .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--glow); }
.app-status.ok .dot { background: var(--ok); box-shadow: 0 0 12px var(--ok); }
.app-status > div { display: grid; } .app-status small { color: var(--muted); }
.app-status details { grid-column: 1 / -1; }
pre.code { background: #0a0a0a; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; overflow-x: auto; color: var(--ink-2); font-size: 13px; }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; margin-top: 20px; }
.skill header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.skill h2 { font-size: 18px; font-weight: 600; margin: 0 0 2px; }
.stage-pill { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.stage-pill.trial { color: var(--glow); border-color: rgba(255, 179, 138, .4); }
.stage-pill.trusted { color: var(--ok); border-color: rgba(143, 227, 176, .4); }
.ladder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 18px 0 14px; }
.rung { display: grid; gap: 6px; } .rung i { height: 4px; border-radius: 4px; background: var(--surface-3); }
.rung span { font-size: 11px; color: var(--faint); }
.rung.done i { background: var(--ink); } .rung.now i { background: linear-gradient(90deg, #fff, var(--glow)); }
.rung.now span, .rung.done span { color: var(--ink-2); }
.meter { display: grid; gap: 6px; }
.bar-track { position: relative; height: 8px; border-radius: 6px; background: var(--surface-3); }
.bar-track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6b6b6b, var(--glow)); transition: width .8s var(--ease); }
.skill.trusted .bar-track i { background: linear-gradient(90deg, #6b6b6b, var(--ok)); }
.bar-track em { position: absolute; top: -3px; width: 2px; height: 14px; background: rgba(255, 255, 255, .35); border-radius: 2px; }
.skill-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.skill-foot form { margin: 0; }
.skill.off { opacity: .6; }
.dlog .by { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ok);
  border: 1px solid rgba(143, 227, 176, .35); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
@media (max-width: 600px) { .skills { grid-template-columns: 1fr; } }
.login { width: min(400px, 100%); display: grid; gap: 14px; justify-items: start; padding: 28px; }
.login .input, .login .btn { width: 100%; }

/* ---------- install button + Umi's install guide ---------- */
.install-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 179, 138, .45); background: linear-gradient(180deg, rgba(255, 179, 138, .14), rgba(255, 179, 138, .04));
  color: var(--ink); font: 600 13px var(--sans); transition: background .2s, transform .15s var(--ease); }
.install-btn svg { width: 16px; height: 16px; }
.install-btn:hover { background: var(--ink); color: #0a0a0a; }
.install-btn:active { transform: scale(.94); }
.install-btn[hidden] { display: none; }
#cg-install-sheet { position: fixed; inset: 0; z-index: 120; }
#cg-install-sheet .ig-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .66); backdrop-filter: blur(4px); opacity: 0; transition: opacity .25s var(--ease); }
#cg-install-sheet.in .ig-dim { opacity: 1; }
.ig-card { position: absolute; left: 50%; top: 50%; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 60px); overflow-y: auto;
  transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .35s var(--ease), opacity .25s var(--ease);
  padding: 22px; border-radius: 26px; background: linear-gradient(180deg, #171412, #0d0d0d); border: 1px solid rgba(255, 179, 138, .22);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .95); }
#cg-install-sheet.in .ig-card { transform: translate(-50%, -50%); opacity: 1; }
.ig-card .umi-row { position: relative; }
.ig-x { margin-left: auto; }
.ig-card h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.05; margin: 2px 0 6px; }
.ig-lead { color: var(--ink-2); margin: 0 0 14px; font-size: 15px; }
.ig-go { width: 100%; margin: 4px 0 14px; }
.ig-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ig-steps li { animation: fade .45s var(--ease) both; }
.ig-steps p { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); display: flex; gap: 10px; align-items: flex-start; }
.ig-steps p b { color: var(--ink); }
.ig-steps p svg { vertical-align: -4px; color: #4da3ff; }
.ig-n { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--sans);
  background: var(--ink); color: #0a0a0a; margin-top: 1px; }
.ig-note { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.ig-later { display: block; margin: 16px auto 0; background: none; border: 0; color: var(--faint); font-size: 13px; cursor: pointer; }
.ig-art { position: relative; height: 92px; border-radius: 16px; overflow: hidden; background: #f2f2f4; color: #1c1c1e; font: 500 13px -apple-system, var(--sans); }
.ig-bar { position: absolute; left: 10px; right: 10px; bottom: 12px; height: 40px; border-radius: 14px; background: #fff; display: flex; align-items: center; gap: 6px; padding: 0 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.ig-bar.ig-bottom { justify-content: space-around; }
.ig-url { flex: 1; color: #8e8e93; padding-left: 6px; }
.ig-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #0a84ff; font-size: 18px; }
.ig-ping { position: relative; }
.ig-ping::after { content: ""; position: absolute; inset: -4px; border-radius: 12px; border: 2px solid #ff6a3d; animation: ping 1.6s var(--ease) infinite; }
.ig-sheet, .ig-menu { position: absolute; left: 12px; right: 12px; top: 8px; border-radius: 12px; background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); overflow: hidden; }
.ig-menu { left: auto; width: 62%; top: 6px; }
.ig-row { padding: 6px 12px; border-top: 1px solid #ececf0; display: flex; justify-content: space-between; align-items: center; }
.ig-row:first-child { border-top: 0; }
.ig-hi { background: #fff1ea; color: #c2410c; font-weight: 600; animation: hi 2s ease-in-out infinite; }
@keyframes hi { 50% { background: #ffe0cf; } }
.ig-confirm { position: absolute; inset: 8px 12px; border-radius: 12px; background: #fff; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; padding: 8px 12px; }
.ig-confirm b { text-align: center; font-size: 12px; } .ig-confirm span { color: #0a84ff; }
.ig-strong { font-weight: 700; }
.ig-app { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.ig-icon { display: block; width: 34px; height: 34px; border-radius: 9px; position: relative; background: conic-gradient(from 210deg, #fff, #ffb38a, #ff4b2b, #fff); }
.ig-icon::after { content: ""; position: absolute; inset: 10px; border-radius: 3px; background: #050505; }
.ig-home { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 34px); gap: 10px; align-content: center; justify-content: center;
  background: linear-gradient(135deg, #3a4a6b, #8a5a7a); }
.ig-home i { display: block; width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .28); }
.ig-home .ig-pop { background: conic-gradient(from 210deg, #fff, #ffb38a, #ff4b2b, #fff); animation: igpop 2.4s var(--ease) infinite; }
@keyframes igpop { 0%, 15% { transform: scale(0); } 30% { transform: scale(1.2); } 40%, 100% { transform: scale(1); } }
.ig-toast { position: fixed; left: 50%; bottom: 28px; z-index: 110; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 10px; border-radius: 20px; background: rgba(22, 20, 18, .96); border: 1px solid rgba(255, 179, 138, .3);
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, .9); transform: translate(-50%, 20px); opacity: 0; transition: transform .35s var(--ease), opacity .25s; font-size: 14px; }
.ig-toast.in { transform: translate(-50%, 0); opacity: 1; }
.ig-toast .umi { width: 38px; height: 38px; flex: 0 0 auto; }
.ig-toast .btn.sm { height: 34px; flex: 0 0 auto; }
@media (max-width: 899px) {
  .ig-toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  .ig-card { top: auto; bottom: 0; left: 0; right: 0; width: auto; transform: translateY(40px); border-radius: 26px 26px 0 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom)); max-height: 88vh; }
  #cg-install-sheet.in .ig-card { transform: none; }
  .install-btn span { display: none; }
  .install-btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
}
.ig-t { flex: 1; min-width: 0; }
.ig-nudge { width: min(440px, calc(100vw - 32px)); }
.ig-nudge > span { flex: 1; min-width: 0; line-height: 1.35; }
body.nudging #cg-help { opacity: 0; pointer-events: none; }
@media (max-width: 380px) {
  .brand { font-size: 0; gap: 0; }            /* just the logo mark on very small phones */
  .credit { padding: 5px 10px 5px 6px; gap: 6px; }
  .credit .tag-test { display: none; }
  .nav { gap: 4px; }
}
