:root {
  /* Brand palette (from the Good Home Meal pitch deck) */
  --brand-terracotta: #c8553d;
  --brand-mustard: #e39b2d;
  --brand-sage: #5e7d5a;
  --brand-cocoa: #2b2118;
  --brand-cream: #f7efe8;
  --brand-slate: #3e5c76;

  --bg: #fbf6f1;
  --surface: #ffffff;
  --text: #2b2118;
  --muted: #74645a;
  --border: #eadfd5;
  --accent: #c8553d;
  --accent-hover: #a8442f;
  --accent-soft: #f8e6df;
  --good: #4f7a4b;
  --good-soft: #e9f1e6;
  --font-display: 'Fraunces', Cambria, Georgia, 'Times New Roman', serif;
  --warn: #b35c00;
  --danger: #c92a2a;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);

  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1812;
    --surface: #2b2118;
    --text: #f7efe8;
    --muted: #b8a89b;
    --border: #44362b;
    --accent: #d9664c;
    --accent-hover: #e57c63;
    --accent-soft: #3d241c;
    --good: #9cc095;
    --good-soft: #243321;
    --warn: #ffa94d;
    --danger: #ff6b6b;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.4em;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1.15rem;
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 0.6em;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

/* Elements marked hidden stay hidden even when a rule below gives them a display (e.g. labels are flex). */
[hidden] {
  display: none !important;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 500;
  font-size: 0.92rem;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

legend {
  font-weight: 500;
  font-size: 0.92rem;
  margin-bottom: 0.3rem;
}

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

.small {
  font-size: 0.85rem;
}

/* Layout */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem max(16px, calc((100vw - 1040px) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.wordmark-home {
  color: var(--brand-terracotta);
}

.brand-tagline {
  margin-top: 0.25rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.header nav {
  display: flex;
  gap: 0.25rem;
}

.header nav a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.header nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.count {
  min-width: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  text-align: center;
}

.main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 16px 3rem;
  min-height: calc(100vh - 140px);
}

.footer {
  text-align: center;
  padding: 1.5rem 16px;
  border-top: 1px solid var(--border);
}

.narrow {
  max-width: 640px;
  margin: 0 auto;
}

.back {
  display: inline-block;
  margin-bottom: 1rem;
  text-decoration: none;
  font-weight: 500;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-head h1 {
  margin: 0;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

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

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

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn.ghost:hover {
  color: var(--text);
}

.btn.danger {
  background: var(--danger);
}

.btn.danger:hover {
  background: color-mix(in srgb, var(--danger) 85%, #000);
}

.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

.danger-zone h2 {
  color: var(--danger);
}

.danger-zone ul {
  margin: 0;
  padding-left: 1.2rem;
}

.btn.small {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  margin-bottom: 1.5rem;
}

.hero p {
  max-width: 560px;
}

/* One line wherever it fits; phones still wrap rather than shrink the text. */
.hero p.tagline,
.hero p.serving {
  max-width: none;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.filter-row label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.filter-row select {
  width: auto;
}

/* Eat Today filters: meal type + sort, then one row of pill-shaped filters */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
}

.sort-by {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.pill,
select.pill-select,
input.pill-select {
  width: auto;
  min-height: 0;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background-color: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.4;
  cursor: pointer;
}

select.pill-select {
  padding-right: 1.9rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 0.95rem center, right 0.65rem center;
  background-size: 0.3rem 0.3rem;
  background-repeat: no-repeat;
}

.pill:hover,
.pill-select:hover {
  border-color: var(--accent);
}

.pill.on,
.pill-select.on {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent);
}

.pill[aria-expanded='true'] {
  border-color: var(--accent);
}

.filter-pills button.link {
  padding: 0.3rem 0.4rem;
  font-size: 0.88rem;
}

.filters #diet-filter {
  padding: 0.6rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

label.check {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
}

label.check input {
  width: auto;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
  cursor: pointer;
}

.chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

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

.meal-card {
  position: relative;
  display: flex;
  gap: 1rem;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s, border-color 0.12s;
}

.meal-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.meal-card.sold-out {
  opacity: 0.55;
}

.meal-emoji {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 2rem;
}

.meal-thumb {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--accent-soft);
}

.meal-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* All of a tile's pills (meal type, delivery, dietary tags) on one line; extras scroll sideways. */
.pills {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  /* Above the card's full-tile link so the row can be swiped; a fade hints there's more. */
  position: relative;
  z-index: 1;
  mask-image: linear-gradient(to right, #000 85%, transparent);
}

.pills:not(:has(> :nth-child(3))) {
  mask-image: none;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pills > * {
  flex: none;
  margin: 0;
  white-space: nowrap;
}

.pills:empty {
  display: none;
}

.meal-body p {
  margin-bottom: 0.3rem;
}

.meal-top,
.meal-foot,
.row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.meal-top h3 {
  margin: 0;
}

/* The title link covers the whole card; the cook's name is its own link on top. */
.meal-card a.stretched {
  color: inherit;
  text-decoration: none;
}

.meal-card a.stretched::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.meal-card a.stretched:focus-visible {
  outline: none;
}

.meal-card:has(a.stretched:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.meal-card .cook-link {
  position: relative;
  z-index: 1;
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

.meal-card .cook-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* The pickup time sits at the bottom of every tile, whatever is above it. */
.meal-foot {
  align-items: center;
  margin-top: auto;
  padding-top: 0.4rem;
}

.meal-foot .when {
  min-width: 0;
}

.price {
  font-weight: 700;
  white-space: nowrap;
}

.price.big {
  font-size: 1.6rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag {
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--good-soft);
  color: var(--good);
  font-size: 0.75rem;
  font-weight: 500;
}

.portions {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.portions.low {
  color: var(--warn);
}

.empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
}

/* Detail */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 760px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-main {
  padding: 1.5rem;
}

.detail-emoji {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.meal-photos {
  margin-bottom: 1rem;
}

.meal-photo-main {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: var(--border);
}

.meal-photo-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.meal-photo-thumbs button {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: none;
  cursor: pointer;
}

.meal-photo-thumbs button.active {
  border-color: var(--accent);
}

.meal-photo-thumbs img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.kitchen-thumb {
  width: 1.6em;
  height: 1.6em;
  border-radius: 6px;
  object-fit: cover;
  vertical-align: -0.35em;
}

.file-pick {
  position: relative;
  align-self: flex-start;
  display: inline-flex;
  flex-direction: row;
  padding: 0.5rem 0.9rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.file-pick:hover {
  border-color: var(--accent);
}

.file-pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-pick:focus-within {
  outline: 2px solid var(--accent);
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 1rem 0;
}

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

.facts dd {
  margin: 0;
}

.cook {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.cook p {
  margin: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.order-box {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stepper button {
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 1.1rem;
  cursor: pointer;
}

.stepper button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stepper span {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
}

.total {
  display: flex;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Lists */

.notice {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--good-soft);
  color: var(--good);
  font-weight: 500;
}

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

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

.row-emoji {
  font-size: 2rem;
}

.row-body {
  flex: 1;
  min-width: 0;
}

.row-body p {
  margin: 0.2rem 0;
}

.status {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--border);
  color: var(--muted);
}

.status-placed {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-awaiting-payment {
  background: var(--border);
  color: var(--muted);
}

.status-ready,
.status-picked-up {
  background: var(--good-soft);
  color: var(--good);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1rem;
}

.stat strong {
  font-size: 1.4rem;
}

.kitchen-meal {
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.kitchen-meal h2 {
  margin: 0;
}

.kitchen-meal h2 a {
  color: inherit;
  text-decoration: none;
}

.order-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.order-list > li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}

.order-list p {
  margin: 0.15rem 0 0;
}

.actions {
  display: flex;
  gap: 0.4rem;
}

/* Form */

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  margin-top: 1rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 520px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.emoji-picker button {
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 1.35rem;
  cursor: pointer;
}

.emoji-picker button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.error {
  margin: 0;
  color: var(--danger);
  font-weight: 500;
}

/* Accounts & location search */

#nav-auth {
  display: contents;
}

.location-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.location-bar .grow {
  flex: 1 1 260px;
}

.location-bar select {
  width: auto;
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.location-bar .error {
  flex-basis: 100%;
}

.result-count {
  margin-bottom: 0.75rem;
}

.callout {
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  border-color: var(--accent);
}

.callout h2 {
  margin-bottom: 0.4rem;
}

.hint {
  font-weight: 400;
}

.pickup {
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: var(--accent-soft);
}

.logout {
  margin-top: 1rem;
}

.empty .btn {
  margin: 0.25rem;
}

.header nav a {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .header nav {
    flex-wrap: wrap;
    gap: 0;
  }

  .header nav a {
    padding: 0.35rem 0.55rem;
    font-size: 0.92rem;
  }
}

/* Email verification & password reset */

.banner {
  padding: 0.6rem 16px;
  background: var(--accent-soft);
  color: var(--text);
  text-align: center;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
}

.banner[hidden] {
  display: none;
}

.forgot {
  align-self: flex-start;
  margin-top: -0.5rem;
}

.verified {
  color: var(--good);
  font-weight: 500;
}

/* Demo data */

.mine-badge {
  display: inline-block;
  padding: 0 0.45rem;
  border-radius: 6px;
  background: #e6f4ea;
  color: #1e7a3c;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: 0.15em;
}

.demo-badge {
  display: inline-block;
  padding: 0 0.45rem;
  border-radius: 6px;
  background: var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: 0.15em;
}

.demo-note {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--border);
  font-size: 0.9rem;
}

/* Seller setup */

.checklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}

.checklist li {
  padding: 0.2rem 0;
}

.checklist li.done {
  color: var(--muted);
}

.setup-step {
  padding: 1.25rem;
  margin-top: 1rem;
}

.setup-step h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.setup-step.done {
  border-color: var(--good);
}

.step-num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
}

.setup-step.done .step-num {
  background: var(--good);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.inline-form .grow {
  flex: 1 1 240px;
}

.inline-form .error {
  flex-basis: 100%;
}

.address-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  /* Lets the City/State/ZIP row stack by the form's width (the meal page's order box is narrow on any screen). */
  container-type: inline-size;
}

.address-fields legend {
  padding: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.address-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1fr;
  gap: 0.75rem;
}

@container (max-width: 440px) {
  .address-row {
    grid-template-columns: 1fr 1fr;
  }
  .address-row label:first-child {
    grid-column: 1 / -1;
  }
}

.form.compact {
  padding: 0;
  margin-top: 0.75rem;
  border: 0;
  box-shadow: none;
}

.agreement {
  margin: 0.75rem 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.55;
  font-size: 0.92rem;
}

.agreement li {
  margin-bottom: 0.5rem;
}

label.check.agree {
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

label.check.agree input {
  margin-top: 0.3rem;
  flex: none;
}

.card-image {
  max-width: 100%;
  max-height: 360px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.done-callout {
  border-color: var(--good);
}

details summary {
  cursor: pointer;
  color: var(--accent);
}

/* Areas: buyers (terracotta, default), sellers "Good Home Meal for Cooks" (sage), admin (slate blue) */

body[data-area='seller'] {
  --accent: #5e7d5a;
  --accent-hover: #4a6647;
  --accent-soft: #e8efe5;
}

body[data-area='admin'] {
  --accent: #3e5c76;
  --accent-hover: #2f475c;
  --accent-soft: #e4ebf1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-terracotta: #e8836c;
  }

  body[data-area='seller'] {
    --accent: #9cc095;
    --accent-hover: #b5d2af;
    --accent-soft: #243321;
  }

  body[data-area='admin'] {
    --accent: #9fb8cf;
    --accent-hover: #bfd0e0;
    --accent-soft: #212c37;
  }
}

.brand-sub {
  align-self: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .brand-tagline {
    display: none;
  }
}

.header nav .switch {
  margin-left: 0.25rem;
  border: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.steps-preview {
  margin: 0.75rem 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.6;
}

.switch-area {
  margin-top: 1rem;
  text-align: center;
}

/* Card review status (seller setup) */

.review {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-weight: 500;
}

.review-approved {
  background: var(--good-soft);
  color: var(--good);
}

.review-pending {
  background: var(--accent-soft);
}

.review-rejected {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

/* Admin */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.tab-count {
  display: inline-block;
  min-width: 1.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--border);
  font-size: 0.75rem;
  text-align: center;
}

.review-row {
  padding: 1rem 1.25rem;
  margin-bottom: 0.9rem;
}

.review-row h2 {
  margin: 0;
}

.review-row .facts {
  margin: 0.75rem 0;
}

.admin-preview {
  margin: 0.6rem 0;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.review-actions .reason {
  flex: 1 1 220px;
  width: auto;
  padding: 0.35rem 0.7rem;
}

.review-row .error {
  margin-top: 0.5rem;
}

/* Ratings */

.rating {
  color: #b7791f;
  font-weight: 600;
  white-space: nowrap;
}

.rating.new {
  color: var(--muted);
  font-weight: 500;
}

.stars {
  color: #d69e2e;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.rate-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  padding: 0.6rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.rate-box[hidden],
.rated[hidden] {
  display: none;
}

.rate-box textarea {
  flex-basis: 100%;
}

.stars-input {
  display: flex;
}

.star {
  padding: 0 0.1rem;
  border: 0;
  background: none;
  color: var(--border);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.star.on {
  color: #d69e2e;
}

.star:hover,
.star:focus-visible {
  transform: scale(1.15);
}

.reviews {
  margin-top: 1rem;
}

.reviews h3 {
  font-size: 0.95rem;
}

.reviews ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.reviews li {
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
}

.reviews li p {
  margin: 0.2rem 0 0;
}

.location-actions .link {
  align-self: center;
}

/* Meal types: leftovers and frozen */

.style-badge {
  display: inline-block;
  margin-bottom: 0.3rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.style-badge.leftover {
  background: #fff4d6;
  color: #8a5a00;
}

.style-badge.frozen {
  background: #e3f1fb;
  color: #1f5f8b;
}

.style-badge.cottage {
  background: #fbe9f0;
  color: #8b2f55;
}

.style-badge.delivery {
  background: #efe8fb;
  color: #5b3a9b;
}

.fulfillment {
  border: 0;
  padding: 0;
  margin: 0 0 0.5rem;
  display: grid;
  gap: 0.25rem;
}

.fulfillment legend {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

@media (prefers-color-scheme: dark) {
  .style-badge.leftover {
    background: #3a2f12;
    color: #f5c96b;
  }

  .style-badge.frozen {
    background: #13293a;
    color: #8cc8f0;
  }

  .style-badge.delivery {
    background: #2a2140;
    color: #c4a8f5;
  }

  .style-badge.cottage {
    background: #3a1626;
    color: #f2a6c4;
  }
}

.price .was,
.price.big .was {
  font-weight: 400;
  font-size: 0.8em;
}

.deal {
  color: #8a5a00;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .deal {
    color: #f5c96b;
  }
}

.style-note {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.92rem;
}

.style-note.leftover {
  background: #fff8e6;
}

.style-note.frozen {
  background: #eef7fd;
}

@media (prefers-color-scheme: dark) {
  .style-note.leftover {
    background: #2c2413;
  }

  .style-note.frozen {
    background: #142330;
  }
}

.style-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.5rem;
}

.style-option {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.style-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.style-option input {
  width: auto;
  margin-top: 0.25rem;
}

.style-option > span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-weight: 400;
}

.style-fields[hidden] {
  display: none;
}

div.style-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.segmented button,
.segmented a {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.88rem;
  cursor: pointer;
}

.segmented a {
  color: inherit;
  text-decoration: none;
}

.segmented button.active,
.segmented a.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Discounted price on cards: regular price stacked above the deal price */
.meal-top .price {
  text-align: right;
}

.meal-top .price .was {
  display: block;
  line-height: 1.1;
}

/* Status page */
.status-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.status-table th,
.status-table td {
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.status-table th {
  width: 45%;
  font-weight: 500;
}

.status-table .bad {
  color: var(--danger);
}

/* Search: what the box was understood as */
.place-details {
  flex-basis: 100%;
}

.place-details p {
  margin: 0.15rem 0;
}

.alternatives .link {
  font-size: inherit;
}

.location-bar .hint em {
  font-style: normal;
  color: var(--text);
}

/* Cravings */
.craving {
  padding: 0.9rem 1rem;
}

.craving-text {
  font-size: 1.05rem;
}

.craving p {
  margin: 0.25rem 0;
}

.tag-yours {
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.matches {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.4rem 0;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  background: var(--good-soft);
}

.matches .match {
  font-weight: 600;
}

.narrow h2 {
  margin-top: 1.75rem;
}

.craving-nudge {
  margin-top: 1.25rem;
  text-align: center;
}

.cravings-nearby {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.cravings-nearby ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cravings-nearby li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}

.cravings-nearby li p {
  margin: 0.15rem 0 0;
}

/* On demand & catering */
.service-card {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.service-card h2 {
  margin: 0;
}

.service-block {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.service-block h3 {
  margin-bottom: 0.5rem;
}

.menu {
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
}

.menu li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.3rem 0;
}

.menu .tags {
  display: inline-flex;
  margin-left: 0.3rem;
}

.request-row {
  padding: 0.9rem 1rem;
}

.request-row p {
  margin: 0.25rem 0;
}

.request-actions {
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.5rem;
}

.quote {
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: var(--accent-soft);
}

.quote-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  width: 100%;
}

.quote-form label {
  width: 8rem;
}

.quote-form input[name='message'] {
  flex: 1 1 220px;
  width: auto;
}

.dash-requests {
  margin-bottom: 1rem;
}

.menu-row {
  display: grid;
  grid-template-columns: 2fr 1fr 3fr auto;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

@media (max-width: 560px) {
  .menu-row {
    grid-template-columns: 1fr 1fr;
  }
}

label.check.toggle {
  font-size: 1rem;
}

.form hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
}

.brand-mark svg {
  display: block;
}

/* Favorites */
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.fav-btn {
  flex: none;
}

.fav-btn.on {
  background: #d6336c;
  color: #fff;
  border-color: #d6336c;
}

.fav-heart {
  color: #d6336c;
}

.favorite {
  padding: 0.9rem 1rem;
}

.favorite p {
  margin: 0.2rem 0;
}

.notify-toggle {
  margin-top: 0.4rem;
  font-weight: 400;
}

.error-detail {
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.75rem;
  background: var(--border);
  padding: 0.75rem;
  border-radius: 8px;
  max-height: 16rem;
  overflow: auto;
}

/* Cook's Corner */
.narrow.wide {
  max-width: 820px;
}

.corner-tabs {
  margin-bottom: 1rem;
}

.search-row {
  margin: 0.75rem 0 1rem;
}

.search-row input {
  flex: 1 1 240px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .three-col {
    grid-template-columns: 1fr 1fr;
  }
}

a.chip {
  color: inherit;
  text-decoration: none;
}

.forum-cats {
  margin-top: 0.5rem;
}

.recipe {
  padding: 1.25rem 1.5rem;
}

.recipe h1 {
  margin-top: 0;
}

.recipe-card,
.thread-row,
.post {
  padding: 0.9rem 1rem;
}

.recipe-card p,
.post p {
  margin: 0.25rem 0;
}

.recipe h2 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}

.recipe .ingredients,
.recipe .steps {
  padding-left: 1.25rem;
  line-height: 1.6;
}

.recipe .steps li {
  margin-bottom: 0.4rem;
}

.recipe-actions {
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.post {
  margin-bottom: 0.75rem;
}

.post.first {
  border-left: 3px solid var(--accent);
}

.thread-row p {
  margin: 0.3rem 0 0;
}

/* Cook profile */
.cook-profile {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.cook-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cook-head h1 {
  margin: 0 0 0.25rem;
}

.avatar.big {
  width: 128px;
  height: 128px;
  font-size: 3rem;
  flex: none;
}

@media (max-width: 520px) {
  .avatar.big {
    width: 96px;
    height: 96px;
  }
}

/* An image that opens full size in the lightbox when clicked. */
.zoomable {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: inherit;
}

.zoomable img {
  display: block;
}

.zoomable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gallery-tile .zoomable,
.meal-photo-zoom {
  width: 100%;
}

.avatar-zoom {
  flex: none;
  border-radius: 50%;
}

.lightbox {
  max-width: min(96vw, 1200px);
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #111;
  color: #fff;
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgb(0 0 0 / 0.8);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(94vh - 3rem);
  margin: 0 auto;
  object-fit: contain;
}

.lightbox-caption {
  margin: 0;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.cook-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1rem 0 0.5rem;
}

.cook-profile .bio {
  line-height: 1.6;
}

.cook-profile h2 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}

.accolades {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.3rem;
}

/* Food Handler Card guide */
.fh-card {
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.fh-card h2 {
  margin-top: 0;
}

.fh-links {
  padding-left: 1.1rem;
  line-height: 1.8;
}

/* Admin: data check */
.table-wrap {
  overflow-x: auto;
}

.data-check td {
  vertical-align: top;
  font-size: 0.85rem;
}

/* Account: sections and saved payment methods */
.account-nav {
  margin: -0.5rem 0 1rem;
}

.pm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.pm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pm-row.default {
  border-color: var(--accent);
}

.pm-row .status {
  margin-left: 0.35rem;
}

.pm-actions {
  display: flex;
  gap: 0.75rem;
}

/* Meal options (modifications and sides) in the order box */
.option-group {
  border: 0;
  padding: 0;
  margin: 0 0 0.25rem;
  display: grid;
  gap: 0.2rem;
}

.option-group legend {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.option-note {
  margin-top: 0;
}

.choices {
  margin: 0.25rem 0;
}

/* Per-plate choices */
.plate {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  margin: 0 0 0.5rem;
}

.plate legend {
  font-weight: 700;
  padding: 0 0.3rem;
}

.option-legend {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.same-plates {
  margin-bottom: 0.5rem;
}

.plate-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0;
}

/* Cook photos */
img.avatar {
  object-fit: cover;
  background: var(--border);
  flex: none;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.avatar-row form {
  flex: 1 1 260px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

.gallery-tile {
  margin: 0;
}

.gallery-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--border);
}

.gallery-tile figcaption {
  margin-top: 0.3rem;
  line-height: 1.35;
}

/* Cook and listing videos */

.video-card {
  margin: 0.5rem 0 1rem;
}

.video-card video {
  display: block;
  width: 100%;
  max-height: 70vh;
  border-radius: 10px;
  background: #000;
}

.video-card figcaption {
  margin-top: 0.35rem;
  line-height: 1.35;
}

#video-card > h2 {
  margin-top: 0;
}

.video-heading {
  font-size: 1.1rem;
  margin: 1rem 0 0.25rem;
}

progress {
  width: 100%;
  accent-color: var(--accent);
}

.tile-actions {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: 0.25rem;
}

.invite-link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.invite-link input {
  font-size: 0.85rem;
}

/* Cook's Corner shop */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.shop-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.shop-img {
  width: 100%;
  border-radius: 0;
}

.shop-img img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
}

.shop-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1rem 1rem;
}

.shop-body h3,
.shop-body p {
  margin: 0;
}

.shop-go {
  align-self: flex-start;
  margin-top: auto;
}

.disclosure {
  margin-top: -0.25rem;
}

.shop-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  flex: none;
}

.shop-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0;
  list-style: none;
}

.shop-admin-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
}

.shop-admin-list .grow {
  flex: 1;
  min-width: 0;
}

.shop-admin-list p {
  margin: 0;
}

/* Background check */

.disclosure-box {
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 0.88rem;
}

.disclosure-box h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.segmented-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.bg-revealed {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: var(--accent-soft);
}

/* Food Handler Card renewals */

.renewal-tag {
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: var(--accent-soft);
}

.warn-text {
  color: #b45309;
}

.notice.warn {
  background: #fff4d6;
  color: #7a4b00;
}

.reminder-box {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
}

.reminder-box p {
  margin: 0;
}

/* Order messages */

.thread-wrap {
  margin-top: 0.4rem;
}

.unread-badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.thread {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 18rem;
  margin: 0 0 0.6rem;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.msg {
  align-self: flex-start;
  max-width: 85%;
  padding: 0.45rem 0.7rem;
  border-radius: 12px 12px 12px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.msg.mine {
  align-self: flex-end;
  border-radius: 12px 12px 4px 12px;
  background: var(--accent-soft);
  border-color: transparent;
}

.msg p {
  margin: 0 0 0.15rem;
  overflow-wrap: anywhere;
}

.message-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.message-form textarea {
  flex: 1 1 220px;
}

.message-form .error {
  flex-basis: 100%;
}

.shop-section {
  margin: 1.5rem 0 0;
}

/* Cook refunds */

.refund-box > summary {
  display: inline-flex;
  list-style: none;
  cursor: pointer;
}

.refund-box > summary::-webkit-details-marker {
  display: none;
}

.refund-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.refund-form label {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.refund-form input {
  width: 7rem;
}

.refund-form .error {
  flex-basis: 100%;
}

/* Account needed (logged-out visitors) */

.account-needed {
  padding: 2rem 1.5rem;
  text-align: center;
}

.account-needed .actions {
  justify-content: center;
}

.account-icon {
  margin: 0;
  font-size: 2.5rem;
}

.browse-note {
  margin-top: 0.5rem;
  color: var(--good);
}

.lock {
  font-size: 0.75em;
}

/* Seller dashboard listings */

.listings-head {
  align-items: center;
  margin-top: 1.5rem;
}

.listings-head h2,
.ended-head {
  margin: 0;
}

.ended-head {
  margin: 1.5rem 0 0.75rem;
  color: var(--muted);
}

/* Admin: users */
.user-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.25rem;
}

.user-filters input {
  flex: 1 1 16rem;
}

.user-filters select {
  flex: 0 1 14rem;
}

.user-list {
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.user-row {
  padding: 1rem;
}

.user-row.is-suspended {
  border-color: var(--danger);
}

.user-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.user-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 0.75rem;
  margin: 0.6rem 0;
}

.user-facts dt {
  color: var(--muted);
}

.user-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag.role-buyer {
  background: var(--brand-cream);
  color: var(--brand-cocoa);
}

.tag.role-cook {
  background: #e8efe5;
  color: #3f5c3c;
}

.tag.role-admin {
  background: #e4ebf1;
  color: var(--brand-slate);
}

.tag.role-suspended {
  background: var(--danger);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .tag.role-buyer {
    background: #3d3026;
    color: var(--text);
  }

  .tag.role-cook {
    background: #243321;
    color: #b5d2af;
  }

  .tag.role-admin {
    background: #212c37;
    color: #bfd0e0;
  }
}

/* Admin: analytics. Chart colors are validated for color-blind separation and contrast in each mode. */
:root {
  --viz-1: #2a78d6;
  --viz-2: #c8553d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --viz-1: #3987e5;
    --viz-2: #d9664c;
  }
}

.analytics {
  max-width: 1040px;
  margin: 0 auto;
}

.analytics.refreshing {
  opacity: 0.55;
  transition: opacity 0.2s;
}

.analytics-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.analytics-head h1 {
  margin: 0;
}

.analytics-head .range {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0.75rem;
}

.stat-tile {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-tile p {
  margin: 0;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 650;
  line-height: 1.25;
}

.stat-delta .up {
  color: var(--good);
  font-weight: 600;
}

.stat-delta .down {
  color: var(--danger);
  font-weight: 600;
}

.now-line {
  margin: 0 0 1rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
  gap: 0.75rem;
}

.chart-card {
  padding: 1rem;
  min-width: 0;
}

.chart-card h2 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.chart-card > p {
  margin: 0 0 0.25rem;
}

.chart-box {
  position: relative;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart .tick {
  fill: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.chart .bar {
  transition: opacity 0.1s;
}

.chart:hover .bar:not(.on) {
  opacity: 0.55;
}

.chart .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .end-dot {
  stroke: var(--surface);
  stroke-width: 2;
}

.chart .end-label {
  fill: var(--muted);
  font-size: 13px;
}

.chart .end-value {
  fill: var(--text);
  font-weight: 600;
}

.chart .guide {
  stroke: var(--muted);
  stroke-width: 1;
}

.chart .hit {
  fill: transparent;
  cursor: crosshair;
}

.chart-tip {
  position: absolute;
  top: 0;
  transform: translate(-50%, -85%);
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.12);
  font-size: 0.8rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

.chart-tip .tip-date {
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.chart-tip i,
.chart-legend i {
  display: inline-block;
  vertical-align: middle;
  width: 12px;
  height: 2px;
  margin-right: 0.35rem;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  margin: 0 0 0.25rem;
  color: var(--muted);
}

.chart-legend i.key-bar {
  height: 10px;
  border-radius: 2px;
}

.chart-table summary {
  cursor: pointer;
  color: var(--muted);
  margin-top: 0.25rem;
}

.chart-table .table-wrap {
  max-height: 16rem;
  overflow: auto;
}

.chart-table th,
.chart-table td,
.top-pages td {
  width: auto;
  font-variant-numeric: tabular-nums;
}

.top-pages td:last-child {
  text-align: right;
}

/* Background checks: standalone FCRA disclosure, admin steps */
.disclosure-box.standalone {
  margin-bottom: 1rem;
  border-width: 2px;
}

.cra-card {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.cra-card summary {
  cursor: pointer;
}

.bg-report,
.bg-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.bg-report > p,
.bg-steps > p {
  flex-basis: 100%;
  margin: 0;
}

.bg-steps .reason {
  flex: 1 1 18rem;
}

/* Account: profile header + tiles; each tile opens its section on its own page */
.account-hub {
  max-width: 820px;
  margin: 0 auto;
}

.account-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.account-who {
  flex: 1 1 14rem;
  min-width: 0;
}

.account-who h1 {
  margin: 0 0 0.15rem;
}

.account-who p {
  margin: 0.15rem 0;
  overflow-wrap: anywhere;
}

.account-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem !important;
}

.account-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 0.75rem;
}

.account-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 5.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.account-tile:hover,
.account-tile:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tile-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 1.35rem;
}

.tile-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.tile-summary {
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.tile-go {
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
}

.account-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.account-footer .logout {
  margin: 0;
}

.danger-link {
  color: var(--danger);
}

.account-section h1 {
  font-size: 1.5rem;
}

/* Privacy Policy */
.policy-toc {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.policy-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2 14rem;
}

.policy-section {
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 7rem;
}

.policy-section h2 {
  font-size: 1.1rem;
  margin-top: 0;
}

.policy-section ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0;
}

.policy-section li,
.policy-section p {
  line-height: 1.55;
  margin: 0.35rem 0;
}

.bg-switch {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.bg-switch p {
  margin: 0 0 0.6rem;
}

/* Admin → Payments: held earnings and Stripe shortcuts */
.held-payouts,
.stripe-links {
  margin-top: 1rem;
}

.held-payouts .status-table th {
  width: auto;
}

.held-payouts .status-table td {
  vertical-align: top;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}

.link-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.link-list li:last-child {
  border-bottom: 0;
}

.payouts-held {
  margin: 0.75rem 0;
}

.payouts-held .btn {
  margin-top: 0.25rem;
}

.payments-card,
.held-payouts,
.stripe-links {
  padding: 1rem 1.25rem;
}

.held-payouts h2,
.stripe-links h2 {
  margin-top: 0;
}

/* Seller sign-up and setup: what the law requires of cooks */
.legal-notice {
  font-weight: 400;
  color: var(--text, inherit);
  line-height: 1.5;
}

.legal-notice p {
  margin: 0;
}

/* Admin → Messages */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.past-messages {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
}

.message-history summary {
  cursor: pointer;
}

.message-body {
  white-space: pre-wrap;
  margin: 0.5rem 0 0;
}

/* Admin → Users: editing an account */
.user-row.editing h2 {
  margin-top: 0;
}

/* Admin → Marketing */

.market-states {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.market-state {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
}

.market-state:hover,
.market-state.active {
  border-color: var(--accent);
}

.market-state.active {
  background: var(--accent-soft);
}

.market-cal-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.market-cal-head h2 {
  margin: 0 0.5rem;
  min-width: 10rem;
  text-align: center;
}

.market-cal-head .btn:last-child {
  margin-left: auto;
}

.market-week,
.market-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.market-week span {
  padding: 0 0.4rem;
}

.market-cal {
  margin-bottom: 0.75rem;
}

.market-day {
  min-height: 6.5rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.market-day.empty-day {
  border-style: dashed;
  background: transparent;
}

.market-day.today {
  border-color: var(--accent);
}

.day-num {
  font-size: 0.75rem;
  color: var(--muted);
}

.day-num .wd {
  display: none;
}

.market-chip {
  display: block;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.75rem;
  line-height: 1.3;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--border);
  color: var(--text);
}

.market-chip.status-placed {
  background: var(--accent-soft);
}

.market-chip.status-ready {
  background: var(--good-soft);
}

.market-list .market-chip {
  display: inline-block;
  max-width: 100%;
  font-size: 0.85rem;
}

.market-writer {
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.market-video {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.market-video legend,
.market-writer legend {
  font-weight: 600;
  padding: 0 0.35rem;
}

.market-variant {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: var(--bg);
}

.market-variant .message-body {
  white-space: pre-wrap;
  margin: 0.25rem 0;
}

#market-count.error {
  color: var(--danger);
}

.table-scroll {
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

.market-links td,
.market-links th {
  vertical-align: top;
}

@media (max-width: 720px) {
  /* The month becomes a list of the days that have posts. */
  .market-week {
    display: none;
  }

  .market-cal {
    grid-template-columns: 1fr;
  }

  .market-day.empty-day,
  .market-day.no-posts:not(.today) {
    display: none;
  }

  .market-day {
    min-height: 0;
  }

  .market-day .day-num {
    font-size: 0.8rem;
    font-weight: 600;
  }

  .day-num .wd {
    display: inline;
  }

  .market-chip {
    white-space: normal;
    font-size: 0.85rem;
  }
}

.marketing > section.card,
.marketing section.card {
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

/* Seller → Services: the Desserts & baking menu */
.bake-row {
  display: grid;
  grid-template-columns: 2fr minmax(5.5rem, 1fr) 1.4fr 2fr auto;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

@media (max-width: 560px) {
  .bake-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Admin → Service areas */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.2rem 0.75rem;
  margin: 0.75rem 0;
}

/* Admin → Marketing: a Zeely ad brief keeps its line breaks */
.market-brief {
  white-space: pre-wrap;
}

/* Baked goods & treats: buyers choose a pickup day */
.weekday-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
}

.weekday-picks legend {
  width: 100%;
}

.order-list li.day-head {
  display: block;
  padding: 0.5rem 0 0.25rem;
  border-bottom: 1px solid var(--border);
  background: none;
}
