:root {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  color: #222;
}

body {
  margin: 0;
  background: #fafafa;
}

.topnav {
  background: #2d6a4f;
  padding: 0.75rem 1.5rem;
}

.topnav a {
  color: #fff;
  text-decoration: none;
  margin-right: 1.5rem;
  font-weight: 600;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

form input[type="url"],
form input[type="text"],
form input[type="number"],
form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem;
  margin: 0.25rem 0 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.row {
  display: flex;
  gap: 1rem;
}

.row label {
  flex: 1;
}

button {
  background: #2d6a4f;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

button[formaction] {
  background: #888;
  margin-left: 0.5rem;
}

.status-panel {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 4px;
  background: #eef6f1;
}

.status-failed {
  background: #fdecea;
  color: #842029;
}

.form-error {
  background: #fdecea;
  color: #842029;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.auth-links {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.ingredient-row {
  display: grid;
  grid-template-columns: 4rem 5rem 1fr 2rem;
  gap: 0.5rem;
  align-items: center;
}

.instruction-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.remove-btn {
  background: none;
  color: #b00020;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 2rem;
  height: 2rem;
  padding: 0;
  line-height: 1;
  font-size: 1.1rem;
  cursor: pointer;
}

button[onclick^="addRow"] {
  background: none;
  color: #2d6a4f;
  border: 1px dashed #2d6a4f;
  margin-bottom: 1rem;
}

.thumb {
  max-width: 200px;
  border-radius: 6px;
  display: block;
  margin-bottom: 0.5rem;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.recipe-card {
  display: block;
  background: #fff;
  border-radius: 6px;
  padding: 0.75rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recipe-card img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.week-nav {
  margin-bottom: 1rem;
}

.plan-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.plan-grid th,
.plan-grid td {
  border: 1px solid #ddd;
  padding: 0.4rem;
  vertical-align: top;
  font-size: 0.85rem;
}

.plan-grid thead th {
  background: #f0f0f0;
}

.meal-slot-cell select {
  width: 100%;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.meal-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eef6f1;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  margin-bottom: 0.25rem;
}

.meal-chip a {
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-chip button {
  background: none;
  border: none;
  color: #b00020;
  cursor: pointer;
  padding: 0 0.25rem;
}

.grocery-list {
  list-style: none;
  padding: 0;
}

.grocery-item-row {
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
}

.grocery-item-row.checked {
  opacity: 0.5;
  text-decoration: line-through;
}

.grocery-item-detail {
  margin-left: 1.5rem;
  font-size: 0.85rem;
  color: #666;
}

fieldset {
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
