:root {
  --bg: #f5f3ec;
  --surface: #ffffff;
  --border: #ddd6c4;
  --text: #2a271e;
  --text-muted: #756f5e;
  --accent: #8a5a2b;
  --accent-soft: #f0e4d0;
  --bad: #b3432f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.7;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-header .brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.app-header nav a {
  margin-left: 1.2rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.logout-form {
  margin: 0;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1 { font-size: 1.5rem; margin-bottom: 1.2rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }

.note { color: var(--text-muted); font-size: 0.9rem; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin-bottom: 1.2rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15em 0.7em;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  margin-left: 0.5rem;
}

.flash {
  list-style: none;
  padding: 0.8rem 1rem;
  margin: 0 0 1.2rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 6px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

legend {
  font-weight: 700;
  padding: 0;
  margin-bottom: 0.4rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

label.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}

.dish-eval {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.dish-eval > span {
  font-size: 0.9rem;
}

.dish-eval-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.dish-eval-favorite {
  margin-top: 0.2rem;
  color: var(--text-muted);
}

.dish-eval-options label.inline {
  flex: 0 0 auto;
  white-space: nowrap;
}

.diary-content {
  white-space: pre-wrap;
}

.diary-refs {
  margin-top: 0.4rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-soft);
}

.diary-refs .tags {
  display: block;
}

input[type="text"],
input[type="number"],
textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

button {
  align-self: flex-start;
  font: inherit;
  font-weight: 700;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover { opacity: 0.9; }

.proposals {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.proposal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
}

.proposal-card .summary {
  color: var(--text-muted);
  margin-top: 0;
}

.dishes {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dishes li {
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}

.dishes .tags {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0.3rem;
}

.dishes .recipe {
  margin: 0;
  font-size: 0.9rem;
  white-space: pre-line;
}

.comment {
  font-size: 0.9rem;
  color: var(--text-muted);
}
