:root {
  color-scheme: light;
  --bg: #f7faf9;
  --ink: #17211f;
  --muted: #60716d;
  --line: #d8e2df;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --danger: #b42318;
  --warm: #f59e0b;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 1rem;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

.ghost-button {
  min-height: 2.25rem;
  padding: 0 0.75rem;
}

button:disabled {
  color: #91a19d;
  cursor: not-allowed;
}

.shell {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 16px;
}

.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 0.45rem 0.8rem;
  white-space: nowrap;
}

.status.recording {
  border-color: #fed7aa;
  color: #9a3412;
  background: #fff7ed;
}

.status.error {
  border-color: #fecaca;
  color: var(--danger);
  background: #fff1f2;
}

.panel,
.workspace {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.hidden {
  display: none;
}

.login-form,
.upload-form {
  display: grid;
  gap: 8px;
}

.input-row {
  display: flex;
  gap: 8px;
}

input {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 0.85rem;
}

input[type="checkbox"] {
  width: 1rem;
  min-height: 1rem;
  accent-color: var(--accent);
}

.controls,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-button {
  flex: 1 1 220px;
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.record-button.active {
  background: var(--danger);
  border-color: var(--danger);
}

.record-button:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.meter-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 24px;
  margin-top: 10px;
}

.vu-meter {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  height: 24px;
}

.vu-bar {
  width: 10px;
  height: 22px;
  border-radius: 999px;
  background: #dfe9e5;
  opacity: 0.55;
  transform: scaleY(0.58);
  transform-origin: center bottom;
  transition:
    background 90ms ease,
    opacity 90ms ease,
    transform 90ms ease;
}

.vu-bar.active {
  background: #16a34a;
  opacity: 1;
  transform: scaleY(1);
}

.live {
  min-height: 2.75rem;
  margin: 14px 0;
  border-left: 4px solid var(--warm);
  background: #fffbeb;
  color: #713f12;
  padding: 0.7rem 0.85rem;
}

.transcript-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

textarea {
  width: 100%;
  min-height: 38vh;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  line-height: 1.5;
}

.actions {
  align-items: center;
  margin-top: 10px;
}

.auto-copy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  color: var(--muted);
  white-space: nowrap;
}

body.compact {
  background: #ffffff;
}

body.compact .shell {
  width: min(100vw - 16px, 460px);
  padding: 8px 0;
}

body.compact .topbar {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

body.compact .eyebrow,
body.compact .transcript-label,
body.compact #popoutButton {
  display: none;
}

body.compact h1 {
  font-size: 1.05rem;
}

body.compact .workspace,
body.compact .panel {
  border: 0;
  padding: 0;
}

body.compact .status {
  max-width: 48vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.compact .controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
}

body.compact button {
  min-height: 2.5rem;
}

body.compact .live {
  min-height: 2.25rem;
  margin: 8px 0;
  padding: 0.55rem 0.7rem;
}

body.compact textarea {
  min-height: 180px;
  max-height: 36vh;
  padding: 0.75rem;
}

body.compact .actions {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  gap: 6px;
}

body.compact .auto-copy-toggle {
  justify-content: end;
  min-height: 2.5rem;
}

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 20px, 980px);
    padding: 16px 0;
  }

  .topbar,
  .input-row {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .status {
    width: 100%;
    text-align: center;
  }

  body.compact .topbar {
    flex-direction: row;
    align-items: center;
  }

  body.compact .top-actions {
    align-items: center;
    flex-direction: row;
  }

  body.compact .status {
    width: auto;
    text-align: left;
  }
}

