:root {
  --crust: #8a4b1f;
  --crust-dark: #6b3715;
  --fern: #55684d;  /* the sprig in the logo; filled surfaces that aren't buttons */
  --ink: #2b1d14;
  --muted: #7a6a5d;
  --cream: #faf5ee;
  --card: #fffdf9;
  --line: #eadfd2;
  --ok: #3d7a4a;
  --warn: #b5541c;
  --radius: 8px;   /* store: gently rounded, not pills */
  --pill: 10px;
  --serif: 'Rubik', system-ui, sans-serif;
  --serif-weight: 600;
  --sans: 'Rubik', system-ui, -apple-system, sans-serif;
}
/* Back office keeps its original fonts. */
body.admin {
  --radius: 12px;  /* back office keeps the softer look */
  --pill: 999px;
  --serif: 'Fraunces', Georgia, serif;
  --serif-weight: 600;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.5 var(--sans); color: var(--ink); background: var(--cream); }
a { color: var(--crust); }
h1, h2, h3 { font-family: var(--serif); font-weight: var(--serif-weight); letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .5em; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  border: 0; border-radius: var(--pill); padding: .7em 1.4em; cursor: pointer;
  background: var(--crust); color: #fff; text-decoration: none; font-weight: 600;
  transition: background .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--crust-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--crust); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--crust); }
.btn.danger { background: #a3361f; }
.btn.small { padding: .35em .9em; font-size: .875rem; }
.btn-lg { font-size: 1.2rem; padding: .9em 2em; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .9rem; }
label small { font-weight: 400; color: var(--muted); }
.address small { display: block; margin-top: .3rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .65em .8em;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; font-weight: 400;
}
input:focus, textarea:focus { outline: none; border-color: var(--crust); }
textarea { min-height: 7em; resize: vertical; }
.error { color: #a3361f; font-weight: 600; min-height: 1.5em; margin: .5rem 0; }
.muted { color: var(--muted); }

/* Splash (home + admin background) */
.splash {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: linear-gradient(rgba(30, 18, 10, .45), rgba(30, 18, 10, .55)), var(--bg) center / cover no-repeat fixed;
}
.splash-inner { text-align: center; color: #fff; }
.logo {
  display: inline-block; height: 100%; aspect-ratio: 1150 / 1369; background: currentColor;
  -webkit-mask: url(/img/logo.svg) center / contain no-repeat; mask: url(/img/logo.svg) center / contain no-repeat;
}
/* Home: the logo on a round label, like the stickers on the bags. */
.sticker {
  width: clamp(240px, 46vmin, 430px); aspect-ratio: 1; margin: 0 auto 1.6rem; border-radius: 50%;
  display: grid; place-items: center; background: #fbf8f2; color: #1f1510;
  box-shadow: 0 24px 70px rgba(0,0,0,.4), inset 0 0 0 1px rgba(0,0,0,.04);
}
.sticker .logo { height: 76%; transform: translateX(3%); }
.splash-inner p { font-size: 1.25rem; margin: 0 0 .25rem; opacity: .92; }
.splash-inner p:last-of-type { margin-bottom: 2rem; }
.splash-inner .btn { background: #fff; color: var(--crust); box-shadow: 0 10px 40px rgba(0,0,0,.25); display: inline-block; line-height: 1.3; }
.splash-inner .btn span { font-weight: 400; }
.splash-inner .btn:hover { background: var(--cream); }

/* Store header */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: .5rem clamp(1rem, 4vw, 2.5rem); background: rgba(250, 245, 238, .92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: block; height: 84px; margin-block: -.2rem; color: var(--ink); }
@media (max-width: 640px) { .brand { height: 66px; } }
.brand:hover { color: var(--crust); }
.cart-link {
  position: relative; display: inline-flex; align-items: center; gap: .5em; padding: .5em 1em;
  border-radius: var(--pill); background: var(--card); border: 1.5px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.cart-link:hover { border-color: var(--crust); }
.cart-count {
  min-width: 1.6em; height: 1.6em; padding: 0 .4em; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--crust); color: #fff; font-size: .8rem;
}
.cart-count.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: scale(1.35); } }

.page { max-width: 1040px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 2rem; }
.page.narrow { max-width: 680px; }
.page-footer { text-align: center; color: var(--muted); padding: 1.5rem 1rem 3rem; }
.back { display: inline-block; font-size: .9rem; margin-bottom: 1rem; }

/* Category tabs + grid */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.tab {
  border: 1.5px solid var(--line); background: var(--card); border-radius: var(--pill);
  padding: .5em 1.2em; cursor: pointer; font-weight: 600;
}
.tab[aria-selected=true] { background: var(--fern); color: #fff; border-color: var(--fern); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card {
  text-align: left; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card);
  padding: 1.4rem 1.3rem; cursor: pointer; min-height: 150px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1rem;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover:not(:disabled) { border-color: var(--crust); box-shadow: 0 8px 24px rgba(107, 55, 21, .12); transform: translateY(-2px); }
.card h3 { font-size: 1.3rem; margin: 0; }
.card .price { font-weight: 600; color: var(--crust); display: flex; justify-content: space-between; align-items: center; }
.card .desc { margin: .4rem 0 0; font-size: .92rem; color: var(--muted); }
.card .add { font-size: .85rem; color: var(--muted); }
.card:disabled { opacity: .45; cursor: not-allowed; }

.notice {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 2rem; text-align: center;
}
.notice h2 { font-size: 2rem; }

/* Subscribe pitch above the menu. */
.sub-cta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem;
  background: var(--card); border: 1.5px solid var(--line); border-left: 4px solid var(--fern);
  border-radius: var(--radius); padding: .9rem 1.1rem; margin: 2rem 0 0;
  color: var(--ink); text-decoration: none;
}
.sub-cta:hover { border-color: var(--fern); }
.sub-cta span { color: var(--muted); font-size: .95rem; }

/* Modal */
dialog {
  border: 0; border-radius: var(--radius); padding: 1.8rem; width: min(420px, calc(100vw - 2rem));
  box-shadow: 0 30px 80px rgba(0,0,0,.3); background: var(--card); color: var(--ink);
}
dialog::backdrop { background: rgba(30, 18, 10, .45); }
dialog h2 { font-size: 1.6rem; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.5rem 0; }
.stepper button {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1.5px solid var(--line); background: #fff;
  font-size: 1.3rem; cursor: pointer;
}
.stepper button:hover { border-color: var(--crust); }
.stepper output { font-size: 1.8rem; font-weight: 700; min-width: 2ch; text-align: center; }
.actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }

.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 20;
  background: var(--fern); color: #fff; padding: .7em 1.3em; border-radius: var(--pill); font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* Cart */
.panel { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: 1.35rem; }
.line { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .qty { display: flex; align-items: center; gap: .4rem; }
.line .qty button, .line .remove {
  width: 2rem; height: 2rem; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; cursor: pointer;
}
.line .remove { border: 0; background: none; color: var(--muted); font-size: 1.2rem; }
.line .remove:hover { color: #a3361f; }
.line .amt { min-width: 4.5em; text-align: right; font-weight: 600; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; }
.totals .grand { font-size: 1.25rem; font-weight: 700; padding-top: .5rem; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: var(--pill); padding: .45em 1.1em; cursor: pointer; font-weight: 600;
}
.chip[aria-pressed=true] { background: var(--crust); border-color: var(--crust); color: #fff; }
.chips input { width: 7em; margin: 0; display: inline-block; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.choice label {
  margin: 0; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1rem; cursor: pointer; background: #fff;
  display: flex; gap: .6rem; align-items: center;
}
.choice label:has(input:checked) { border-color: var(--crust); box-shadow: inset 0 0 0 1px var(--crust); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .row2, .choice { grid-template-columns: 1fr; } }
.ts { margin: .5rem 0 1rem; min-height: 65px; }

/* Admin */
.admin-box {
  width: min(1000px, 100%); background: #fff; border-radius: 20px; padding: clamp(1.25rem, 4vw, 2.25rem);
  box-shadow: 0 30px 90px rgba(0,0,0,.35); align-self: start; margin-block: 3vh;
}
.admin-box.login { width: min(400px, 100%); align-self: center; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-head h1 { font-size: 1.7rem; margin: 0; }
.admin-tabs { display: flex; gap: .25rem; border-bottom: 1.5px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; }
.admin-tabs button {
  border: 0; background: none; padding: .7em 1.1em; cursor: pointer; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap;
}
.admin-tabs button[aria-selected=true] { color: var(--ink); border-color: var(--crust); }
.badge { background: var(--warn); color: #fff; border-radius: 999px; font-size: .75rem; padding: .05em .55em; margin-left: .3em; }
.order { border: 1.5px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: .8rem; }
.order.fulfilled { opacity: .6; }
.order-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: baseline; }
.order-head strong { font-size: 1.1rem; }
.order ul { margin: .6rem 0; padding-left: 1.2rem; }
.order .contact { font-size: .92rem; color: var(--muted); }
.order .contact a { color: inherit; white-space: nowrap; }
.status { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.status button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .25em .8em; cursor: pointer; font-size: .85rem; font-weight: 600; }
.status button[aria-pressed=true][data-s=submitted] { background: var(--warn); border-color: var(--warn); color: #fff; }
.status button[aria-pressed=true][data-s=in_progress] { background: #2f5d8a; border-color: #2f5d8a; color: #fff; }
.status button[aria-pressed=true][data-s=fulfilled] { background: var(--ok); border-color: var(--ok); color: #fff; }
.fulfilled-list { margin-top: 1.5rem; }
.fulfilled-list summary {
  cursor: pointer; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  font-weight: 600; padding: .6rem 0; list-style-position: inside;
}
.fulfilled-list .scroll {
  max-height: min(55vh, 520px); overflow-y: auto; padding: .25rem .25rem 0 0; margin-top: .25rem;
  border-top: 1px solid var(--line); overscroll-behavior: contain;
}
.fulfilled-list .order:first-child { margin-top: .75rem; }
.ending { color: var(--warn); }
.status .done { color: var(--ok); font-weight: 700; font-size: .85rem; align-self: center; margin-right: .3rem; }
.status .undo { border-style: dashed; }
.section-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 2rem 0 .8rem; font-family: var(--sans); }
.cat { border: 1.5px solid var(--line); border-radius: 12px; padding: 1rem; margin-bottom: 1.2rem; }
.cat-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.cat-head input { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; border-color: transparent; margin: 0; }
.cat-head input:hover { border-color: var(--line); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .4rem; }
td { padding: .3rem .4rem; border-top: 1px solid var(--line); }
td input[type=text], td input[type=number] { margin: 0; padding: .4em .6em; }
td input.item-desc { margin-top: .3rem; font-size: .88rem; }
td.center, th.center { text-align: center; }
td input[type=checkbox] { width: 1.2rem; height: 1.2rem; accent-color: var(--crust); }
.table-wrap { overflow-x: auto; }
.add-row { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.add-row input { margin: 0; flex: 1; min-width: 8rem; }
.add-row input[type=number] { flex: 0 0 7rem; }
.note { border: 1.5px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: .8rem; }
.note p { white-space: pre-wrap; margin: .4rem 0 .8rem; }
.saved { color: var(--ok); font-weight: 600; margin-left: .8rem; }
.check { margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer; font-weight: 600; }
.check span { display: none; }

/* An app, not a page: no double-tap zoom, no tap flash, no text inflation in landscape. */
body.admin { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.admin-box { min-width: 0; overflow-wrap: anywhere; }
.admin-box .contact a { white-space: normal; }

/* Back office on phones */
@media (max-width: 640px) {
  /* Under 16px, iOS zooms in on focus. */
  .admin-box input, .admin-box textarea { font-size: 16px; }
  .splash:has(.admin-box) { padding: 0; place-items: start stretch; background-attachment: scroll; }
  .admin-box, .admin-box.login {
    width: 100%; margin: 0; border-radius: 0; min-height: 100vh; box-shadow: none;
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(3rem + env(safe-area-inset-bottom, 0px));
  }
  .admin-box.login { min-height: auto; margin: 1rem; width: auto; border-radius: 16px; padding: 1.5rem; }
  .splash:has(.login:not([hidden])) { place-items: center stretch; }
  .admin-head { margin-bottom: .5rem; }
  .admin-head h1 { font-size: 1.35rem; }
  .admin-tabs {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 4; background: #fff;
    margin: 0 -1rem 1rem; padding: 0 .5rem; display: grid; grid-template-columns: repeat(3, 1fr);
  }
  .admin-tabs button { padding: .8em .2em; font-size: .92rem; }

  .order { padding: .9rem; }
  .order-head { flex-direction: column; align-items: stretch; }
  .status { display: grid; grid-template-columns: repeat(3, 1fr); }
  .status:has(.undo) { display: flex; justify-content: space-between; }
  .status button { padding: .6em .3em; font-size: .85rem; }
  .order .contact { line-height: 1.8; }

  .cat { padding: .75rem; }
  .cat-head { flex-wrap: wrap; }
  .cat-head input { flex: 1 1 100%; font-size: 1.2rem; padding-inline: .3rem; }
  .table-wrap { overflow: visible; }
  .cat table, .cat tbody, .cat tr, .cat td { display: block; }
  .cat thead { display: none; }
  .cat tr[data-id] {
    display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .75rem; align-items: center;
    grid-template-areas: "name name" "offered available" "price del";
    padding: .75rem 0; border-top: 1px solid var(--line);
  }
  .cat td { border: 0; padding: 0; width: auto !important; text-align: left; }
  .cat td:nth-child(1) { grid-area: name; }
  .cat td:nth-child(2) { grid-area: price; display: flex; align-items: center; }
  .cat td:nth-child(2)::before { content: '$'; font-weight: 600; margin-right: .35rem; }
  .cat td:nth-child(3) { grid-area: offered; }
  .cat td:nth-child(4) { grid-area: available; }
  .cat td:nth-child(5) { grid-area: del; justify-self: end; }
  .cat td[colspan] { grid-column: 1 / -1; }
  .check { justify-content: flex-start; min-height: 2.5rem; }
  .check span { display: inline; font-size: .9rem; }
  td input[type=checkbox] { width: 1.4rem; height: 1.4rem; }
  .add-row input { flex: 1 1 100%; }
  .add-row input[type=number] { flex: 1 1 auto; }
  .settings .actions .btn { flex: 1 1 100%; }
}

/* Order page photos */
.banner {
  position: relative; overflow: hidden; border-radius: var(--radius); margin-bottom: 1.5rem;
  min-height: clamp(90px, 12vw, 130px); display: flex; align-items: center; color: #fff;
}
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(30,18,10,.78) 0%, rgba(30,18,10,.4) 60%, rgba(30,18,10,.1) 100%); }
.banner p { position: relative; z-index: 1; margin: 0; padding: 1rem clamp(1.1rem, 3vw, 1.75rem); max-width: 32rem; font-size: 1.15rem; font-weight: 600; }

/* Gallery: a tab that isn't a category */
.gallery-tab { border-style: dashed; background: transparent; color: var(--crust); margin-left: .4rem; }
.gallery-tab::before { content: '▦ '; }
.gallery-tab[aria-selected=true] { background: var(--crust); border: 1.5px solid var(--crust); color: #fff; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform .3s; }
.gallery button:hover img { transform: scale(1.03); }
dialog.photo { padding: 0; width: auto; max-width: min(92vw, 900px); background: none; box-shadow: none; }
dialog.photo button { padding: 0; border: 0; background: none; cursor: zoom-out; display: block; }
dialog.photo img { display: block; max-width: 100%; max-height: 88vh; border-radius: var(--radius); }
dialog.photo::backdrop { background: rgba(20, 12, 6, .85); }
@media (max-width: 640px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
}

/* Calendars: the store's day picker and the back office planner */
.calendar { margin-bottom: .5rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.cal-nav {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1.5px solid var(--line);
  background: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.cal-nav:hover { border-color: var(--crust); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; }
.cal-dow { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 600; }
.cal-day {
  height: 2.1rem; padding: 0 .1rem; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: #fff; cursor: pointer; font-weight: 600; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .1rem;
}
.cal-day:hover:not(:disabled) { border-color: var(--crust); }
.cal-day:disabled { opacity: .4; cursor: not-allowed; background: var(--cream); }
.cal-day[aria-pressed=true] { background: var(--crust); border-color: var(--crust); color: #fff; }
.cal-day.cal-edit { height: 2.7rem; }
.cal-day .cap { font-size: .6rem; font-weight: 600; color: var(--muted); line-height: 1; }
.cal-day[aria-pressed=true] .cap { color: #fff; }
.cal-day.past { opacity: .5; }
.cal-quick { display: flex; gap: .4rem; flex-wrap: wrap; margin: .75rem 0; }
.cal-caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .5rem 1rem; margin: .75rem 0; }
.cal-caps label { margin: 0; }
.cat-max { margin: 0; font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.cat-max input { width: 4.5rem; margin: 0; padding: .35em .5em; }
.order .ready { color: var(--crust); }
@media (max-width: 640px) {
  .cal-grid { gap: .2rem; }
  .cal-day { height: 2rem; font-size: .9rem; }
  .cal-day.cal-edit { height: 2.5rem; }
  .cal-day .cap { font-size: .52rem; }
  .cat-max { flex: 1 1 100%; justify-content: flex-start; }
}
.add-home { text-align: center; margin: 1.25rem 0 0; }
.linkish { background: none; border: 0; padding: .5em; color: var(--muted); font-size: .9rem; text-decoration: underline; cursor: pointer; }
.linkish:hover { color: var(--crust); }
.steps { margin: 0 0 1.25rem; padding-left: 1.2rem; line-height: 1.8; }
