:root {
  color-scheme: light;
  --ink: #162022;
  --muted: #667174;
  --line: #d9e0df;
  --paper: #fbfcfb;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warm: #b45309;
  --soft: #eef7f4;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f7fbfa 0%, #eef4f0 45%, #f9faf7 100%);
  color: var(--ink);
}

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

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

.workspace {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 56px);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(19, 38, 35, 0.08);
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  background: #17312e;
  color: white;
}

.eyebrow {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #9ee8d7;
}

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

h1 {
  max-width: 9ch;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.steps {
  display: grid;
  gap: 12px;
  color: #d8efea;
}

.steps div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.steps span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #9ee8d7;
}

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.98fr);
  grid-template-rows: auto 1fr;
  gap: 0;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 30px 0;
  background: var(--paper);
}

.language-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.language-control select {
  width: auto;
  min-width: 132px;
  height: 36px;
  padding: 0 10px;
}

.input-panel,
.result-panel {
  padding: 30px;
}

.input-panel {
  display: grid;
  align-content: start;
  gap: 20px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.row {
  display: grid;
  gap: 16px;
}

.row.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.row.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: #364143;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 270px;
  resize: vertical;
  padding: 14px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

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

button.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

button.secondary:hover {
  background: var(--soft);
}

.result-panel {
  display: grid;
  align-content: start;
  gap: 20px;
}

.result-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

#providerBadge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty {
  border: 1px dashed #b9c6c3;
  padding: 22px;
  color: var(--muted);
  line-height: 1.7;
  background: #fbfdfc;
}

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

.block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.block h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.block p,
.block li {
  color: #2c383a;
  line-height: 1.65;
}

ul {
  margin: 0;
  padding-left: 20px;
}

.keywords,
.variants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.variant {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  background: #fbfdfc;
  color: #344245;
  font-size: 13px;
}

.variant {
  border-radius: 6px;
  flex: 1 1 210px;
  line-height: 1.5;
}

.variant strong {
  display: block;
  margin-bottom: 4px;
  color: var(--warm);
}

.hidden {
  display: none;
}

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

  .sidebar {
    gap: 28px;
  }

  h1 {
    max-width: 14ch;
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topbar {
    padding: 16px 22px 0;
  }
}

@media (max-width: 680px) {
  .shell {
    width: 100%;
    padding: 0;
  }

  .workspace {
    min-height: 100vh;
    border: 0;
  }

  .row.two,
  .row.three,
  .row.four {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .input-panel,
  .result-panel {
    padding: 22px;
  }

  .topbar {
    justify-content: flex-start;
    padding: 16px 22px 0;
  }

  .language-control {
    width: 100%;
    justify-content: space-between;
  }
}
