:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #68746f;
  --line: #d7e2de;
  --page: #f4f8f6;
  --card: #ffffff;
  --brand: #123f38;
  --brand-mid: #1f6c5f;
  --accent: #c9782f;
  --shadow: 0 18px 50px rgba(18, 63, 56, 0.12);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(18, 63, 56, 0.08), rgba(18, 63, 56, 0) 300px),
    var(--page);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

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

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: #fbfdfc;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  border-color: rgba(31, 108, 95, 0.55);
}

.primary {
  background: var(--brand-mid);
  border-color: var(--brand-mid);
  color: white;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px 16px 32px;
}

.topbar {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px;
  color: white;
  background: var(--brand);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow,
.kicker,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 19px;
  line-height: 1.2;
}

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

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

.output-panel {
  margin-top: 16px;
}

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

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

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

textarea {
  min-height: 260px;
  padding: 14px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(31, 108, 95, 0.75);
  box-shadow: 0 0 0 3px rgba(31, 108, 95, 0.13);
}

.topbar input {
  max-width: 320px;
  background: white;
}

.inline-controls,
.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 8px;
}

.link-row {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

#result {
  min-height: 180px;
}

@media (max-width: 760px) {
  .shell {
    padding-inline: 10px;
  }

  .topbar,
  .board,
  .panel-head,
  .inline-controls,
  .link-row {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar input {
    max-width: none;
  }

  textarea {
    min-height: 220px;
  }
}
