:root {
  color-scheme: light;
  --bg: #efe9dc;
  --surface: #fffaf0;
  --surface-strong: #f7efd9;
  --ink: #1f2a24;
  --muted: #6c756b;
  --line: rgba(52, 64, 55, 0.18);
  --accent: #0f766e;
  --accent-strong: #134e4a;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(35, 45, 38, 0.16);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 34rem),
    linear-gradient(135deg, #f5f0e5 0%, var(--bg) 44%, #e6ddca 100%);
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

button:active {
  transform: scale(0.96);
}

button:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 2px;
}

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

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.summary {
  max-width: 620px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.hero-actions,
.panel-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  position: sticky;
  top: 12px;
  z-index: 2;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.82);
  box-shadow: 0 10px 30px rgba(35, 45, 38, 0.08);
  backdrop-filter: blur(16px);
}

.primary-button,
.ghost-button,
.panel-actions button {
  border-radius: 999px;
  font-weight: 800;
}

.primary-button {
  padding: 13px 20px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button.secondary {
  color: var(--accent-strong);
  background: #d8eee9;
  box-shadow: none;
}

.ghost-button,
.panel-actions button {
  padding: 10px 14px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.72);
  border: 1px solid var(--line);
}

.ghost-button:hover,
.panel-actions button:hover {
  background: #fffdf7;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-weight: 700;
}

.status.error {
  color: var(--danger);
}

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

.panel {
  min-height: 68vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.panel-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.panel-header span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

textarea {
  width: 100%;
  flex: 1;
  resize: none;
  overflow: auto;
  white-space: pre;
  border: 0;
  padding: 20px;
  color: #20342d;
  background: transparent;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.7;
  tab-size: 2;
}

textarea::selection {
  color: #fff;
  background: var(--accent);
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 720px);
    padding: 18px 0;
  }

  .hero {
    display: block;
  }

  .hero-actions {
    margin-top: 18px;
  }

  .toolbar {
    top: 8px;
    border-radius: 18px;
  }

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

  .panel {
    min-height: 460px;
    border-radius: 22px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
