:root {
  color-scheme: dark;
  --bg: #111311;
  --surface: #191c18;
  --surface2: #22261f;
  --ink: #f0f0e7;
  --muted: #9da495;
  --line: #32382e;
  --accent: #c4ef82;
  --accent-ink: #17220c;
  --danger: #f6a096;
  --radius: 18px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', Arial, sans-serif;
}
html[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f4ec;
  --surface: #fffef7;
  --surface2: #e9ecdf;
  --ink: #242a21;
  --muted: #66705e;
  --line: #d9dece;
  --accent: #36552c;
  --accent-ink: #fff;
  --danger: #a13228;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button {
  border: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1.07;
  letter-spacing: -2px;
}
h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.6px;
}
h3 {
  font-size: 17px;
  font-weight: 500;
}
small,
.muted {
  color: var(--muted);
}
img {
  max-width: 100%;
  display: block;
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
button svg {
  pointer-events: none;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.btn {
  padding: 12px 20px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid transparent;
  min-height: 44px;
  transition:
    transform 0.15s,
    filter 0.15s;
}
.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn.quiet {
  background: var(--surface2);
  color: var(--ink);
}
.btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--line);
}
.btn.small {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 12px;
}
.icon-btn {
  background: transparent;
  color: var(--muted);
  padding: 10px;
  border-radius: 8px;
  min-width: 42px;
  min-height: 42px;
}
.icon-btn:hover {
  background: var(--surface2);
  color: var(--ink);
}
.eyebrow {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 2.1px;
  font-weight: 600;
  color: var(--muted);
}
.brand-mark {
  font-family: var(--serif);
  font-size: 37px;
  line-height: 1;
  letter-spacing: -3px;
  color: var(--accent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.brand-name {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 1.8px;
}
.app-shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 33px 23px 20px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  margin-bottom: 48px;
}
.nav-label {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  margin: 0 12px 13px;
}
.nav {
  display: grid;
  gap: 5px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}
.nav a.active {
  color: var(--ink);
  background: var(--surface2);
}
.nav a.active:after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: auto;
}
.nav a:hover {
  color: var(--ink);
}
.sidebar-bottom {
  margin-top: auto;
}
.workspace-label {
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 11px;
}
.workspace-label p {
  margin-top: 5px;
  color: var(--muted);
}
.user-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.user-row .avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface2);
  width: 32px;
  height: 32px;
  color: var(--accent);
}
.user-row > span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main-wrap {
  min-width: 0;
}
.topbar {
  height: 80px;
  border-bottom: 1px solid var(--line);
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.breadcrumbs {
  font-size: 12px;
  color: var(--muted);
}
.breadcrumbs b {
  color: var(--ink);
  font-weight: 400;
  margin-left: 10px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
}
.badge.good {
  color: var(--accent);
}
.badge.bad {
  color: var(--danger);
}
.dot {
  width: 5px;
  height: 5px;
  display: inline-block;
  border-radius: 50%;
  background: currentColor;
}
.page {
  max-width: 1500px;
  margin: auto;
  padding: 38px 42px 60px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.page-head h1 {
  font-size: 44px;
  margin-top: 10px;
}
.page-head p {
  color: var(--muted);
  margin-top: 12px;
  max-width: 580px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.spread {
  justify-content: space-between;
}
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 390px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 28px;
}
.hero-copy {
  padding: 45px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hero-copy h1 {
  margin: 22px 0 20px;
  max-width: 540px;
}
.hero-copy h1 em {
  font-weight: 400;
  color: var(--accent);
}
.hero-copy p {
  max-width: 340px;
  color: var(--muted);
  font-size: 13px;
}
.hero-copy .row {
  margin-top: 28px;
}
.hero-art {
  position: relative;
  min-height: 370px;
  background: #30382a;
  overflow: hidden;
}
.hero-art img {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: cover;
  object-position: center 26%;
}
.hero-art:after {
  content: '';
  position: absolute;
  inset: 60% 0 0;
  background: linear-gradient(transparent, rgba(9, 14, 6, 0.8));
}
.hero-caption {
  position: absolute;
  z-index: 1;
  bottom: 25px;
  left: 25px;
  right: 25px;
  color: #f4f5ee;
  display: flex;
  justify-content: space-between;
  align-items: end;
}
.hero-caption strong {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 400;
}
.hero-caption small {
  color: #d4d9ca;
}
.hero-art .orb {
  width: 230px;
  height: 300px;
  border: 1px solid #707f5b;
  border-radius: 50%;
  position: absolute;
  top: 20px;
  left: calc(50% - 115px);
  transform: rotate(-24deg);
}
.hero-art .orb:nth-child(2) {
  transform: rotate(24deg);
}
.hero-art .orb:nth-child(3) {
  transform: rotate(80deg);
}
.hero-art .art-word {
  position: absolute;
  top: 100px;
  left: 0;
  right: 0;
  text-align: center;
  font: italic 100px var(--serif);
  color: #c4ef82;
}
.hero-art .art-note {
  position: absolute;
  top: 25px;
  left: 25px;
  font-size: 9px;
  letter-spacing: 3px;
  color: #c4ef82;
}
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 35px;
}
.stat {
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}
.stat:last-child {
  border: 0;
}
.stat strong {
  display: block;
  font: 32px var(--serif);
  margin-bottom: 4px;
}
.stat span {
  font-size: 11px;
  color: var(--muted);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 28px 0 20px;
}
.section-head h2 {
  font-size: 21px;
}
.text-link {
  background: none;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.roster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.talent-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.talent-card:hover {
  transform: translateY(-3px);
  border-color: var(--muted);
}
.card-portrait {
  height: 300px;
  position: relative;
  background: var(--surface2);
  overflow: hidden;
}
.card-portrait img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: top;
}
.card-portrait .badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(17, 19, 17, 0.8);
  color: #c4ef82;
  border: 0;
}
.initial-portrait {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 110px var(--serif);
  color: var(--muted);
  border-radius: 50% 50% 0 0;
  margin: 30px 30px 0;
  border: 1px solid var(--line);
}
.talent-info {
  padding: 20px;
}
.talent-info h3 {
  font: 28px var(--serif);
  margin-bottom: 4px;
}
.talent-info .role-line {
  min-height: 18px;
  margin: 12px 0;
  font-size: 11px;
  color: var(--muted);
}
.card-counts {
  display: flex;
  gap: 24px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.card-counts b {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  margin-right: 4px;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.card-actions .btn {
  flex: 1;
}
.add-card {
  border: 1px dashed var(--line);
  border-radius: 14px;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  background: none;
  color: var(--ink);
  gap: 16px;
}
.add-card .plus {
  font-size: 32px;
  font-weight: 200;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
}
.add-card p {
  max-width: 190px;
  font-size: 12px;
  color: var(--muted);
}
.empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 50px 28px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 230px;
}
.empty h2 {
  font: 30px var(--serif);
}
.empty p {
  color: var(--muted);
  max-width: 420px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}
.toolbar input {
  max-width: 320px;
}
.toolbar select {
  max-width: 160px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.panel h2 {
  margin-bottom: 18px;
}
.intelligence-view .panel { margin-bottom: 20px; }
.intelligence-view details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.intelligence-view details[open] > summary { margin-bottom: 18px; }
.intelligence-view pre, .intelligence-view .source-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.intelligence-view article { padding: 16px 0; border-bottom: 1px solid var(--line); }
.intelligence-view article .btn { margin: 8px 8px 0 0; }
#agent-messages p { white-space: pre-wrap; overflow-wrap: anywhere; padding: 14px 0; border-bottom: 1px solid var(--line); }
[data-video-form] .field[hidden] {
  display: none;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.field > span,
.field > label {
  font-size: 12px;
  font-weight: 500;
}
.field small {
  font-size: 11px;
}
input,
select,
textarea {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 13px;
  min-height: 44px;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}
input[type='checkbox'] {
  width: 17px;
  height: 17px;
  min-height: 17px;
  accent-color: var(--accent);
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.6;
  margin: 15px 0;
}
.check input {
  margin-top: 2px;
  flex-shrink: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.span-2 {
  grid-column: span 2;
}
.notice {
  border: 1px solid var(--line);
  background: var(--surface2);
  padding: 14px 17px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  margin: 18px 0;
}
.notice.error {
  color: var(--danger);
}
.notice strong {
  color: var(--ink);
}
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}
.auth-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 60px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.auth-story h1 {
  font-size: clamp(45px, 5.6vw, 80px);
  max-width: 630px;
  margin: 50px 0 25px;
}
.auth-story h1 em {
  color: var(--accent);
}
.auth-story p {
  color: var(--muted);
  max-width: 420px;
}
.auth-story footer {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 2px;
}
.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-form {
  width: 100%;
  max-width: 350px;
}
.auth-form h2 {
  font: 36px var(--serif);
  margin: 10px 0;
}
.auth-form > p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 28px;
}
.auth-form .btn {
  width: 100%;
  margin-top: 6px;
}
.wizard {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 45px;
  max-width: 960px;
  margin: 35px auto;
}
.wizard-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  align-content: start;
}
.wizard-steps li {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 13px;
  color: var(--muted);
  font-size: 13px;
}
.wizard-steps li.current {
  color: var(--ink);
  background: var(--surface2);
  border-radius: 9px;
}
.step-number {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
}
.current .step-number {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.wizard-body h2 {
  font: 34px var(--serif);
  margin-bottom: 10px;
}
.wizard-body > p {
  color: var(--muted);
  margin-bottom: 30px;
}
.wizard-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 25px;
  padding-top: 20px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 14px 0;
}
.chip {
  display: inline-flex;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  background: none;
  color: var(--muted);
}
.chip.selected {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.studio-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 25px;
}
.studio-top h1 {
  font-size: 38px;
}
.studio-top .badge {
  margin-right: auto;
}
.tabs {
  display: flex;
  gap: 25px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 25px;
  overflow: auto;
}
.tab {
  padding: 12px 2px 15px;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
}
.tab.active {
  color: var(--accent);
  border-color: var(--accent);
}
.studio-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 24px;
}
.identity-sidebar {
  align-self: start;
}
.identity-sidebar .reference-image {
  aspect-ratio: 3/4;
  background: var(--surface2);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 18px;
}
.reference-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.identity-sidebar h3 {
  font: 24px var(--serif);
}
.identity-sidebar dl {
  font-size: 11px;
  margin-top: 20px;
  display: grid;
  gap: 5px;
}
.identity-sidebar dt {
  color: var(--muted);
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 9px;
}
.identity-sidebar dd {
  margin: 0;
}
.studio-main {
  min-width: 0;
}
.canvas {
  min-height: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 18px;
}
.canvas > img {
  max-height: 500px;
  width: auto;
  object-fit: contain;
  border-radius: 7px;
}
.canvas-empty {
  display: grid;
  text-align: center;
  justify-items: center;
  gap: 13px;
  padding: 30px;
}
.canvas-empty .brand-mark {
  font-size: 65px;
  margin-bottom: 15px;
}
.canvas-empty h2 {
  font: 29px var(--serif);
}
.canvas-empty p {
  font-size: 12px;
  color: var(--muted);
  max-width: 310px;
}
.direction-box {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.direction-box textarea {
  background: transparent;
  border: 0;
  padding: 6px 0;
  min-height: 90px;
}
.direction-box .controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.controls .field {
  margin-bottom: 0;
  min-width: 100px;
  flex: 1;
}
.controls .field > span {
  font-size: 10px;
  color: var(--muted);
}
.controls select {
  padding: 9px 10px;
  font-size: 11px;
}
.controls .btn {
  align-self: flex-end;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.media-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}
.media-card .preview {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--surface2);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-card .preview img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.media-card .preview:hover {
  filter: brightness(1.08);
}
.media-card video {
  width: 100%;
  max-height: 320px;
}
.media-card audio {
  width: 100%;
  height: 42px;
  margin: 12px 0;
}
.media-card .media-info {
  padding: 13px;
}
.media-info p {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 5px;
}
.media-info small {
  font-size: 10px;
}
.media-info .row {
  gap: 6px;
  margin-top: 11px;
}
.audio-art {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font: italic 45px var(--serif);
  letter-spacing: 4px;
  background: var(--surface2);
}
.identity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.identity-slot {
  border: 1px dashed var(--line);
  border-radius: 10px;
  min-height: 160px;
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}
.identity-slot img {
  height: 130px;
  width: 100%;
  object-fit: cover;
}
.identity-slot span {
  padding: 8px;
}
.identity-slot.filled {
  border-style: solid;
}
.history-list {
  display: grid;
  gap: 13px;
}
.job-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: var(--surface);
}
.job-row summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.job-row summary strong {
  font-weight: 500;
}
.job-row .job-detail {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.job-row .job-detail p {
  margin: 12px 0;
}
.job-row .job-detail b {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.job-status {
  font-size: 11px;
  color: var(--muted);
}
.job-status.failed {
  color: var(--danger);
}
.job-status.completed {
  color: var(--accent);
}
progress {
  height: 5px;
  width: 100%;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  margin: 12px 0;
  background: var(--surface2);
  accent-color: var(--accent);
}
progress::-webkit-progress-bar {
  background: var(--surface2);
}
progress::-webkit-progress-value {
  background: var(--accent);
}
.job-tray {
  position: fixed;
  bottom: 20px;
  right: 24px;
  width: 320px;
  max-width: calc(100vw - 48px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 15px 60px #0004;
  z-index: 8;
}
.job-tray:empty {
  display: none;
}
.job-tray p {
  font-size: 12px;
}
.job-tray small {
  font-size: 10px;
}
.provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.provider {
  display: flex;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 23px;
  background: var(--surface);
}
.provider .provider-icon {
  font: italic 28px var(--serif);
  color: var(--accent);
  width: 40px;
  flex-shrink: 0;
}
.provider p {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
}
.provider h3 {
  margin-bottom: 10px;
}
.provider code {
  font-size: 10px;
  color: var(--muted);
  word-break: break-word;
}
.settings-note {
  margin-top: 28px;
  max-width: 800px;
}
.settings-note p {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}
.settings-note code {
  color: var(--ink);
  font-size: 12px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  font-size: 11px;
  color: var(--muted);
}
.loading {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.loading:before {
  content: '';
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 25px;
  align-items: center;
  justify-content: center;
}
.skip {
  position: fixed;
  top: -60px;
  left: 20px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px;
}
.skip:focus {
  top: 10px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 600px;
  width: max-content;
  max-width: calc(100vw - 40px);
  padding: 13px 22px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 9px;
  z-index: 100;
  font-size: 13px;
  box-shadow: 0 8px 40px #0004;
}
#toast:empty {
  display: none;
}
dialog {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  width: min(760px, calc(100vw - 30px));
  max-height: 90vh;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font: 32px var(--serif);
  margin: 0 0 18px;
}
dialog .modal-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
dialog img {
  max-height: 55vh;
  margin: 0 auto 20px;
  object-fit: contain;
}
dialog video {
  width: 100%;
  max-height: 55vh;
}
dialog audio {
  width: 100%;
  margin: 20px 0;
}
dialog .metadata {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 11px;
  gap: 10px;
  color: var(--muted);
  margin: 20px 0;
  overflow-wrap: anywhere;
}
.mobile-brand {
  display: none;
}
.help-line {
  font-size: 11px;
  color: var(--muted);
  margin-top: 14px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1550px) {
  .roster {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .card-portrait {
    height: 330px;
  }
}
@media (max-width: 1150px) {
  .app-shell {
    grid-template-columns: 185px 1fr;
  }
  .sidebar {
    padding: 28px 16px;
  }
  .topbar {
    padding: 0 25px;
  }
  .page {
    padding: 30px 25px;
  }
  .hero-copy {
    padding: 30px 25px;
  }
  .hero-copy h1 {
    font-size: 46px;
  }
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
  }
  .roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .studio-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-copy .btn {
    padding: 11px 14px;
    font-size: 11px;
  }
}
@media (max-width: 800px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: sticky;
    z-index: 10;
    top: 0;
    padding: 0;
    background: var(--bg);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .brand,
  .nav-label,
  .sidebar-bottom {
    display: none;
  }
  .nav {
    display: flex;
    overflow-x: auto;
    gap: 0;
    padding: 6px 12px;
  }
  .nav a {
    flex: 1;
    justify-content: center;
    min-width: 68px;
    padding: 12px 9px;
    font-size: 11px;
    gap: 7px;
  }
  .nav a svg {
    width: 16px;
    height: 16px;
  }
  .nav a.active:after {
    display: none;
  }
  .topbar {
    height: 64px;
    padding: 0 20px;
  }
  .mobile-brand {
    display: block;
    font-size: 27px;
  }
  .breadcrumbs {
    display: none;
  }
  .top-actions .badge {
    display: none;
  }
  .page {
    padding: 25px 20px 80px;
  }
  .hero-copy h1 {
    font-size: 43px;
  }
  .hero-copy {
    padding: 28px 24px;
  }
  .hero {
    min-height: 350px;
  }
  .hero-art {
    min-height: 350px;
  }
  .hero-caption strong {
    font-size: 25px;
  }
  .hero-caption .badge {
    display: none;
  }
  .stat {
    padding: 16px;
  }
  .stat strong {
    font-size: 28px;
  }
  .stat span {
    font-size: 10px;
  }
  .studio-layout {
    grid-template-columns: 1fr;
  }
  .identity-sidebar {
    display: none;
  }
  .wizard {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .wizard-steps {
    display: flex;
    gap: 3px;
    justify-content: space-between;
    overflow: auto;
  }
  .wizard-steps li {
    padding: 9px;
    flex-direction: column;
    gap: 5px;
    font-size: 10px;
  }
  .wizard-body h2 {
    font-size: 30px;
  }
  .auth-story {
    padding: 35px;
  }
  .auth-story h1 {
    font-size: 48px;
  }
  .auth-form-wrap {
    padding: 30px;
  }
  .provider-grid {
    grid-template-columns: 1fr 1fr;
  }
  .page-head h1 {
    font-size: 38px;
  }
}
@media (max-width: 560px) {
  .nav a {
    flex-direction: column;
    font-size: 9px;
    gap: 4px;
    min-width: 58px;
    padding: 7px;
  }
  .nav a svg {
    width: 17px;
    height: 17px;
  }
  .top-actions {
    gap: 4px;
  }
  .top-actions .btn {
    font-size: 11px;
    padding: 8px 12px;
  }
  .hero {
    display: flex;
    flex-direction: column;
  }
  .hero-copy {
    padding: 30px 23px;
  }
  .hero-copy h1 {
    font-size: 46px;
    margin: 20px 0;
  }
  .hero-art {
    min-height: 250px;
    max-height: 300px;
  }
  .hero-art img {
    object-position: center 25%;
  }
  .hero-copy .btn {
    font-size: 11px;
  }
  .hero-copy .row {
    gap: 9px;
  }
  .hero-art .orb {
    top: -20px;
    height: 250px;
  }
  .hero-art .art-word {
    top: 40px;
  }
  .hero-caption {
    bottom: 18px;
  }
  .stat-strip {
    grid-template-columns: 1fr 1fr;
  }
  .stat:nth-child(2) {
    border-right: 0;
  }
  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .roster {
    gap: 16px;
    grid-template-columns: 1fr;
  }
  .card-portrait {
    height: 370px;
  }
  .add-card {
    min-height: 230px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }
  .page-head h1 {
    font-size: 39px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .wizard-steps li {
    padding: 7px 4px;
    font-size: 9px;
  }
  .step-number {
    width: 24px;
    height: 24px;
  }
  .provider-grid {
    grid-template-columns: 1fr;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-story {
    padding: 28px;
    min-height: 330px;
  }
  .auth-story h1 {
    font-size: 46px;
    margin: 30px 0 16px;
  }
  .auth-story footer {
    display: none;
  }
  .auth-form-wrap {
    padding: 35px 25px;
  }
  .media-grid {
    gap: 12px;
  }
  .media-info .btn.small {
    padding: 6px 8px;
    font-size: 10px;
  }
  .studio-top {
    flex-wrap: wrap;
    gap: 10px;
  }
  .studio-top h1 {
    font-size: 33px;
  }
  .tabs {
    gap: 22px;
  }
  .canvas {
    min-height: 290px;
  }
  .direction-box {
    padding: 16px;
  }
  .controls .btn {
    width: 100%;
    margin-top: 8px;
  }
  .identity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar input {
    max-width: none;
  }
  .job-row summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .stat-strip {
    margin-bottom: 28px;
  }
  .section-head h2 {
    font-size: 20px;
  }
  dialog {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.card-portrait {
  display: block;
}
.auth-form-wrap .notice[hidden] {
  display: none;
}
/* Product and campaign workspaces reuse the studio's shared surfaces and type. */
.commerce-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  margin: 24px 0;
}
.commerce-intro {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 22px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.commerce-intro p {
  max-width: 420px;
  font-size: 18px;
  color: var(--ink);
}
.product-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: transform 0.2s;
}
.product-card:hover {
  transform: translateY(-3px);
}
.product-cover {
  aspect-ratio: 4/3;
  background: var(--surface2);
  display: grid;
  place-items: center;
}
.product-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-meta {
  padding: 22px;
}
.product-meta h2 {
  margin: 18px 0 6px;
}
.product-meta p {
  color: var(--muted);
}
.commerce-steps {
  display: flex;
  gap: 8px;
  margin: 12px 0 30px;
  overflow: auto;
  padding-bottom: 8px;
}
.commerce-steps a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: nowrap;
  color: var(--muted);
}
.commerce-steps a.active {
  border-color: var(--accent);
  color: var(--ink);
}
.commerce-steps b {
  color: var(--accent);
}
.commerce-panel {
  max-width: 1100px;
}
.commerce-panel h2 {
  font-family: var(--serif);
  font-size: 34px;
  margin: 8px 0 20px;
}
.commerce-panel form {
  margin: 24px 0;
}
.commerce-panel .btn {
  margin-top: 12px;
}
.variant-list > .row,
.readiness-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.readiness-row .badge {
  margin-left: 16px;
}
.fidelity-rule {
  padding: 20px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 18px 0;
}
.references img {
  width: 100%;
  height: 230px;
  object-fit: contain;
  background: var(--surface2);
  border-radius: 10px;
  margin-bottom: 16px;
}
.reference-upload {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}
.references .row {
  flex-wrap: wrap;
}
.campaign-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.campaign-card p {
  color: var(--muted);
  flex: 1;
}
.campaign-summary {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}
.campaign-summary p {
  max-width: 660px;
  margin-top: 14px;
}
.campaign-summary .row {
  align-self: flex-end;
  flex-wrap: wrap;
}
.campaign-output {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.campaign-output img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 12px;
}
.output-image {
  padding: 0;
  background: var(--surface2);
  border-radius: 12px;
}
.output-definition {
  margin-bottom: 24px;
}
#campaign-plan pre,
.provenance pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  max-height: 500px;
  overflow: auto;
  padding: 20px;
  background: var(--surface2);
  border-radius: 12px;
}
#campaign-plan details {
  margin: 16px 0;
}
.reference-strip {
  display: flex;
  gap: 12px;
  overflow: auto;
  margin: 20px 0;
}
.reference-strip img {
  width: 120px;
  height: 140px;
  object-fit: contain;
  background: var(--surface2);
}
.review-media img,
.review-media video {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
}
.review-media audio {
  width: 100%;
}
#commerce-review-form {
  margin: 24px 0;
}
.library-filters {
  margin-bottom: 28px;
}
.media-info {
  padding: 18px;
}
.media-preview {
  padding: 0;
  background: var(--surface2);
  width: 100%;
  height: 280px;
  color: var(--ink);
}
.media-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#commerce-library .media-card {
  overflow: hidden;
}
.provenance {
  margin-top: 24px;
}
summary {
  cursor: pointer;
}
@media (max-width: 700px) {
  .commerce-grid {
    grid-template-columns: 1fr;
  }
  .commerce-intro,
  .campaign-summary {
    flex-direction: column;
  }
  .commerce-steps a {
    padding: 12px;
  }
  .commerce-panel h2 {
    font-size: 28px;
  }
  .campaign-summary .row {
    align-self: flex-start;
  }
  .commerce-steps {
    margin-bottom: 18px;
  }
  .readiness-row .badge {
    margin-left: 0;
  }
  .readiness-row {
    display: grid;
    gap: 8px;
  }
  .page-head > .row {
    flex-wrap: wrap;
  }
  .commerce-panel {
    padding: 20px;
  }
}
.commerce-grid:has(.campaign-output) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}
.campaign-output .output-image {
  order: -1;
  min-height: 240px;
}
.campaign-output > p:first-of-type {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reference-strip a {
  display: grid;
  gap: 6px;
  min-width: 120px;
  font-size: 11px;
  color: var(--muted);
}
.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: 20px;
  margin: 22px 0;
}
.ops-card {
  padding: 24px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ops-card h2,
.ops-card h3 {
  margin: 12px 0;
}
.ops-card p {
  line-height: 1.7;
}
.ops-card .btn {
  margin: 6px 5px 6px 0;
}
.ops-preview {
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: var(--surface-2, #242824);
  border-radius: 8px;
}
.ops-card audio,
.ops-card video {
  max-width: 100%;
}
.ops-tabs {
  display: flex;
  gap: 6px;
  overflow: auto;
  border-bottom: 1px solid var(--border, #3c403c);
  margin-bottom: 24px;
  padding-bottom: 12px;
}
.ops-tabs a {
  padding: 10px 14px;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 6px;
}
.ops-tabs a.active {
  background: var(--accent, #d5ff79);
  color: #172011;
}
.ops-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.ops-metrics .card {
  padding: 20px;
  display: grid;
  gap: 10px;
}
.ops-metrics strong {
  font-size: 32px;
}
.ops-metrics span {
  text-transform: capitalize;
}
.ops-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 24px 0;
  align-items: flex-start;
  max-width: 100%;
}
.ops-column {
  flex: 0 0 285px;
  min-height: 200px;
  background: var(--surface-2, #1d211d);
  padding: 12px;
  border-radius: 12px;
}
.ops-column > h3 {
  text-transform: capitalize;
  padding: 8px;
}
.ops-column .ops-card {
  padding: 16px;
  margin: 12px 0;
}
.ops-column .ops-preview {
  height: 180px;
}
.ops-item {
  border-top: 1px solid var(--border, #3c403c);
  padding: 16px 0;
}
.ops-output {
  border: 1px solid var(--border, #3c403c);
  border-radius: 8px;
  padding: 18px;
  margin: 16px 0;
  display: grid;
  gap: 14px;
}
.form-stack {
  display: grid;
  gap: 16px;
}
.ops-card pre,
dialog pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  max-height: 350px;
  overflow: auto;
}
.preserve-lines {
  white-space: pre-wrap;
}
.review-shell {
  max-width: 1180px;
  margin: auto;
  padding: 28px;
}
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 50px;
}
.review-title {
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.1;
}
.review-shell textarea {
  width: 100%;
  min-height: 80px;
}
.review-shell .card {
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .ops-tabs {
    margin-inline: -8px;
  }
  .ops-card {
    padding: 18px;
  }
  .review-shell {
    padding: 18px;
  }
  .ops-board {
    gap: 12px;
  }
  .ops-column {
    flex-basis: 265px;
  }
}

.video-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 3fr);
  gap: 20px;
  margin: 24px 0;
}
.video-scene {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 1px solid var(--border, #343834);
  border-radius: 8px;
  padding: 16px;
  margin: 10px 0;
  cursor: pointer;
}
.video-scene.active {
  border-color: var(--accent, #d5ff79);
}
.video-scene span {
  font-size: 12px;
  opacity: 0.7;
}
.video-preview {
  aspect-ratio: 16/9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #080b08;
  border-radius: 10px;
  text-align: center;
  padding: 20px;
}
.video-preview p {
  opacity: 0.6;
}
@media (max-width: 760px) {
  .video-workspace {
    grid-template-columns: 1fr;
  }
}
