:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --ink: #14201f;
  --muted: #60706d;
  --line: #d9e1df;
  --panel: #ffffff;
  --panel-soft: #eef4f2;
  --accent: #0f766e;
  --accent-strong: #0a5d57;
  --accent-soft: #dcefeb;
  --warning: #8a5a12;
  --code: #102927;
  --shadow: 0 18px 50px rgba(22, 35, 33, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  grid-template-rows: auto auto;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
}

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

.rail {
  grid-row: span 2;
  padding: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

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

.brand h1 {
  font-size: 22px;
  line-height: 1.15;
}

.brand p,
.section-title p,
.tab-button small,
.result-strip span,
.field span,
.boundary-box li,
.status-line {
  color: var(--muted);
}

.object-tabs {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.tab-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.tab-button span {
  font-weight: 800;
  letter-spacing: 0;
}

.tab-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.boundary-box {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid #ead5aa;
  border-radius: 8px;
  background: #fff8e8;
}

.boundary-box h2 {
  color: var(--warning);
  font-size: 16px;
}

.boundary-box ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 18px;
}

.boundary-box li {
  line-height: 1.45;
}

.panel {
  padding: 20px;
}

.form-panel {
  min-height: 560px;
}

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

.resolver-panel {
  grid-column: 2 / 4;
}

.section-title {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.section-title p {
  font-size: 13px;
  font-weight: 700;
}

.section-title h2 {
  font-size: 22px;
  line-height: 1.25;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field span {
  font-size: 13px;
  font-weight: 700;
}

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

input,
select {
  height: 42px;
  padding: 0 11px;
}

textarea {
  min-height: 88px;
  resize: vertical;
  padding: 10px 11px;
}

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

.form-actions,
.resolver-row {
  display: flex;
  align-items: end;
  gap: 10px;
}

.form-actions {
  margin-top: 18px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border-color: var(--accent);
  background: #fff;
  color: var(--accent-strong);
}

.ghost-button {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.output-stack {
  display: grid;
  gap: 14px;
}

.result-strip {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.result-strip code {
  overflow-wrap: anywhere;
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 800;
}

.receipt-grid {
  display: grid;
  gap: 12px;
}

.receipt-grid article {
  display: grid;
  gap: 8px;
}

.receipt-grid h3 {
  font-size: 14px;
}

pre {
  min-height: 112px;
  max-height: 240px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid #cbd8d5;
  border-radius: 8px;
  background: #0c1d1b;
  color: #d7f7ee;
  font-size: 12px;
  line-height: 1.55;
}

.resolver-row {
  align-items: end;
}

.resolver-row .field {
  flex: 1;
}

.status-line {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.status-line.valid {
  color: var(--accent-strong);
}

.status-line.invalid {
  color: #a13b2a;
}

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

  .output-panel,
  .resolver-panel {
    grid-column: 2;
  }
}

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

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

  .rail,
  .output-panel,
  .resolver-panel {
    grid-column: 1;
  }

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

  .form-actions,
  .resolver-row {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }
}
