/* Shared product-preview UI */
.app-window {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 var(--s-4);
  background: var(--cream-200);
  border-bottom: 1px solid var(--line);
}

.window-bar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.window-url {
  margin: 0 auto;
  padding: 3px var(--s-4);
  border-radius: var(--r-full);
  background: var(--white);
  font-size: 0.75rem;
  color: var(--ink-muted);
  transform: translateX(-15px);
}

.app-body {
  padding: var(--s-5);
}

.app-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.app-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--green-800);
}

.app-meta {
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--cream-200);
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.seg-item {
  padding: 6px var(--s-3);
  border-radius: var(--r-full);
  color: var(--ink-muted);
}

.seg-item.is-active {
  background: var(--white);
  color: var(--green-800);
  box-shadow: var(--shadow-sm);
}

.mini-week {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}

.mini-day {
  display: grid;
  gap: var(--s-2);
}

.mini-day-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Meal card */
.meal-card {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2);
  border-radius: var(--r-md);
  background: var(--cream);
  border: 1px solid var(--line);
  border-left: 3px solid var(--meal-accent, var(--green-300));
  min-width: 0;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease);
}

.meal-card > div {
  min-width: 0;
}

.meal-card p {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.meal-tag {
  display: inline-block;
  margin-bottom: 2px;
  padding: 1px 6px;
  border-radius: var(--r-full);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--meal-tag-bg);
  color: var(--meal-tag-fg);
}

.meal-b { --meal-accent: var(--yellow-300); --meal-tag-bg: var(--yellow-100); --meal-tag-fg: var(--yellow-800); }
.meal-l { --meal-accent: var(--green-300); --meal-tag-bg: var(--green-100); --meal-tag-fg: var(--green-700); }
.meal-d { --meal-accent: #e7a688; --meal-tag-bg: var(--clay-100); --meal-tag-fg: var(--clay-700); }

/* Checkbox visual */
.cbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--white);
  color: var(--white);
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.cbox .icon {
  width: 12px;
  height: 12px;
}

.is-done .cbox {
  background: var(--green-800);
  border-color: var(--green-800);
}

/* Floating grocery card (hero) */
.float-grocery {
  position: absolute;
  right: -24px;
  bottom: -40px;
  width: 232px;
  padding: var(--s-4);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.float-head,
.aside-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
}

.float-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--yellow-300);
  color: var(--green-900);
}

.float-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--green-800);
}

.float-meta {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.float-cat {
  margin: var(--s-2) 0 var(--s-1);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.float-items li,
.li-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px 0;
  font-size: 0.8125rem;
  color: var(--ink);
}

.float-items em,
.li-row em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.float-items .is-done,
.li-row.is-done {
  color: var(--ink-muted);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

/* Step mockups */
.ui-card {
  width: 100%;
  max-width: 300px;
  padding: var(--s-4);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.ui-label {
  margin: var(--s-3) 0 var(--s-2);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.ui-label:first-child {
  margin-top: 0;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 0.875rem;
}

.stepper strong {
  font-weight: 600;
  color: var(--green-800);
}

.stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.chip.is-on {
  background: var(--green-800);
  border-color: var(--green-800);
  color: var(--white);
}

.cal-row {
  display: grid;
  grid-template-columns: 36px repeat(3, 1fr);
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.cal-head span {
  text-align: center;
}

.cal-row i {
  height: 26px;
  border-radius: 6px;
}

.c-b { background: var(--yellow-100); border-left: 3px solid var(--yellow-300); }
.c-l { background: var(--green-100); border-left: 3px solid var(--green-300); }
.c-d { background: var(--clay-100); border-left: 3px solid #e7a688; }

/* Interactive planner */
.planner {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.planner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}

.planner-panel {
  padding: var(--s-6);
}

.planner-split {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--s-6);
  align-items: start;
}

.week-head,
.week-row {
  display: grid;
  grid-template-columns: 64px repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  align-items: stretch;
}

.week-head {
  margin-bottom: var(--s-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.week-row + .week-row {
  margin-top: var(--s-2);
}

.week-day {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green-800);
}

.week .meal-card {
  padding: var(--s-2) var(--s-3);
}

.week .meal-card p {
  font-size: 0.875rem;
}

.week .meal-tag {
  display: none;
}

.week .meal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.week-more {
  display: none;
}

.week-aside {
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--cream);
}

.aside-cats li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-2) 0;
  font-size: 0.875rem;
  border-bottom: 1px dashed var(--line);
}

.aside-cats li:last-child {
  border-bottom: 0;
  margin-bottom: var(--s-3);
}

.aside-count {
  min-width: 28px;
  padding: 1px 8px;
  border-radius: var(--r-full);
  background: var(--green-100);
  color: var(--green-800);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 1023px) {
  .planner-split {
    grid-template-columns: 1fr;
  }

  .week-aside {
    display: none;
  }
}

@media (max-width: 767px) {
  .planner-top {
    padding: var(--s-4);
  }

  .planner-panel {
    padding: var(--s-4);
  }

  .week-head {
    display: none;
  }

  .week-row {
    grid-template-columns: 1fr;
    gap: var(--s-2);
    padding-bottom: var(--s-3);
  }

  .week-row + .week-row {
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--line);
  }

  .week .meal-tag {
    display: inline-block;
  }

  /* week-head is the first div, so n + 5 keeps Mon to Wed visible */
  .week:not(.is-expanded) .week-row:nth-of-type(n + 5) {
    display: none;
  }

  .week-more {
    display: flex;
    margin-top: var(--s-3);
  }
}
