:root {
  color-scheme: dark;
  --bg: #111113;
  --bg-deep: #0c0c0e;
  --panel: #19191c;
  --panel-raised: #212125;
  --surface: #141416;
  --surface-soft: #18181b;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #ededef;
  --text-muted: #9d9da6;
  --text-faint: #6b6b74;
  --cream: #f4f4f5;
  --accent: #ee713f;
  --accent-bright: #ff8a58;
  --accent-soft: rgba(238, 113, 63, 0.12);
  --accent-line: rgba(238, 113, 63, 0.3);
  --green: #8ac9a0;
  --red: #e37b67;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial,
    sans-serif;
  --serif: "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --shadow-deep: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  height: 100%;
  margin: 0;
}

html {
  background: var(--bg);
}

body {
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

#root {
  isolation: isolate;
}

::selection {
  color: #19191c;
  background: var(--accent-bright);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid rgba(255, 138, 88, 0.72);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.17);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(145deg, #131316 0%, #111114 55%, #101013 100%);
}

.app-shell::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

/* Title bar */

.titlebar {
  position: relative;
  z-index: 10;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  height: 54px;
  padding: 0 20px 0 88px;
  user-select: none;
}

.titlebar-brand {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.titlebar-brand svg {
  display: block;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25));
}

.brand-name {
  color: var(--cream);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.titlebar-divider {
  width: 1px;
  height: 14px;
  margin: 0 13px;
  background: var(--line-strong);
}

.titlebar-context {
  display: flex;
  gap: 9px;
  align-items: baseline;
  min-width: 0;
}

.titlebar-file {
  overflow: hidden;
  max-width: 260px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.titlebar-file.is-muted {
  color: var(--text-faint);
  font-weight: 420;
}

.titlebar-meta {
  color: var(--text-faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.titlebar-spacer {
  flex: 1;
}

.save-indicator {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  align-items: center;
  padding: 3px 8px;
  color: var(--text-faint);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.save-indicator svg {
  color: var(--green);
}

.save-indicator.is-error {
  color: #e0a093;
  border-color: rgba(227, 123, 103, 0.2);
  background: rgba(227, 123, 103, 0.08);
}

.save-indicator.is-error svg {
  color: var(--red);
}

/* Layout */

.app-body {
  display: grid;
  flex: 1;
  grid-template-columns: 240px minmax(0, 1fr) 344px;
  gap: 12px;
  min-height: 0;
  padding: 0 14px 14px;
}

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

/* Sidebar */

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.sidebar-top {
  flex: 0 0 auto;
  padding: 7px 7px 10px;
}

.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.library-title {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 16px;
  padding: 0 5px;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 550;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.library-actions {
  display: flex;
  gap: 3px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--text-faint);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  transition:
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.4;
}

.library-subtitle {
  margin: 7px 0 0;
  color: var(--text-faint);
  font-family: var(--serif);
  font-size: 11.5px;
  font-style: italic;
  letter-spacing: 0.005em;
}

.video-list {
  flex: 1;
  min-height: 0;
  padding: 2px 4px 14px 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.video-item {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.video-item::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  z-index: 2;
  width: 2px;
  content: "";
  background: transparent;
  border-radius: 999px;
  transition: background 150ms ease;
}

.video-item:hover {
  background: rgba(255, 255, 255, 0.034);
}

.video-item.is-selected {
  background:
    linear-gradient(90deg, rgba(238, 113, 63, 0.12), rgba(255, 255, 255, 0.025) 70%),
    rgba(255, 255, 255, 0.018);
  border-color: rgba(238, 113, 63, 0.14);
}

.video-item.is-selected::before {
  background: var(--accent);
}

.video-select {
  display: flex;
  flex: 1;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 6px 27px 6px 7px;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 9px;
}

.video-thumb {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 57px;
  height: 34px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.24);
  background: #0c0c0f;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-duration {
  position: absolute;
  right: 3px;
  bottom: 2px;
  padding: 1px 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 7.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  background: rgba(4, 4, 7, 0.72);
  border-radius: 3px;
  backdrop-filter: blur(4px);
}

.video-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.video-name {
  overflow: hidden;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 540;
  letter-spacing: -0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-meta {
  display: flex;
  gap: 5px;
  align-items: center;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  white-space: nowrap;
}

.meta-dot {
  display: inline-block;
  width: 2px;
  height: 2px;
  background: var(--text-faint);
  border-radius: 50%;
}

.video-remove {
  position: absolute;
  right: 5px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  color: var(--text-faint);
  cursor: pointer;
  background: rgba(18, 18, 21, 0.8);
  border: 1px solid transparent;
  border-radius: 5px;
  opacity: 0;
  transition:
    opacity 120ms ease,
    color 120ms ease,
    background 120ms ease;
}

.video-item:hover .video-remove,
.video-remove:focus-visible {
  opacity: 1;
}

.video-remove:hover {
  color: #f0a093;
  background: rgba(227, 123, 103, 0.12);
}

.importing-row {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 10px 8px;
  color: var(--text-muted);
  font-size: 10.5px;
}

.library-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 14px;
  text-align: center;
}

.library-empty-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 11px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.library-empty p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
}

.library-empty span {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.5;
}

.sidebar-footer {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 5px;
  padding: 11px 7px 2px;
  border-top: 1px solid var(--line);
}

.tool-status {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 9.5px;
  white-space: nowrap;
}

.status-dot {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  background: var(--text-faint);
  border-radius: 50%;
}

.tool-status.is-ready .status-dot {
  background: var(--green);
  box-shadow: 0 0 7px rgba(138, 201, 160, 0.45);
}

.tool-status.is-missing {
  color: #9d9da0;
}

.tool-status.is-missing .status-dot {
  background: var(--red);
}

.drop-hint {
  color: var(--text-faint);
  font-size: 9px;
  opacity: 0.7;
}

/* Preview header */

.preview-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.preview-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 32px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.preview-label {
  color: var(--text-faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.preview-tabs {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preview-tab {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 520;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 6px;
  transition:
    color 130ms ease,
    background 130ms ease;
}

.preview-tab:hover {
  color: var(--text-muted);
}

.preview-tab.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tab-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.preview-head-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.playback-chip {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 5px;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.playback-chip svg {
  color: var(--accent);
}

.preview-spec {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stage */

.stage {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.045), transparent 54%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(160deg, #1a1a1d 0%, #121215 72%);
  background-size:
    auto,
    34px 34px,
    34px 34px,
    auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 22px 55px rgba(0, 0, 0, 0.22);
}

.stage::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.22) 100%);
}

.stage.is-empty {
  background:
    radial-gradient(circle at 50% 38%, rgba(238, 113, 63, 0.055), transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(160deg, #19191c 0%, #121215 75%);
  background-size:
    auto,
    38px 38px,
    38px 38px,
    auto;
}

.stage.is-empty::before {
  background: radial-gradient(ellipse at center, transparent 38%, rgba(0, 0, 0, 0.2) 100%);
}

.media-frame {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  overflow: hidden;
  background: #07070a;
  border-radius: 12px;
  box-shadow:
    0 26px 65px rgba(0, 0, 0, 0.54),
    0 0 0 1px rgba(255, 255, 255, 0.13),
    0 0 0 7px rgba(255, 255, 255, 0.018);
  isolation: isolate;
}

.media-frame.is-result {
  background-color: #0a0a0d;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.026) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.026) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.026) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.026) 75%);
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
  background-size: 24px 24px;
}

.preview-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

.preview-video.is-hidden {
  visibility: hidden;
}

.preview-gif {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}

.media-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 13px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0b0b0e;
}

.media-fallback > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  filter: blur(0.3px) saturate(0.8) brightness(0.8);
}

.media-fallback-mark {
  color: var(--text-faint);
}

.media-fallback-note {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 76%;
  padding: 6px 9px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  line-height: 1.4;
  text-align: left;
  background: rgba(10, 10, 13, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  backdrop-filter: blur(10px);
}

.media-fallback-note svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.text-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.overlay-slot {
  position: absolute;
  right: 0;
  left: 0;
  display: flex;
  justify-content: center;
  text-align: center;
}

.overlay-slot.is-top {
  top: 0;
}

.overlay-slot.is-bottom {
  bottom: 0;
}

.overlay-slot > span {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.97);
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.overlay-slot.is-title > span {
  font-weight: 700;
  letter-spacing: -0.014em;
}

.overlay-slot.is-credit > span {
  color: rgba(255, 255, 255, 0.84);
  font-weight: 400;
  letter-spacing: 0.018em;
}

.preview-scrim {
  position: absolute;
  right: 0;
  left: 0;
  height: 36%;
  pointer-events: none;
}

.preview-scrim.is-top {
  top: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0));
}

.preview-scrim.is-bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0));
}

.stage-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0 0 0 2px;
  color: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  background: rgba(10, 10, 13, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0.92;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease,
    opacity 140ms ease;
}

.stage-play-button:hover {
  color: #17171a;
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.04);
}

.stage-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 5;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 8.5px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  pointer-events: none;
  background: rgba(7, 7, 10, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.stage-badge-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(238, 113, 63, 0.5);
}

.stage-badge.is-result .stage-badge-dot {
  background: var(--green);
  box-shadow: 0 0 6px rgba(138, 201, 160, 0.5);
}

.job-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  background: linear-gradient(to top, rgba(5, 5, 8, 0.56), transparent 65%);
}

.job-card {
  width: min(410px, 100%);
  padding: 12px 14px 11px;
  pointer-events: auto;
  background: rgba(26, 26, 29, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
}

.job-heading {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.job-spinner {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border-radius: 50%;
}

.job-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.job-copy strong {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.job-copy span {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-cancel {
  padding: 2px 4px;
  color: var(--text-faint);
  font-size: 9.5px;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 4px;
}

.job-cancel:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.job-cancelling {
  color: var(--text-faint);
  font-size: 9px;
  white-space: nowrap;
}

.job-progress {
  height: 3px;
  margin: 10px 0 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.job-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: inherit;
  transition: width 260ms ease;
}

.job-progress.is-indeterminate span {
  width: 34%;
  animation: indeterminate 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.job-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
}

.job-foot span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-foot span:last-child {
  flex: 0 0 auto;
}

/* Empty state */

.empty-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  overflow-y: auto;
  text-align: center;
}

.empty-art {
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.empty-art svg {
  display: block;
}

.empty-title {
  margin: 0;
  color: var(--cream);
  font-family: var(--serif);
  font-size: clamp(30px, 4.2vh, 42px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.empty-title em {
  color: var(--accent-bright);
  font-weight: 400;
}

.empty-description {
  max-width: 365px;
  margin: 11px 0 18px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.6;
  text-wrap: balance;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.empty-formats {
  margin: 14px 0 0;
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 520;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.empty-warning {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  max-width: 390px;
  margin-top: 16px;
  padding: 8px 10px;
  color: #b1b1b4;
  font-size: 9.5px;
  line-height: 1.5;
  text-align: left;
  background: rgba(227, 123, 103, 0.07);
  border: 1px solid rgba(227, 123, 103, 0.18);
  border-radius: 7px;
}

.empty-warning svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

/* Buttons */

.button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  font-size: 11.5px;
  font-weight: 560;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 8px;
  transition:
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: default;
  opacity: 0.5;
}

.button-primary {
  color: #1a1a1d;
  background: var(--cream);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.button-primary:hover:not(:disabled) {
  background: #ffffff;
  transform: translateY(-1px);
}

.button-quiet {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line-strong);
}

.button-quiet:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.2);
}

.button-small {
  height: 26px;
  padding: 0 9px;
  font-size: 10px;
  border-radius: 6px;
}

.text-button {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 450;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 4px;
  transition:
    color 120ms ease,
    background 120ms ease;
}

.text-button:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.text-button:disabled {
  color: var(--text-faint);
  cursor: default;
  opacity: 0.4;
}

kbd {
  padding: 0 3px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 3px;
}

.spin {
  animation: spin 0.9s linear infinite;
}

/* Transport / timeline */

.transport {
  flex: 0 0 auto;
  padding: 11px 4px 1px;
}

.transport-main {
  display: flex;
  gap: 11px;
  align-items: center;
}

.transport-play {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0 0 0 1px;
  color: #1a1a1d;
  cursor: pointer;
  background: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition:
    background 130ms ease,
    transform 130ms ease;
}

.transport-play:hover {
  background: #ffffff;
  transform: scale(1.035);
}

.timeline-wrap {
  flex: 1;
  min-width: 0;
}

.timeline {
  padding: 9px 0 2px;
  cursor: pointer;
  touch-action: none;
}

.timeline-track {
  position: relative;
  height: 15px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 39px,
      rgba(255, 255, 255, 0.05) 39px,
      rgba(255, 255, 255, 0.05) 40px
    ),
    linear-gradient(180deg, #27272a, #212124);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.timeline-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(238, 113, 63, 0.22);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(238, 113, 63, 0.3);
  pointer-events: none;
}

.timeline-playhead {
  position: absolute;
  top: -4px;
  bottom: -4px;
  z-index: 3;
  width: 2px;
  pointer-events: none;
  background: var(--accent-bright);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(16, 16, 19, 0.38),
    0 0 10px rgba(255, 138, 88, 0.4);
  transform: translateX(-1px);
}

.timeline-playhead::before {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--accent-bright);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.36);
  transform: translateX(-50%);
}

.trim-handle {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 23px;
  cursor: ew-resize;
  background: linear-gradient(180deg, #ffffff, #dddde0);
  border: 1px solid rgba(36, 36, 39, 0.2);
  border-radius: 4px;
  box-shadow:
    0 3px 9px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  touch-action: none;
  transform: translate(-50%, -50%);
  transition: background 120ms ease;
}

.trim-handle span {
  width: 1px;
  height: 8px;
  background: rgba(42, 42, 45, 0.32);
  border-radius: 999px;
}

.trim-handle:hover {
  background: linear-gradient(180deg, #ffffff, #e6e6e9);
}

.trim-handle:active {
  background: var(--accent-bright);
}

.timeline-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 5px 1px 0;
  color: var(--text-faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
}

.time-readout {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.time-readout.is-total {
  color: var(--text-faint);
}

.trim-readout {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  color: var(--text-faint);
  white-space: nowrap;
}

.trim-dot {
  flex: 0 0 auto;
  width: 3px;
  height: 3px;
  margin-right: 2px;
  background: var(--accent);
  border-radius: 50%;
}

.trim-arrow {
  color: var(--text-faint);
  opacity: 0.65;
}

.trim-readout strong {
  margin-left: 2px;
  padding: 1px 5px;
  color: var(--text-muted);
  font-size: 8.5px;
  font-weight: 550;
  background: rgba(255, 255, 255, 0.045);
  border-radius: 4px;
}

.transport-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 5px 1px 0 43px;
  padding-top: 2px;
}

.trim-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.trim-tools-label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-right: 2px;
  color: var(--text-faint);
  font-size: 8.5px;
  font-weight: 570;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.transport-hint {
  color: var(--text-faint);
  font-size: 9px;
  white-space: nowrap;
  opacity: 0.7;
}

.result-bar {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  padding: 9px 11px;
  background:
    linear-gradient(90deg, rgba(138, 201, 160, 0.035), transparent 45%),
    rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.result-info {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.result-check {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 27px;
  height: 27px;
  color: var(--green);
  background: rgba(138, 201, 160, 0.11);
  border: 1px solid rgba(138, 201, 160, 0.16);
  border-radius: 50%;
}

.result-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.result-copy strong {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 580;
}

.result-copy span {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

/* Inspector */

.inspector {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #1d1d20 0%, #17171a 68%, #151518 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.27),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.inspector-scroll {
  flex: 1;
  min-height: 0;
  padding: 19px 18px 6px;
  overflow-x: hidden;
  overflow-y: auto;
}

.inspector-intro {
  margin-bottom: 18px;
}

.inspector-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 8px;
  font-weight: 620;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.inspector-intro h2 {
  margin: 0;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -0.028em;
  line-height: 1.08;
}

.inspector-intro p {
  margin: 5px 0 0;
  color: var(--text-faint);
  font-size: 9.5px;
}

.inspector-section {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 16px 0 18px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.section-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--text-faint);
  font-size: 7.5px;
  font-weight: 620;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 580;
  letter-spacing: -0.012em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 540;
  letter-spacing: 0.005em;
}

.field-help {
  color: var(--text-faint);
  font-size: 9px;
  font-style: normal;
  line-height: 1.45;
}

.slider-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.slider-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.value-pill {
  flex: 0 0 auto;
  padding: 1px 6px;
  color: var(--text-muted);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.range-input {
  width: 100%;
  height: 16px;
  margin: 0;
  padding: 0;
  appearance: none;
  cursor: pointer;
  background: transparent;
}

.range-input::-webkit-slider-runnable-track {
  width: 100%;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--range-progress),
    rgba(255, 255, 255, 0.09) var(--range-progress),
    rgba(255, 255, 255, 0.09) 100%
  );
  border-radius: 999px;
}

.range-input::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  margin-top: -5px;
  appearance: none;
  background: #ededef;
  border: 1px solid rgba(28, 28, 31, 0.22);
  border-radius: 50%;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition:
    background 120ms ease,
    transform 120ms ease;
}

.range-input:hover::-webkit-slider-thumb {
  background: #ffffff;
  transform: scale(1.06);
}

.range-input:active::-webkit-slider-thumb {
  background: var(--accent-bright);
}

.range-input::-moz-range-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
}

.range-input::-moz-range-progress {
  height: 3px;
  background: var(--accent);
  border-radius: 999px;
}

.range-input::-moz-range-thumb {
  width: 13px;
  height: 13px;
  background: #ededef;
  border: 1px solid rgba(28, 28, 31, 0.22);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.38);
}

.switch-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.switch-row.is-disabled {
  opacity: 0.5;
}

.switch-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 18px;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.switch-knob {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  background: #e8e8ea;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.34);
  transition: transform 160ms cubic-bezier(0.3, 0.8, 0.3, 1);
}

.switch.is-on {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.15);
}

.switch.is-on .switch-knob {
  transform: translateX(12px);
}

.switch:disabled {
  cursor: default;
}

.segmented {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 2px;
  width: 100%;
  padding: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segment {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  height: 29px;
  padding: 0 6px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 6px;
  transition:
    color 130ms ease,
    background 130ms ease,
    box-shadow 130ms ease;
}

.segment:hover:not(:disabled) {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.segment.is-active {
  color: var(--text);
  background: #28282b;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.segment.is-active svg {
  color: var(--accent-bright);
}

.segment:disabled {
  cursor: default;
  opacity: 0.4;
}

.segmented--compact .segment {
  height: 24px;
  padding: 0 4px;
  font-size: 9px;
  font-weight: 450;
  border-radius: 5px;
}

.mode-note {
  margin: -6px 0 0;
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.45;
}

.output-specs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.output-specs div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.output-specs span {
  color: var(--text-faint);
  font-size: 7.5px;
  font-weight: 570;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.output-specs strong {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 540;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.width-field .slider-heading {
  align-items: center;
}

.number-input {
  display: flex;
  gap: 1px;
  align-items: center;
  height: 25px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.number-input:focus-within {
  border-color: rgba(238, 113, 63, 0.5);
  box-shadow: 0 0 0 2px rgba(238, 113, 63, 0.1);
}

.number-input input {
  width: 43px;
  padding: 0;
  color: var(--text);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  background: transparent;
  border: 0;
  outline: none;
  appearance: textfield;
}

.number-input input::-webkit-inner-spin-button,
.number-input input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.number-input span {
  color: var(--text-faint);
  font-size: 8.5px;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.preset {
  height: 24px;
  padding: 0 2px;
  color: var(--text-faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 5px;
  transition:
    color 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.preset:hover:not(:disabled) {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
}

.preset.is-active {
  color: var(--cream);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.preset:disabled {
  cursor: default;
  opacity: 0.28;
}

.two-up {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.text-input {
  width: 100%;
  padding: 8px 9px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.45;
  resize: none;
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: none;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.text-input::placeholder {
  color: var(--text-faint);
  opacity: 0.75;
}

.text-input:hover {
  background: rgba(255, 255, 255, 0.04);
}

.text-input:focus {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(238, 113, 63, 0.5);
  box-shadow: 0 0 0 2px rgba(238, 113, 63, 0.09);
}

.text-area {
  min-height: 51px;
}

.char-count {
  color: var(--text-faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.type-footnote {
  margin: -5px 0 0;
  color: var(--text-faint);
  font-family: var(--serif);
  font-size: 9px;
  font-style: italic;
  opacity: 0.8;
}

.tools-alert {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
  padding: 10px 11px;
  background: rgba(227, 123, 103, 0.065);
  border: 1px solid rgba(227, 123, 103, 0.18);
  border-radius: 9px;
}

.tools-alert-title {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--red);
}

.tools-alert-title strong {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 580;
}

.tools-alert p {
  margin: 0;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.5;
}

.tools-alert code {
  padding: 1px 4px;
  color: #bfbfc2;
  font-family: var(--mono);
  font-size: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.tools-alert-detail {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 8px;
  line-height: 1.4;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tools-alert .text-button {
  align-self: flex-start;
  padding-left: 0;
  color: #aeaeb1;
}

.inspector-end {
  height: 12px;
}

/* Export panel */

.export-panel {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
  padding: 11px 14px 13px;
  background:
    linear-gradient(180deg, rgba(28, 28, 31, 0.9), #18181b 65%);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -14px 32px rgba(0, 0, 0, 0.16);
}

.destination-row {
  display: flex;
  gap: 5px;
  align-items: stretch;
}

.destination-button {
  display: flex;
  flex: 1;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition:
    background 130ms ease,
    border-color 130ms ease;
}

.destination-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line-strong);
}

.destination-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.destination-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 23px;
  height: 23px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
}

.destination-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.destination-copy > span {
  color: var(--text-faint);
  font-size: 7.5px;
  font-weight: 550;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.destination-copy strong {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 480;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destination-chevron {
  flex: 0 0 auto;
  color: var(--text-faint);
}

.destination-clear {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  padding: 0;
  color: var(--text-faint);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.destination-clear:hover:not(:disabled) {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.destination-clear:disabled {
  cursor: default;
  opacity: 0.45;
}

.export-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 0 1px;
  color: var(--text-faint);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.summary-dot {
  width: 2px;
  height: 2px;
  background: var(--text-faint);
  border-radius: 50%;
  opacity: 0.7;
}

.export-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 1px;
}

.export-progress-bar {
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.export-progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: inherit;
  transition: width 260ms ease;
}

.export-progress-bar.is-indeterminate span {
  width: 34%;
  animation: indeterminate 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.export-progress > span {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-button {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 39px;
  padding: 0 12px;
  color: #19191c;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: -0.005em;
  cursor: pointer;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  box-shadow:
    0 8px 22px rgba(238, 113, 63, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition:
    background 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease;
}

.export-button:hover:not(:disabled) {
  background: var(--accent-bright);
  box-shadow:
    0 10px 26px rgba(238, 113, 63, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.export-button:active:not(:disabled) {
  transform: translateY(0);
}

.export-button kbd {
  margin-left: 2px;
  color: rgba(25, 25, 28, 0.62);
  font-size: 9px;
  background: rgba(255, 255, 255, 0.2);
  border-color: transparent;
}

.export-button:disabled {
  color: var(--text-faint);
  cursor: default;
  background: rgba(255, 255, 255, 0.065);
  border-color: var(--line);
  box-shadow: none;
}

.export-button.is-cancel {
  color: #efab9e;
  background: rgba(227, 123, 103, 0.1);
  border-color: rgba(227, 123, 103, 0.26);
  box-shadow: none;
}

.export-button.is-cancel:hover:not(:disabled) {
  background: rgba(227, 123, 103, 0.16);
  box-shadow: none;
}

.export-button.is-cancel:disabled {
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.04);
}

.export-reason {
  margin-top: -2px;
  color: var(--text-faint);
  font-size: 8.5px;
  text-align: center;
}

/* Toasts */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(344px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 9px 10px 11px;
  pointer-events: auto;
  background: rgba(29, 29, 32, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  animation: toast-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(20px);
}

.toast-icon {
  flex: 0 0 auto;
  margin-top: 1px;
}

.toast-success .toast-icon {
  color: var(--green);
}

.toast-error .toast-icon {
  color: var(--red);
}

.toast-info .toast-icon {
  color: var(--accent-bright);
}

.toast-copy {
  flex: 1;
  min-width: 0;
}

.toast-copy strong {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 590;
  line-height: 1.35;
}

.toast-copy p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.toast-action {
  align-self: center;
  padding: 3px 6px;
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.toast-action:hover {
  color: var(--text);
}

.toast-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  color: var(--text-faint);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 4px;
}

.toast-close:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

/* Drop target */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(8, 8, 11, 0.6);
  animation: fade-in 120ms ease-out;
  backdrop-filter: blur(3px);
}

.drop-well {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  width: min(410px, 76vw);
  padding: 30px 32px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 25%, rgba(238, 113, 63, 0.1), transparent 60%),
    rgba(24, 24, 27, 0.9);
  border: 2px dashed rgba(238, 113, 63, 0.46);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 50%;
}

.drop-well strong {
  color: var(--cream);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.drop-well > span:last-child {
  color: var(--text-muted);
  font-size: 10px;
}

/* Animation */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes indeterminate {
  0% {
    transform: translateX(-115%);
  }
  100% {
    transform: translateX(340%);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */

@media (max-width: 1180px) {
  .app-body {
    grid-template-columns: 216px minmax(0, 1fr) 316px;
    gap: 10px;
    padding: 0 11px 11px;
  }

  .inspector-scroll {
    padding: 16px 14px 5px;
  }

  .inspector-intro h2 {
    font-size: 23px;
  }

  .inspector-section {
    gap: 12px;
    padding: 14px 0 16px;
  }

  .export-panel {
    padding: 10px 12px 12px;
  }

  .segment {
    font-size: 9.5px;
  }

  .transport-hint {
    display: none;
  }

  .stage {
    padding: 16px;
  }
}

@media (max-width: 1080px) {
  .app-body {
    grid-template-columns: 204px minmax(0, 1fr) 298px;
    gap: 9px;
    padding: 0 9px 9px;
  }

  .brand-name {
    font-size: 15px;
  }

  .titlebar-meta {
    display: none;
  }

  .preview-spec {
    display: none;
  }

  .inspector-scroll {
    padding: 14px 12px 4px;
  }

  .export-panel {
    padding: 9px 10px 10px;
  }

  .result-copy span {
    max-width: 220px;
  }

  .transport-footer {
    margin-left: 0;
  }

  .trim-readout {
    font-size: 8.5px;
  }
}

@media (max-height: 730px) {
  .titlebar {
    height: 48px;
  }

  .app-body {
    padding-bottom: 10px;
  }

  .preview-head {
    height: 28px;
    margin-bottom: 7px;
  }

  .stage {
    padding: 14px;
  }

  .empty-art {
    margin-bottom: 12px;
  }

  .empty-description {
    margin: 8px 0 14px;
  }

  .empty-formats {
    margin-top: 10px;
  }

  .transport {
    padding-top: 7px;
  }

  .inspector-intro {
    margin-bottom: 13px;
  }

  .inspector-section {
    padding: 12px 0 14px;
  }

  .inspector-intro h2 {
    font-size: 22px;
  }
}

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

/* ── Crop ─────────────────────────────────────────────── */

.crop-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.crop-editor {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.crop-box {
  position: absolute;
  box-sizing: border-box;
  cursor: move;
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 9999px rgba(5, 5, 8, 0.62);
  outline: none;
}

.crop-box:focus-visible {
  border-color: var(--accent-bright);
}

.crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, transparent calc(33.333% - 0.5px), rgba(255, 255, 255, 0.28) calc(33.333% - 0.5px), rgba(255, 255, 255, 0.28) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255, 255, 255, 0.28) calc(66.666% - 0.5px), rgba(255, 255, 255, 0.28) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px)),
    linear-gradient(180deg, transparent calc(33.333% - 0.5px), rgba(255, 255, 255, 0.28) calc(33.333% - 0.5px), rgba(255, 255, 255, 0.28) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255, 255, 255, 0.28) calc(66.666% - 0.5px), rgba(255, 255, 255, 0.28) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px));
}

.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
}

.crop-handle::after {
  position: absolute;
  inset: 3px;
  content: "";
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.crop-handle.is-n,
.crop-handle.is-s {
  width: 26px;
  margin-left: -13px;
}

.crop-handle.is-n::after,
.crop-handle.is-s::after {
  inset: 5px 3px;
}

.crop-handle.is-e,
.crop-handle.is-w {
  height: 26px;
  margin-top: -13px;
}

.crop-handle.is-e::after,
.crop-handle.is-w::after {
  inset: 3px 5px;
}

.crop-handle.is-nw { left: 0; top: 0; cursor: nwse-resize; }
.crop-handle.is-n { left: 50%; top: 0; cursor: ns-resize; }
.crop-handle.is-ne { left: 100%; top: 0; cursor: nesw-resize; }
.crop-handle.is-e { left: 100%; top: 50%; cursor: ew-resize; }
.crop-handle.is-se { left: 100%; top: 100%; cursor: nwse-resize; }
.crop-handle.is-s { left: 50%; top: 100%; cursor: ns-resize; }
.crop-handle.is-sw { left: 0; top: 100%; cursor: nesw-resize; }
.crop-handle.is-w { left: 0; top: 50%; cursor: ew-resize; }

.crop-size {
  position: absolute;
  bottom: 6px;
  left: 50%;
  padding: 2px 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  background: rgba(10, 10, 13, 0.72);
  border-radius: 5px;
  transform: translateX(-50%);
}

.crop-aspects {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.crop-aspect {
  padding: 1px 6px;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 4px;
}

.crop-aspect:hover {
  color: var(--text);
}

.crop-aspect.is-active {
  color: var(--accent-bright);
  background: var(--accent-soft);
}

.text-button.is-strong {
  color: var(--accent-bright);
}

/* --- Browser / Rust Wasm overrides --- */
.titlebar {
  padding-left: 18px;
}

.wasm-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

.is-hidden {
  display: none !important;
}

.empty-actions {
  flex-wrap: wrap;
  justify-content: center;
}

#gs-gif-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

/* --- Brand refresh: neutral chrome, sans headings, no ornament --- */
.brand-name,
.library-subtitle,
.inspector-intro h2,
.drop-well strong {
  font-family: var(--sans);
  font-style: normal;
}

.brand-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.titlebar-brand svg {
  filter: none;
}

.inspector-intro h2 {
  font-weight: 600;
  letter-spacing: -0.015em;
}

.empty-title {
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(22px, 3.2vh, 28px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.empty-description {
  max-width: 380px;
  font-size: 12px;
}

.empty-formats {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: none;
}
