:root {
  --bg: #f5f0e8;
  --surface: rgba(255, 253, 248, 0.86);
  --surface-solid: #fffdf8;
  --surface-soft: #eee8df;
  --surface-hover: #e7dfd5;
  --ink: #252326;
  --muted: #777176;
  --line: rgba(37, 35, 38, 0.12);
  --line-strong: rgba(37, 35, 38, 0.2);
  --violet: #7557e8;
  --violet-dark: #5c40c9;
  --violet-soft: #ece6ff;
  --peach: #f1c9b2;
  --green: #3d8d70;
  --amber: #b97928;
  --red: #c65151;
  --shadow: 0 20px 60px rgba(58, 45, 35, 0.09);
  --shadow-small: 0 8px 24px rgba(58, 45, 35, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar: 250px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

:root[data-theme="dark"] {
  --bg: #171619;
  --surface: rgba(36, 34, 39, 0.9);
  --surface-solid: #242227;
  --surface-soft: #2f2c33;
  --surface-hover: #3b3740;
  --ink: #f6f0e9;
  --muted: #aaa3ad;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --violet: #9a80ff;
  --violet-dark: #8063ee;
  --violet-soft: #342d50;
  --peach: #704c3c;
  --green: #64b696;
  --amber: #d8a052;
  --red: #ee7979;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
  --shadow-small: 0 8px 24px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--bg); color: var(--ink); }
button, input, select, textarea { color: inherit; font: inherit; }
button, select, label[for] { cursor: pointer; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--violet) 62%, transparent); outline-offset: 3px; }
::selection { background: var(--violet); color: #fff; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ambient { position: fixed; z-index: -1; border-radius: 999px; filter: blur(4px); pointer-events: none; opacity: .45; }
.ambient-one { width: 360px; height: 360px; top: -180px; right: 8%; background: radial-gradient(circle, rgba(160, 116, 255, .25), transparent 67%); }
.ambient-two { width: 420px; height: 420px; left: 28%; bottom: -260px; background: radial-gradient(circle, rgba(242, 188, 155, .25), transparent 67%); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); padding: 28px 20px 20px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: Georgia, "Times New Roman", serif; font-size: 20px; letter-spacing: -.02em; }
.brand img { filter: drop-shadow(0 6px 9px rgba(117, 87, 232, .22)); }
.brand strong { font-weight: 700; }
.primary-nav { display: grid; gap: 5px; margin-top: 52px; }
.nav-link { min-height: 46px; padding: 0 13px; display: flex; align-items: center; gap: 12px; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 650; transition: background .2s, color .2s, transform .2s; }
.nav-link:hover { color: var(--ink); background: var(--surface-soft); transform: translateX(2px); }
.nav-link.is-active { color: var(--violet); background: var(--violet-soft); }
.nav-icon { display: grid; place-items: center; width: 22px; font-size: 17px; }
.sidebar-foot { margin-top: auto; }
.assistant-card { width: 100%; padding: 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-small); }
.assistant-card:hover { border-color: color-mix(in srgb, var(--violet) 45%, var(--line)); }
.assistant-card small { display: block; margin-bottom: 3px; color: var(--violet); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.assistant-card strong { display: block; font-size: 12px; }
.assistant-orb { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, #c4aeff 23%, #7557e8 55%, #33216f); box-shadow: inset -3px -4px 8px rgba(0,0,0,.2); }
.privacy-note { margin: 15px 4px 0; color: var(--muted); font-size: 10px; letter-spacing: .03em; }
.privacy-note span:first-child { color: var(--green); }

.main-column { padding-left: var(--sidebar); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 15; height: 76px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--bg) 83%, transparent); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.topbar-title { display: grid; gap: 2px; }
.topbar-title strong { font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.eyebrow { display: block; color: var(--violet); font-size: 10px; font-weight: 800; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.status-pill { height: 32px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; font-size: 11px; font-weight: 650; }
.status-pill > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent); }
.status-pill.is-warning > span:first-child { background: var(--amber); }
.select-control select { height: 34px; padding: 0 25px 0 10px; appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='m3 5 3 3 3-3' fill='none' stroke='%23755a8a' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 7px center; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; font-weight: 750; }
.icon-button, .avatar-button { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; transition: .2s; }
.icon-button:hover { color: var(--ink); border-color: var(--line-strong); transform: translateY(-1px); }
.avatar-button { border: 0; border-radius: 50%; color: white; background: linear-gradient(135deg, #7557e8, #c27bb9); font-size: 10px; font-weight: 800; }
.mobile-only { display: none; }

main { padding: 48px clamp(28px, 5vw, 72px) 120px; }
.page { display: none; max-width: 1260px; margin: 0 auto; animation: page-in .35s ease both; }
.page.is-active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.page-heading h1 { max-width: 700px; margin: 7px 0 9px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4.3vw, 56px); font-weight: 500; line-height: 1.02; letter-spacing: -.045em; }
.page-heading p { max-width: 650px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.studio-heading h1 { max-width: 760px; }
.studio-notice { margin: -10px 0 28px; padding: 14px 18px; background: var(--violet-soft); border: 1px solid var(--line); border-radius: 14px; }
.studio-notice p { margin: 0; color: var(--ink); font-size: 11px; line-height: 1.6; }
.studio-notice p + p { margin-top: 6px; color: var(--muted); }
.overview-strip { margin: -12px 0 18px; padding: 14px 20px; display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line); border-radius: 15px; }
.overview-strip div { padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-right: 1px solid var(--line); }
.overview-strip div:first-child { padding-left: 0; }
.overview-strip div:last-child { padding-right: 0; border-right: 0; }
.overview-strip span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.overview-strip strong { font: 500 22px/1 Georgia, serif; }

.button { min-height: 42px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 11px; font-size: 12px; font-weight: 750; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button-primary { color: #fff; background: var(--violet); box-shadow: 0 8px 20px color-mix(in srgb, var(--violet) 23%, transparent); }
.button-primary:hover { background: var(--violet-dark); box-shadow: 0 10px 25px color-mix(in srgb, var(--violet) 35%, transparent); }
.button-ghost { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-danger { color: var(--red); background: transparent; border-color: color-mix(in srgb, var(--red) 32%, transparent); }
.button-large { min-height: 50px; padding: 0 22px; }

.studio-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 16px; }
.workflow-card, .submit-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-small); backdrop-filter: blur(12px); }
.media-card { grid-row: span 2; }
.engines-card { grid-column: 1; }
.submit-card { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.step-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.step-heading h2 { margin: 0 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 600; }
.step-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.step-number { width: 30px; height: 30px; display: grid; place-items: center; flex: none; color: var(--violet); border: 1px solid color-mix(in srgb, var(--violet) 35%, transparent); border-radius: 50%; font: 700 9px/1 ui-monospace, monospace; }
.person-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.person-option { min-width: 0; padding: 13px 9px; display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--muted); background: var(--surface-soft); border: 1px solid transparent; border-radius: 13px; }
.person-option:hover, .person-option.is-selected { color: var(--ink); border-color: var(--violet); background: var(--violet-soft); }
.person-option input { position: absolute; opacity: 0; pointer-events: none; }
.person-avatar { width: 43px; height: 43px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #9377f8, #c489aa); border-radius: 50%; font: 600 17px/1 Georgia, serif; }
.person-option strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.add-person-button { width: 100%; margin-top: 10px; padding: 9px; color: var(--violet); background: transparent; border: 1px dashed color-mix(in srgb, var(--violet) 40%, var(--line)); border-radius: 12px; font-size: 11px; font-weight: 700; }
.dropzone { min-height: 275px; padding: 28px; display: grid; place-items: center; align-content: center; gap: 9px; text-align: center; background: repeating-linear-gradient(135deg, transparent, transparent 10px, color-mix(in srgb, var(--violet) 2%, transparent) 10px, color-mix(in srgb, var(--violet) 2%, transparent) 20px); border: 1px dashed color-mix(in srgb, var(--violet) 44%, var(--line)); border-radius: 17px; transition: .2s; }
.dropzone:hover, .dropzone.is-dragging { background-color: var(--violet-soft); border-color: var(--violet); transform: translateY(-1px); }
.dropzone input, .reference-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-icon { width: 54px; height: 54px; display: grid; place-items: center; color: var(--violet); background: var(--violet-soft); border-radius: 50%; font-size: 24px; }
.drop-copy strong, .drop-copy small { display: block; }
.drop-copy strong { margin-bottom: 5px; font-family: Georgia, serif; font-size: 18px; }
.drop-copy small { color: var(--muted); }
.file-types { margin-top: 5px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.file-preview { position: relative; min-height: 275px; overflow: hidden; border-radius: 17px; background: #0d0d0e; }
.file-preview img, .file-preview video { width: 100%; height: 275px; display: block; object-fit: contain; }
.file-preview-bar { position: absolute; inset: auto 10px 10px; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: white; background: rgba(20,18,23,.8); border: 1px solid rgba(255,255,255,.13); border-radius: 10px; backdrop-filter: blur(12px); }
.file-preview-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 10px; white-space: nowrap; }
.file-preview-bar button { color: white; background: transparent; }
.engine-picker { display: grid; gap: 8px; }
.muted-note { margin: 10px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.engine-option { padding: 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; background: var(--surface-soft); border: 1px solid transparent; border-radius: 12px; }
.engine-option:has(input:checked) { border-color: var(--violet); background: var(--violet-soft); }
.engine-option.is-disabled { opacity: .5; cursor: not-allowed; }
.engine-option input { accent-color: var(--violet); }
.engine-option strong { display: block; font-size: 11px; }
.engine-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.media-tags { display: flex; gap: 4px; }
.media-tags span { padding: 4px 6px; color: var(--violet); background: var(--surface); border-radius: 6px; font-size: 7px; font-weight: 800; text-transform: uppercase; }
.providers-directory { margin-top: 32px; }
.directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.directory-heading h2 { margin: 5px 0 8px; font: 500 28px/1 Georgia, serif; }
.directory-heading p { max-width: 650px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.provider-search input { width: min(280px, 100%); height: 40px; padding: 0 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; }
.provider-limitation { margin-top: 8px !important; }
.batch-file-list { padding: 52px 12px 12px; display: grid; gap: 8px; }
.batch-file-row { min-width: 0; padding: 8px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 9px; color: white; background: rgba(20,18,23,.78); border: 1px solid rgba(255,255,255,.13); border-radius: 9px; }
.batch-file-row img, .batch-file-row video { width: 44px; height: 34px; object-fit: cover; border-radius: 5px; background: #0d0d0e; }
.batch-file-detail { min-width: 0; }
.batch-file-row span { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.batch-file-error { display: block; margin-top: 3px; color: #ffbab5; font-size: 8px; line-height: 1.35; }
.batch-file-row button, .reference-delete { color: inherit; background: transparent; }

.people-grid, .connections-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.people-grid > .empty-state, .connections-grid > .empty-state { grid-column: 1 / -1; }
.person-card, .connection-card { position: relative; overflow: hidden; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-small); }
.person-card { min-height: 205px; display: flex; flex-direction: column; align-items: flex-start; }
.person-card::after { content: ""; position: absolute; width: 110px; height: 110px; right: -45px; top: -45px; border-radius: 50%; background: var(--violet-soft); }
.person-card .person-avatar { width: 52px; height: 52px; }
.person-card h3, .connection-card h3 { margin: 18px 0 5px; font-family: Georgia, serif; font-size: 20px; }
.person-card p, .connection-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.card-actions { width: 100%; margin-top: auto; padding-top: 20px; display: flex; justify-content: space-between; gap: 8px; }
.card-actions .button { min-height: 34px; padding: 0 11px; font-size: 9px; }
.connection-top { display: flex; justify-content: space-between; gap: 12px; }
.connection-mark { width: 42px; height: 42px; display: grid; place-items: center; color: var(--violet); background: var(--violet-soft); border-radius: 12px; font-size: 19px; }
.connection-card h3 { margin-top: 20px; }
.connection-status { align-self: start; padding: 5px 8px; color: var(--muted); background: var(--surface-soft); border-radius: 99px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.connection-status.is-connected, .connection-status.is-ready, .connection-status.is-available { color: var(--green); }

.jobs-list { display: grid; gap: 13px; }
.job-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-small); }
.job-summary { padding: 19px 21px; display: grid; grid-template-columns: auto minmax(140px, 1fr) minmax(120px, 220px) auto; align-items: center; gap: 17px; }
.job-media-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--violet); background: var(--violet-soft); border-radius: 12px; font-size: 17px; }
.job-title strong { display: block; font: 600 16px/1.2 Georgia, serif; }
.job-title small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: 8px; }
.progress-track { height: 5px; overflow: hidden; background: var(--surface-soft); border-radius: 5px; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), #b082f0); border-radius: inherit; transition: width .45s ease; }
.job-status { padding: 6px 9px; color: var(--muted); background: var(--surface-soft); border-radius: 99px; font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.job-status.is-completed, .job-status.is-success { color: var(--green); }
.job-status.is-failed, .job-status.is-error { color: var(--red); }
.job-status.is-partial { color: var(--amber); }
.job-card > .button { margin: 0 21px 20px; }
.job-results { padding: 0 21px 21px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.result-card { min-width: 0; padding: 12px; background: var(--surface-soft); border-radius: 12px; }
.result-card strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 10px; white-space: nowrap; }
.result-card small { display: block; margin: 5px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.result-card .button { width: 100%; min-height: 32px; font-size: 8px; }
.job-error { margin: 0 21px 21px; padding: 10px 12px; color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); border-radius: 10px; font-size: 9px; line-height: 1.5; }

.empty-state { min-height: 300px; padding: 35px; display: grid; place-items: center; align-content: center; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-xl); }
.empty-state img { width: 180px; }
.empty-state h2 { margin: 5px 0 8px; font: 500 25px/1.1 Georgia, serif; }
.empty-state p { max-width: 420px; margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr); }
.login-art { position: relative; overflow: hidden; padding: 45px; display: flex; align-items: flex-end; justify-content: center; color: #f6efe7; background: #232026; }
.login-art::before, .login-art::after { content: ""; position: absolute; border-radius: 50%; filter: blur(1px); }
.login-art::before { width: 550px; height: 550px; top: -180px; left: -180px; background: radial-gradient(circle at 65% 65%, #8f6ff2, #3a3054 40%, transparent 68%); opacity: .7; }
.login-art::after { width: 350px; height: 350px; right: -150px; bottom: -100px; background: radial-gradient(circle, #9b5f61, transparent 67%); opacity: .4; }
.login-art p { z-index: 2; font-size: 9px; font-weight: 700; letter-spacing: .3em; opacity: .55; }
.face-outline { position: absolute; inset: 12% 12% 18%; border: 1px solid rgba(255,255,255,.1); border-radius: 44% 56% 49% 51% / 39% 42% 58% 61%; transform: rotate(-6deg); }
.face-outline::before { content: ""; position: absolute; inset: 20% 22% 26%; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; }
.face-outline span { position: absolute; width: 38%; height: 9%; left: 31%; top: 54%; border-bottom: 1px solid rgba(255,255,255,.35); border-radius: 50%; }
.login-panel { padding: 40px; display: grid; place-items: center; background: var(--bg); }
.login-card { width: min(430px, 100%); padding: 46px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.login-card .brand { margin-bottom: 58px; }
.login-card h1 { margin: 9px 0 12px; font: 500 clamp(34px, 4vw, 48px)/1 Georgia, serif; letter-spacing: -.04em; }
.login-card > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-card form { margin-top: 30px; display: grid; gap: 16px; }
.login-card label > span, .field > span { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 750; }
.login-card input, .field input { width: 100%; height: 48px; padding: 0 14px; color: var(--ink); background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: 10px; }
.login-card .login-future { margin-top: 25px; font-size: 9px; text-align: center; }

.modal { width: min(560px, calc(100% - 28px)); padding: 0; color: var(--ink); background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: 0 28px 100px rgba(0,0,0,.28); }
.modal::backdrop { background: rgba(20, 17, 24, .58); backdrop-filter: blur(5px); }
.modal > form, .modal:not(:has(> form)) { padding: 28px; }
.modal-wide { width: min(850px, calc(100% - 28px)); }
.modal-head { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-head h2 { margin: 5px 0 0; font: 500 28px/1.1 Georgia, serif; }
.field { display: block; margin-bottom: 14px; }
.reference-drop { min-height: 130px; padding: 25px; display: grid; place-items: center; gap: 4px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 14px; }
.reference-drop > span { color: var(--violet); font-size: 24px; }
.reference-drop strong { font-size: 12px; }
.reference-drop small { color: var(--muted); font-size: 9px; }
.reference-preview { margin: 10px 0 15px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.reference-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; }
.modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 9px; }
.references-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reference-card { position: relative; overflow: hidden; aspect-ratio: 1; background: var(--surface-soft); border-radius: 14px; }
.reference-card img { width: 100%; height: 100%; object-fit: cover; }
.reference-card span { position: absolute; inset: auto 6px 6px; padding: 5px 7px; overflow: hidden; color: white; background: rgba(20,18,23,.7); border-radius: 6px; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.reference-delete { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; color: white; background: rgba(20,18,23,.76); border: 1px solid rgba(255,255,255,.2); border-radius: 50%; }
.assistant-disclaimer { margin: -9px 0 15px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.assistant-messages { max-height: 340px; overflow: auto; display: grid; gap: 8px; }
.message { max-width: 86%; padding: 11px 13px; color: var(--ink); background: var(--surface-soft); border-radius: 13px 13px 13px 4px; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.message.is-user { margin-left: auto; color: #fff; background: var(--violet); border-radius: 13px 13px 4px 13px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 5px; }
.suggestions button { padding: 6px 8px; color: var(--violet); background: var(--violet-soft); border-radius: 7px; font-size: 8px; }
.assistant-input { margin-top: 13px; padding: 7px; display: flex; align-items: flex-end; gap: 7px; background: var(--surface-soft); border-radius: 13px; }
.assistant-input textarea { min-height: 42px; flex: 1; padding: 10px; resize: none; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 11px; }
.assistant-input .button { width: 38px; min-height: 38px; padding: 0; border-radius: 9px; }

.feedback-bar { position: fixed; z-index: 18; right: 24px; bottom: 20px; width: min(400px, calc(100% - 32px)); color: var(--ink); background: var(--surface-solid); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.feedback-bar > button { width: 100%; min-height: 45px; padding: 0 15px; display: flex; align-items: center; gap: 9px; color: var(--ink); background: transparent; text-align: left; }
.feedback-bar > button span:first-child { color: var(--violet); }
.feedback-bar > button strong { flex: 1; font-size: 10px; }
.feedback-bar > button span:last-child { color: var(--violet); font-size: 9px; font-weight: 750; }
.feedback-bar form { padding: 0 15px 15px; }
.feedback-bar label span { display: block; margin: 4px 0 7px; font: 500 17px/1.2 Georgia, serif; }
.feedback-bar textarea { width: 100%; min-height: 90px; padding: 11px; resize: vertical; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; font-size: 10px; }
.feedback-bar form > div { margin-top: 8px; display: flex; justify-content: flex-end; gap: 7px; }
.feedback-bar .button { min-height: 34px; font-size: 9px; }

.toast-region { position: fixed; z-index: 100; top: 18px; right: 18px; width: min(380px, calc(100% - 36px)); display: grid; gap: 8px; }
.toast { padding: 13px 15px; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 10px; color: var(--ink); background: var(--surface-solid); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); animation: toast-in .25s ease both; }
.toast-mark { color: var(--green); font-weight: 900; }
.toast.is-error .toast-mark { color: var(--red); }
.toast strong { display: block; font-size: 11px; }
.toast small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.toast button { color: var(--muted); background: transparent; }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } }
.busy-overlay { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; background: rgba(20,17,24,.25); backdrop-filter: blur(2px); }
.spinner { width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.35); border-top-color: var(--violet); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  :root { --sidebar: 220px; }
  main { padding-inline: 28px; }
  .studio-grid { grid-template-columns: 1fr; }
  .media-card { grid-row: auto; }
  .engines-card, .submit-card { grid-column: auto; }
  .people-grid, .connections-grid { grid-template-columns: repeat(2, 1fr); }
  .job-summary { grid-template-columns: auto 1fr auto; }
  .job-progress { grid-column: 2 / -1; }
}

@media (max-width: 720px) {
  .mobile-only { display: grid; }
  .sidebar { transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: translateX(0); }
  .main-column { padding-left: 0; }
  .topbar { height: 65px; padding: 0 16px; }
  .topbar-title .eyebrow, .status-pill { display: none; }
  .topbar-title { margin-right: auto; margin-left: 10px; }
  main { padding: 34px 16px 110px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 25px; }
  .page-actions { width: 100%; }
  .page-heading h1 { font-size: 39px; }
  .page-heading .button { width: 100%; }
  .overview-strip { grid-template-columns: 1fr 1fr; gap: 12px 0; }
  .overview-strip div:nth-child(2) { border-right: 0; padding-right: 0; }
  .overview-strip div:nth-child(3) { padding-left: 0; }
  .workflow-card, .submit-card { padding: 18px; }
  .submit-card { align-items: stretch; flex-direction: column; }
  .people-grid, .connections-grid { grid-template-columns: 1fr; }
  .job-summary { grid-template-columns: auto 1fr; }
  .job-status { justify-self: start; grid-column: 2; }
  .job-progress { grid-column: 1 / -1; }
  .job-results { grid-template-columns: 1fr; }
  .login-view { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; padding: 18px; }
  .login-card { padding: 32px 24px; }
  .login-card .brand { margin-bottom: 45px; }
  .references-grid { grid-template-columns: repeat(2, 1fr); }
  .directory-heading { align-items: stretch; flex-direction: column; }
  .provider-search input { width: 100%; }
  .feedback-bar { right: 16px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
