:root {
  color-scheme: light dark;
  --canvas: #fff;
  --surface: #f8f7f5;
  --raised: #fff;
  --text: #292927;
  --muted: #68655f;
  --border: #e3e1dd;
  --control: #8a8580;
  --accent: #1866af;
  --accent-soft: #eaf2fa;
  --green: #267247;
  --green-soft: #eaf4ed;
  --orange: #92571e;
  --orange-soft: #fff3e6;
  --red: #b5332d;
  --red-soft: #fff0ef;
  --shadow: 0 2px 12px rgba(35, 32, 28, 0.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #191919;
    --surface: #202020;
    --raised: #242424;
    --text: #f5f4f1;
    --muted: #b8b5af;
    --border: #44433f;
    --control: #888580;
    --accent: #88bff7;
    --accent-soft: #233343;
    --green: #9bc9ad;
    --green-soft: #23342a;
    --orange: #f0ba82;
    --orange-soft: #3d3024;
    --red: #f9a49e;
    --red-soft: #3d2828;
    --shadow: none;
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font:
    16px/1.5 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Arial,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -1px;
  font-weight: 650;
}
h2 {
  font-size: 23px;
  line-height: 1.35;
  letter-spacing: -0.4px;
  font-weight: 620;
}
h3 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}
p + p {
  margin-top: 8px;
}
small,
.small {
  font-size: 14px;
}
.muted {
  color: var(--muted);
}
.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;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 20px;
  z-index: 100;
  background: var(--raised);
  padding: 12px;
}
.skip-link:focus {
  top: 12px;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 230px;
  flex: 0 0 230px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 32px 20px;
  position: fixed;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.2;
  margin-bottom: 40px;
}
.brand:hover {
  text-decoration: none;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  margin-top: 5px;
}
.brand-mark {
  width: 36px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--canvas);
  border-radius: 8px;
  font-size: 23px;
  font-weight: 650;
}
.main-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  padding: 12px 14px;
  min-height: 48px;
  text-align: left;
  font-size: 15px;
  white-space: nowrap;
}
.nav-button > span:first-child {
  font-size: 20px;
  width: 22px;
  text-align: center;
}
.nav-button:hover {
  background: var(--border);
}
.nav-button.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.nav-count {
  margin-left: auto;
  font-size: 14px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 24px 10px 0;
  display: grid;
  gap: 10px;
}
.server-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  flex: 0 0 8px;
}
.status-dot.good {
  background: var(--green);
}
.status-dot.bad {
  background: var(--red);
}
.version {
  font-size: 14px;
  color: var(--muted);
  padding-top: 16px;
}
.main-content {
  margin-left: 230px;
  flex: 1;
  min-width: 0;
  padding: 0 40px 40px;
  max-width: 1600px;
}
.topbar {
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.connection-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  min-height: 44px;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}
.page {
  padding-top: 32px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.eyebrow {
  font-size: 14px;
  letter-spacing: 1.5px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 12px;
}
.lead {
  font-size: 16px;
  color: var(--muted);
  margin-top: 12px;
  max-width: 65ch;
}
.tag {
  display: inline-flex;
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  align-items: center;
}
.tag.good {
  color: var(--green);
  background: var(--green-soft);
  border-color: transparent;
}
.tag.warning {
  color: var(--orange);
  background: var(--orange-soft);
  border-color: transparent;
}
.tag.bad {
  color: var(--red);
  background: var(--red-soft);
  border-color: transparent;
}
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 32px;
  gap: 4px;
}
.step {
  border: 0;
  border-radius: 6px;
  min-height: 64px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 15px;
}
.step small {
  display: block;
  font-size: 14px;
  font-weight: 400;
  margin-top: 2px;
}
.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--control);
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  font-size: 14px;
}
.step.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.step.active .step-number {
  background: var(--accent);
  color: var(--canvas);
  border-color: var(--accent);
}
.step.done .step-number {
  color: var(--green);
  border-color: var(--green);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 32px;
}
.editor-column {
  min-width: 0;
}
.summary-column {
  min-width: 0;
}
.summary-card {
  position: sticky;
  top: 24px;
  background: var(--surface);
  border-radius: 10px;
  padding: 24px;
}
.summary-card h3 {
  overflow-wrap: anywhere;
}
.summary-list {
  margin: 24px 0;
  display: grid;
  gap: 16px;
  font-size: 14px;
}
.summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.summary-list dt {
  color: var(--muted);
  max-width: 140px;
}
.summary-list dd {
  margin: 0;
  text-align: right;
  font-weight: 550;
  max-width: 100px;
  overflow-wrap: anywhere;
}
.summary-tip {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin: 24px 0;
  font-size: 14px;
}
.summary-tip p {
  color: var(--muted);
  margin-top: 8px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.section-header p {
  margin-top: 8px;
}
.section-header.compact {
  align-items: center;
  margin-bottom: 16px;
}
.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 24px;
  background: var(--raised);
}
.card h3,
.card h2 {
  margin-bottom: 16px;
}
.section-header h3,
.section-header h2 {
  margin-bottom: 0;
}
.starter-card {
  background: var(--surface);
}
.inline-control {
  display: flex;
  gap: 12px;
  align-items: center;
}
.inline-control > input,
.inline-control > select {
  min-width: 0;
  flex: 1;
}
.starter-controls > label {
  display: block;
  font-size: 14px;
  font-weight: 550;
  margin-bottom: 8px;
}
.starter-card details {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.starter-card details p {
  margin: 12px 0;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  min-width: 0;
}
.form-field:last-child {
  margin-bottom: 0;
}
label {
  font-size: 14px;
  font-weight: 550;
}
.field-help {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}
input:not([type='checkbox']):not([type='radio']),
select,
textarea {
  border: 1px solid var(--control);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--text);
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type='checkbox'] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 3px 0 0;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid var(--control);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.4;
  text-decoration: none;
  white-space: normal;
  text-align: center;
  flex-shrink: 0;
}
.button:hover {
  text-decoration: none;
  filter: brightness(0.96);
}
.button.primary {
  background: var(--accent);
  color: var(--canvas);
  border-color: var(--accent);
}
.button.secondary {
  background: var(--raised);
  color: var(--text);
}
.button.danger-button {
  background: var(--red);
  color: var(--canvas);
  border-color: var(--red);
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 10px 4px;
  min-height: 44px;
  text-align: left;
  font-size: 14px;
}
.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 23px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  flex: 0 0 44px;
}
.icon-button:hover {
  background: var(--surface);
  color: var(--text);
}
.scene-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--raised);
}
.scene-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.scene-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.scene-index {
  color: var(--accent);
  font-size: 14px;
}
.scene-actions {
  display: flex;
  gap: 0;
}
.scene-actions .icon-button {
  font-size: 17px;
  width: 44px;
}
.scene-body {
  padding: 20px;
}
.scene-body textarea.scene-text {
  font-size: 16px;
  min-height: 95px;
}
.scene-body details {
  margin-top: 16px;
}
.scene-body details > div {
  margin-top: 16px;
}
.scene-body .form-field {
  margin-bottom: 16px;
}
.editor-tools {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.editor-tools > span {
  margin-left: auto;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  font-weight: 450;
  min-height: 44px;
  margin: 16px 0;
}
.check-row small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}
.check-row span {
  min-width: 0;
}
.check-row input {
  cursor: pointer;
}
details > summary {
  cursor: pointer;
  min-height: 32px;
  font-size: 15px;
  font-weight: 600;
  list-style-position: outside;
  margin-left: 14px;
}
details[open] > summary {
  margin-bottom: 20px;
}
.card.details,
details.card {
  display: block;
}
.metadata {
  margin-top: 16px;
}
.studio-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding: 24px 0 0;
}
.studio-footer > span {
  margin-left: auto;
}
.studio-footer .primary {
  min-width: 180px;
}
.notice {
  padding: 16px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid transparent;
  font-size: 14px;
  margin-bottom: 24px;
  overflow-wrap: anywhere;
}
.notice.warning {
  background: var(--orange-soft);
  color: var(--orange);
}
.notice.danger {
  background: var(--red-soft);
  color: var(--red);
}
.notice.good {
  background: var(--green-soft);
  color: var(--green);
}
.notice a {
  color: inherit;
  text-decoration: underline;
}
.library-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 24px;
}
.library-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 14px;
}
.library-row > div {
  min-width: 0;
}
.library-row strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.library-row small {
  color: var(--muted);
}
.review-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 24px;
}
.workspace.review-mode {
  grid-template-columns: 1fr;
}
.workspace.review-mode .summary-column {
  display: none;
}
.phone-preview {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 9/16;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  align-self: start;
}
.phone-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #141414;
  display: block;
}
.preview-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 14px;
}
.preview-empty strong {
  color: var(--text);
  font-size: 16px;
}
.preview-icon {
  font-size: 42px;
  color: var(--accent);
}
.review-content {
  min-width: 0;
}
.preflight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.preflight-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}
.preflight-list span {
  color: var(--muted);
}
.quality-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.quality-metrics > div {
  padding: 12px;
  background: var(--surface);
  border-radius: 6px;
}
.quality-metrics strong {
  display: block;
  font-size: 20px;
}
.quality-metrics span {
  font-size: 14px;
  color: var(--muted);
}
.warning-list {
  margin: 12px 0 20px;
  padding-left: 20px;
  font-size: 14px;
  color: var(--orange);
}
.source-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.source-row p {
  color: var(--muted);
  margin: 4px 0;
}
.result-actions,
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.result-actions .button {
  flex: 1;
}
.job-stages {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 20px 0;
}
.job-stages li {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface);
  font-size: 14px;
  color: var(--muted);
}
.job-stages li.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.job-stages li.done {
  color: var(--green);
}
.event-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  font:
    14px/1.7 ui-monospace,
    Menlo,
    Consolas,
    monospace;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 16px 0 0;
}
.job-card #jobMessage {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.history-tools {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  max-width: 720px;
}
.history-tools input {
  flex: 1;
}
.history-tools select {
  width: 240px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  background: var(--raised);
}
.history-thumb {
  width: 50px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  border-radius: 6px;
  flex: 0 0 50px;
  font-size: 24px;
}
.history-info {
  flex: 1;
  min-width: 0;
}
.history-info h3 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.history-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}
.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.empty-state {
  border: 1px dashed var(--control);
  border-radius: 10px;
  text-align: center;
  padding: 64px 24px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 16px;
  color: var(--muted);
}
.empty-state h2 {
  color: var(--text);
}
.empty-state p {
  max-width: 52ch;
}
.narrow-column {
  max-width: 800px;
}
.settings-save {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}
.file-button {
  cursor: pointer;
  position: relative;
}
.file-button:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
dialog {
  width: min(560px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--raised);
  color: var(--text);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.3);
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.dialog-header h2 {
  font-size: 24px;
}
.dialog-header .icon-button {
  margin: -10px -12px -10px 0;
}
dialog > form > p,
dialog > p {
  margin-bottom: 24px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
dialog .check-row {
  margin-top: 24px;
}
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: min(390px, calc(100% - 32px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 8px;
  background: var(--raised);
  box-shadow: var(--shadow);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.toast.error {
  border-color: var(--red);
  color: var(--red);
}
.toast.success {
  border-color: var(--green);
}
@media (min-width: 1700px) {
  .main-content {
    margin-right: auto;
  }
}
@media (max-width: 1200px) {
  .main-content {
    padding-left: 24px;
    padding-right: 24px;
  }
  .sidebar {
    width: 200px;
    flex-basis: 200px;
    padding: 24px 12px;
  }
  .main-content {
    margin-left: 200px;
  }
  .workspace {
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 230px;
  }
  .step {
    padding: 8px;
    gap: 8px;
  }
  .step small {
    font-size: 14px;
  }
  .steps {
    gap: 0;
  }
  .page-heading .tag {
    display: none;
  }
  .inline-control {
    flex-wrap: wrap;
  }
  .inline-control .button {
    flex-shrink: 1;
  }
}
@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .summary-card {
    position: static;
  }
  .summary-column {
    order: 2;
  }
  .summary-card .summary-tip {
    display: none;
  }
  .summary-list {
    grid-template-columns: repeat(2, 1fr);
    margin: 16px 0;
  }
  .summary-card > .eyebrow {
    display: none;
  }
  .summary-card {
    padding: 20px;
  }
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .history-item {
    gap: 16px;
    flex-wrap: wrap;
  }
  .history-actions {
    margin-left: 66px;
  }
  .review-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 20px 20px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand {
    margin-bottom: 20px;
  }
  .main-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }
  .nav-button {
    padding: 10px 4px;
    justify-content: center;
    font-size: 14px;
    gap: 4px;
    flex-wrap: wrap;
    white-space: normal;
    text-align: center;
    flex-direction: column;
  }
  .nav-button > span:first-child {
    font-size: 20px;
  }
  .nav-count {
    display: none;
  }
  .sidebar-bottom {
    display: none;
  }
  .main-content {
    margin: 0;
    padding: 0 20px 24px;
  }
  .topbar {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
  }
  .topbar > div {
    font-size: 14px;
  }
  .connection-button {
    font-size: 14px;
    padding: 8px;
  }
  .page {
    padding-top: 24px;
  }
  .page-heading {
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
  }
  h1 {
    font-size: 28px;
    letter-spacing: -0.6px;
  }
  .eyebrow {
    font-size: 14px;
    letter-spacing: 1px;
  }
  .steps {
    margin-bottom: 24px;
    padding: 4px;
    gap: 2px;
  }
  .step {
    min-height: 68px;
    font-size: 14px;
    gap: 8px;
  }
  .step small {
    font-size: 14px;
    line-height: 1.3;
  }
  .step-number {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
  }
  .card {
    padding: 20px;
    margin-bottom: 20px;
  }
  .section-header {
    gap: 12px;
    flex-wrap: wrap;
  }
  .section-header h2 {
    font-size: 22px;
  }
  .section-header .button {
    font-size: 14px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .scene-body {
    padding: 16px;
  }
  .scene-top {
    padding: 8px 12px;
  }
  .scene-title {
    gap: 8px;
  }
  .scene-actions .icon-button {
    width: 44px;
  }
  .inline-control {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .starter-card .inline-control .button {
    align-self: stretch;
  }
  .editor-tools {
    gap: 8px;
  }
  .editor-tools > span {
    margin-left: 0;
    width: 100%;
  }
  .summary-list {
    grid-template-columns: 1fr;
  }
  .studio-footer {
    position: static;
    margin-top: 24px;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 20px;
  }
  .studio-footer > span {
    order: -1;
    width: 100%;
    margin-left: 0;
    margin-bottom: 8px;
  }
  .studio-footer .primary {
    min-width: 0;
    flex: 1;
  }
  .studio-footer .button {
    padding: 10px 12px;
  }
  .review-layout {
    grid-template-columns: 1fr;
  }
  .phone-preview {
    margin: auto;
    width: 270px;
    max-width: 100%;
  }
  .quality-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .quality-metrics > div {
    padding: 10px;
  }
  .quality-metrics strong {
    font-size: 18px;
  }
  .quality-metrics span {
    font-size: 14px;
  }
  .history-tools {
    flex-direction: column;
    gap: 12px;
  }
  .history-tools select {
    width: 100%;
  }
  .history-item {
    padding: 16px;
    gap: 12px;
  }
  .history-info h3 {
    font-size: 17px;
  }
  .history-actions {
    margin-left: 0;
    width: 100%;
  }
  .history-actions > .button {
    flex: 1;
  }
  .history-thumb {
    width: 42px;
    height: 62px;
    flex-basis: 42px;
  }
  .history-meta {
    gap: 8px;
  }
  .empty-state {
    padding: 40px 20px;
  }
  .settings-save {
    align-items: stretch;
    flex-direction: column;
  }
  .button-row > .button {
    flex: 1;
  }
  dialog {
    padding: 20px;
    max-height: calc(100dvh - 32px);
  }
  .dialog-actions .button {
    flex: 1;
  }
  .dialog-header h2 {
    font-size: 22px;
  }
  .event-log {
    padding: 12px;
    font-size: 14px;
  }
  .toasts {
    right: 16px;
    bottom: 16px;
  }
  .result-actions {
    flex-direction: column;
  }
  .library-row {
    align-items: flex-start;
  }
  .library-row .tag {
    font-size: 14px;
  }
  .job-stages {
    gap: 6px;
  }
  .job-stages li {
    font-size: 14px;
  }
  .preflight-list li {
    flex-direction: column;
    gap: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}

.nav-button svg { width: 20px; height: 20px; display: block; }

.autopilot-item { padding: 20px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.autopilot-item:first-child { padding-top: 0; }
.autopilot-item:last-child { border-bottom: 0; }
.autopilot-item p { margin: 8px 0 16px; }
.queue-error { color: var(--text); border-left: 3px solid #D5803B; padding-left: 12px; }
#scheduleForm .form-grid { margin-bottom: 24px; }
#autopilotQueueForm > p { margin-bottom: 16px; }
#autopilotQueueMessage:not(:empty) { margin-top: 12px; }
