@import url("/styles/tokens.css");
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  scroll-padding-bottom: 120px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(130px + env(safe-area-inset-bottom));
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: wait;
  opacity: 0.45;
}
button,
select {
  min-height: 44px;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
a {
  color: inherit;
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
button svg {
  pointer-events: none;
}
[hidden] {
  display: none !important;
}
.wrap {
  max-width: 880px;
  padding-inline: 24px;
  margin: auto;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: calc(22px + env(safe-area-inset-top));
  padding-bottom: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
  font-size: 22px;
  letter-spacing: -0.8px;
  line-height: 1.2;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.8px;
  font-weight: 600;
  margin-top: 5px;
  color: var(--muted);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 14px;
  font-family: Georgia, serif;
  font-size: 34px;
  position: relative;
}
.brand-mark span {
  position: absolute;
  right: 8px;
  bottom: 4px;
  font-size: 28px;
}
.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 25px;
  flex-shrink: 0;
}
.status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 18px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 700;
}
.heading {
  margin-bottom: 26px;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -1.8px;
  font-size: clamp(35px, 6vw, 48px);
  line-height: 1.1;
  margin: 0 0 12px;
}
h2,
h3,
p {
  margin-top: 0;
}
.heading p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 16px;
}
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.toolbar > label {
  flex: 1;
  min-width: 120px;
}
.toolbar label span {
  font-size: 11px;
  color: var(--muted);
}
.search {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 0 14px;
}
.search input {
  border: 0;
  background: none;
  padding: 12px 0;
  min-width: 0;
  width: 100%;
  outline-offset: 0;
}
.search:focus-within {
  outline: 2px solid var(--ink);
}
.search input:focus {
  outline: 0;
}
input,
select,
textarea {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 16px;
  min-width: 0;
  width: 100%;
}
select {
  padding-right: 22px;
}
textarea {
  min-height: 115px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
.segments {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin: 18px 0 12px;
}
.segments button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  flex: 1;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
}
.segments button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 18px;
  margin: 22px 0;
  overflow: hidden;
  background: var(--surface);
}
.stat {
  padding: 15px 16px;
  border-right: 1px solid var(--border);
}
.stat:last-child {
  border: 0;
}
.stat strong {
  display: block;
  font-size: 25px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-bottom: 7px;
}
.stat span {
  font-size: 11px;
  color: var(--muted);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 25px 0 12px;
}
.section-heading h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0;
}
.section-heading small {
  color: var(--muted);
}
.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.2s;
}
.item {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--wash);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.urgent .badge {
  background: var(--ink);
  color: var(--bg);
}
.soon .badge {
  border: 1px solid var(--ink);
}
.info {
  min-width: 0;
  flex: 1;
}
.info h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  font-weight: 550;
  font-size: 15px;
}
.urgent .info h3 {
  font-weight: 800;
}
.meta {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.actions button {
  background: transparent;
  border: 0;
  border-radius: 10px;
  width: 44px;
  min-width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}
.actions button:hover {
  background: var(--wash);
}
.card-footer {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0 14px 12px;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 9px;
}
.pill.solid {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.pill svg {
  width: 13px;
  height: 13px;
}
.empty {
  text-align: center;
  padding: 38px 20px;
  border: 1px dashed var(--border);
  border-radius: 22px;
  margin-top: 20px;
}
.empty > .badge {
  margin: 0 auto 16px;
  width: 54px;
  height: 54px;
  border-radius: 18px;
}
.empty h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 27px;
  margin-bottom: 8px;
}
.empty p {
  color: var(--muted);
  font-size: 13px;
  max-width: 32ch;
  margin: 0 auto 20px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 650;
  font-size: 13px;
  text-decoration: none;
}
.btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn.quiet {
  background: transparent;
  border-color: transparent;
}
.btn.small {
  padding: 7px 11px;
  font-size: 12px;
}
.fab {
  position: fixed;
  right: max(24px, calc((100vw - 832px) / 2));
  bottom: calc(94px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 8px 25px #0003;
  display: grid;
  place-items: center;
  z-index: 10;
}
.fab svg {
  width: 24px;
  height: 24px;
}
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--glass);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 8px;
}
.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  max-width: 130px;
  border: 0;
  border-radius: 14px;
  padding: 9px 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.2px;
}
.tabbar button[aria-current="page"] {
  background: var(--wash);
  color: var(--ink);
}
.tabbar button[aria-current="page"] svg {
  stroke-width: 2.4;
}
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #0006;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.24s ease;
}
.sheet {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 0 22px calc(22px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow: auto;
  overscroll-behavior: contain;
  transform: translate3d(0, 100%, 0);
  transition: transform 0.38s cubic-bezier(0.22, 0.9, 0.25, 1);
  box-shadow: 0 -15px 60px #0002;
}
.sheet-overlay.open {
  opacity: 1;
}
.sheet-overlay.open .sheet {
  transform: translate3d(0, 0, 0);
}
.sheet.dragging {
  transition: none;
}
.drag-zone {
  height: 30px;
  display: grid;
  place-items: center;
  touch-action: none;
  cursor: grab;
}
.grabber {
  width: 36px;
  height: 4px;
  background: var(--muted);
  border-radius: 8px;
  opacity: 0.4;
}
.sheet-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 16px;
}
.sheet-heading h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  margin: 0;
}
.sheet-heading .icon-button {
  border: 0;
  background: transparent;
}
.field {
  display: block;
  margin-bottom: 15px;
}
.field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field small,
.help {
  font-size: 12px;
  color: var(--muted);
}
.row {
  display: flex;
  gap: 12px;
}
.row > .field {
  flex: 1;
  min-width: 0;
}
.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.sheet-actions .primary {
  flex: 1;
}
.more-button {
  width: 100%;
  text-align: left;
  justify-content: space-between;
}
.extra-fields {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.3s cubic-bezier(0.22, 0.9, 0.25, 1),
    opacity 0.2s;
}
.extra-fields > div {
  overflow: hidden;
}
.extra-fields.expanded {
  grid-template-rows: 1fr;
  opacity: 1;
}
.extra-fields.expanded > div {
  padding-top: 16px;
}
.error {
  border: 1px solid var(--ink);
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  margin: 12px 0;
}
.toast {
  position: fixed;
  bottom: calc(95px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 14px;
  z-index: 80;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.recipe-summary {
  padding: 16px;
  list-style: none;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 80px;
}
.recipe-summary::-webkit-details-marker {
  display: none;
}
.recipe-summary .info h3 {
  font-size: 17px;
}
.recipe-body {
  padding: 0 18px 18px;
}
.recipe-body h4 {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 16px 0 8px;
}
.ingredients {
  padding: 0;
  list-style: none;
}
.ingredients li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.instructions {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.ingredient-editor {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  background: var(--surface);
}
.ingredient-editor .row {
  gap: 7px;
}
.ingredient-editor .row input {
  flex: 1;
  width: 0;
}
.ingredient-editor .row select {
  width: 90px;
}
.ingredient-editor .field {
  margin-bottom: 8px;
}
.ingredient-editor .remove-ingredient {
  border: 0;
  background: transparent;
  width: 44px;
  flex-shrink: 0;
}
.ingredient-editor .stock-link {
  font-size: 16px;
}
.checked .info h3 {
  text-decoration: line-through;
  color: var(--muted);
}
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 0 16px;
}
.week-nav strong {
  font-size: 14px;
}
.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin: 14px 0;
}
.days button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 7px 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
}
.days button strong {
  font-size: 17px;
}
.days button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}
.meal-slot {
  padding: 16px;
}
.meal-slot h3 {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.meal-slot h4 {
  font-size: 17px;
  margin: 0 0 9px;
}
.meal-slot .btn {
  width: 100%;
  margin-top: 8px;
}
.day-plan {
  display: grid;
  gap: 10px;
}
.desktop-day {
  display: none;
}
.day-title {
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  margin: 20px 0 12px;
}
.update-bar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 15px;
  border-radius: 14px;
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 12px;
  box-shadow: var(--shadow);
}
.update-bar button {
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 8px;
  white-space: nowrap;
}
.new-entry {
  animation: rise 0.35s cubic-bezier(0.22, 0.9, 0.25, 1) both;
}
.leaving {
  overflow: hidden;
  opacity: 0 !important;
  transform: translateX(-12px);
  max-height: 0 !important;
  margin: 0 !important;
  padding-block: 0 !important;
  transition:
    max-height 0.25s ease,
    opacity 0.18s,
    transform 0.25s,
    margin 0.25s,
    padding 0.25s;
}
.btn,
.icon-button,
.fab,
.tabbar button {
  transition:
    transform 0.18s cubic-bezier(0.22, 0.9, 0.25, 1),
    background-color 0.18s;
}
.btn:active,
.icon-button:active,
.fab:active,
.tabbar button:active {
  transform: scale(0.95);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (min-width: 1000px) {
  body:has(.planner-grid) .wrap {
    max-width: 1200px;
  }
  .planner-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
  }
  .desktop-day {
    display: block;
  }
  .day-plan {
    display: block;
  }
  .day-plan .meal-slot {
    margin-bottom: 10px;
    padding: 10px;
  }
  .days {
    display: none;
  }
  .day-title {
    font-size: 18px;
  }
  .meal-slot h4 {
    font-size: 14px;
  }
  .meal-slot .actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 370px) {
  .wrap {
    padding-inline: 16px;
  }
  .item {
    gap: 8px;
    padding: 11px;
  }
  .item > .badge {
    display: none;
  }
  .brand small {
    font-size: 7px;
  }
  .sheet {
    padding-inline: 16px;
  }
  .stat {
    padding: 13px 11px;
  }
  .status-line {
    font-size: 9px;
  }
  .toolbar {
    gap: 6px;
  }
  .toolbar > label {
    min-width: 100px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .sheet,
  .tabbar {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
