:root {
  --bg: #f3eee4; --paper: #fbf8f2; --paper-2: #f6f1e7; --line: #e2d9c8; --line-2: #d4c8b3;
  --ink: #1d1b18; --muted: #6f665a; --faint: #9a8f80;
  --blue: #2563eb; --blue-soft: rgba(37, 99, 235, .1); --red: #c8322b; --ok: #16794a; --ok-soft: #e1f2e8; --warn: #a15c07; --warn-soft: #fbefd9;
  --shadow: 0 1px 2px rgba(60,40,10,.08), 0 12px 28px -14px rgba(60,40,10,.28);
  --serif: "Instrument Serif", Georgia, serif; --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); }
body { background-image: radial-gradient(rgba(120,90,40,.05) 1px, transparent 1px); background-size: 4px 4px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2 { margin: 0; letter-spacing: -.01em; }
h1 { font: italic 400 44px/1.05 var(--serif); }
h2 { font: 600 17px var(--font); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .xs { font-size: 12px; } .small { font-size: 13px; }
.grow { flex: 1; } .row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; margin-top: 12px; }
.mono { font-family: ui-monospace, Menlo, monospace; }
code { font-size: 12px; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }

.app { min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 12px 24px; background: rgba(243,238,228,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 16px var(--font); }
.brand.big { font-size: 22px; }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 12px; box-shadow: 0 6px 14px -6px var(--blue); }
.content { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 8px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.section-title { margin: 30px 0 12px; font: italic 400 30px var(--serif); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; transition: transform .1s, box-shadow .15s; }
.btn:hover:not(:disabled) { box-shadow: 0 4px 12px -6px rgba(60,40,10,.35); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--blue); border-color: transparent; color: #fff; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--ink); background: var(--paper-2); box-shadow: none; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 14px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.block { width: 100%; }
.input { width: 100%; border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 12px; font: inherit; outline: none; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
textarea.input { resize: vertical; line-height: 1.5; }
.input.sm { padding: 7px 10px; font-size: 13px; }
.input.xs { padding: 4px 8px; font-size: 12px; width: auto; max-width: 190px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 13px; } .field em { font-style: normal; font-weight: 400; color: var(--faint); margin-left: 6px; }
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.seg { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 10px 12px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-color: var(--blue); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--paper-2); color: var(--muted); border: 1px solid var(--line); }
.pill.live { background: var(--blue-soft); color: var(--blue); border-color: transparent; } .pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.done { background: var(--ink); color: #fff; border-color: transparent; } .pill.bad { background: #fde7e5; color: var(--red); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--blue); color: #fff; border-color: transparent; }
.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: -6px 0 14px; }
.result { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; }
.result.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.style { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.style.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); } .style.off { opacity: .55; }
.swatch { height: 54px; border-radius: 8px; background: #ece5d8; position: relative; overflow: hidden; }
.swatch.paper::before { content: ""; position: absolute; left: 12px; top: 10px; width: 34px; height: 30px; background: #ffe873; rotate: -6deg; box-shadow: 0 4px 8px rgba(0,0,0,.12); }
.swatch.paper::after { content: ""; position: absolute; right: 12px; top: 14px; width: 40px; height: 30px; background: #fbf8f2; rotate: 5deg; box-shadow: 0 4px 8px rgba(0,0,0,.12); }
.swatch.oneTake { background: linear-gradient(135deg, #ece5d8, #d9cdb6); } .swatch.toolOfTheWeek { background: linear-gradient(135deg, #0f1b3d, #2563eb); }

.writing { display: flex; align-items: center; gap: 16px; padding: 18px; color: var(--muted); }
.scripts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.script { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; margin: 0; font: inherit; color: var(--ink); }
.script:hover { border-color: var(--line-2); }
.script.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft), var(--shadow); }
.script .row { justify-content: space-between; } .script b { font-size: 15px; }
.angle { font: italic 400 17px/1.3 var(--serif); color: var(--muted); }
.script p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.6; }
.sticky-bar { position: sticky; bottom: 14px; margin-top: 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.vcard { display: flex; flex-direction: column; gap: 10px; }
.vthumb { position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #ece5d8; box-shadow: var(--shadow); border: 1px solid var(--line); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard:hover .vthumb { transform: translateY(-2px); box-shadow: 0 18px 34px -16px rgba(60,40,10,.45); } .vthumb { transition: transform .15s, box-shadow .15s; }
.vplaceholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; }
.vplaceholder span { font: italic 400 28px/1.1 var(--serif); background: var(--paper); padding: 16px; rotate: -2deg; box-shadow: var(--shadow); }
.vmeta { display: flex; flex-direction: column; gap: 4px; } .vmeta b { font-size: 14px; }
.vbar { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 6px; border-radius: 6px; background: rgba(0,0,0,.15); overflow: hidden; }
.vbar.wide { position: static; margin-top: 12px; height: 8px; }
.vbar i { display: block; height: 100%; background: var(--blue); transition: width .5s; }
.empty { text-align: center; padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty p { max-width: 420px; }

.studio { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .studio { grid-template-columns: 1fr; } }
.stage { position: sticky; top: 76px; }
.phone { border-radius: 26px; overflow: hidden; background: #1d1b18; padding: 8px; box-shadow: 0 30px 60px -28px rgba(40,25,5,.6); }
.phone > div { border-radius: 19px; overflow: hidden; }
.phone.working { aspect-ratio: 9 / 16; background: #ece5d8; border: 8px solid #1d1b18; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.panel { min-width: 0; }
.shot { padding: 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.shot-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shot-head .input.sm { width: auto; font-weight: 600; }
.sub-row { display: grid; grid-template-columns: auto 1fr 1.4fr auto; gap: 6px; align-items: start; }
.sub-row:has(> :nth-child(3):last-child) { grid-template-columns: 1fr auto auto; }
.sub-row:has(> :nth-child(2):last-child) { grid-template-columns: 1fr auto; }
.cue { max-width: 150px; }
.thumbwrap { width: 200px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }
.danger { margin-top: 26px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.alert { background: #fde7e5; color: var(--red); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }

.paper-stack { position: relative; width: 70px; height: 70px; }
.paper-stack i { position: absolute; inset: 10px; background: var(--paper); box-shadow: var(--shadow); animation: shuffle 1.8s ease-in-out infinite; }
.paper-stack i:nth-child(1) { background: #ffe873; animation-delay: -.6s; } .paper-stack i:nth-child(2) { animation-delay: -1.2s; }
@keyframes shuffle { 0%, 100% { transform: rotate(-8deg) translate(-6px, 2px); } 50% { transform: rotate(7deg) translate(6px, -3px); } }
@media (prefers-reduced-motion: reduce) { .paper-stack i { animation: none; } }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); rotate: -1deg; }
.lede { font: italic 400 22px/1.3 var(--serif); color: var(--muted); margin: 14px 0 22px; }
.err { color: var(--red); font-size: 13px; }
.skel { height: 260px; border-radius: 16px; background: linear-gradient(90deg, var(--paper-2), var(--paper), var(--paper-2)); background-size: 200% 100%; animation: sk 1.4s infinite; margin: 30px auto; max-width: 1280px; }
@keyframes sk { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 99; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 13px; box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); }
.toast.err { background: var(--red); }
@media (max-width: 640px) { .content { padding: 18px 14px 60px; } h1 { font-size: 34px; } .results { grid-template-columns: 1fr; } .styles { grid-template-columns: 1fr 1fr 1fr; } .top { padding: 10px 14px; } }
