:root {
  --bg: #f6f7f5;
  --panel: #ffffff;
  --ink: #17211c;
  --muted: #69736d;
  --line: #d9ded9;
  --accent: #2f6f4e;
  --accent-dark: #1f5138;
  --soft: #edf3ee;
  --warn: #8c4f16;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
}

.disclaimer {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d7e4d9;
  border-radius: 6px;
  background: var(--soft);
  color: #26352d;
  font-weight: 650;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

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

.compact {
  padding: 18px;
}

.side {
  display: grid;
  gap: 16px;
  align-content: start;
  position: sticky;
  top: 104px;
}

.panel-head {
  margin-bottom: 20px;
}

fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 20px 0 4px;
}

legend {
  padding-right: 12px;
  color: var(--accent-dark);
  font-weight: 800;
}

label {
  display: grid;
  gap: 6px;
  color: #29332e;
  font-size: 14px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd3ce;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #d8eadf;
  border-color: var(--accent);
}

.grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 12px;
}

.inline label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.question {
  margin-bottom: 14px;
}

.question label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  font-weight: 750;
}

.question input {
  width: auto;
}

.inline input {
  width: auto;
}

.actions,
.button-stack {
  display: flex;
  gap: 10px;
}

.button-stack {
  flex-direction: column;
  margin-top: 16px;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

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

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

.secondary {
  background: var(--soft);
  color: var(--accent-dark);
}

.secondary:hover {
  background: #dfeae2;
}

.wide {
  width: 100%;
}

.doc-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.doc-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #334039;
  font-size: 13px;
}

.doc-row button {
  padding: 7px 10px;
  font-size: 13px;
}

#status.busy {
  color: var(--warn);
}

#status.ok {
  color: var(--accent-dark);
}

@media (max-width: 900px) {
  .topbar,
  .layout {
    padding: 18px;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .layout,
  .two {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1;
  }
}
