:root {
  --bg: #fdf7f8;
  --card: #ffffff;
  --ink: #2c2a2b;
  --muted: #948b8f;
  --accent: #e8556d;
  --accent-dark: #d43f58;
  --line: #f0e6e9;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(150, 70, 85, 0.1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.hidden {
  display: none !important;
}

button {
  font: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 18px;
  padding-top: env(safe-area-inset-top);
  background: rgba(253, 247, 248, 0.86);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.5px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 85, 109, 0.16);
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 14px 18px 6px;
}

.tab {
  flex: 1;
  height: 42px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  background: #f6eef0;
  transition: 0.18s;
}

.tab.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(232, 85, 109, 0.32);
}

main {
  padding: 10px 18px 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 14px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
}

input[type="date"] {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}

.primary {
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(232, 85, 109, 0.28);
  transition: 0.18s;
}

.primary:active {
  transform: translateY(1px);
  background: var(--accent-dark);
}

.primary:disabled {
  opacity: 0.6;
}

.ghost {
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: #f3ecee;
  color: var(--ink);
  font-weight: 600;
}

.danger {
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: #fdecef;
  color: var(--accent-dark);
  font-weight: 600;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

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

.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photo {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #efe6e8;
  padding: 0;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grid.recipes {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 0;
}

.recipe-card img,
.recipe-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6eef0;
  font-size: 34px;
}

.recipe-body {
  padding: 10px 12px 12px;
}

.recipe-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}

.recipe-tags {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  margin: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 12, 14, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.viewer-del {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(30, 18, 22, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
}

.sheet h2 {
  margin: 0 0 16px;
  font-size: 19px;
}

.sheet label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.sheet input[type="text"],
.sheet textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbf7f8;
  color: var(--ink);
  resize: vertical;
}

.sheet input[type="file"] {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.cover-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 0 14px;
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.grow {
  flex: 1;
}

.err {
  margin: 12px 0 0;
  color: var(--accent-dark);
  font-size: 13px;
  min-height: 1em;
}

@media (min-width: 640px) {
  main {
    max-width: 720px;
    margin: 0 auto;
  }

  .tabs {
    max-width: 720px;
    margin: 0 auto;
  }

  .grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid.recipes {
    grid-template-columns: repeat(3, 1fr);
  }
}

.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 28px calc(24px + env(safe-area-inset-bottom));
  max-width: 420px;
  margin: 0 auto;
}

.login h1 {
  margin: 0 0 6px;
  font-size: 34px;
  letter-spacing: 2px;
}

.login .sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.login input {
  height: 50px;
  margin-bottom: 12px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}

.login .primary {
  height: 50px;
  border-radius: 14px;
  font-size: 16px;
  margin-top: 4px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.who {
  font-size: 13px;
  color: var(--muted);
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost.small {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
}

.appver {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 12px;
}

.section-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(232, 85, 109, 0.22);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.chips {
  scroll-behavior: smooth;
}

.photo {
  box-shadow: 0 2px 10px rgba(120, 60, 70, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.photo:active {
  transform: scale(0.97);
}

.recipe-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.recipe-card:active {
  transform: scale(0.98);
}

.recipe-tags {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fbeff1;
  color: var(--accent-dark);
}

/* week planner */
.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
}

.week-title-wrap {
  text-align: center;
}

.week-title {
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.today-label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f6eef0;
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:active {
  transform: scale(0.94);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}

.week-day .wd {
  font-size: 11px;
}

.week-day .dd {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.week-day.today {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(232, 85, 109, 0.28);
}

.week-day.today .dd {
  color: #fff;
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  border: 1px solid transparent;
}

.day-card.today {
  border-color: rgba(232, 85, 109, 0.35);
}

.day-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-name {
  font-weight: 700;
  font-size: 15px;
}

.day-date {
  color: var(--muted);
  font-size: 12px;
}

.day-add {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fbeff1;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}

.day-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.day-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 4px 0;
}

.meal-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  background: #fbf7f8;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.meal-pill img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.meal-pill:active {
  transform: scale(0.97);
}

/* recipe detail */
.sheet-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  font-size: 22px;
  line-height: 1;
}

.detail-sheet {
  position: relative;
}

.detail-cover {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 14px;
}

.detail-title {
  margin: 0 6px 6px 0;
  font-size: 22px;
}

.detail-tags {
  color: var(--accent-dark);
  font-size: 13px;
  margin-bottom: 12px;
}

.video-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 12px;
  background: #fb7299;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 16px;
}

.video-btn:active {
  transform: scale(0.97);
}

.detail-section h3,
.comments h3 {
  margin: 16px 0 6px;
  font-size: 15px;
}

.pre {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  font-size: 14px;
  color: #3a3638;
  margin: 0;
}

.detail-actions {
  margin: 16px 0 4px;
}

/* comments */
.comments {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.count {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 12px;
}

.comment-item {
  background: #fbf7f8;
  border-radius: 12px;
  padding: 10px 12px;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-user {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-dark);
}

.comment-time {
  color: var(--muted);
  font-size: 11px;
}

.comment-del {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  text-decoration: underline;
}

.comment-text {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 12px;
}

.comment-input {
  display: flex;
  gap: 8px;
}

.comment-input input {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbf7f8;
}

.primary.small {
  height: 42px;
  padding: 0 14px;
}

/* picker */
.picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  margin: 8px 0 4px;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.picker-item.selected {
  border-color: var(--accent);
  background: #fff5f7;
}

.picker-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: #f6eef0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex: 0 0 auto;
}

.picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.picker-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

.picker-mark {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  width: 18px;
}

.video-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(251, 114, 153, 0.95);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-card {
  position: relative;
}

.sheet {
  position: relative;
}

.sheet h2 {
  padding-right: 36px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  background: rgba(44, 42, 43, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 200;
  max-width: 80vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* today bubbles */
#tab-plan {
  display: flex;
  flex-direction: column;
}

.today-hero {
  text-align: center;
  padding: 2px 0 10px;
}

.today-kicker {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--muted);
}

.today-title {
  margin-top: 2px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--ink);
}

.today-weekday {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-dark);
}

.bubble-field {
  position: relative;
  flex: 1;
  min-height: 56vh;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #ffeef2 0%, #fdf7f8 45%, #f7eef6 100%);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.bubble-field .empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 24px;
}

.bubble {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(150, 70, 85, 0.16);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  will-change: transform;
  transform: translate(0, 0);
}

.bubble:active {
  filter: brightness(0.96);
}

.bubble img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 58%);
  pointer-events: none;
}

.bubble-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.bubble-name {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  padding: 0 8px;
  margin-bottom: 10px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shuffle-btn {
  align-self: center;
  margin: 0 0 6px;
}

/* day strip */
.day-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}

.day-strip::-webkit-scrollbar {
  display: none;
}

.day-chip {
  position: relative;
  flex: 0 0 auto;
  min-width: 52px;
  padding: 7px 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.dc-wd {
  display: block;
  font-size: 11px;
}

.dc-dd {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.dc-count {
  position: absolute;
  top: 3px;
  right: 4px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
}

.day-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.day-chip.active .dc-dd {
  color: #fff;
}

.day-chip.today {
  box-shadow: 0 0 0 2px rgba(232, 85, 109, 0.18);
}

/* slot box */
.slot-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px 12px;
  margin-bottom: 10px;
}

.slot-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slot-tab {
  padding: 7px 16px;
  border-radius: 999px;
  background: #f6eef0;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.slot-tab.active {
  background: var(--accent);
  color: #fff;
}

.slot-pick {
  margin-left: auto;
  height: 34px;
  font-size: 13px;
}

.slot-meals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.slot-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 4px 0;
}

.slot-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  background: #fbf7f8;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.slot-chip img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.slot-chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-remove {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f1e6e9;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

/* bubble field: no visible boundary */
.bubble-field {
  background: transparent;
  border: none;
  min-height: 44vh;
  margin-top: 2px;
}

.shuffle-icon {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 6;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(150, 70, 85, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.shuffle-icon:active {
  transform: scale(0.94);
}

/* type switch */
.type-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.type-opt {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  background: #f6eef0;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.type-opt.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(232, 85, 109, 0.28);
}

/* type badges */
.type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  z-index: 2;
}

.type-badge.cook {
  background: rgba(232, 85, 109, 0.92);
}

.type-badge.out {
  background: rgba(255, 153, 0, 0.95);
}

.detail-type {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.detail-type.cook {
  background: var(--accent);
}

.detail-type.out {
  background: #ff9900;
}

.meituan-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 12px;
  background: #ffc300;
  color: #2c2a2b;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 16px;
}

.meituan-btn:active {
  transform: scale(0.97);
}

/* drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(30, 18, 22, 0.35);
  transition: opacity 0.2s ease;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  width: 78%;
  max-width: 320px;
  background: var(--card);
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.18);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.drawer-brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}

.drawer-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f3ecee;
  font-size: 22px;
  line-height: 1;
}

.drawer-user {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.drawer-item {
  width: 100%;
  text-align: left;
  padding: 13px 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
}

.drawer-item:active {
  background: #fbf7f8;
}

.drawer-item.danger {
  color: var(--accent-dark);
}

.drawer-bottom {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* pending photo placeholders */
.recipe-placeholder.pending {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-dark);
  background: linear-gradient(135deg, #fdeef2, #f7dde4);
}

.bubble.pending {
  background: linear-gradient(135deg, #fdeef2, #f7dde4);
  box-shadow: inset 0 0 0 1px rgba(232, 85, 109, 0.15), 0 10px 24px rgba(150, 70, 85, 0.16);
}

.bubble.pending::after {
  display: none;
}

.bubble.pending .bubble-emoji {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.bubble.pending .bubble-name {
  color: var(--accent-dark);
  text-shadow: none;
}

.picker-thumb.pending {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 1px;
}

.detail-cover-pending {
  width: 100%;
  height: 160px;
  border-radius: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fdeef2, #f7dde4);
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  border: 1px dashed rgba(232, 85, 109, 0.35);
}

/* shopping checklist */
.shopping-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  margin: 8px 0;
}

.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #fbf7f8;
  border: 1px solid var(--line);
  font-size: 14px;
}

.shop-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.shop-item.checked span {
  color: var(--muted);
  text-decoration: line-through;
}

/* compress top content, give bubbles more room */
.today-hero {
  padding: 0 0 6px;
}

.today-title {
  font-size: 26px;
}

.today-weekday {
  font-size: 13px;
}

.day-strip {
  padding: 0 0 6px;
  gap: 5px;
}

.day-chip {
  min-width: 48px;
  padding: 5px 7px;
  border-radius: 12px;
}

.dc-dd {
  font-size: 12px;
}

.slot-box {
  padding: 8px 10px 10px;
  margin-bottom: 8px;
}

.slot-meals {
  margin-top: 8px;
}

.bubble-field {
  min-height: 48vh;
}

/* editor image grid */
.image-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.img-cell {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f6eef0;
  padding: 0;
}

.img-cell.cover {
  border-color: var(--accent);
}

.img-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-cell.pending {
  opacity: 0.9;
}

.img-cover-badge {
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

.img-empty {
  width: 100%;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* detail gallery */
.detail-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  margin: -4px 0 8px;
  scrollbar-width: none;
}

.detail-gallery::-webkit-scrollbar {
  display: none;
}

.gallery-thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  background: #f6eef0;
  padding: 0;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb:active {
  transform: scale(0.96);
}

/* compact header + more bubble room */
.today-hero {
  padding: 0 0 4px;
  text-align: center;
}

.today-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.day-strip {
  padding: 0 0 4px;
}

.day-chip {
  min-width: 46px;
  padding: 4px 6px;
}

.dc-wd {
  font-size: 10px;
}

.dc-dd {
  font-size: 12px;
}

.dc-count {
  min-width: 13px;
  height: 13px;
  font-size: 9px;
  line-height: 13px;
}

.slot-box {
  padding: 7px 9px 9px;
  margin-bottom: 6px;
}

.slot-meals {
  margin-top: 6px;
}

.bubble-field {
  flex: 1;
  min-height: 52vh;
}

/* photo date selector */
.date-btn {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
}

.date-btn.today {
  color: var(--accent-dark);
}

.date-native {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.image-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.image-hint {
  font-size: 12px;
  color: var(--muted);
}

/* fix image picker layout */
.image-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.image-picker .ghost.small {
  flex: 0 0 auto;
  white-space: nowrap;
}

.image-hint {
  flex: 1 1 140px;
  min-width: 120px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  white-space: normal;
  word-break: normal;
}

.ghost.small,
.drawer-item,
.slot-tab {
  white-space: nowrap;
}

.image-picker input[type="file"] {
  display: none !important;
}

.dc-dd {
  white-space: nowrap;
}

.today-hero {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  padding: 0 0 4px;
}

.today-year {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-dark);
  background: #fbeff1;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.4;
}

.today-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* harmonious year label */
.today-year {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  padding: 0;
  border-radius: 0;
  line-height: 1.4;
}

.today-title {
  color: var(--ink);
}

/* pull-all progress bar */
.pull-progress {
  height: 6px;
  border-radius: 999px;
  background: #f1e6e9;
  overflow: hidden;
  margin: 0 0 10px;
}

.pull-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #f07a8d, #e8556d);
  transition: width 0.2s ease;
}

.today-hero {
  align-items: center;
}

.hero-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: #f6eef0;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-icon:active {
  transform: scale(0.94);
}

.hero-today {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
  background: #fbeff1;
  padding: 3px 9px;
  border-radius: 999px;
}

.pull-stats {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}

.hero-icon,
.hero-today {
  flex: 0 0 auto;
  white-space: nowrap;
}

.today-title,
.today-year {
  white-space: nowrap;
}

.image-picker input[type="file"] {
  display: block !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.add-image-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
