:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --text: #0d0d0d;
  --text-muted: #6e6e80;
  --border: #e5e5e5;
  --bubble: #f4f4f4;
  /* ChatGPT-style monochrome accent: black button on light backgrounds */
  --accent: #0d0d0d;
  --accent-hover: #2f2f2f;
  --accent-text: #ffffff;
  --link: #0d0d0d;
  --radius: 16px;
  --font: "Söhne", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #212121;
    --bg-subtle: #2a2a2a;
    --text: #ececf1;
    --text-muted: #a1a1aa;
    --border: #3a3a3a;
    --bubble: #2f2f2f;
    /* Inverted on dark: white button with dark text */
    --accent: #ffffff;
    --accent-hover: #e3e3e3;
    --accent-text: #0d0d0d;
    --link: #ececf1;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  padding: 8px 0 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}
.brand-mark { width: 22px; height: 22px; color: var(--text); flex: none; }
.brand-text { font-size: 15px; }

/* Hero */
.hero {
  text-align: center;
  margin: 24px 0 28px;
}
.hero h1 {
  font-size: clamp(26px, 5vw, 36px);
  line-height: 1.15;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.subtitle {
  color: var(--text-muted);
  margin: 0;
  font-size: 16px;
}

.view { flex: 1; }

/* Input bubble */
.input-bubble {
  background: var(--bubble);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.input-bubble.static { min-height: 96px; }

textarea#prompt {
  width: 100%;
  border: none;
  background: transparent;
  resize: vertical;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  outline: none;
}

.composer-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { width: 100%; }
.field-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
select, input[type="text"] {
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
}
select:focus, input[type="text"]:focus { border-color: var(--text); }

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--bg-subtle); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn.big { padding: 12px 22px; font-size: 16px; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; }

/* Toggle */
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Result */
.result { margin-top: 22px; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; }
.muted { color: var(--text-muted); font-size: 14px; }
.hint { color: var(--text-muted); font-size: 14px; }
.hint a { color: var(--link); text-decoration: underline; }

/* Player */
.typed {
  font-size: 18px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 28px;
}
.typed::after {
  content: "▍";
  margin-left: 1px;
  color: var(--text);
  animation: blink 1s steps(1) infinite;
}
.typed.done::after { content: ""; }
@keyframes blink { 50% { opacity: 0; } }

.player-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* Footer */
.footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.disclaimer {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  margin: 0;
}

@media (max-width: 480px) {
  .composer-row { flex-direction: column; align-items: stretch; }
  .composer-row .btn-primary { width: 100%; }
}

