:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #d8dde6;
  --text: #1f242b;
  --muted: #5e6a78;
  --brand: #256f63;
  --brand-strong: #195348;
  --warning: #8a6214;
  --error: #a13232;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  gap: 12px;
  min-height: 100vh;
  padding: 14px;
}

.topbar,
.message,
.reply {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  font-weight: 650;
}

h2 {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.25;
}

h3 {
  font-size: 14px;
}

.topbar p,
.meta,
.eyebrow {
  color: var(--muted);
}

.status {
  min-width: 70px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

.status[data-tone="busy"],
.status[data-tone="warn"] {
  color: var(--warning);
  border-color: #d8b25f;
  background: #fff7df;
}

.status[data-tone="ok"] {
  color: var(--brand-strong);
  border-color: #8fc7bb;
  background: #e7f5f1;
}

.status[data-tone="error"] {
  color: var(--error);
  border-color: #df9b9b;
  background: #fff0f0;
}

.message,
.reply {
  padding: 14px;
}

.meta {
  display: grid;
  gap: 2px;
  font-size: 12px;
}

.reply {
  display: grid;
  gap: 12px;
}

.reply-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 600;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

input {
  min-height: 38px;
  padding: 0 10px;
}

textarea {
  min-height: 260px;
  resize: vertical;
  padding: 10px;
}

textarea:focus,
input:focus,
button:focus {
  outline: 2px solid #7fb7da;
  outline-offset: 2px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
}

button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  border-color: #9da8b6;
}

button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

button.primary:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

@media (max-width: 340px) {
  .actions {
    grid-template-columns: 1fr;
  }
}
