:root {
  --bg: #0f1720;
  --panel: #15202c;
  --panel-soft: rgba(21, 32, 44, 0.82);
  --line: rgba(214, 226, 241, 0.12);
  --line-strong: rgba(214, 226, 241, 0.22);
  --text: #edf2f7;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #f97316;
  --success: #10b981;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.2), transparent 30%),
    radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.2), transparent 28%),
    linear-gradient(180deg, #091018 0%, #0f1720 100%);
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 22px 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.eyebrow.small {
  letter-spacing: 0.12em;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  margin-top: 12px;
}

h2 {
  font-size: 1.5rem;
}

.lead {
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.7;
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel-head,
.button-row,
.topbar-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.grid.two,
.definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.definition-grid {
  margin-top: 18px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

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

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: rgba(8, 15, 24, 0.72);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  border: 0;
}

.button.solid {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #03131f;
}

.button.secondary {
  background: linear-gradient(135deg, var(--accent-2), #fb923c);
  color: #160b03;
}

.button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.chip {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.84rem;
}

.definition-item,
.result-card,
.bubble,
.inline-note-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(8, 15, 24, 0.68);
  border: 1px solid var(--line);
}

.definition-item strong,
.inline-note-card strong,
.bubble .role {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.definition-item span,
.inline-note-card span,
.result-card {
  line-height: 1.6;
}

.audio-input-grid {
  margin-top: 16px;
}

.inline-note-card {
  display: grid;
  align-content: center;
}

audio {
  width: 100%;
  margin-top: 14px;
}

.transcript {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
}

.bubble.user {
  background: rgba(249, 115, 22, 0.14);
  justify-self: end;
  width: min(92%, 560px);
}

.bubble.assistant {
  background: rgba(16, 185, 129, 0.14);
  width: min(92%, 560px);
}

.bubble.tool,
.bubble.system {
  background: rgba(148, 163, 184, 0.1);
}

.console {
  min-height: 320px;
  max-height: 520px;
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  background: #050b12;
  color: #d9fff5;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

@media (max-width: 960px) {
  .topbar,
  .layout,
  .grid.two,
  .definition-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .topbar {
    align-items: stretch;
  }
}
