:root {
  --bg: #f5f2ec;
  --surface: #ffffff;
  --surface-sky: #eef7fb;
  --surface-mint: #eef7f0;
  --surface-warm: #fff7ed;
  --text: #25282d;
  --muted: #68707a;
  --line: #d9dde2;
  --primary: #2f6f7e;
  --primary-dark: #214f5a;
  --accent: #c96d3a;
  --success: #3d7a54;
  --shadow: 0 18px 44px rgba(37, 40, 45, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI",
    sans-serif;
  line-height: 1.7;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  background:
    linear-gradient(120deg, rgba(33, 79, 90, 0.96), rgba(55, 111, 89, 0.86)),
    linear-gradient(90deg, rgba(201, 109, 58, 0.38), rgba(47, 111, 126, 0.24));
  color: #ffffff;
  padding: 44px 20px 40px;
}

.header-inner,
.app-shell,
.app-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.92rem;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 1.2;
  letter-spacing: 0;
}

.lead {
  max-width: 820px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 20px;
  padding: 28px 0;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel-heading {
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.panel-heading h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.panel-heading p,
.app-footer p {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 126, 0.15);
}

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

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

button.secondary:hover {
  background: #f1f4f6;
}

.result {
  display: grid;
  gap: 14px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  padding: 22px;
}

.result-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.result-block:nth-child(2n) {
  background: var(--surface-sky);
}

.result-block:nth-child(3n) {
  background: var(--surface-mint);
}

.result-block.warning {
  background: var(--surface-warm);
  border-color: #efc49e;
}

.result-block h3 {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 1rem;
}

.badge {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-dark);
  color: #ffffff;
  font-size: 0.82rem;
  line-height: 1;
}

.result-block p {
  margin-bottom: 0;
  color: var(--text);
}

.result-block ul,
.result-block ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.25rem;
}

.prompt-box {
  white-space: pre-wrap;
  border-left: 4px solid var(--accent);
  background: #fff8f2;
  padding: 12px 14px;
}

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

#copy-status {
  min-height: 1.5em;
  color: var(--success);
  font-weight: 700;
}

.app-footer {
  padding: 8px 0 36px;
}

.app-footer p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  button {
    width: 100%;
  }
}
