:root {
  color-scheme: light;
  --ink: #222523;
  --muted: #667067;
  --paper: #fbfaf4;
  --panel: #ffffff;
  --line: #d9ddd2;
  --terminal: #151817;
  --acid: #dff26a;
  --mint: #78d6a3;
  --berry: #a8577e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
a { color: inherit; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 244, .92);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 800; text-decoration: none; }
.site-header nav { display: flex; gap: 12px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.page { max-width: 1040px; margin: 0 auto; padding: 28px 16px 56px; }
.hero-machine {
  min-height: 68vh;
  border-radius: 8px;
  padding: clamp(24px, 6vw, 64px);
  background:
    radial-gradient(circle at 74% 30%, rgba(223, 242, 106, .28), transparent 22%),
    linear-gradient(135deg, #17201c, #252923 58%, #151817);
  color: #f8f4df;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--acid);
  text-transform: uppercase;
  font-size: 12px;
}
h1 { font-size: clamp(42px, 8vw, 84px); line-height: .95; margin: 0 0 18px; }
p { line-height: 1.7; }
.primary-action, button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--acid);
  color: #1b1d18;
  font-weight: 800;
  text-decoration: none;
  width: fit-content;
  cursor: pointer;
}
.primary-action {
  display: inline-flex;
  align-items: center;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.secondary-link {
  color: inherit;
  font-weight: 800;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--panel);
}
.narrow { max-width: 520px; margin: 0 auto; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
.icon-picker-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.icon-picker-field input {
  min-width: 0;
}
.emoji-palette {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 6px;
  width: min(278px, calc(100vw - 48px));
  max-height: 304px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(27, 29, 24, .18);
}
.emoji-palette[hidden] { display: none; }
.icon-picker-toggle {
  justify-self: start;
  width: auto;
  min-height: 44px;
  margin-top: 0;
  padding: 9px 12px;
  white-space: nowrap;
  border: 2px solid #1f2c22;
  border-radius: 8px;
  background: #ecf2ea;
  color: #244b35;
}
.emoji-choice {
  width: 34px;
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.error { color: #a83232; font-weight: 700; }
.inline-form { display: inline-flex; align-items: center; gap: 10px; }
.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
}

.section-head { margin-bottom: 22px; }
.section-head--compact { margin-bottom: 14px; }
.section-head h1,
.section-head h2 {
  margin-bottom: 10px;
}
.section-head p {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
}
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.slot-item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  display: grid;
  gap: 12px;
  align-content: start;
}
.slot-item-card.is-muted { opacity: .6; }
.slot-item-card__top {
  display: flex;
  gap: 10px;
  align-items: center;
}
.item-icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: #f4f1e2;
  border-radius: 8px;
}
.item-category,
.item-meta,
.item-notes,
.label-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.slot-item-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}
.nutrition-note {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.nutrition-note ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.card-actions form { display: inline; }
.ingredient-edit {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.ingredient-edit summary {
  cursor: pointer;
  width: max-content;
  list-style: none;
}
.ingredient-edit summary::-webkit-details-marker {
  display: none;
}
.ingredient-edit-form {
  margin-top: 12px;
}
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkbox-field input {
  width: auto;
}
.secondary-button,
.danger-button {
  width: auto;
  padding: 10px 14px;
  border-radius: 8px;
}
.secondary-button {
  background: #ecf2ea;
  color: #244b35;
}
.danger-button {
  background: #f7e5e5;
  color: #8d2f2f;
}
.inventory-panel { margin-bottom: 22px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.form-grid label:has(textarea) {
  grid-column: 1 / -1;
}
.form-note {
  grid-column: 1 / -1;
  margin: 4px 0 -4px;
}
.form-grid button {
  justify-self: start;
}
.textarea-field textarea {
  min-height: 96px;
  resize: vertical;
}
.base-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid #d8e2d8;
  border-radius: 999px;
  padding: 8px 12px;
  background: #edf5ef;
  color: #285c48;
  font-size: 14px;
}
.chip strong { font-weight: 800; }
.chip span { color: inherit; }
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
}

.slot-machine {
  border: 1px solid #26312b;
  border-radius: 8px;
  padding: clamp(20px, 5vw, 44px);
  background: #151817;
  color: #f8f4df;
}

.slot-machine .section-head p {
  color: #bcc5b6;
}

.spin-stage {
  min-height: calc(100svh - 120px);
  display: grid;
  align-content: center;
  gap: 16px;
}

.spin-stage .smoothie-cabinet {
  width: min(100%, 920px);
}

.spin-stage__fallback {
  margin: 0 auto;
  text-align: center;
}

.slot-empty {
  border-color: #2d3831;
  color: #e2e6dc;
  background: rgba(255, 255, 255, 0.03);
}

.slot-form {
  display: grid;
  gap: 18px;
}

.slot-rule-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(242, 201, 76, .45);
  border-radius: 8px;
  background: rgba(242, 201, 76, .12);
  color: #f8fbf4;
  font-size: 14px;
  line-height: 1.6;
}

.panel .slot-rule-note {
  color: var(--ink);
  background: #fff8d8;
}

.guest-slot {
  display: grid;
  gap: 18px;
}

.guest-form-section {
  display: grid;
  gap: 14px;
  border: 1px solid #2f3932;
  border-radius: 8px;
  padding: 16px;
}

.guest-inventory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guest-inventory-toolbar h2,
.guest-inventory-toolbar p {
  margin: 0;
}

.guest-inventory-toolbar p,
.guest-fixed-unit {
  color: #bcc5b6;
}

.guest-add-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  display: grid;
  place-items: center;
}

.guest-ingredient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.guest-ingredient-row {
  border: 1px solid #2f3932;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.guest-ingredient-row--empty input::placeholder {
  color: rgba(248, 244, 223, 0.34);
}

.guest-ingredient-row--empty input {
  caret-color: var(--acid);
}

.guest-ingredient-row legend {
  padding: 0 6px;
  color: var(--acid);
  font-weight: 800;
}

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

.slot-field-grid label {
  color: #f8f4df;
}

.slot-field-grid label:has(.guest-fixed-unit) {
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 6px;
  align-items: end;
}

.slot-field-grid label:has(.guest-fixed-unit) > input[name="liquid_base_amount"] {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

.slot-field-grid label:has(.guest-fixed-unit) > .guest-fixed-unit {
  grid-column: 2;
  grid-row: 2;
  white-space: nowrap;
  margin-bottom: 12px;
}

.guest-fixed-unit {
  font-size: 14px;
  font-weight: 600;
}

.slot-machine input,
.slot-machine select {
  background: #f7f5e7;
  color: #1b1d18;
  border-color: #2f3932;
}

.slot-machine input::placeholder {
  color: rgba(27, 29, 24, 0.34);
}

.slot-preview-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #2f3932;
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(11, 13, 12, 0.4);
}

.slot-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.slot-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid #38453d;
  border-radius: 8px;
  background: rgba(248, 244, 223, 0.06);
}

.slot-option__icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f8f4df;
  color: #151817;
  font-size: 20px;
}

.slot-option__name {
  color: #f8f4df;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.slot-reels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid #2f3932;
  border-radius: 8px;
  background:
    radial-gradient(circle at top, rgba(223, 242, 106, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(10, 12, 11, 0.9), rgba(30, 35, 31, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.slot-reel {
  min-height: 132px;
  padding: 14px 10px;
  display: grid;
  gap: 10px;
  place-items: center;
  border: 1px solid #465246;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #1d221f 0%, #101311 16%, #242b26 100%);
  color: #f8f4df;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 18px rgba(0, 0, 0, 0.22);
}

.slot-reel__icon {
  font-size: 32px;
  line-height: 1;
}

.slot-reel__label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.slot-reel.is-spinning {
  transform: translateY(-3px);
  opacity: 0.82;
}

.slot-reel.is-final {
  border-color: var(--acid);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 2px rgba(223, 242, 106, 0.35),
    0 12px 20px rgba(0, 0, 0, 0.26);
}

.smoothie-cabinet {
  --cabinet-red: #e70d24;
  --cabinet-pink: #f5a6c9;
  --cabinet-metal: #e7ece8;
  --cabinet-shadow: #343a37;
  max-width: 860px;
  margin: 12px auto 22px;
  padding: clamp(12px, 3vw, 22px);
  border: 1px solid #b9c2bc;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(210,219,214,.96)),
    var(--cabinet-metal);
  box-shadow: 0 20px 36px rgba(0,0,0,.18), inset 0 0 0 2px rgba(255,255,255,.55);
}

.smoothie-cabinet--static {
  box-shadow: 0 12px 24px rgba(0,0,0,.12), inset 0 0 0 2px rgba(255,255,255,.55);
}

.cabinet-marquee {
  min-height: 72px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid #2e312f;
  border-radius: 8px;
  background: var(--cabinet-red);
  color: #ffdfe6;
  text-align: center;
  letter-spacing: 0;
  font-size: clamp(24px, 5vw, 44px);
  line-height: 1;
}

.cabinet-marquee strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cabinet-light {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  justify-self: center;
  background: #ffd34d;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.18);
}

.cabinet-light.is-lit {
  box-shadow: 0 0 18px rgba(255, 211, 77, .9), inset 0 -4px 0 rgba(0,0,0,.16);
}

.cabinet-face {
  display: grid;
  grid-template-columns: minmax(54px, 78px) minmax(0, 1fr) minmax(54px, 78px);
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: var(--cabinet-pink);
  border: 2px solid #6f6268;
}

.cabinet-meter {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 72px;
  border-radius: 8px;
  background: #171b18;
  color: #ff3d53;
  font-size: 11px;
  font-weight: 900;
}

.cabinet-meter strong {
  color: #ffd34d;
  font-size: 22px;
}

.cabinet-reel-window {
  min-width: 0;
  overflow: hidden;
  border: 4px solid #4f5130;
  border-radius: 8px;
  background: #fff8e7;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.65);
}

.cabinet-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 64px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #f9fbf8, #cfd7d1);
}

.cabinet-lever {
  width: 22px;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2b201f, #111);
  transform: rotate(18deg);
}

.cabinet-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f5a6c9;
  border: 4px solid #574c50;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.45);
}

.cabinet-button--lit {
  background: #dfef44;
}

.result-reveal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 8px;
}

.result-reel {
  min-height: 128px;
  overflow: hidden;
  border: 1px solid #d8c681;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,247,216,.96)),
    #fff8e7;
  color: #1f241f;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.smoothie-cabinet--static .result-reel {
  min-height: 104px;
}

.result-reel__track {
  display: grid;
  gap: 8px;
  font-size: 28px;
  line-height: 1;
  opacity: 0;
  transform: translateY(-18px);
}

.result-reel.is-spinning .result-reel__track {
  opacity: .8;
  animation: reel-roll .26s linear infinite;
}

.result-reel.is-final .result-reel__track {
  display: none;
}

.result-reel__icon {
  font-size: 30px;
  line-height: 1;
}

.result-reel__label {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.result-reel.is-spinning {
  transform: translateY(-2px);
  filter: brightness(1.2);
}

.result-reel.is-final {
  border-color: #f2c94c;
  box-shadow: 0 0 0 2px rgba(242, 201, 76, .2), 0 10px 24px rgba(0,0,0,.18);
}

@keyframes reel-roll {
  from { transform: translateY(-24px); }
  to { transform: translateY(18px); }
}

@media (max-width: 640px) {
  .cabinet-face {
    grid-template-columns: 1fr;
  }

  .cabinet-meter {
    min-height: 46px;
  }

  .result-reveal {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  }
}

.slot-machine button,
.result-actions button {
  justify-self: start;
}

.recipe-list {
  display: grid;
  gap: 14px;
}

.recipe-card {
  text-decoration: none;
  color: inherit;
  align-items: start;
}

.recipe-card__body {
  display: grid;
  gap: 8px;
}

.recipe-card h2 {
  margin: 0;
  font-size: 18px;
}

.timeline-toolbar {
  margin-bottom: 18px;
  align-items: end;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-card {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.timeline-card__body {
  display: grid;
  gap: 8px;
  align-content: start;
}

.timeline-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.timeline-card h2 a {
  text-decoration: none;
}

.timeline-card p {
  margin: 0;
}

.timeline-card__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.like-form {
  display: inline;
}

.like-button {
  width: auto;
  padding: 9px 12px;
  border-radius: 8px;
  background: #ecf2ea;
  color: #244b35;
}

.like-button.is-liked {
  background: #f8d8e8;
  color: #7a2852;
}

.post-publish-form,
.share-link-panel {
  display: grid;
  gap: 12px;
}

.timeline-detail blockquote {
  margin: 14px 0;
}

.recipe-thumb,
.recipe-photo {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

.recipe-thumb {
  aspect-ratio: 16 / 9;
}

.recipe-photo {
  max-height: 420px;
}

.recipe-detail {
  display: grid;
  gap: 18px;
}

.public-recipe {
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 5vw, 40px);
  background: #fff;
  display: grid;
  gap: 18px;
}

.recipe-detail .base-list {
  margin-bottom: 0;
}

.recipe-ingredients {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.recipe-ingredients li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.recipe-edit-panel {
  display: grid;
  gap: 18px;
}

.recipe-item-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.recipe-item-editor legend {
  padding: 0 6px;
  font-weight: 800;
}

.recipe-item-editor__row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(92px, 140px) minmax(80px, 120px);
  gap: 10px;
  align-items: end;
}

.recipe-item-editor__row > span {
  align-self: center;
  font-weight: 700;
}

.recipe-edit-panel button {
  justify-self: start;
}

@media (max-width: 620px) {
  .search-form,
  .timeline-card {
    grid-template-columns: 1fr;
  }

  .recipe-item-editor__row {
    grid-template-columns: 1fr 1fr;
  }

  .recipe-item-editor__row > span {
    grid-column: 1 / -1;
  }
}

.recipe-detail blockquote {
  margin: 0;
  padding-left: 14px;
  border-left: 4px solid var(--mint);
  color: var(--muted);
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 5vw, 40px);
  background: #fff;
  display: grid;
  gap: 18px;
}

.guest-result {
  max-width: 820px;
  margin: 0 auto;
}

.guest-save-panel {
  display: grid;
  gap: 12px;
}

.guest-save-panel h2,
.guest-save-panel p {
  margin: 0;
}

.result-summary {
  margin: 0;
  color: var(--muted);
}

.result-section h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.result-ingredients,
.nutrition-lines {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.result-ingredients li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.share-actions {
  margin: 0;
}

.public-copy,
.public-disclaimer {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  gap: 14px;
  color: var(--muted);
}

.site-footer a {
  text-decoration: none;
}
