:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #1d2521;
  --muted: #65726b;
  --line: #dce3dc;
  --accent: #1f7a4d;
  --accent-dark: #155c39;
  --danger: #b42318;
  --focus: #f4c430;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent-dark);
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 24px;
}

.brand {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  gap: 16px;
}

.topbar nav a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 28px 20px 56px;
}

.hero {
  align-items: center;
  display: grid;
  gap: 24px;
  min-height: 48vh;
}

.hero h1 {
  font-size: 48px;
  line-height: 1.05;
  margin: 0 0 10px;
}

.hero p,
.section p {
  color: var(--muted);
}

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 22px;
}

.section h1,
.section h2 {
  margin-top: 0;
}

.split {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-row span {
  background: #eef5ef;
  border: 1px solid #d5e6d8;
  border-radius: 8px;
  padding: 10px 12px;
}

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

.link-grid {
  margin-top: 18px;
}

label,
fieldset {
  color: var(--muted);
  display: grid;
  font-size: 14px;
  gap: 6px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
.button:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wide {
  grid-column: 1 / -1;
}

.inline-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr auto;
  margin-bottom: 16px;
}

.actions,
.stacked-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stacked-actions {
  align-items: flex-start;
  flex-direction: column;
}

button,
.button {
  background: #eef2ee;
  border: 1px solid #d4ddd4;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  min-height: 42px;
  padding: 9px 14px;
  text-decoration: none;
}

.compact {
  min-height: 34px;
  padding: 6px 10px;
}

.big-action {
  align-items: center;
  font-size: 18px;
  min-height: 52px;
  padding: 12px 20px;
}

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

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

.ghost {
  background: transparent;
}

.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.danger-zone {
  border-color: #efc6c1;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.items-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.items-grid label {
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.choice-table {
  min-width: 520px;
}

.choice-table input[type="checkbox"] {
  min-height: 20px;
  width: 20px;
}

.muted-row {
  color: var(--muted);
}

.muted-row td {
  background: #f6f7f4;
}

.error {
  background: #fff1ef;
  border: 1px solid #efc6c1;
  border-radius: 8px;
  color: var(--danger);
  padding: 10px 12px;
}

.legal {
  max-width: 760px;
}

small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .split,
  .link-grid,
  .grid-form,
  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
  }
}
