:root {
  color-scheme: light;
  --bg: #f4f7f4;
  --ink: #16211d;
  --muted: #5c6a64;
  --line: #cfd8d2;
  --panel: #ffffff;
  --accent: #197f74;
  --accent-dark: #0f5e55;
  --warning: #a24722;
  --shadow: 0 18px 45px rgba(21, 36, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif;
  background:
    linear-gradient(135deg, rgba(25, 127, 116, 0.1), transparent 34%),
    linear-gradient(315deg, rgba(162, 71, 34, 0.1), transparent 32%),
    var(--bg);
  color: var(--ink);
}

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

.app-shell {
  width: min(1380px, calc(100% - 40px));
  min-height: calc(100vh - 40px);
  margin: 20px auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
  gap: 18px;
}

.workspace,
.output-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(207, 216, 210, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.workspace {
  padding: 30px;
}

.output-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 720px;
}

.intro {
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--accent-dark);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.12;
}

h2 {
  font-size: 22px;
}

.lead {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.prompt-form {
  display: grid;
  gap: 18px;
}

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

label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

label > span,
legend {
  font-size: 13px;
  font-weight: 700;
  color: #273630;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(25, 127, 116, 0.14);
}

.checks {
  margin: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checks legend {
  padding: 0 6px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}

.checks input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.form-actions button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.form-actions button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

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

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-dark);
  cursor: pointer;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover,
.prompt-actions button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

#promptOutput {
  flex: 1;
  min-height: 520px;
  background: #101715;
  color: #ecf4f0;
  border-color: #101715;
  line-height: 1.65;
}

.prompt-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.prompt-actions button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.note {
  margin: 14px 0 0;
  color: var(--warning);
  line-height: 1.7;
  font-size: 13px;
}

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

  .output-panel {
    min-height: 620px;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 1380px);
    margin: 10px auto;
  }

  .workspace,
  .output-panel {
    padding: 18px;
  }

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

  h1 {
    font-size: 30px;
  }
}
