:root {
  --bg: #f5f1ea;
  --panel: #fffdf8;
  --ink: #22201b;
  --muted: #72695f;
  --line: #e6ddd1;
  --accent: #8d5f3a;
  --accent-strong: #704728;
  --success: #2f6b47;
  --error: #8e433f;
  --shadow: 0 18px 40px rgba(44, 35, 26, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Sans SC", sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)),
    var(--bg);
}

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

.intro {
  margin-bottom: 28px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro h1,
.panel-head h2 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.intro h1 {
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  line-height: 1;
}

.lead {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.9;
}

.intro-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.intro-notes span,
.meta-pill,
.status-indicator {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-form,
.panel-status {
  padding: 26px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-head h2 {
  font-size: 2rem;
  line-height: 1.05;
}

.panel-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

#wake-form {
  display: grid;
  gap: 18px;
}

.field-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.field-wide {
  grid-column: span 2;
}

.field span {
  font-size: 0.95rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input::placeholder {
  color: #afa295;
}

.field input:focus {
  outline: none;
  border-color: #c49a72;
  box-shadow: 0 0 0 4px rgba(141, 95, 58, 0.12);
}

.actions,
.status-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button,
.link-button {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

.button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  transition: background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.button-secondary {
  color: var(--ink);
  background: #f1e8dc;
}

.button-secondary:hover {
  background: #e8dccd;
}

.panel-head-status {
  margin-bottom: 16px;
}

.status-indicator {
  color: var(--muted);
}

.panel-status.is-busy .status-indicator {
  color: #8a6028;
  border-color: #e8d1b3;
  background: #fbf3e8;
}

.panel-status.is-success .status-indicator {
  color: var(--success);
  border-color: #cfe3d7;
  background: #edf6f0;
}

.panel-status.is-error .status-indicator {
  color: var(--error);
  border-color: #efd4d2;
  background: #fbefee;
}

.link-button {
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  background: transparent;
}

#result {
  margin: 0;
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbf8f2;
  color: #40362d;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.status-notes {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.status-notes p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

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

  .panel-form,
  .panel-status {
    padding: 20px;
  }

  .panel-head {
    flex-direction: column;
  }

  .panel-meta,
  .status-tools,
  .actions {
    width: 100%;
  }

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

  .field-wide {
    grid-column: span 1;
  }

  .button {
    width: 100%;
  }
}
