:root {
  --bg: #f3efe6;
  --paper: rgba(255, 251, 245, 0.88);
  --ink: #181512;
  --muted: #70665d;
  --line: rgba(24, 21, 18, 0.12);
  --accent: #c44d2d;
  --accent-strong: #962f14;
  --user: #f1ddc5;
  --assistant: #dbe7d3;
  --shadow: 0 18px 50px rgba(76, 47, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Pretendard Variable", "SUIT Variable", "Apple SD Gothic Neo", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(196, 77, 45, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(42, 104, 72, 0.15), transparent 28%),
    linear-gradient(180deg, #f8f2e8 0%, #efe6d9 100%);
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 32px auto 48px;
}

.hero {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  line-height: 0.96;
  font-family: "Iowan Old Style", "Times New Roman", serif;
}

.lede {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

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

.row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.row + .row {
  margin-top: 14px;
}

.field {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.field.small {
  flex: 0 0 120px;
}

.field span,
.toggle span,
.panel-head h2 {
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

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

button {
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  background: #201a16;
  color: #fff8f2;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

button.accent,
button.send {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

button.active-trigger {
  background: linear-gradient(135deg, #2f7a46 0%, #194d2b 100%);
}

.actions {
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.composer {
  align-items: stretch;
}

.composer textarea {
  flex: 1;
}

.send {
  align-self: stretch;
  min-width: 112px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
}

.status {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
  max-height: 60vh;
  overflow: auto;
}

.bubble {
  max-width: min(760px, 100%);
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.bubble.user {
  align-self: flex-end;
  background: var(--user);
}

.bubble.assistant {
  align-self: flex-start;
  background: var(--assistant);
}

.bubble.meta {
  align-self: center;
  padding: 10px 12px;
  background: rgba(32, 26, 22, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
}

.stop-response {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  min-width: 132px;
  padding: 14px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7d1f1f 0%, #411010 100%);
  box-shadow: 0 14px 34px rgba(65, 16, 16, 0.24);
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1040px);
    margin-top: 20px;
  }

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

  .field.small {
    flex-basis: auto;
  }

  .send {
    min-height: 52px;
  }

  .stop-response {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    min-width: 124px;
  }
}
