:root {
  color-scheme: light;
  --shell: #121f19;
  --shell-raised: #1e3126;
  --shell-line: #35473b;
  --shell-text: #f5f7ee;
  --shell-muted: #b4c2b5;
  --paper: #f2f1e8;
  --surface: #fffdf6;
  --ink: #1c2921;
  --muted: #536358;
  --line: #d9dfd1;
  --accent: #dbed86;
  --accent-dark: #3c5527;
  --wash: #edf2df;
  --focus: #526f2b;
  --error: #762a21;
  --radius: 13px;
  --rail-width: 222px;
  --bar-height: 64px;
  --work-gutter: clamp(20px, 3.3vw, 46px);
  --card-gutter: clamp(16px, 1.9vw, 25px);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --display: Georgia, "Songti SC", "Noto Serif CJK SC", SimSun, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--shell);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
h1, h2, h3, p, dd { overflow-wrap: anywhere; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.app-header :focus-visible, .sidebar :focus-visible,
.project-mast :focus-visible, .split-card :focus-visible, .sample-card :focus-visible { outline-color: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.app-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr) auto;
  align-items: center;
  min-height: var(--bar-height);
  padding: 0 24px 0 0;
  color: var(--shell-text);
  background: #101b16;
  border-bottom: 1px solid var(--shell-line);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-height: 44px;
  margin-left: 20px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -.055em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  grid-template-rows: repeat(2, 7px);
  place-content: center;
  flex: none;
  gap: 3px;
  width: 29px;
  height: 29px;
  border: 1px solid #84995c;
  border-radius: 7px;
  color: var(--accent);
}
.brand-mark i { border: 1px solid currentColor; border-radius: 1px; }
.brand-mark i:first-child, .brand-mark i:last-child { background: currentColor; }
.brand-pro {
  margin-left: -3px;
  padding: 2px 4px;
  color: var(--accent);
  border: 1px solid #6d8151;
  border-radius: 4px;
  font: 700 11px/1.15 var(--mono);
  letter-spacing: 0;
}

.header-location {
  min-width: 0;
  padding: 3px 22px;
  border-left: 1px solid var(--shell-line);
  color: var(--shell-muted);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: .11em;
}

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.wallet-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid var(--shell-line);
  border-radius: 7px;
  color: var(--shell-text);
  background: var(--shell-raised);
  font-size: 13px;
  white-space: nowrap;
}
.wallet-trigger:hover { border-color: #8eaa65; }
.wallet-trigger strong { color: var(--accent); font: 700 14px/1.2 var(--mono); }
.coin { flex: none; width: 11px; height: 11px; border: 2px solid #adc36d; border-radius: 50%; }
.logout-button {
  min-height: 42px;
  padding-inline: 9px;
  border: 0;
  border-radius: 7px;
  color: var(--shell-muted);
  background: transparent;
  white-space: nowrap;
}
.logout-button:hover { color: var(--shell-text); background: var(--shell-raised); }

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: calc(100vh - var(--bar-height));
}

.sidebar {
  position: sticky;
  top: var(--bar-height);
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 16px;
  min-width: 0;
  height: calc(100vh - var(--bar-height));
  height: calc(100svh - var(--bar-height));
  padding: 24px 15px 18px;
  border-right: 1px solid var(--shell-line);
  color: var(--shell-text);
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: 8px;
  padding-left: 5px;
}

.sidebar-title h2 { font-size: 15px; font-weight: 700; letter-spacing: .035em; }

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 22px;
  line-height: 1;
}
.icon-button:hover { background: var(--wash); }
.create-project { border-color: var(--shell-line); color: var(--accent); background: var(--shell-raised); }
.create-project:hover { border-color: #7c9356; background: #30483a; }

#project-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding: 2px;
}

.project-button {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 55px;
  padding: 9px 10px 9px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--shell-text);
  background: transparent;
  text-align: start;
  overflow-wrap: anywhere;
}

.project-button:hover { background: var(--shell-raised); }
.project-button[aria-current="true"] { color: var(--accent); border-color: #536947; background: #22382b; }

.project-button[aria-current="true"]::before {
  position: absolute;
  inset: 11px auto 11px 0;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.project-button:focus-visible { outline-offset: -2px; }
.project-button strong { font-size: 15px; font-weight: 660; }
.project-meta, .side-hint { color: var(--shell-muted); font-size: 12px; }
.project-meta { font-variant-numeric: tabular-nums; }
.side-hint { padding: 4px 7px; }
.sidebar-footer { margin-top: auto; padding: 13px 5px 0; border-top: 1px solid var(--shell-line); }
.sidebar-footer p { color: var(--shell-muted); font-size: 12px; line-height: 1.6; }

.workspace { min-width: 0; background: var(--paper); }

#project-view, .initial-state {
  width: min(100%, 1460px);
  padding: clamp(22px, 3.3vw, 40px) var(--work-gutter) 45px;
  margin-inline: auto;
}

.initial-state h1 { margin-bottom: 10px; font: 700 clamp(30px, 4vw, 46px)/1.18 var(--display); }
.initial-state p { margin: 0 0 14px; color: var(--muted); }
.app-shell.is-locked { grid-template-columns: minmax(0, 1fr); }
.app-shell.is-locked .workspace { min-height: calc(100svh - var(--bar-height)); }
.login-form {
  display: grid;
  gap: 17px;
  max-width: 440px;
  margin: min(7vh, 65px) auto 0;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.login-form .primary-button { justify-self: start; }

.project-mast {
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 17px;
  min-width: 0;
  min-height: clamp(235px, 26vw, 315px);
  padding: clamp(22px, 3.3vw, 42px);
  margin-bottom: 17px;
  border: 1px solid #364c3c;
  border-radius: 15px;
  color: var(--shell-text);
  background:
    linear-gradient(90deg, #15271f 0%, #15271fe8 17%, #15271f9e 43%, #15271f00 76%),
    linear-gradient(0deg, #14251cc5, #14251c00 66%),
    #1c3327 url("/studio-cover.webp") right center / cover no-repeat;
}

.project-mast h1 {
  max-width: min(72%, 16ch);
  font: 700 clamp(42px, 5.15vw, 74px)/1.12 var(--display);
  letter-spacing: -.034em;
  text-shadow: 0 2px 14px #14241add;
  text-wrap: balance;
}

.project-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 420px);
  padding-top: 13px;
  border-top: 1px solid #a9ba9a76;
}
.project-metrics > div { min-width: 0; padding-right: 10px; }
.project-metrics > div + div { padding-left: 13px; border-left: 1px solid #a9ba9a52; }
.project-metrics dt { color: #d3ded0; font-size: 11px; font-weight: 550; letter-spacing: .1em; }
.project-metrics dd { margin-top: 4px; color: var(--accent); font: 650 clamp(17px, 2.3vw, 26px)/1.15 var(--mono); }
.project-metrics small { color: #e1eadd; font: 500 12px/1.3 var(--sans); }

.studio-site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; }
.studio-site-nav a { text-decoration: none; color: inherit; }
.studio-site-nav a:hover, .studio-site-nav a[aria-current="page"] { color: var(--accent); }
.project-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #cdd7c7;
}
.project-nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.workflow-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.workflow-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 5px 12px;
  border: 1px solid #c1cdb5;
  border-radius: 7px;
  background: #e6ebda;
  color: #263822;
  font-weight: 680;
  white-space: nowrap;
  text-decoration: none;
}
.workflow-link:hover {
  border-color: #819569;
  background: #dce7d0;
}
.workflow-nav button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 99px;
  min-height: 46px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 7px 7px 0 0;
  color: var(--muted);
  background: transparent;
  font-weight: 670;
  white-space: nowrap;
}
.workflow-nav button:hover { color: var(--ink); background: #e9ede0; }
.workflow-nav button[aria-selected="true"] { color: #263822; border-color: #d5dfbd; border-bottom-color: transparent; background: #e5edcf; }
.workflow-nav button[aria-selected="true"]::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: var(--accent-dark);
  content: "";
}
.workflow-icon { color: var(--accent-dark); font: 700 15px/1 var(--mono); }

.notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-bottom: 16px;
  padding: 10px 13px;
  border: 1px solid #bacb9e;
  border-radius: 8px;
  color: #314621;
  background: var(--wash);
  overflow-wrap: anywhere;
}
.notice.is-error { color: var(--error); border-color: #ddad9f; background: #fff0e8; }

.script-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(225px, 1fr);
  align-items: start;
  gap: 16px;
}

.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card h2 { font-size: clamp(19px, 2.1vw, 23px); font-weight: 720; letter-spacing: -.025em; }
.card p { color: var(--muted); }
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px var(--card-gutter) 16px;
}
.card-header > div { min-width: 0; }
.card-header p { margin-top: 5px; font-size: 14px; }
.script-card .card-header { align-items: center; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid #d2dfbc;
  border-radius: 20px;
  color: #3b562d;
  background: #eff4e5;
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.status-pill > span:empty { flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#draft-status { flex: none; white-space: nowrap; }
#draft-status.is-dirty { color: #795522; border-color: #e5d4a7; background: #f8efda; }

.script-editor { padding-inline: var(--card-gutter); }
.script-editor textarea {
  display: block;
  width: 100%;
  min-height: clamp(295px, 39vh, 420px);
  padding: 16px 17px;
  resize: vertical;
  border: 1px solid #d9ddce;
  border-radius: 9px;
  color: #243227;
  background: #f8f7ef;
  font-size: 16px;
  line-height: 1.85;
  tab-size: 2;
}
.script-editor textarea::placeholder { color: #647166; opacity: 1; }
.script-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 13px var(--card-gutter) 16px; }
.script-footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.script-footer-actions [hidden] { display: none; }
.mono-label { color: var(--muted); font: 500 13px/1.4 var(--mono); }
.script-side { display: grid; gap: 12px; min-width: 0; }

.split-card {
  padding: 15px;
  border-color: #394e40;
  color: var(--shell-text);
  background: #203528;
}
.split-card h2 { margin-top: 14px; }
.split-card p { margin-top: 7px; color: #bfccbc; font-size: 14px; line-height: 1.68; }
.primary-button, .secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 43px;
  max-width: 100%;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 670;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.primary-button { color: #263419; border-color: #b0c45d; background: var(--accent); }
.primary-button:hover:not(:disabled) { border-color: #849c34; background: #cfe66c; }
.primary-button:disabled { color: #5b6958; border-color: #d9dfcf; background: #e8ecdf; }
.secondary-button { color: #344c32; border-color: #cbd7c2; background: #f8f8ef; }
.secondary-button:hover:not(:disabled) { border-color: #8ba276; background: var(--wash); }
.secondary-button:disabled { color: #6e7b70; border-color: #d9dfd4; background: #edefea; }
.split-card .secondary-button { width: 100%; margin-top: 15px; color: var(--accent); border-color: #6a8056; background: #2b4434; }
.split-card .secondary-button:hover:not(:disabled) { border-color: var(--accent); background: #39533e; }
.split-card .secondary-button:disabled { color: #b3beb0; border-color: #506052; background: #27392e; }

.writing-guide { min-width: 0; padding: 5px 13px; border: 1px solid var(--line); border-radius: 9px; background: #f9f8f0; }
.writing-guide summary { min-height: 41px; padding-block: 9px; cursor: pointer; font-size: 14px; font-weight: 650; }
.writing-guide summary::marker { color: var(--accent-dark); }
.writing-guide p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }

.export-options {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 16px;
}

.export-card {
  display: flex;
  flex-direction: column;
  align-items: start;
  min-height: 205px;
  padding: 17px var(--card-gutter);
}
.export-card h2 { margin-top: 11px; }
.export-card p { flex: 1; margin-top: 6px; font-size: 14px; }
.export-card :is(.primary-button, .secondary-button) { margin-top: 15px; }
.file-type {
  display: inline-flex;
  padding: 3px 6px;
  border: 1px solid #cbd9bb;
  border-radius: 4px;
  color: var(--accent-dark);
  background: var(--wash);
  font: 700 12px/1.3 var(--mono);
  letter-spacing: .025em;
}
.sample-card { color: var(--shell-text); border-color: #3a5141; background: #203528; }
.sample-card p { color: #c4d0c0; }
.sample-card .file-type { color: var(--accent); border-color: #637c55; background: #314837; }
.sample-card .export-availability { flex: none; margin-top: 9px; color: #ffdfce; font-size: 13px; }

.job-review-resume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 var(--card-gutter) 12px;
  padding: 10px 12px;
  border: 1px solid #b8c9a2;
  border-radius: 8px;
  background: var(--wash);
}
.job-review-resume p { margin-top: 2px; overflow-wrap: anywhere; }
.job-review-resume button { margin-inline-start: auto; min-height: 44px; }
#shot-list, #job-list { padding-inline: var(--card-gutter); }
#shot-list > :last-child, #job-list > :last-child { margin-bottom: 13px; }
#shot-list > *, #job-list > *, .item-list > * { min-width: 0; }

.shot-row, .job-row, .ledger-row {
  min-width: 0;
  align-items: start;
  gap: 10px 13px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.shot-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; }
.shot-cell { min-width: 0; }
.shot-cell strong, .job-detail strong { font-weight: 730; }
.shot-row p, .job-row p { margin-top: 3px; }
.shot-index {
  display: grid;
  place-items: center;
  width: 36px;
  padding-block: 5px;
  border: 1px solid #dce5c7;
  border-radius: 5px;
  color: var(--accent-dark);
  background: var(--wash);
  font: 700 13px/1.4 var(--mono);
}
.shot-time { color: var(--muted); font: 500 13px/1.6 var(--mono); white-space: nowrap; }
.shot-frames { display: grid; gap: 2px; color: var(--muted); font: 500 12px/1.55 var(--mono); }
.shot-frame-range { display: flex; flex-wrap: wrap; gap: 2px 5px; font-variant-numeric: tabular-nums; }
.shot-frame-range span { white-space: nowrap; }
.shot-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.shot-dialogue { padding-left: 9px; border-left: 2px solid #c4d3ae; color: var(--ink); white-space: pre-wrap; }
.shot-controls { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.shot-row .secondary-button, .job-row .secondary-button { min-height: 39px; padding: 6px 9px; }

.job-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.job-detail, .job-controls { min-width: 0; }
.job-detail { padding-block: 2px; }
.job-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.job-progress { display: block; width: min(100%, 19rem); height: 9px; margin-top: 8px; accent-color: var(--accent-dark); }
.job-running { background: #e8f1db; }
.job-failed { color: var(--error); border-color: #ddad9f; background: #fff0e8; }
.ledger-row { display: flex; flex-wrap: wrap; justify-content: space-between; }
.empty-row { padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); }
.item-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style-position: inside; }
.item-list > li { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #faf9f0; overflow-wrap: anywhere; }
.item-list .shot-time { margin-left: 8px; }
.subtle { color: var(--muted); font-size: 14px; }
.form-error, .card .form-error { color: var(--error); }
.quote-amount { margin-block: 8px; color: var(--accent-dark); font: 700 25px/1.25 var(--mono); }
.wallet-balances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.wallet-balances > div { padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #f9f8f0; }
.wallet-balances dd { margin-top: 3px; font: 700 18px/1.3 var(--mono); }

dialog {
  width: min(calc(100% - 28px), 600px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid #aec0a7;
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 18px 65px #0c1a1469;
}

dialog::backdrop { background: #101d16ca; }
.dialog-heading {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.dialog-heading h2 { font-size: 23px; font-weight: 720; letter-spacing: -.02em; }
#modal-content { padding: 18px 20px 22px; overflow-wrap: anywhere; }
.sample-preview { width: min(calc(100% - 28px), 820px); }
.sample-preview .dialog-heading p { margin-top: 4px; }
.sample-preview-body { display: grid; gap: 10px; padding: 16px 20px 20px; }
.sample-preview-body video {
  display: block;
  width: 100%;
  max-height: 62dvh;
  aspect-ratio: 16 / 9;
  border: 1px solid #283e31;
  border-radius: 9px;
  background: #121f19;
  object-fit: contain;
}
.sample-preview-body .form-error { color: #762a21; }
.sample-frame-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #d8e3cd;
  border-radius: 8px;
  background: #f3f6eb;
}
.sample-frame-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 9px;
  min-width: 0;
}
.sample-frame-label { color: var(--accent-dark); font-size: 13px; font-weight: 690; }
.sample-frame-timecode {
  color: var(--ink);
  font: 690 20px/1.25 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sample-frame-number {
  flex-basis: 100%;
  font: 500 12px/1.45 var(--mono);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.sample-frame-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.sample-frame-actions .secondary-button { min-width: 68px; min-height: 44px; padding: 4px 9px; white-space: nowrap; }
.sample-frame-actions .secondary-button[aria-disabled="true"] { cursor: wait; opacity: 0.7; }
.sample-frame-status { grid-column: 1 / -1; margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.sample-preview-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 7px 14px; }
.sample-preview-times { padding-bottom: 7px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sample-seek { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; }
.sample-seek .form-field { gap: 4px; font-size: 13px; }
.sample-seek input {
  width: 7rem;
  min-height: 42px;
  padding: 5px 7px;
  border: 1px solid #c5d1c1;
  border-radius: 7px;
  color: var(--ink);
  background: #f9f9f2;
  font-size: 16px;
}
.sample-seek input:disabled { background: #edefea; }
.sample-dialogue {
  max-height: min(24dvh, 9rem);
  padding: 8px 11px;
  overflow: auto;
  border-left: 3px solid #afc37b;
  border-radius: 5px;
  background: #f2f7e7;
}
.sample-dialogue h3 { margin-bottom: 3px; font-size: 13px; }
.sample-dialogue p { white-space: pre-wrap; overflow-wrap: anywhere; }
.sample-review { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fcfbf4; }
.sample-review summary { min-height: 44px; padding: 10px 11px; cursor: pointer; font-weight: 650; overflow-wrap: anywhere; }
.sample-review summary::marker { color: var(--accent-dark); }
.sample-review summary > .subtle { margin-inline-start: 9px; font-weight: 500; }
.sample-review > p { margin: 1px 11px 7px; }
.sample-review-shots {
  display: grid;
  gap: 4px;
  max-height: min(30dvh, 15rem);
  margin: 0;
  padding: 0 7px 7px;
  overflow: auto;
  list-style: none;
}
.sample-review-shots:empty { padding: 0; }
.sample-review-shot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
  width: 100%;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: start;
  color: var(--ink);
  background: transparent;
}
.sample-review-shot strong { min-width: 0; overflow-wrap: anywhere; }
.sample-review-shot:not(:disabled):hover { background: var(--wash); }
.sample-review-shot[aria-current="true"] { border-color: #a6bd7a; background: var(--wash); }
.sample-review-timestamp { font: 500 12px/1.8 var(--mono); white-space: nowrap; color: var(--muted); }
.sample-review-shot:focus-visible { outline-offset: -2px; }
.sample-notes-body { display: grid; gap: 10px; padding: 0 10px 10px; }
.sample-note-form { display: grid; gap: 6px; }
.sample-note-form textarea {
  width: 100%;
  min-height: 64px;
  padding: 6px 8px;
  resize: vertical;
  border: 1px solid #c5d1c1;
  border-radius: 7px;
  color: var(--ink);
  background: #f9f9f2;
  font-size: 16px;
}
.sample-note-actions, .sample-note-meta { display: flex; flex-wrap: wrap; gap: 6px 9px; align-items: center; }
.sample-note-actions { justify-content: space-between; }
.sample-notes-list { display: grid; gap: 6px; max-height: min(30dvh, 15rem); margin: 0; padding: 0 3px; overflow: auto; list-style: none; }
.sample-notes-list:empty { display: none; }
.sample-note { min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; }
.sample-note-meta .secondary-button { min-height: 40px; padding: 4px 7px; }
.sample-note-text { margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sample-notes-body > button { justify-self: start; }
.dialog-stack { display: grid; gap: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 8px; }
.form-field { display: grid; gap: 5px; min-width: 0; }
.form-field > :is(label, span) { font-weight: 650; }
#modal-content :is(input:not([type="checkbox"], [type="radio"]), textarea, select) {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #c5d1c1;
  border-radius: 7px;
  color: var(--ink);
  background: #f9f9f2;
}
#modal-content textarea { min-height: 83px; resize: vertical; }


.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #c5d1c1;
  border-radius: 7px;
  color: var(--ink);
  background: #f9f9f2;
  font-size: 16px;
}

@media (max-width: 1040px) {
  :root { --rail-width: 185px; }
  .sidebar { padding-inline: 10px; }
  .job-row { align-items: start; }
}

@media (max-width: 880px) {
  :root { --rail-width: 169px; }
  .script-layout { grid-template-columns: minmax(0, 1fr); }
  .script-side { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); align-items: start; }
  .export-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sample-card { grid-column: 1 / -1; min-height: 0; }
  .shot-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .shot-controls { grid-column: 2 / -1; justify-content: start; }
  .job-controls { max-width: 250px; }
}

@media (max-width: 680px) {
  .shot-row.is-frame-based { grid-template-columns: 36px minmax(0, 1fr); }
  .shot-row.is-frame-based .shot-frames { grid-column: 2; }
  :root { --bar-height: 58px; --work-gutter: 13px; --card-gutter: 13px; }
  .app-header { position: static; display: flex; justify-content: space-between; gap: 7px; padding: 0 11px; }
  .brand { gap: 6px; margin-left: 0; font-size: 21px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-pro { margin-left: 0; }
  .header-location { display: none; }
  .header-actions { gap: 3px; }
  .wallet-trigger { gap: 5px; min-height: 43px; padding-inline: 7px; }
  .wallet-trigger strong { font-size: 13px; }
  .logout-button { min-height: 43px; padding-inline: 6px; font-size: 13px; }
  .app-shell { display: block; }
  .sidebar { position: static; gap: 5px; height: auto; padding: 7px 0 10px; border-right: 0; }
  .sidebar-title { padding-inline: 13px; }
  .sidebar-title h2 { font-size: 14px; }
  #project-list { display: flex; gap: 6px; overflow-x: auto; padding: 2px 12px 5px; }
  #project-list .project-button {
    display: flex;
    align-items: center;
    flex: none;
    gap: 5px 7px;
    width: auto;
    max-width: 85%;
    min-height: 44px;
    padding: 7px 10px;
  }
  .project-button strong { min-width: 0; font-size: 14px; }
  .project-meta { flex: none; font-size: 11px; }
  .project-button[aria-current="true"]::before { display: none; }
  .sidebar-footer { display: none; }
  .workspace { min-height: calc(100svh - 160px); border-radius: 12px 12px 0 0; }
  #project-view, .initial-state { padding-block: 13px 26px; }
  .project-mast {
    gap: 14px;
    min-height: 190px;
    margin-bottom: 11px;
    padding: 16px;
    border-radius: 11px;
    background-image: linear-gradient(90deg, #14271eed 0%, #15271ec2 37%, #15271e12 100%),
      linear-gradient(0deg, #14251ce0, #14251c00 85%), url("/studio-cover.webp");
  }
  .project-mast h1 { max-width: 100%; font-size: clamp(36px, 9.75vw, 53px); }
  .project-metrics { padding-top: 9px; }
  .project-metrics dt { font-size: 10px; letter-spacing: .07em; }
  .project-metrics dd { font-size: clamp(17px, 5.5vw, 22px); }
  .project-metrics > div + div { padding-left: 9px; }
  .project-nav { display: grid; gap: 7px; margin-bottom: 13px; padding-bottom: 7px; }
  .project-nav-links { justify-content: start; }
  .workflow-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .workflow-nav button { gap: 4px; min-width: 0; min-height: 47px; padding-inline: 4px; font-size: 13px; }
  .workflow-icon { font-size: 13px; }
  .script-layout { gap: 12px; }
  .script-side { grid-template-columns: minmax(0, 1fr); }
  .card-header { gap: 9px; padding-block: 15px 13px; }
  .card h2 { font-size: 19px; }
  .card-header p { font-size: 13px; }
  .script-editor textarea { min-height: 255px; padding: 12px; }
  .script-footer { padding-block: 11px 12px; }
  .export-card { min-height: 0; padding-block: 14px; }
  .job-row { grid-template-columns: minmax(0, 1fr); }
  .job-controls { justify-content: start; max-width: none; }
  .sample-preview-body { padding: 12px 13px 15px; }
  .dialog-heading { padding: 12px 13px; }
  .shot-row .secondary-button, .job-row .secondary-button { min-height: 42px; }
  #modal-content :is(input, select, textarea) { font-size: 16px; }
}

@media (max-width: 420px) {
  .export-options { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .export-card h2 { margin-top: 8px; }
  .export-card :is(.primary-button, .secondary-button) { margin-top: 12px; }
  .sample-frame-tools { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sample-review-shot { grid-template-columns: auto minmax(0, 1fr); gap: 2px 7px; }
  .sample-review-timestamp { grid-column: 2; white-space: normal; overflow-wrap: anywhere; }
}

.studio-page {
  --shell: #121b17;
  --shell-raised: #203027;
  --shell-line: #34463a;
  --shell-muted: #b5c2b6;
  --paper: #f6f4eb;
  --surface: #fffdf7;
  --ink: #1b2720;
  --muted: #4e6052;
  --line: #dedfd1;
  --accent: #bed88a;
  --accent-dark: #476337;
  --wash: #eef2e2;
  --focus: #526d39;
  --rail-width: 208px;
  --bar-height: 62px;
  --work-gutter: clamp(18px, 2.4vw, 36px);
  --card-gutter: clamp(16px, 1.7vw, 23px);
}

.studio-page .app-header { background: var(--shell); border-color: #2e3d33; }
.studio-page .brand { margin-left: 18px; }
.studio-page .header-location {
  padding-inline: var(--work-gutter);
  border-left: 0;
  letter-spacing: .02em;
}
.studio-page .studio-site-nav { gap: 4px; }
.studio-page .studio-site-nav a {
  display: inline-flex;
  min-height: 42px;
  padding-inline: 13px;
  align-items: center;
  border-radius: 7px;
  white-space: nowrap;
}
.studio-page .studio-site-nav a:hover { color: var(--shell-text); background: #25342b; }
.studio-page .studio-site-nav a[aria-current="page"] {
  color: var(--accent);
  background: #24362a;
  font-weight: 690;
}
.studio-page .wallet-trigger { border-radius: 9px; background: #25352b; }
.studio-page .coin { border-color: var(--accent); }

.studio-page .sidebar { gap: 15px; padding: 20px 13px 17px; background: #141f19; }
.studio-page .sidebar-title { padding-inline: 4px; }
.studio-page .sidebar-title h2 { color: #dbe4d7; font-size: 13px; letter-spacing: .025em; }
.studio-page .create-project { width: 44px; height: 44px; border-color: #526848; background: #273c2d; }
.studio-page .create-project:hover { background: #344c39; }
.studio-page #project-list { gap: 5px; scrollbar-color: #4d6254 transparent; }
.studio-page .project-button {
  gap: 3px;
  min-height: 58px;
  padding: 9px 10px 9px 13px;
  border-radius: 8px;
  line-height: 1.35;
}
.studio-page .project-button[aria-current="true"] {
  color: #ebf1e2;
  border-color: #526849;
  background: #273b2e;
}
.studio-page .project-button[aria-current="true"] .project-meta { color: var(--accent); }
.studio-page .sidebar-footer { padding: 9px 2px 0; }
.studio-page .sidebar-footer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding-inline: 9px;
  border-radius: 7px;
  color: var(--shell-muted);
  font-size: 13px;
  text-decoration: none;
}
.studio-page .sidebar-footer a:hover { color: var(--shell-text); background: var(--shell-raised); }

.studio-page .workspace { border-radius: 0; }
.studio-page #project-view, .studio-page .initial-state { padding-block-start: clamp(20px, 2.3vw, 31px); }
.studio-page .project-mast {
  position: relative;
  isolation: isolate;
  min-height: 145px;
  align-content: center;
  justify-items: stretch;
  padding: clamp(17px, 2.15vw, 29px);
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid #d9ded0;
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface);
}
.studio-page .project-mast::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: 43%;
  background: linear-gradient(90deg, var(--surface), #fffdf754 33%, transparent 62%),
    #1f382a url("/studio-cover.webp") center 55% / cover no-repeat;
  content: "";
}
.studio-page .project-mast-main { width: min(68%, 650px); }
.studio-page .project-mast h1 {
  max-width: none;
  margin-bottom: 14px;
  font: 700 clamp(31px, 3.4vw, 53px)/1.14 var(--display);
  letter-spacing: -.03em;
  text-shadow: none;
  text-wrap: pretty;
}
.studio-page .project-metrics {
  width: min(100%, 480px);
  grid-template-columns: minmax(60px, .8fr) minmax(60px, .8fr) minmax(100px, 1.4fr);
  padding-top: 9px;
  border-color: #d9e1ce;
}
.studio-page .project-metrics > div { padding-right: 7px; }
.studio-page .project-metrics > div + div { padding-left: 12px; border-color: #dce3d3; }
.studio-page .project-metrics dt { color: #526450; font-size: 11px; letter-spacing: .025em; }
.studio-page .project-metrics dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 4px;
  margin-top: 3px;
  color: var(--accent-dark);
  font: 720 clamp(16px, 1.74vw, 23px)/1.12 var(--mono);
}
.studio-page .project-metrics small { color: #51634d; font-size: 11px; }

.studio-page .project-nav {
  gap: 12px;
  margin-bottom: 16px;
  padding: 6px;
  border: 1px solid #dce0d2;
  border-radius: 12px;
  background: var(--surface);
}
.studio-page .workflow-nav {
  flex-shrink: 0;
  gap: 3px;
  padding: 2px;
  border: 1px solid #e7eadd;
  border-radius: 8px;
  background: #f3f4e9;
}
.studio-page .workflow-nav button {
  gap: 6px;
  min-width: 74px;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
}
.studio-page .workflow-nav button[aria-selected="true"] {
  color: #f6fae9;
  border-color: #476337;
  background: #476337;
}
.studio-page .workflow-nav button[aria-selected="true"]::after { content: none; }
.studio-page .workflow-nav button[aria-selected="true"] .workflow-icon { color: #e2efca; }
.studio-page .project-nav-links { gap: 4px; }
.studio-page .workflow-link {
  min-height: 44px;
  padding: 4px 9px;
  border-color: transparent;
  color: #41563a;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}
.studio-page .workflow-link:hover { border-color: #cfdbbf; background: var(--wash); }

.studio-page .script-layout {
  gap: 14px;
  grid-template-columns: minmax(0, 2.38fr) minmax(210px, 1fr);
}
.studio-page .card { border-color: #dddfd1; border-radius: 13px; }
.studio-page .script-card .card-header { padding-top: 18px; }
.studio-page .script-editor textarea {
  min-height: clamp(265px, 40vh, 430px);
  border-color: #e0e1d4;
  border-radius: 8px;
  color: var(--ink);
  background: #faf9f1;
}
.studio-page .script-footer { padding-block: 12px 14px; }
.studio-page .split-card {
  padding: 17px;
  color: var(--ink);
  background: var(--surface);
}
.studio-page .split-card h2 { margin-top: 0; }
.studio-page .split-card p { margin-top: 7px; color: var(--muted); line-height: 1.57; }
.studio-page .split-card .secondary-button {
  width: auto;
  margin-top: 13px;
  color: #365132;
  border-color: #cad6bd;
  background: #f2f5e6;
}
.studio-page .split-card .secondary-button:hover:not(:disabled) { border-color: #a9bd8d; background: #e9f0da; }
.studio-page .split-card .secondary-button:disabled { color: #647060; border-color: #dee2d7; background: #eeefe8; }
.studio-page .split-card :focus-visible, .studio-page .project-mast :focus-visible { outline-color: var(--focus); }
.studio-page .create-script-card {
  border-color: #cbd8bb;
  background: #edf2e2;
}
.studio-page .writing-guide { background: #f8f7ee; }
.studio-page .primary-button:not(:disabled) { color: #203119; border-color: #afc880; background: var(--accent); }
.studio-page .primary-button:hover:not(:disabled) { border-color: #90ad62; background: #b2ce79; }
.studio-page .sample-card {
  border-color: #3b5140;
  background: #23362b;
}
.studio-page .sample-card .file-type { border-color: #587047; background: #2b4132; }
.studio-page .export-card { min-height: 186px; }
.studio-page .export-options { gap: 12px; }
.studio-page .sample-preview-body video { background: #121b17; }

@media (max-width: 1080px) {
  .studio-page { --rail-width: 176px; }
  .studio-page .sidebar { padding-inline: 10px; }
  .studio-page .project-nav { gap: 7px; align-items: flex-start; }
  .studio-page .project-nav-links { justify-content: flex-end; }
  .studio-page .workflow-link { padding-inline: 6px; }
}

@media (max-width: 900px) {
  .studio-page .project-nav { display: grid; grid-template-columns: minmax(0, 1fr); }
  .studio-page .workflow-nav { justify-self: start; }
  .studio-page .project-nav-links { justify-content: flex-start; }
  .studio-page .script-layout { grid-template-columns: minmax(0, 1fr); }
  .studio-page .script-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .studio-page .writing-guide { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .studio-page {
    --bar-height: 98px;
    --work-gutter: 12px;
    --card-gutter: 13px;
    -webkit-tap-highlight-color: #bed88a38;
  }
  .studio-page .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 0;
    min-height: 0;
    padding: 6px 10px 0;
  }
  .studio-page .brand { margin-left: 0; }
  .studio-page .header-location {
    display: block;
    grid-area: 2 / 1 / 2 / -1;
    padding: 0;
    margin: 3px 0 4px;
  }
  .studio-page .studio-site-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
  .studio-page .studio-site-nav a {
    min-width: 0;
    min-height: 41px;
    justify-content: center;
    padding-inline: 3px;
  }
  .studio-page .header-actions { grid-area: 1 / 2; }
  .studio-page .sidebar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 4px 0 7px 10px;
  }
  .studio-page .sidebar-title { padding: 0; }
  .studio-page .sidebar-title h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .studio-page #project-list { flex: 1; min-width: 0; gap: 5px; padding: 2px 10px 2px 1px; }
  .studio-page #project-list .project-button { max-width: min(78vw, 260px); min-height: 44px; padding: 6px 8px; }
  .studio-page #project-list .project-button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .studio-page .project-meta { font-size: 11px; }
  .studio-page .workspace { min-height: calc(100svh - 155px); }
  .studio-page #project-view, .studio-page .initial-state { padding-block-start: 13px; }
  .studio-page .project-mast {
    min-height: 118px;
    margin-bottom: 10px;
    padding: 13px;
    border-radius: 12px;
    background: var(--surface);
  }
  .studio-page .project-mast::before {
    width: 50%;
    background-image: linear-gradient(90deg, var(--surface), #fffdf7ef 28%, #fffdf744 81%),
      url("/studio-cover.webp");
    background-position: center, 64% center;
  }
  .studio-page .project-mast-main { width: min(100%, 415px); }
  .studio-page .project-mast h1 { max-width: 85%; margin-bottom: 9px; font-size: clamp(30px, 8.25vw, 42px); }
  .studio-page .project-metrics { width: min(93%, 420px); padding-top: 7px; }
  .studio-page .project-metrics > div + div { padding-left: 7px; }
  .studio-page .project-metrics dt, .studio-page .project-metrics small { font-size: 10px; }
  .studio-page .project-metrics dd { font-size: clamp(15px, 4.3vw, 20px); }
  .studio-page .project-nav { gap: 5px; padding: 5px; margin-bottom: 11px; }
  .studio-page .workflow-nav { justify-self: stretch; }
  .studio-page .workflow-nav button { gap: 4px; min-width: 0; min-height: 44px; padding-inline: 4px; }
  .studio-page .project-nav-links { gap: 3px; }
  .studio-page .workflow-link { flex: 1 1 32%; min-width: 0; min-height: 44px; padding-inline: 4px; background: #f6f7ef; }
  .studio-page .script-layout, .studio-page .script-side { gap: 9px; }
  .studio-page .script-card .card-header { padding-top: 14px; }
  .studio-page .script-editor textarea { min-height: 260px; }
  .studio-page .split-card { padding: 11px; }
  .studio-page .split-card p { font-size: 13px; }
  .studio-page .split-card .secondary-button { width: 100%; min-height: 44px; padding-inline: 6px; }
  .studio-page .export-card { min-height: 0; }
  .studio-page .job-row :is(.secondary-button, .primary-button),
  .studio-page .shot-row :is(.secondary-button, .primary-button) { min-height: 44px; }
}
