:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #141821;
  --muted: #677283;
  --line: #dfe5ee;
  --soft: #eef3f8;
  --blue: #2563eb;
  --teal: #0f766e;
  --green: #15803d;
  --amber: #b45309;
  --red: #dc2626;
  --shadow: 0 18px 50px rgba(20, 24, 33, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 251, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

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

h1 {
  font-size: 17px;
  line-height: 1.2;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

.status-line {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.neutral {
  color: var(--muted);
  background: var(--soft);
}

.ok {
  color: var(--green);
  background: #dcfce7;
}

.warn {
  color: var(--amber);
  background: #fef3c7;
}

.bad {
  color: var(--red);
  background: #fee2e2;
}

.transcript {
  width: min(920px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 32px 0 148px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.empty-state {
  min-height: 44vh;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  color: var(--ink);
}

.message {
  display: grid;
  gap: 8px;
}

.message.user {
  justify-items: end;
}

.bubble {
  max-width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--panel);
  box-shadow: 0 8px 26px rgba(20, 24, 33, 0.06);
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 15px;
}

.user .bubble {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
}

.meta {
  color: var(--muted);
  font-size: 12px;
}

.result-list {
  display: grid;
  gap: 12px;
}

.result-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.result-card strong {
  font-size: 13px;
}

.result-card p {
  color: #293241;
  white-space: pre-wrap;
  line-height: 1.5;
}

.composer-wrap {
  position: fixed;
  inset: auto 0 0;
  padding: 18px 14px 20px;
  background: linear-gradient(180deg, rgba(247, 248, 251, 0), var(--bg) 28%);
}

.composer {
  width: min(920px, calc(100vw - 28px));
  min-height: 64px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

#promptInput {
  width: 100%;
  max-height: 220px;
  min-height: 42px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 10px 8px;
  color: var(--ink);
  background: transparent;
  line-height: 1.45;
  font-size: 15px;
}

.round-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease, background 150ms ease;
}

.round-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.round-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.send {
  color: #ffffff;
  background: var(--blue);
  font-size: 21px;
  font-weight: 800;
}

.stop {
  color: var(--red);
  background: #fee2e2;
  font-size: 13px;
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .badges {
    justify-content: flex-start;
  }

  .transcript {
    padding-top: 24px;
  }
}
