:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #252525;
  --muted: #666b70;
  --line: #deded8;
  --primary: #2f6f73;
  --primary-dark: #24585b;
  --danger: #a73636;
  --warning: #8a5a14;
  --success: #2f6b3f;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.brand {
  font-weight: 750;
  color: var(--text);
  margin-right: auto;
}

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

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

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

.inline-actions input,
.inline-actions select {
  width: auto;
  min-width: 220px;
}

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

.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.stat {
  font-size: 34px;
  font-weight: 800;
}

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

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.button:hover,
button:hover {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
}

.button.secondary,
button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.button.danger,
button.danger {
  background: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

textarea {
  min-height: 520px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

label {
  display: block;
  font-weight: 700;
  margin: 14px 0 6px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background: #eeeeea;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  background: #eef6ef;
  color: var(--success);
  border: 1px solid #cfe4d3;
}

.alert.error {
  background: #fbefef;
  color: var(--danger);
  border-color: #ebcccc;
}

.alert.warning {
  background: #fff6e6;
  color: var(--warning);
  border-color: #eed9ad;
}

.markdown-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  overflow-wrap: anywhere;
}

.markdown-body table {
  margin: 18px 0;
}

.markdown-body h1,
.markdown-body h2 {
  line-height: 1.2;
}

.recipe-picker {
  display: grid;
  gap: 10px;
}

.recipe-row {
  display: grid;
  grid-template-columns: auto 1fr 96px;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.recipe-row input[type="checkbox"] {
  width: auto;
}

.recipe-row input[type="number"] {
  min-width: 84px;
}

@media (max-width: 700px) {
  .page-head {
    display: block;
  }

  .actions {
    margin-top: 12px;
  }

  .recipe-row {
    grid-template-columns: auto 1fr;
  }

  .recipe-row input[type="number"] {
    grid-column: 2;
  }
}
