/* Semantic surfaces: every workspace follows the same theme tokens. The media canvas does not. */
body {
  background: var(--bg);
  color: var(--text);
}
header,
.rail,
.timeline,
#trackLabels,
footer {
  background: var(--chrome);
}
.library,
.inspector,
dialog {
  background: var(--panel);
  color: var(--text);
}
button:hover {
  background: var(--hover);
}
.primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}
.viewer {
  background: var(--bg);
}
.stage {
  background: var(--bg);
}
.field,
.track-label,
.transport,
.clip-name {
  color: var(--muted);
}
.field textarea,
.field input:not([type="range"]):not([type="color"]),
.field select,
dialog input:not([type="checkbox"]):not([type="color"]),
dialog select,
dialog textarea {
  background: var(--input);
  border-color: var(--line);
  color: var(--text);
}
.field textarea {
  color: var(--text);
}
.rail button.active,
.preset.active {
  background: var(--soft);
  color: var(--accent);
}
.asset,
.preset,
.import {
  background: var(--input);
}
.clip {
  background: var(--video);
  color: var(--track-text);
}
.clip.audio {
  background: var(--audio);
  color: var(--track-text);
}
.clip.text {
  background: var(--title);
  color: var(--track-text);
}
.clip.selected {
  border-color: var(--accent);
}
.track {
  border-color: var(--line);
}
.preview-badge {
  color: #ffffff90;
  background: #0b111ba8;
  border-radius: 4px;
  padding: 5px 7px;
  display: flex;
  gap: 6px;
  align-items: center;
  letter-spacing: 1px;
}
.preview-badge img {
  width: 14px;
  height: 14px;
}
.asset .thumb:after {
  color: var(--accent-ink);
}
.brand {
  padding: 0;
  text-align: left;
  gap: 10px;
  flex-shrink: 0;
}
.brand:hover {
  background: transparent;
}
.brand img {
  width: 44px;
  height: 44px;
}
.brand b {
  display: flex;
  flex-direction: column;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -0.6px;
  gap: 3px;
}
.brand span {
  font-size: 9px;
  color: var(--text);
  letter-spacing: 2px;
  font-weight: 750;
}
.brand-about {
  padding: 20px;
  text-align: center;
  max-width: 620px;
  margin: auto;
}
.brand-about > img {
  width: 370px;
  max-width: 100%;
  height: 125px;
  object-fit: contain;
  display: block;
  background: #11151b;
  border-radius: 12px;
  padding: 18px;
  margin: 0 auto 20px;
}
.brand-tagline {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text);
}
.brand-about-chips {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 25px 0;
}
.brand-about-chips span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: var(--input);
}
.library-foot {
  display: flex;
  align-items: center;
  gap: 8px;
}
.library-foot img {
  width: 17px;
  height: 17px;
}
.ai-orb {
  background: var(--soft);
  color: var(--accent);
}
.ai-switch,
.ai-check {
  color: var(--text) !important;
}
.ai-tool-list button,
.ai-profile,
.ai-secret-row button,
.ai-workspace-tools button.active,
.ai-results,
.ai-custom-fields textarea,
.ai-task textarea,
.transition-card,
#transitionSearch {
  background: var(--input);
  border-color: var(--line);
  color: var(--text);
}
.ai-tool-list button:hover {
  background: var(--hover);
}
.ai-profile.active {
  border-color: var(--accent);
}
.ai-tool-list button > span,
.ai-workspace-tools button > span {
  color: var(--accent);
}
.ai-request-preview {
  background: var(--soft);
  border-color: var(--line);
}
.ai-request-preview dt,
.ai-request-preview details,
.ai-preview-title span {
  color: var(--muted);
}
.ai-request-preview pre {
  background: var(--input);
  color: var(--text);
}
.ai-error,
#aiSettingsStatus {
  color: var(--danger);
}
.ai-job b {
  color: var(--accent);
}
.transition-card-name {
  color: var(--text);
}
.transition-card-actions button[aria-pressed="true"] {
  color: var(--accent);
}
.note {
  background: var(--soft);
  color: var(--muted);
  border-color: var(--accent);
}
.note b,
.ai-modal .note b {
  color: var(--text);
}
.wide,
.empty {
  color: var(--muted);
}
#toast {
  background: var(--panel);
  color: var(--text);
  border-color: var(--accent);
}
input[type="checkbox"],
input[type="range"] {
  accent-color: var(--accent);
}
.modal-title button {
  color: var(--text);
}
.theme-modal {
  width: 980px;
  height: min(760px, 88vh);
  overflow: hidden;
}
.theme-modal #dialogContent {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.theme-modal .modal-title,
.theme-modal .theme-intro,
.theme-modal .theme-controls,
.theme-modal .theme-actions {
  flex-shrink: 0;
}
.theme-modal .theme-grid {
  flex: 1;
  min-height: 0;
  max-height: none;
}
.theme-intro {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}
.theme-intro > img {
  width: 70px;
  height: 70px;
}
.theme-intro h3 {
  font-size: 25px;
  letter-spacing: -0.6px;
  margin: 0 0 8px;
}
.theme-intro p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}
.theme-intro .eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
}
.theme-controls {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 10px;
  margin-bottom: 18px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  max-height: 400px;
  overflow: auto;
  padding: 3px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  text-align: left;
  white-space: normal;
  background: var(--input);
  border: 1px solid var(--line);
  padding: 9px;
}
.theme-card.active {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}
.theme-card strong {
  font-size: 11px;
  line-height: 1.5;
}
.theme-card small {
  font-size: 9px;
  color: var(--muted);
}
.theme-mini {
  display: block;
  height: 70px;
  position: relative;
  background: var(--mini-bg);
  border-radius: 4px;
  border: 1px solid var(--mini-line);
  overflow: hidden;
}
.theme-mini i {
  position: absolute;
  left: 5px;
  top: 7px;
  width: 13px;
  height: 12px;
  border: 2px solid var(--mini-accent);
  transform: skew(-12deg);
}
.theme-mini b {
  position: absolute;
  top: 5px;
  left: 24px;
  right: 6px;
  height: 36px;
  background: var(--mini-panel);
}
.theme-mini em {
  position: absolute;
  top: 49px;
  left: 6px;
  right: 25%;
  height: 5px;
  background: var(--mini-accent);
}
.theme-mini u {
  position: absolute;
  top: 58px;
  left: 25%;
  right: 6px;
  height: 4px;
  background: var(--mini-line);
}
.theme-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}
.theme-actions > span {
  color: var(--muted);
  margin-right: auto;
  font-size: 11px;
}
.theme-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
html[data-scheme="light"] .key-row {
  background: var(--input);
}
html[data-scheme="light"] .key-row button {
  color: var(--text);
}
@media (max-width: 1200px) {
  header {
    gap: 18px;
    padding: 0 14px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .brand b {
    font-size: 19px;
  }
  .brand span {
    font-size: 8px;
    letter-spacing: 1.3px;
  }
  .header-actions {
    gap: 2px;
  }
  .header-actions button {
    padding: 7px 8px;
  }
  .project-title input {
    width: 135px;
  }
  .theme-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .theme-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .theme-controls {
    grid-template-columns: 1fr 130px;
  }
  .theme-controls > button {
    grid-column: 1/-1;
  }
  .theme-actions {
    flex-wrap: wrap;
  }
}

.brand .parent-plaque {
  display: flex;
  align-items: center;
  background: #fff4e5;
  border-radius: 6px;
  padding: 4px 8px;
  letter-spacing: 0;
}
.brand .parent-plaque img {
  width: 155px;
  height: 36px;
  object-fit: contain;
}
.brand b {
  font-size: 23px;
}
.brand b span {
  font-size: 8px;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.parent-about {
  background: #fff4e5;
  border-radius: 12px;
  padding: 18px;
  margin: 0 auto 20px;
  max-width: 370px;
}
.parent-about img {
  max-width: 100%;
  height: 155px;
  object-fit: contain;
}
.brand-about > img {
  height: 112px;
}
.preview-badge img {
  width: 15px;
  height: 15px;
}
footer,
kbd,
dialog label {
  color: var(--muted);
}
#playhead {
  background: var(--accent);
}
.transition-marker {
  color: var(--accent);
}
.selected .handle {
  background: var(--soft);
}
.theme-card small {
  color: var(--muted);
}
@media (max-width: 1200px) {
  .brand .parent-plaque img {
    width: 108px;
    height: 30px;
  }
  .brand b {
    font-size: 19px;
  }
  .brand .parent-plaque {
    padding: 3px 5px;
  }
}

.brand-about > img {
  width: 460px;
  height: 300px;
  background: transparent;
  padding: 0;
  object-fit: contain;
}
.parent-about {
  max-width: 240px;
  padding: 10px;
}
.parent-about img {
  height: 100px;
}
.theme-intro > img {
  object-fit: contain;
}
.library-foot img {
  object-fit: contain;
}
.preview-badge img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
