:root {
  --vd-bg: #f4f5f7;
  --vd-surface: #ffffff;
  --vd-raised: #ffffff;
  --vd-inset: #f7f8fa;
  --vd-text: #121826;
  --vd-muted: #4b5565;
  --vd-faint: #6b7280;
  --vd-border: #d7dce3;
  --vd-border-strong: #c5ccd6;
  --vd-accent: #1d4ed8;
  --vd-accent-hover: #1e40af;
  --vd-accent-soft: #e8eefc;
  --vd-on-accent: #ffffff;
  --vd-danger: #b42318;
  --vd-danger-soft: #fef3f2;
  --vd-success: #067647;
  --vd-warning: #b54708;
  --vd-focus: #c2410c;
  --vd-recording: #b42318;
  --vd-paused: #b54708;
  --vd-ready: #344054;
  --vd-disabled-fg: #98a2b3;
  --vd-shadow: none;
  --vd-space-1: 4px;
  --vd-space-2: 8px;
  --vd-space-3: 12px;
  --vd-space-4: 16px;
  --vd-space-5: 20px;
  --vd-space-6: 24px;
  --vd-space-8: 32px;
  --vd-radius-xs: 4px;
  --vd-radius-sm: 6px;
  --vd-radius: 8px;
  --vd-radius-lg: 10px;
  --vd-font: Inter, "Segoe UI", system-ui, sans-serif;
  --vd-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --vd-ease: 180ms ease;
}

[data-theme="dark"] {
  --vd-bg: #0e1116;
  --vd-surface: #161b22;
  --vd-raised: #1c2330;
  --vd-inset: #12171f;
  --vd-text: #e8edf4;
  --vd-muted: #b4becb;
  --vd-faint: #8b97a8;
  --vd-border: #2b3442;
  --vd-border-strong: #3d4a5c;
  --vd-accent: #6ea8fe;
  --vd-accent-hover: #8bbcff;
  --vd-accent-soft: #1a2740;
  --vd-on-accent: #0e1116;
  --vd-danger: #f2b8b5;
  --vd-danger-soft: #2a1614;
  --vd-success: #7dd3a8;
  --vd-warning: #f0b429;
  --vd-focus: #f0b429;
  --vd-recording: #f2b8b5;
  --vd-paused: #f0b429;
  --vd-ready: #c5d0de;
  --vd-disabled-fg: #667085;
}

* { box-sizing: border-box; }

.vd-skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 200;
  padding: 8px 12px;
  background: var(--vd-accent);
  color: var(--vd-on-accent);
  border-radius: var(--vd-radius-sm);
  font: 500 13px/1.2 var(--vd-font);
  text-decoration: none;
}
.vd-skip:focus { top: 12px; }

body.vd-page {
  margin: 0;
  background: var(--vd-bg);
  color: var(--vd-text);
  font-family: var(--vd-font);
}

body.vd-page .tools-top-nav {
  background: var(--vd-surface);
  border-bottom: 1px solid var(--vd-border);
  box-shadow: none;
  padding: 10px 20px;
}
body.vd-page .tools-nav-back {
  background: var(--vd-inset);
  color: var(--vd-text);
  border: 1px solid var(--vd-border);
  border-radius: var(--vd-radius-sm);
}
body.vd-page .tools-nav-back:hover {
  background: var(--vd-accent-soft);
  color: var(--vd-accent);
}
body.vd-page .tools-nav-title {
  color: var(--vd-text);
  font-weight: 600;
}
body.dark-tools.vd-page .tools-top-nav,
body.vd-page[data-theme="dark"] .tools-top-nav {
  background: var(--vd-surface);
  border-color: var(--vd-border);
  box-shadow: none;
}
body.dark-tools.vd-page .tools-nav-back,
body.vd-page[data-theme="dark"] .tools-nav-back {
  background: var(--vd-inset);
  color: var(--vd-text);
}
body.dark-tools.vd-page .tools-nav-title,
body.vd-page[data-theme="dark"] .tools-nav-title {
  color: var(--vd-text);
}

.vd-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 0;
  font-family: var(--vd-font);
}

.vd-product { padding: 4px 2px 20px; }
.vd-crumb {
  margin: 0 0 10px;
  color: var(--vd-faint);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
}
.vd-crumb a { color: var(--vd-muted); text-decoration: none; }
.vd-crumb a:hover { color: var(--vd-accent); text-decoration: underline; }
.vd-product h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.vd-product-line {
  margin: 4px 0 0;
  color: var(--vd-accent);
  font-size: 14px;
  font-weight: 500;
}
.vd-proposition {
  max-width: 640px;
  margin: 10px 0 0;
  color: var(--vd-muted);
  font-size: 15px;
  line-height: 1.55;
}
.vd-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.vd-capabilities li {
  padding: 4px 10px;
  border: 1px solid var(--vd-border);
  border-radius: var(--vd-radius-xs);
  background: var(--vd-surface);
  color: var(--vd-muted);
  font-size: 12px;
  font-weight: 500;
}
.vd-usecases {
  margin: 12px 0 0;
  color: var(--vd-faint);
  font-size: 12px;
  line-height: 1.5;
}

.vd-flow-wrap {
  position: sticky;
  top: 56px;
  z-index: 20;
  margin-bottom: 12px;
  padding: 8px 0;
  background: var(--vd-bg);
  background: color-mix(in srgb, var(--vd-bg) 88%, transparent);
  backdrop-filter: blur(8px);
}
.vd-flow {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.vd-flow a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--vd-border);
  border-radius: 999px;
  background: var(--vd-surface);
  color: var(--vd-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.vd-flow span {
  color: var(--vd-faint);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.vd-flow .is-current a {
  border-color: var(--vd-accent);
  background: var(--vd-accent-soft);
  color: var(--vd-text);
}
.vd-flow .is-done a { color: var(--vd-text); }
.vd-flow .is-done span { color: var(--vd-success); }

.vd-trust {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--vd-border);
  border-radius: var(--vd-radius);
  background: var(--vd-surface);
}
.vd-trust-title {
  margin: 0 0 8px;
  color: var(--vd-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.vd-trust ul {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.vd-trust li {
  color: var(--vd-muted);
  font-size: 12px;
  line-height: 1.45;
}
.vd-trust strong {
  display: block;
  margin-bottom: 2px;
  color: var(--vd-text);
  font-size: 12px;
  font-weight: 600;
}

.vd-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}
.vd-main, .vd-side { display: grid; gap: 16px; min-width: 0; }

.vd-pane {
  padding: 18px 18px 16px;
  border: 1px solid var(--vd-border);
  border-radius: var(--vd-radius-lg);
  background: var(--vd-surface);
  scroll-margin-top: 120px;
}
.vd-pane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.vd-kicker {
  margin: 0 0 4px;
  color: var(--vd-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.vd-pane h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.vd-pane-meta, .vd-editor-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--vd-faint);
  font-size: 12px;
}
.vd-limit {
  padding: 4px 8px;
  border-radius: var(--vd-radius-xs);
  background: var(--vd-inset);
  color: var(--vd-muted);
  font-size: 12px;
  font-weight: 500;
}

.vd-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--vd-inset);
  color: var(--vd-ready);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.vd-badge-quiet { font-weight: 500; letter-spacing: .04em; }
[data-vd-state="recording"] .vd-badge { background: var(--vd-danger-soft); color: var(--vd-recording); }
[data-vd-state="paused"] .vd-badge { background: #fff7ed; color: var(--vd-paused); }
[data-vd-state="processing"] .vd-badge { background: var(--vd-accent-soft); color: var(--vd-accent); }
[data-vd-state="recorded"] .vd-badge { background: #ecfdf3; color: var(--vd-success); }
[data-vd-state="error"] .vd-badge { background: var(--vd-danger-soft); color: var(--vd-danger); }
[data-theme="dark"] [data-vd-state="paused"] .vd-badge { background: #2a2110; }
[data-theme="dark"] [data-vd-state="recorded"] .vd-badge { background: #12261c; }

.vd-recorder {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--vd-border);
  border-radius: var(--vd-radius);
  background: var(--vd-inset);
}
.vd-timer {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: 1;
}
.vd-state {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  margin-top: 8px;
  color: var(--vd-muted);
  font-size: 13px;
  font-weight: 500;
}
.vd-rec-dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vd-recording);
}
.is-recording .vd-rec-dot,
[data-vd-state="recording"] .vd-rec-dot {
  display: inline-block;
  animation: vd-pulse 1.2s ease-in-out infinite;
}
.vd-mic {
  margin: 6px 0 0;
  color: var(--vd-faint);
  font-size: 12px;
}
.vd-waveform {
  display: block;
  width: 100%;
  height: 72px;
}
[data-vd-state="recording"] .vd-waveform {
  height: 80px;
}

.vd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.vd-toolbar { margin-bottom: 12px; }
.vd-btn, .vd-chip, select, input, textarea { min-height: 44px; font: inherit; }
.vd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--vd-radius-sm);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--vd-ease), border-color var(--vd-ease), color var(--vd-ease);
}
.vd-btn-primary {
  background: var(--vd-accent);
  color: var(--vd-on-accent);
}
.vd-btn-primary:hover:not(:disabled) { background: var(--vd-accent-hover); }
.vd-btn-secondary {
  border-color: var(--vd-border-strong);
  background: var(--vd-surface);
  color: var(--vd-text);
}
.vd-btn-secondary:hover:not(:disabled) { background: var(--vd-inset); }
.vd-btn-danger {
  border-color: var(--vd-danger);
  background: transparent;
  color: var(--vd-danger);
}
.vd-btn-danger:hover:not(:disabled) { background: var(--vd-danger-soft); }
.vd-btn:disabled {
  border-color: var(--vd-border);
  background: var(--vd-inset);
  color: var(--vd-disabled-fg);
  cursor: not-allowed;
}
.vd-btn-primary:disabled {
  background: var(--vd-inset);
  color: var(--vd-disabled-fg);
}
.vd-btn:focus-visible,
.vd-chip:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.vd-output:focus-visible,
.vd-flow a:focus-visible,
.vd-skip:focus-visible {
  outline: 2px solid var(--vd-focus);
  outline-offset: 2px;
}

.vd-options {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-top: 14px;
}
.vd-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--vd-text);
  font-size: 14px;
  cursor: pointer;
}
.vd-check input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--vd-accent);
}
.vd-toggle-state {
  color: var(--vd-faint);
  font-size: 12px;
  font-weight: 600;
}
.vd-toggle-state.is-on { color: var(--vd-success); }
.vd-field {
  display: grid;
  gap: 6px;
  color: var(--vd-muted);
  font-size: 12px;
  font-weight: 500;
}
.vd-field-inline { margin-left: auto; }
select, input, textarea {
  border: 1px solid var(--vd-border);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface);
  color: var(--vd-text);
}
select, input { padding: 8px 12px; }
.vd-field-inline select { min-width: 200px; }
.vd-help, .vd-note, .vd-infra {
  margin: 10px 0 0;
  color: var(--vd-faint);
  font-size: 12px;
  line-height: 1.5;
}
.vd-infra { margin: 18px 2px 8px; }

.vd-recording-result {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--vd-border);
}
.vd-recording-result p {
  margin: 0 0 8px;
  color: var(--vd-muted);
  font-size: 13px;
}
audio { display: block; width: 100%; min-height: 44px; }
.vd-download { margin-top: 10px; }
.vd-details {
  margin-top: 12px;
  color: var(--vd-muted);
  font-size: 13px;
}
.vd-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  cursor: pointer;
}
.vd-details p {
  overflow-wrap: anywhere;
  font-family: var(--vd-mono);
  font-size: 12px;
}

.vd-editor-frame {
  position: relative;
  border: 1px solid var(--vd-border);
  border-radius: var(--vd-radius);
  background: var(--vd-inset);
}
.vd-editor-frame textarea {
  display: block;
  width: 100%;
  min-height: 280px;
  padding: 14px;
  border: 0;
  border-radius: var(--vd-radius);
  background: transparent;
  resize: vertical;
  font: 400 15px/1.65 var(--vd-font);
}
.vd-empty {
  margin: 0;
  padding: 18px 16px 8px;
  color: var(--vd-faint);
  font-size: 13px;
  line-height: 1.55;
}
.vd-editor-frame .vd-empty { padding-bottom: 0; }
.vd-editor-frame.has-text .vd-empty { display: none; }
.vd-document .vd-empty { padding: 8px 0 12px; }

.vd-status {
  min-height: 22px;
  margin-top: 10px;
  color: var(--vd-muted);
  font-size: 13px;
  line-height: 1.5;
}
.vd-status.is-error { color: var(--vd-danger); }

.vd-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.vd-progress span {
  padding: 4px 8px;
  border-radius: var(--vd-radius-xs);
  background: var(--vd-inset);
  color: var(--vd-faint);
  font-size: 11px;
  font-weight: 500;
}
.vd-progress span.is-current {
  background: var(--vd-accent-soft);
  color: var(--vd-accent);
}
.vd-progress span.is-done { color: var(--vd-success); }

.vd-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.vd-type {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--vd-border);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface);
  color: var(--vd-text);
  text-align: left;
  cursor: pointer;
}
.vd-type-name { font-size: 13px; font-weight: 600; }
.vd-type-hint {
  color: var(--vd-faint);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}
.vd-type.is-active {
  border-color: var(--vd-accent);
  background: var(--vd-accent-soft);
}
.vd-type.is-active .vd-type-name { color: var(--vd-text); }
.vd-custom { margin-bottom: 12px; }
.vd-custom span { display: flex; justify-content: space-between; }
.vd-custom textarea { min-height: 72px; padding: 10px 12px; resize: vertical; }

.vd-output {
  min-height: 180px;
  padding: 14px;
  border: 1px solid var(--vd-border);
  border-radius: var(--vd-radius);
  background: var(--vd-inset);
  color: var(--vd-text);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.vd-output.has-output { display: block; }
.vd-disclosure {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--vd-accent);
  background: var(--vd-inset);
  color: var(--vd-muted);
  font-size: 12px;
  line-height: 1.5;
}
.vd-disclosure-warn { border-left-color: var(--vd-warning); }
.vd-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; }

@keyframes vd-pulse {
  50% { opacity: .3; }
}

@media (max-width: 1024px) {
  .vd-trust ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .vd-workspace { grid-template-columns: 1fr; }
  .vd-shell { width: min(100% - 24px, 1280px); padding-top: 20px; }
}
@media (max-width: 768px) {
  .vd-flow-wrap { top: 50px; }
  .vd-flow { overflow-x: auto; }
  .vd-flow a { flex: 0 0 auto; }
  .vd-trust ul { grid-template-columns: 1fr; }
  .vd-types { grid-template-columns: 1fr; }
  .vd-field-inline { margin-left: 0; width: 100%; }
  .vd-field-inline select { width: 100%; min-width: 0; }
  .vd-options { align-items: stretch; flex-direction: column; }
  .vd-editor-frame textarea { min-height: 42vh; }
  .vd-actions .vd-btn { flex: 1 1 140px; }
  .vd-pane-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 430px) {
  .vd-product h1 { font-size: 22px; }
  .vd-timer { font-size: 40px; }
  .vd-capabilities { overflow-x: auto; flex-wrap: nowrap; }
  .vd-capabilities li { flex: 0 0 auto; }
  .vd-usecases { overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .vd-rec-dot,
  [data-vd-state="recording"] .vd-rec-dot { animation: none !important; }
  .vd-btn, .vd-chip, .vd-flow a { transition: none !important; }
  .vd-flow-wrap { backdrop-filter: none; }
}
