:root {
  --bg: #0d0d0f; --panel: #151518; --panel-2: #1c1c20; --line: #2a2a30; --text: #f2efe9; --muted: #9a958c;
  --accent: #e8693c; --accent-2: #f2a65a; --ok: #6fcf97; --bad: #eb5757; --radius: 14px;
  --serif: 'Instrument Serif', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.btn, .top a { text-decoration: none; }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 999px; padding: 9px 16px; }
.btn:hover { border-color: #3a3a42; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #f07849; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(13,13,15,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap, .top .bar { display: flex; align-items: center; gap: 12px; height: 60px; }
.top .bar { padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; letter-spacing: .2px; }
.brand .mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.brand em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 20px; }
.spacer { flex: 1; }
.balance { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-variant-numeric: tabular-nums; }

/* landing */
.hero { padding: 72px 0 40px; text-align: center; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 7vw, 72px); line-height: 1.02; margin: 0 0 16px; }
.hero h1 i { color: var(--accent-2); }
.hero p { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero .cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
section { padding: 48px 0; }
section h2 { font-family: var(--serif); font-weight: 400; font-size: 38px; margin: 0 0 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.placeholder { aspect-ratio: 9/16; border-radius: 12px; border: 1px dashed #3a3a42; display: grid; place-items: center; text-align: center;
  background: repeating-linear-gradient(135deg, #17171a 0 14px, #1b1b1f 14px 28px); color: var(--muted); font-size: 13px; padding: 12px; }
.placeholder.wide { aspect-ratio: 16/10; }
.placeholder b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
table.prices { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.prices th, table.prices td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: right; }
table.prices th:first-child, table.prices td:first-child { text-align: left; }
table.prices .ours { color: var(--accent-2); font-weight: 600; }
.tablebox { overflow-x: auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: 13px; }
footer a { margin-right: 14px; }

/* studio */
.studio { display: grid; grid-template-columns: 360px 1fr; gap: 16px; padding: 16px; height: calc(100vh - 60px); }
.side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.side .scroll > * { flex-shrink: 0; }
.side .scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.model { border-radius: 12px; padding: 16px; background: linear-gradient(135deg, #2a1a14, #1c1c20 60%); border: 1px solid #3a2a22; }
.model h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--accent-2); }
.model p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.box label.k { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.refs { display: flex; flex-wrap: wrap; gap: 8px; }
.ref { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.ref img, .ref video { width: 100%; height: 100%; object-fit: cover; }
.ref .tag { position: absolute; left: 3px; bottom: 3px; font-size: 10px; background: rgba(0,0,0,.7); padding: 1px 4px; border-radius: 4px; }
.ref .x { position: absolute; right: 2px; top: 2px; border: 0; background: rgba(0,0,0,.7); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; line-height: 18px; padding: 0; }
.ref.add { display: grid; place-items: center; color: var(--muted); font-size: 24px; border-style: dashed; cursor: pointer; background: transparent; }
.ref.audio { display: grid; place-items: center; font-size: 11px; color: var(--muted); padding: 4px; text-align: center; }
textarea.prompt { width: 100%; min-height: 90px; resize: vertical; background: transparent; border: 0; outline: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.seg button.on { border-color: var(--accent); background: rgba(232,105,60,.15); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.go { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.go button { border-radius: 12px; padding: 12px 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-align: left; }
.go button.fast { background: var(--accent); border-color: var(--accent); color: #fff; }
.go button b { display: block; font-size: 15px; }
.go button span { font-size: 12px; opacity: .85; }
.go .note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); text-align: center; }
.main { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow-y: auto; }
.main .head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.job { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.job .media { background: #000; aspect-ratio: 9/16; display: grid; place-items: center; position: relative; }
.job .media.w { aspect-ratio: 16/9; }
.job .media.s { aspect-ratio: 1/1; }
.job video { width: 100%; height: 100%; object-fit: contain; }
.job .meta { padding: 10px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.job .meta p { margin: 0; color: var(--text); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.job .acts button, .job .acts a { font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); text-decoration: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.06); }
.badge.fast { color: var(--accent-2); }
.spin { width: 22px; height: 22px; border: 2px solid #444; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: none; place-items: center; z-index: 50; padding: 16px; }
.modal.open { display: grid; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; width: min(760px, 100%); max-height: 90vh; overflow-y: auto; padding: 24px; position: relative; }
.sheet h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin: 0 0 6px; }
.sheet .close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.pack { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--panel-2); text-align: left; color: var(--text); }
.pack b { font-size: 28px; display: block; }
.pack:hover { border-color: var(--accent); }
.custom { display: flex; gap: 8px; align-items: center; }
.custom input { width: 120px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.field { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.tabs { display: flex; gap: 6px; margin: 10px 0 14px; }
.tabs button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 6px 12px; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.lib .item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 1; position: relative; cursor: pointer; color: var(--muted); font-size: 12px; display: grid; place-items: center; text-align: center; }
.lib .item img, .lib .item video { width: 100%; height: 100%; object-fit: cover; }
.lib .item:hover { border-color: var(--accent); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #26262c; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 60; display: none; max-width: calc(100% - 32px); }
.toast.show { display: block; }
.legal { max-width: 760px; padding: 40px 16px 80px; margin: 0 auto; }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: 44px; }
.draft { border: 1px dashed var(--accent); color: var(--accent-2); padding: 10px 12px; border-radius: 10px; font-size: 13px; }

@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; height: auto; }
  .side .scroll { overflow: visible; }
  .grid3, .gallery { grid-template-columns: 1fr 1fr; }
  .packs { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr; } }
