:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, .84);
  --solid: #fff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, .10);
  --line-strong: rgba(0, 0, 0, .18);
  --accent: #0071e3;
  --accent-pressed: #005bb8;
  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;
  --radius: 8px;
  --shadow: 0 18px 58px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
}
button, input, textarea { font: inherit; letter-spacing: 0; }
button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--accent);
  color: white;
  font-weight: 650;
  cursor: pointer;
}
button:active { background: var(--accent-pressed); }
button:disabled { background: #d2d2d7; color: #86868b; cursor: default; }
button.secondary { background: #e8e8ed; color: var(--text); }
a { color: inherit; text-decoration: none; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  color: var(--text);
  padding: 12px;
  outline: 0;
}
textarea { min-height: 112px; resize: vertical; line-height: 1.52; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: rgba(245,245,247,.76);
  backdrop-filter: blur(22px);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { font-size: 19px; font-weight: 760; }
.session {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255,255,255,.76);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 18px 34px;
}
.hero {
  min-height: 214px;
  display: grid;
  align-content: end;
  padding: 24px 0 30px;
}
.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(39px, 8vw, 84px);
  line-height: .96;
  font-weight: 780;
  letter-spacing: 0;
}
.hero p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2.5vw, 21px);
  line-height: 1.46;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}
.stack { display: grid; gap: 12px; }
.panel {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}
.panel h2 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 720;
}
.row, .actions, .media-grid { display: grid; gap: 10px; }
.row, .actions, .media-grid { grid-template-columns: 1fr 1fr; }
.media-grid.single { grid-template-columns: 1fr; }
.drop {
  position: relative;
  min-height: 128px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255,255,255,.62);
}
.drop strong { font-size: 15px; }
.drop small {
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.voice-progress {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.voice-progress div {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8e8ed;
}
.voice-progress i {
  display: block;
  width: 33%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .2s ease;
}
.voice-script {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
  min-height: 92px;
  display: grid;
  align-content: center;
  padding: 16px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.42;
  font-weight: 650;
}
.recording {
  background: #d92d20;
}
.recording:active {
  background: #b42318;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: #e8e8ed;
  margin-bottom: 12px;
}
.segmented button {
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.segmented button.active {
  background: var(--solid);
  color: var(--text);
  box-shadow: 0 1px 5px rgba(0,0,0,.08);
}
.list { display: grid; gap: 8px; }
.item {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.68);
  color: var(--text);
  text-align: left;
}
.item.active {
  border-color: rgba(0,113,227,.62);
  box-shadow: inset 0 0 0 1px rgba(0,113,227,.36);
}
.item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}
.job-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.68);
}
.job-card p, .hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
  overflow-wrap: anywhere;
}
.hint { font-size: 13px; }
.job-state { font-weight: 760; }
.job-state.queued { color: var(--accent); }
.job-state.running { color: var(--warn); }
.job-state.succeeded { color: var(--ok); }
.job-state.failed, .job-state.cancelled { color: var(--danger); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  max-width: calc(100vw - 28px);
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  border-radius: 999px;
  background: rgba(29,29,31,.92);
  color: white;
  padding: 10px 14px;
  font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .grid, .media-grid, .row, .actions { grid-template-columns: 1fr; }
  .hero { min-height: 180px; }
  .topbar-inner, main { padding-left: 14px; padding-right: 14px; }
  .panel { padding: 14px; }
}
