:root {
  --ink: #241915;
  --muted: #76645d;
  --cream: #fff8ed;
  --rose: #c56b58;
  --mahogany: #4a2119;
  --line: rgba(74, 33, 25, 0.16);
  --panel: rgba(255, 248, 237, 0.88);
  --shadow: 0 28px 80px rgba(74, 33, 25, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(197, 107, 88, 0.28), transparent 34rem),
    radial-gradient(circle at 85% 8%, rgba(74, 33, 25, 0.18), transparent 26rem),
    linear-gradient(135deg, #fff8ed 0%, #f1d7c7 100%);
}

button,
input {
  font: inherit;
}

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

.hero {
  max-width: 760px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--rose);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(3.5rem, 10vw, 8rem);
  line-height: 0.86;
  letter-spacing: -0.07em;
}

.lede {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.panel,
.transcript,
.toolbox {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  display: grid;
  gap: 24px;
  margin-bottom: 22px;
  padding: 24px;
}

.status-row,
.controls,
.input-row,
.transcript-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9e8d86;
  box-shadow: 0 0 0 6px rgba(158, 141, 134, 0.14);
}

.status-dot.connected {
  background: #2d8a54;
  box-shadow: 0 0 0 6px rgba(45, 138, 84, 0.14);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  color: #fffaf3;
  background: var(--mahogany);
  cursor: pointer;
}

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

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

#messageModeButton {
  color: var(--mahogany);
  background: rgba(197, 107, 88, 0.2);
}

#disconnectButton,
#copyConversationButton,
#copyToolsButton,
#clearButton,
#clearToolsButton {
  color: var(--mahogany);
  background: rgba(74, 33, 25, 0.1);
}

.message-form {
  display: grid;
  gap: 10px;
}

.message-form label {
  color: var(--muted);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.input-row {
  align-items: stretch;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  outline: none;
}

input:focus {
  border-color: rgba(197, 107, 88, 0.8);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 22px;
}

.transcript,
.toolbox {
  overflow: hidden;
}

.transcript-header {
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.transcript-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.log,
.tool-log {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  padding: 18px;
}

.entry,
.tool-entry {
  border-radius: 18px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.54);
  line-height: 1.45;
}

.entry strong,
.tool-entry strong {
  display: block;
  margin-bottom: 4px;
  color: var(--mahogany);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-entry pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .shell {
    padding: 32px 0;
  }

  .controls,
  .input-row {
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  input,
  button {
    min-height: 48px;
    width: 100%;
  }
}
