:root {
  --ink: #302b24;
  --muted: #756f63;
  --paper: #f3ead7;
  --paper-light: #fbf4e5;
  --note: #fff8d8;
  --tape: #eadcaa;
  --pencil: #5c554c;
  --olive: #667348;
  --olive-dark: #4f5f35;
  --line: rgba(76, 66, 52, 0.2);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Hiragino Sans GB", "PingFang SC", "Songti SC", serif;
  background:
    radial-gradient(circle at 14% 18%, rgba(121, 98, 59, 0.07) 0 1px, transparent 1.5px),
    radial-gradient(circle at 80% 40%, rgba(121, 98, 59, 0.05) 0 1px, transparent 1.5px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 38%, rgba(126, 102, 62, 0.04)),
    var(--paper);
  background-size: 13px 13px, 17px 17px, auto, auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.topbar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 22px 14px;
}

.kicker,
.eyebrow {
  margin: 0 0 8px;
  color: var(--olive);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 500;
  line-height: 1.05;
}

.daily-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 15px;
}

.layout {
  max-width: 1120px;
  margin: 0 auto 42px;
  padding: 0 22px;
}

.sidebar {
  position: relative;
  display: flex;
  gap: 8px;
  padding: 12px 0 0;
  margin-top: 12px;
  margin-bottom: 0;
  background: transparent;
  overflow-x: auto;
}

.nav-button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  padding: 6px 9px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: 0.78;
}

.nav-button.active {
  background: transparent;
  color: var(--olive);
}

.content {
  padding: clamp(12px, 3vw, 24px);
  border: 1px solid rgba(86, 74, 58, 0.16);
  border-radius: 3px;
  background:
    linear-gradient(rgba(94, 79, 58, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent),
    var(--paper-light);
  background-size: 100% 31px, auto, auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.fridge-note {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(240px, 1.05fr);
  gap: 18px;
  margin: 4px 0 22px;
}

.fridge-note > div,
.lottery-note,
.memo-panel,
.week-board-section {
  border: 1px solid rgba(87, 75, 57, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 248, 216, 0.72);
}

.fridge-note > div {
  padding: 16px 18px;
  transform: rotate(-0.7deg);
}

.fridge-note .picked-note {
  transform: rotate(0.5deg);
  background: rgba(250, 241, 203, 0.86);
}

.fridge-note h2,
.lottery-note h2,
.hand-section h2,
.memo-panel h2,
.week-board-section h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 500;
}

.fridge-note p,
.lottery-note p,
.week-board-section p {
  margin-bottom: 0;
  color: var(--pencil);
  line-height: 1.7;
}

.lottery-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 22px;
  background: rgba(255, 252, 230, 0.86);
}

.hand-section {
  margin-top: 24px;
}

.hand-section > h2 {
  display: inline-block;
  margin-left: 8px;
  padding-bottom: 2px;
  border-bottom: 2px solid rgba(95, 84, 64, 0.3);
}

.section-head {
  margin: 22px 0 14px;
}

.section-head h2 {
  font-family: Georgia, "Songti SC", serif;
  font-weight: 500;
}

.ghost-button,
.primary-button,
.card-actions button,
.new-dish-form input,
.new-dish-form select,
.new-dish-form textarea,
#categoryFilter {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 242, 0.75);
  color: var(--ink);
  min-height: 42px;
}

.ghost-button,
.primary-button,
.card-actions button {
  padding: 10px 14px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.ghost-button {
  color: var(--olive);
  background: transparent;
}

.primary-button,
.card-actions [data-action="add"] {
  border: 0;
  background: var(--tape);
  color: var(--ink);
}

.ghost-button:hover,
.primary-button:hover,
.card-actions button:hover {
  transform: none;
  box-shadow: none;
}

.card-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px 16px;
}

.dish-card {
  width: min(31%, 310px);
  min-width: 210px;
  border: 1px solid rgba(71, 61, 48, 0.16);
  border-radius: 3px;
  background: #fffaf0;
  box-shadow: none;
  overflow: visible;
  padding: 10px 10px 12px;
  transform: rotate(var(--tilt, -1deg));
  position: relative;
}

.dish-card[draggable="true"] {
  cursor: grab;
}

.dish-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 34%;
  width: 74px;
  height: 19px;
  background: rgba(232, 215, 168, 0.72);
  transform: rotate(2deg);
}

.dish-image,
.dialog-image,
.shopping-thumb {
  background-position: center;
  background-size: cover;
}

.dish-image {
  aspect-ratio: 4 / 3.3;
  min-height: 0;
  position: relative;
  margin: 0 0 10px;
  border-radius: 0;
  border: 6px solid #fffdf4;
}

.dish-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(44, 48, 37, 0.16));
}

.dish-body {
  padding: 0 2px;
}

.dish-meta {
  display: none;
}

.dish-card h3 {
  margin: 0 0 4px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 500;
}

.dish-card p {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.tag-row {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(111, 127, 79, 0.16);
  border-radius: 999px;
  background: var(--leaf);
  color: var(--olive-dark);
  font-size: 12px;
}

.tag.warn {
  background: #f8ecdb;
  color: #94734d;
}

.dish-time {
  display: none;
}

.card-actions {
  display: inline-flex;
  gap: 8px;
}

.card-actions button {
  min-height: auto;
  border: 0;
  padding: 5px 8px;
  font-size: 14px;
  transform: rotate(-1deg);
}

.card-actions [data-action="fav"] {
  display: inline-flex;
  width: 32px;
  color: transparent;
  position: relative;
  background: transparent;
}

.card-actions [data-action="fav"]::after {
  content: "❤️";
  color: var(--ink);
  position: absolute;
  inset: 4px 0 auto;
}

.lottery-link {
  border: 0;
  background: transparent;
  color: var(--olive);
  font-family: "Songti SC", Georgia, serif;
  font-size: 18px;
  text-decoration: underline;
  text-underline-offset: 5px;
  transform: rotate(-2deg);
}

.tiny-link {
  border: 0;
  background: transparent;
  color: var(--olive);
  padding: 0 3px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-button {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 1px solid rgba(107, 123, 91, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--olive);
  padding: 7px 12px;
  font-size: 13px;
}

.account-button:hover,
.auth-tabs button:hover {
  background: rgba(107, 123, 91, 0.08);
}

.auth-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid rgba(48, 43, 36, 0.08);
  border-radius: 999px;
  background: #faf8f2;
}

.auth-tabs button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  font-size: 13px;
}

.auth-tabs button.active {
  background: #ffffff;
  color: var(--olive-dark);
}

.auth-message {
  min-height: 20px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-message.error {
  color: #9b3d31;
}

.account-actions {
  gap: 12px;
  align-items: center;
}

.delete-link {
  color: #9b3d31;
}

.random-helper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 16px;
  align-items: center;
  margin: 24px 0 10px;
  padding: 12px 14px;
  border: 1px dashed rgba(87, 75, 57, 0.24);
  border-radius: 4px;
  background: rgba(255, 248, 216, 0.45);
  transform: rotate(0.2deg);
}

.random-helper h2 {
  margin: 0 0 3px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  font-weight: 500;
}

.random-helper p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.global-search-panel {
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid rgba(48, 43, 36, 0.08);
  border-radius: 12px;
  background: #ffffff;
}

.global-search-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.global-search-panel input {
  width: 100%;
  border: 1px solid rgba(48, 43, 36, 0.1);
  border-radius: 12px;
  background: #faf8f2;
  color: var(--ink);
  padding: 8px 11px;
  font-size: 15px;
}

.search-results {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.search-results h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 22px;
  font-weight: 500;
}

.search-result-group {
  display: grid;
  gap: 9px;
}

.search-result-group h3 {
  margin: 0;
  color: var(--olive-dark);
  font-size: 15px;
  font-weight: 500;
}

.search-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.search-empty {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.blind-box-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.blind-box-card {
  padding: 13px 14px;
  border: 1px solid rgba(48, 43, 36, 0.08);
  border-radius: 12px;
  background: #ffffff;
}

.blind-box-card h3 {
  margin-bottom: 9px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 19px;
  font-weight: 500;
}

.blind-box-lines {
  display: grid;
  gap: 6px;
}

.blind-box-lines p {
  display: grid;
  grid-template-columns: minmax(78px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  margin: 0;
  font-size: 13px;
}

.blind-box-lines span {
  color: var(--muted);
}

.blind-box-lines .tiny-link {
  text-align: left;
}

.random-score,
.blind-box-advice {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.blind-box-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.image-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.image-choice-row .tiny-link:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.image-status {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.image-status.error {
  color: #9b3d31;
}

.image-import-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(48, 43, 36, 0.16);
  border-radius: 12px;
  background: #ffffff;
}

.image-import-panel.drag-over {
  border-color: rgba(107, 123, 91, 0.55);
  background: #faf8f2;
}

.image-import-panel h3 {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 500;
}

.image-import-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.image-import-button input {
  display: none;
}

.image-import-result {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
}

.image-import-result .warn {
  color: #9b3d31;
}

.home-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.memo-panel,
.week-board-section,
.library-item,
.note-item,
.shopping-group,
.nutrition-item,
.recommend-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 248, 216, 0.68);
  box-shadow: none;
}

.memo-panel,
.week-board-section {
  padding: 18px;
}

.memo-panel {
  background: rgba(247, 235, 199, 0.82);
  transform: rotate(0.7deg);
}

.recommend-list,
.library-list,
.note-list {
  display: grid;
  gap: 10px;
}

.library-group {
  display: grid;
  gap: 12px;
}

.library-group + .library-group {
  margin-top: 22px;
}

.library-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.library-group-head h2,
.library-group > h2 {
  margin: 8px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  font-weight: 500;
}

.library-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(48, 43, 36, 0.08);
  border-radius: 12px;
  background: #ffffff;
}

.library-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.library-section-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.library-section-head h3 span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.library-section-head > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.library-section-items {
  display: grid;
  gap: 8px;
}

.recommend-item {
  padding: 10px 12px;
  background: rgba(255, 252, 230, 0.72);
}

.recommend-item h3,
.library-item h3,
.shopping-group h3,
.note-item h3 {
  margin-bottom: 5px;
  font-size: 18px;
}

.recommend-item p,
.library-item p,
.note-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.week-board-section {
  margin-top: 24px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.26), transparent),
    rgba(240, 226, 195, 0.8);
}

.week-board {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  padding: 8px 0 4px;
}

.day-column {
  width: min(170px, 45%);
  min-width: 130px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff8de;
  transform: rotate(var(--wall-tilt, 1deg));
}

.day-column h3 {
  margin-bottom: 4px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
  font-weight: 500;
}

.day-column p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mini-photo {
  aspect-ratio: 4 / 3;
  margin-bottom: 7px;
  border: 4px solid #fffdf4;
  background-size: cover;
  background-position: center;
}

.meal-slot {
  min-height: 70px;
  padding: 9px;
  border: 1px dashed rgba(111, 127, 79, 0.28);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.75);
  margin-top: 8px;
}

.meal-slot.drag-over {
  background: var(--leaf);
}

.slot-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.slot-dish {
  color: var(--olive-dark);
  font-weight: 700;
  line-height: 1.35;
}

.library-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 15px;
}

.shopping-board {
  display: block;
  max-width: 680px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    linear-gradient(rgba(73, 65, 50, 0.08) 1px, transparent 1px),
    #fff8dc;
  background-size: 100% 32px;
}

.shopping-group {
  padding: 4px 0 18px;
  border: 0;
  background: transparent;
}

.shopping-group label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  color: var(--pencil);
  font-size: 17px;
}

.shopping-thumb {
  display: none;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 16px;
}

.nutrition-item {
  padding: 16px;
  text-align: center;
}

.nutrition-ring {
  width: 104px;
  height: 104px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--olive) var(--ring), #edf0e5 0);
}

.nutrition-ring span {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fffdf7;
  color: var(--olive-dark);
  font-weight: 700;
}

.nutrition-item strong {
  display: block;
  color: var(--olive-dark);
  font-size: 16px;
}

.nutrition-item p {
  margin: 5px 0 0;
  color: var(--muted);
}

.meter {
  display: none;
}

.new-dish-form {
  display: grid;
  gap: 12px;
}

.new-dish-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.new-dish-form input,
.new-dish-form select,
.new-dish-form textarea,
#categoryFilter {
  width: 100%;
  padding: 10px 12px;
}

.new-dish-form {
  max-width: 760px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.photo-uploader {
  min-height: 230px;
  border: 1px dashed rgba(111, 127, 79, 0.32);
  border-radius: var(--radius);
  background: var(--cream);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.photo-uploader input {
  display: none;
}

#photoPreview {
  width: 100%;
  min-height: 230px;
  display: grid;
  place-items: center;
  background-position: center;
  background-size: cover;
  color: var(--olive-dark);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.empty {
  color: var(--muted);
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.58);
}

.dish-dialog {
  width: min(720px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #fffdf7;
  box-shadow: 0 28px 80px rgba(61, 56, 39, 0.25);
  overflow: hidden;
}

.dish-dialog::backdrop {
  background: rgba(55, 53, 42, 0.28);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.9);
  color: var(--ink);
  font-size: 24px;
}

.dialog-image {
  aspect-ratio: 4 / 2;
}

.dialog-content {
  padding: 22px;
}

.dialog-content h2 {
  margin-bottom: 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 34px;
}

.kitchen-brief {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  align-items: center;
  gap: 6px 16px;
  padding: 8px 76px 7px 16px;
  margin-bottom: 6px;
  border: 1px solid rgba(87, 75, 57, 0.18);
  border-radius: 5px;
  background:
    linear-gradient(rgba(82, 72, 55, 0.055) 1px, transparent 1px),
    rgba(255, 249, 221, 0.86);
  background-size: 100% 28px;
  transform: rotate(-0.25deg);
}

.kitchen-brief h1 {
  margin-bottom: 2px;
  font-size: clamp(27px, 3.5vw, 40px);
  line-height: 1.08;
}

.kitchen-brief h2 {
  margin: 0 0 4px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
  font-weight: 500;
}

.brief-main {
  align-self: start;
}

.brief-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(200px, 1fr);
  gap: 12px;
  align-items: start;
}

.brief-bottom > div {
  padding: 8px 10px;
  border-top: 1px dashed rgba(83, 73, 55, 0.2);
}

.brief-bottom p {
  margin: 0;
  color: var(--pencil);
  line-height: 1.55;
}

.draw-box p {
  font-family: "Songti SC", Georgia, serif;
  font-size: 20px;
}

.fridge-note,
.lottery-note {
  display: none;
}

.dish-image {
  aspect-ratio: 4 / 2.65;
  margin: 0 auto 9px;
  width: 92%;
  border: 5px solid #fffdf4;
  transform: rotate(var(--photo-tilt, 0.6deg));
}

.dish-card:nth-child(2n) .dish-image {
  --photo-tilt: -0.8deg;
}

.dish-card:nth-child(3n) .dish-image {
  --photo-tilt: 1.2deg;
}

.dish-card p {
  display: none;
}

.tag-row {
  display: none;
  gap: 5px;
  margin: 5px 0 8px;
}

.dish-card:hover .tag-row,
.dish-card:focus-within .tag-row,
.dialog-content .tag-row {
  display: flex;
}

.tag {
  min-height: 22px;
  padding: 2px 6px;
  border: 0;
  border-radius: 3px;
  background: rgba(235, 222, 177, 0.74);
  color: var(--pencil);
  font-size: 12px;
}

.dish-time {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.card-actions button,
.card-actions [data-action="fav"] {
  display: inline-flex;
  width: auto;
  min-height: auto;
  padding: 4px 7px;
  border: 0;
  border-radius: 3px;
  background: rgba(232, 215, 168, 0.74);
  color: var(--ink);
  font-size: 13px;
  position: static;
}

.card-actions [data-action="fav"]::after {
  content: none;
}

.card-actions [data-action="schedule"] {
  background: rgba(218, 226, 190, 0.72);
}

.schedule-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff8dc;
  box-shadow: none;
  overflow: hidden;
}

.schedule-dialog::backdrop {
  background: rgba(55, 53, 42, 0.24);
}

.schedule-days {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.schedule-days button {
  border: 1px solid rgba(76, 66, 52, 0.18);
  border-radius: 4px;
  background: rgba(232, 215, 168, 0.72);
  color: var(--ink);
  padding: 9px 10px;
}

.card-actions [data-action="add"] {
  background: rgba(239, 226, 181, 0.94);
}

.hand-section > h2 {
  font-size: clamp(21px, 2.6vw, 30px);
}

.memo-panel .note-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px;
}

.memo-panel input {
  border: 0;
  border-bottom: 1px solid rgba(75, 67, 54, 0.28);
  background: transparent;
  color: var(--pencil);
  font-family: "Songti SC", Georgia, serif;
  font-size: 17px;
  min-width: 0;
}

.memo-day {
  text-align: right;
}

.card-grid .dish-card:nth-child(2n) {
  --tilt: 1.1deg;
  margin-top: 18px;
}

.card-grid .dish-card:nth-child(3n) {
  --tilt: -1.6deg;
  width: min(34%, 330px);
}

.card-grid .dish-card:nth-child(4n) {
  --tilt: 0.4deg;
  margin-top: 7px;
}

.week-board .day-column:nth-child(2n) {
  --wall-tilt: -1.1deg;
}

.week-board .day-column:nth-child(3n) {
  --wall-tilt: 1.6deg;
}

.memo-panel .note-item {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 8px 0;
  border: 0;
  background: transparent;
}

.memo-panel .note-item h3,
.memo-panel .note-item p {
  margin: 0;
}

.memo-panel .note-item h3 {
  min-width: 70px;
  font-family: "Songti SC", Georgia, serif;
  font-weight: 500;
}

.memo-panel .note-item p {
  color: var(--pencil);
  font-size: 17px;
}

.memo-panel .note-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px;
  align-items: baseline;
}

.memo-panel input {
  border: 0;
  border-bottom: 1px solid rgba(75, 67, 54, 0.28);
  background: transparent;
  color: var(--pencil);
  font-family: "Songti SC", Georgia, serif;
  font-size: 17px;
  min-width: 0;
}

.memo-day {
  text-align: right;
}

@media (max-width: 860px) {
  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .fridge-note,
  .kitchen-brief,
  .brief-bottom,
  .home-panels,
  .nutrition-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .card-grid {
    display: flex;
    gap: 12px;
  }

  .dish-card,
  .card-grid .dish-card:nth-child(3n) {
    width: calc(50% - 7px);
    min-width: 0;
  }

  .dish-body {
    padding: 0;
  }

  .dish-card h3 {
    font-size: 16px;
  }

  .dish-card p {
    font-size: 12px;
  }

  .dish-image {
    border-width: 4px;
  }

  .tag {
    font-size: 11px;
    padding: 3px 7px;
  }

  .card-actions {
    display: inline-flex;
  }

  .card-actions button {
    font-size: 12px;
    padding: 4px 5px;
  }

  .kitchen-brief {
    padding: 12px;
  }

  .brief-bottom {
    gap: 5px;
  }

  .brief-bottom > div {
    padding: 7px 0;
  }
}

/* Home board refresh: tidy family menu board, no intentional tilt. */
.content,
.kitchen-brief,
.brief-bottom > div,
.hand-section,
.dish-card,
.dish-image,
.dish-card::before,
.card-actions button,
.memo-panel,
.week-board-section,
.random-helper,
.lottery-link,
.day-column {
  transform: none !important;
}

body {
  background:
    radial-gradient(circle at 16% 18%, rgba(90, 78, 55, 0.045) 0 1px, transparent 1.5px),
    radial-gradient(circle at 82% 38%, rgba(90, 78, 55, 0.035) 0 1px, transparent 1.5px),
    #f5eddf;
}

.content {
  border-radius: 8px;
  background:
    linear-gradient(rgba(84, 75, 59, 0.035) 1px, transparent 1px),
    #fbf5ea;
  background-size: 100% 34px, auto;
}

.kitchen-brief {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 18px;
  padding: 14px 16px;
  border: 1px solid rgba(92, 80, 61, 0.14);
  border-radius: 8px;
  background: #fff7df;
}

.kitchen-brief h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 4.8vw, 48px);
}

.daily-line {
  gap: 8px 16px;
}

.brief-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(210px, 0.68fr) minmax(420px, 1.32fr);
  gap: 12px;
}

.brief-bottom > div {
  padding: 12px 14px;
  border: 1px solid rgba(92, 80, 61, 0.12);
  border-radius: 8px;
  background: rgba(255, 252, 242, 0.74);
}

.brief-bottom h2 {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 500;
}

.brief-bottom p {
  margin: 4px 0 0;
  color: var(--pencil);
  line-height: 1.6;
}

.nutrition-plate {
  background: rgba(255, 253, 244, 0.8) !important;
}

.nutrition-plate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.plate-chip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid rgba(92, 80, 61, 0.12);
  border-radius: 8px;
  background: rgba(255, 252, 242, 0.72);
  color: var(--pencil);
  font-size: 12px;
  line-height: 1.25;
}

.plate-chip small {
  color: #8d8578;
  font-size: 11px;
}

.plate-chip.covered {
  background: #fff4cf;
}

.plate-chip.good {
  background: #e8efdc;
}

.nutrition-advice {
  margin-top: 9px !important;
  padding-top: 8px;
  border-top: 1px solid rgba(92, 80, 61, 0.12);
  color: var(--olive-dark) !important;
}

.nutrition-plate:has(.nutrition-plate-grid:empty) .nutrition-plate-grid {
  display: none;
}

.shopping-jump {
  margin-top: 8px;
}

.picked-group {
  margin-top: 8px;
}

.picked-group strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.picked-list {
  display: grid;
  gap: 3px;
  margin: 0 0 4px;
  padding-left: 0;
  list-style: none;
}

.picked-list li {
  color: var(--pencil);
  line-height: 1.45;
}

.picked-section {
  display: grid;
  gap: 2px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(92, 80, 61, 0.12);
}

.picked-section:last-child {
  border-bottom: 0;
}

.picked-section-title {
  color: var(--muted);
  font-size: 12px;
}

.picked-section-items {
  display: grid;
  gap: 2px;
}

.picked-section-items p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.empty-inline {
  color: #948b7d;
  font-size: 13px;
}

.tiny-link {
  color: var(--olive);
  font-size: 13px;
}

.hand-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(92, 80, 61, 0.12);
  border-radius: 8px;
}

.breakfast-section {
  background: #fff5d7;
}

.dinner-section {
  background: #edf3e3;
}

.recommend-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.recommend-head h2 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 26px);
}

.meal-modules {
  display: grid;
  gap: 12px;
}

.meal-module {
  padding: 10px;
  border: 1px solid rgba(92, 80, 61, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.52);
}

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

.module-head h3 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
  font-weight: 500;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.module-actions button {
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(92, 80, 61, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.74);
  color: var(--muted);
  font-size: 12px;
}

.module-actions button.active {
  background: rgba(102, 115, 72, 0.14);
  color: var(--olive-dark);
}

.module-actions .tiny-link {
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-range,
.page-separator {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: #8a8a78;
  font-size: 12px;
  line-height: 24px;
}

.module-actions .page-next,
.module-actions .page-back {
  padding-inline: 2px;
  color: #7b7b68;
  text-decoration: none;
}

.module-actions .page-back:disabled {
  cursor: default;
  opacity: 0.34;
}

.module-actions .page-next:disabled {
  cursor: default;
  opacity: 0.34;
}

.module-grid-fade {
  animation: moduleCardsFade 200ms ease both;
}

@keyframes moduleCardsFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.card-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}

.dish-card,
.card-grid .dish-card:nth-child(3n) {
  width: auto !important;
  min-width: 0;
  margin-top: 0 !important;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.88);
  box-shadow: none;
}

.breakfast-section .dish-card {
  background: rgba(255, 252, 239, 0.9);
}

.dinner-section .dish-card {
  background: rgba(250, 253, 246, 0.9);
}

.dish-card::before {
  top: -8px;
  left: 50%;
  width: 76px;
  height: 14px;
  border-radius: 2px;
  background: rgba(231, 217, 170, 0.62);
  transform: translateX(-50%) !important;
}

.dish-image {
  width: 100%;
  height: clamp(120px, 13vw, 150px);
  aspect-ratio: auto;
  margin-bottom: 7px;
  border: 4px solid #fffdf6;
  border-radius: 0;
}

.dish-card h3 {
  margin-bottom: 3px;
  font-size: clamp(15px, 1.7vw, 18px);
}

.dish-card p {
  display: none;
}

.dish-time {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}

.tag-row {
  display: none;
}

.dish-card:hover .tag-row,
.dish-card:focus-within .tag-row,
.dialog-content .tag-row {
  display: flex;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-actions button,
.card-actions [data-action="fav"] {
  width: auto;
  min-height: 24px;
  padding: 3px 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(236, 224, 188, 0.76);
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
}

.card-actions [data-action="fav"]::after {
  content: none;
}

.card-actions [data-action="add"] {
  background: var(--olive);
  color: #fffdf4;
}

.card-actions [data-action="schedule"] {
  background: #ad8f61;
  color: #fffdf4;
}

.card-actions [data-action="fav"].liked {
  background: #f3d9d1;
  color: #8e3d32;
}

.home-panels {
  margin-top: 16px;
}

.memo-panel {
  max-width: 620px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f7dfc8;
}

.memo-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  font-weight: 500;
}

.memo-panel h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.memo-panel .note-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.memo-panel .note-item {
  grid-template-columns: 66px 1fr;
  padding: 4px 0;
}

.memo-panel input {
  font-size: 14px;
}

.week-board-section {
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #eee2d0;
}

.week-board-section h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

.week-board-section > p {
  margin-bottom: 10px;
  font-size: 14px;
}

.week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 4px;
}

.week-day-card {
  min-width: 120px;
  padding: 8px;
  border: 1px solid rgba(92, 80, 61, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 239, 0.72);
}

.week-day-card h3 {
  margin: 0 0 6px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 16px;
  font-weight: 500;
}

.week-slot {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 7px 8px;
  border: 1px solid rgba(92, 80, 61, 0.12);
  border-radius: 7px;
  background: rgba(255, 253, 246, 0.8);
  color: var(--ink);
  text-align: left;
}

.week-slot span {
  color: var(--muted);
  font-size: 12px;
}

.week-slot strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.week-slot-items {
  display: grid;
  gap: 3px;
  margin-top: 3px;
}

.week-slot-items p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.week-add {
  margin-top: 5px;
}

.week-slot.empty-cell strong {
  color: #948b7d;
  font-weight: 400;
}

.shopping-board {
  background:
    linear-gradient(rgba(73, 65, 50, 0.055) 1px, transparent 1px),
    #e8eef0;
  background-size: 100% 32px;
}

.shopping-prep {
  max-width: 680px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(92, 80, 61, 0.12);
  border-radius: 8px;
  background: #f7dfc8;
}

.shopping-prep h2 {
  margin-bottom: 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  font-weight: 500;
}

.random-helper {
  margin-top: 18px;
  border-style: solid;
  border-radius: 8px;
  background: #f4eee3;
}

.random-score {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--olive-dark);
}

.lottery-link {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(102, 115, 72, 0.12);
  color: var(--olive-dark);
  font-size: 15px;
  text-decoration: none;
}

@media (max-width: 860px) {
  .kitchen-brief,
  .brief-bottom {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr !important;
  }

  .dish-card,
  .card-grid .dish-card:nth-child(3n) {
    width: auto !important;
  }

  .memo-panel .note-list {
    grid-template-columns: 1fr;
  }

  .nutrition-plate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .random-helper {
    grid-template-columns: 1fr;
  }

  .week-board {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .recommend-head {
    grid-template-columns: 1fr;
  }

  .module-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .module-actions {
    justify-content: flex-start;
  }
}

/* Keep the daily menu board static. */
.dish-card,
.dish-card:hover,
.dish-image,
.dish-image:hover,
.card-actions button,
.card-actions button:hover,
.ghost-button,
.ghost-button:hover,
.primary-button,
.primary-button:hover,
.tiny-link,
.tiny-link:hover,
.lottery-link,
.lottery-link:hover,
.week-slot,
.week-slot:hover,
.week-add,
.week-add:hover {
  transform: none !important;
  transition-property: background-color, border-color, color, opacity !important;
}

.dish-card:hover .tag-row,
.dish-card:focus-within .tag-row {
  display: none;
}

/* Sticky tomorrow menu layout. */
.home-board-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 16px;
  align-items: start;
}

.home-main-sections {
  min-width: 0;
}

.tomorrow-sidebar {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 10px;
  max-width: 360px;
  z-index: 3;
}

.sidebar-card {
  padding: 12px 14px;
  border: 1px solid rgba(92, 80, 61, 0.12);
  border-radius: 8px;
  background: rgba(255, 252, 242, 0.86);
}

.sidebar-card h2 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 500;
}

.drawer-toggle {
  display: none;
}

.tomorrow-sidebar .nutrition-plate-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tomorrow-sidebar .plate-chip {
  min-height: 36px;
  padding: 5px 7px;
  font-size: 11px;
}

.tomorrow-sidebar .plate-chip small {
  font-size: 10px;
}

@media (max-width: 860px) {
  .home-board-shell {
    display: block;
  }

  .tomorrow-sidebar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    max-width: none;
    max-height: 54px;
    overflow: hidden;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(92, 80, 61, 0.16);
    border-radius: 10px;
    background: #fbf5ea;
    z-index: 20;
  }

  .tomorrow-sidebar.open {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .drawer-toggle {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid rgba(92, 80, 61, 0.12);
    border-radius: 8px;
    background: rgba(255, 252, 242, 0.92);
    color: var(--olive-dark);
    text-align: left;
  }

  .tomorrow-sidebar:not(.open) .sidebar-card {
    display: none;
  }

  body {
    padding-bottom: 78px;
  }
}

/* Clean recipe board refresh: lighter Mealime-inspired surface. */
:root {
  --paper: #faf8f2;
  --paper-light: #ffffff;
  --line: rgba(48, 43, 36, 0.1);
  --olive: #667348;
  --olive-dark: #4f5f35;
}

body {
  background: #faf8f2;
  color: #2f2b25;
  font-family: "Hiragino Sans GB", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

.layout {
  max-width: 1180px;
}

.content {
  border-color: rgba(48, 43, 36, 0.08);
  border-radius: 14px;
  background: #fffdf9;
  background-image: none;
}

.kitchen-brief,
.hand-section,
.meal-module,
.sidebar-card,
.week-board-section,
.random-helper,
.memo-panel,
.library-item,
.shopping-board,
.shopping-prep,
.nutrition-item,
.recommend-item {
  border: 1px solid rgba(48, 43, 36, 0.08);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(48, 43, 36, 0.035);
}

.kitchen-brief {
  padding: 8px 76px 7px 16px;
}

.kitchen-brief h1,
.hand-section h2,
.module-head h3,
.sidebar-card h2,
.week-board-section h2,
.memo-panel summary,
.dialog-content h2 {
  font-family: Georgia, "Songti SC", serif;
}

.daily-line,
.module-head h3,
.dish-card h3,
.picked-section-items p {
  color: #302b24;
}

.kitchen-brief .daily-line {
  gap: 4px 12px;
  font-size: 15px;
  line-height: 1.35;
}

.breakfast-section,
.dinner-section {
  background: #ffffff;
}

.meal-module {
  box-shadow: none;
}

.module-actions button {
  border-color: rgba(48, 43, 36, 0.08);
  background: #faf8f2;
}

.module-actions button.active {
  background: #edf2e6;
}

.dish-card,
.breakfast-section .dish-card,
.dinner-section .dish-card,
.card-grid .dish-card:nth-child(3n) {
  padding: 0;
  border: 1px solid rgba(48, 43, 36, 0.08);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(48, 43, 36, 0.045);
}

.dish-card::before {
  content: none;
}

.dish-image {
  width: 100%;
  height: clamp(124px, 13vw, 152px);
  margin: 0;
  border: 0;
  border-radius: 0;
  position: relative;
}

.dish-image::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 36%, transparent);
}

.image-add,
.image-fav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(48, 43, 36, 0.12);
}

.image-add {
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  background: #667348;
  color: #fff;
  font-size: 23px;
  line-height: 1;
}

.image-fav {
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.88);
  color: #8e3d32;
  font-size: 14px;
}

.image-fav.liked {
  background: #f8e3df;
}

.dish-body {
  padding: 10px 11px 11px;
}

.dish-time {
  color: #756f63;
}

.card-actions {
  margin-top: 8px;
}

.card-actions button,
.card-actions [data-action="fav"] {
  border: 1px solid rgba(48, 43, 36, 0.08);
  background: #faf8f2;
  color: #5c554c;
}

.card-actions [data-action="detail"] {
  background: #eef3e8;
  color: var(--olive-dark);
}

.card-actions [data-action="schedule"] {
  background: #f4efe4;
  color: #6d604f;
}

.dish-dialog {
  border-radius: 18px;
  background: #ffffff;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-image {
  min-height: 180px;
  max-height: 34vh;
}

.dialog-content {
  display: grid;
  gap: 12px;
  padding-bottom: 28px;
}

.dialog-summary {
  color: var(--muted);
  line-height: 1.6;
}

.recipe-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.recipe-detail-grid p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #faf8f2;
}

.recipe-detail-grid strong,
.dialog-content label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.recipe-detail-grid strong {
  margin-bottom: 3px;
  color: var(--olive-dark);
}

.dialog-content input,
.dialog-content textarea {
  width: 100%;
  border: 1px solid rgba(48, 43, 36, 0.1);
  border-radius: 10px;
  background: #fffdf9;
  color: var(--ink);
  padding: 9px 10px;
  resize: vertical;
}

.dialog-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 36%);
}

.library-item {
  border-radius: 12px;
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.library-actions small {
  flex-basis: 100%;
  text-align: right;
  color: var(--muted);
}

.photo-uploader {
  background: #faf8f2;
}

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

  .blind-box-grid {
    grid-template-columns: 1fr;
  }

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

  .dish-dialog {
    width: min(100vw - 18px, 760px);
    max-height: calc(100vh - 18px);
  }

  .dialog-image {
    min-height: 150px;
    max-height: 28vh;
  }
}

/* Refined photo-corner actions: quiet, static, and secondary to the food image. */
.image-add,
.image-fav {
  top: 1px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  color: #3f4638;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  opacity: 0.92;
  text-shadow: 0 1px 5px rgba(255, 255, 255, 0.82), 0 1px 4px rgba(0, 0, 0, 0.16);
  transform: none !important;
  transition: opacity 150ms ease, color 150ms ease !important;
}

.image-add {
  right: 1px;
  color: #39b54a;
}

.image-fav {
  left: 1px;
  color: #6f6258;
}

.image-add:hover,
.image-add:focus-visible,
.image-fav:hover,
.image-fav:focus-visible {
  background: transparent;
  opacity: 1;
  transform: none !important;
}

.image-fav.liked {
  background: transparent;
  color: #c94b43;
}

.delete-link {
  color: #9b4b42;
}

.move-targets button.active {
  border-color: rgba(107, 123, 91, 0.34);
  background: rgba(107, 123, 91, 0.13);
  color: var(--olive-dark);
}

.install-tip {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(420px, calc(100vw - 28px));
  padding: 10px 12px;
  border: 1px solid rgba(107, 123, 91, 0.18);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(48, 43, 36, 0.08);
  color: #4d4a42;
  transform: translateX(-50%);
}

.install-tip[hidden] {
  display: none;
}

.install-tip span {
  flex: 1;
  font-size: 13px;
}

.install-tip button {
  border: 1px solid rgba(107, 123, 91, 0.18);
  border-radius: 999px;
  background: #eef3e8;
  color: #536440;
  padding: 6px 10px;
  font-size: 12px;
}

#dismissInstallTip {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 860px) {
  .image-add,
  .image-fav {
    width: 30px;
    height: 30px;
    font-size: 22px;
  }
}

/* Responsive pass: keep the daily menu usable on smaller screens without changing the desktop layout. */
@media (min-width: 768px) and (max-width: 1199px) {
  .layout {
    max-width: 100%;
    padding: 0 14px;
  }

  .content {
    padding: 14px;
  }

  .home-board-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(286px, 320px);
    gap: 14px;
    align-items: start;
  }

  .tomorrow-sidebar {
    position: sticky !important;
    top: 12px;
    left: auto;
    right: auto;
    bottom: auto;
    max-width: 320px;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .tomorrow-sidebar .sidebar-card {
    display: block !important;
  }

  .drawer-toggle {
    display: none !important;
  }

  .card-grid,
  .search-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 9px;
  }

  .module-head {
    align-items: center !important;
    flex-direction: row !important;
  }

  .module-actions {
    justify-content: flex-end !important;
  }

  body {
    padding-bottom: 0;
  }
}

@media (max-width: 767px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
    touch-action: manipulation;
  }

  .layout {
    width: 100%;
    margin: 0 auto 22px;
    padding: 0 8px;
  }

  .content {
    padding: 8px;
    border-left: 0;
    border-right: 0;
  }

  .sidebar {
    margin-top: 6px;
    padding-top: 6px;
  }

  .nav-button {
    padding: 5px 8px;
    font-size: 12px;
  }

  .kitchen-brief {
    min-height: auto;
    padding: 7px 54px 7px 12px;
    margin-bottom: 8px;
  }

  .kitchen-brief h1 {
    margin-bottom: 3px;
    font-size: 28px;
    line-height: 1.05;
  }

  .kitchen-brief .daily-line {
    gap: 2px 8px;
    font-size: 13px;
    line-height: 1.25;
  }

  .account-button {
    top: 8px;
    right: 8px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .global-search-panel {
    margin: 8px 0;
    padding: 8px 10px;
  }

  .global-search-panel label {
    gap: 5px;
  }

  .global-search-panel input {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 14px;
  }

  .hand-section {
    min-width: 0;
    padding: 10px 8px;
    margin-bottom: 10px;
  }

  .recommend-head {
    margin-bottom: 8px;
  }

  .recommend-head h2 {
    font-size: 20px;
  }

  .meal-modules {
    gap: 10px;
  }

  .meal-module {
    min-width: 0;
    padding: 8px;
  }

  .module-head {
    min-width: 0;
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 6px;
    margin-bottom: 7px;
  }

  .module-head h3 {
    font-size: 16px;
  }

  .module-actions {
    display: flex;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .module-actions > * {
    flex: 0 0 auto;
  }

  .module-actions button {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 11px;
  }

  .page-range,
  .page-separator {
    min-height: 24px;
    font-size: 11px;
    line-height: 24px;
  }

  .card-grid,
  .search-card-grid,
  .module-grid {
    display: grid !important;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .dish-card,
  .breakfast-section .dish-card,
  .dinner-section .dish-card,
  .card-grid .dish-card:nth-child(2n),
  .card-grid .dish-card:nth-child(3n),
  .card-grid .dish-card:nth-child(4n) {
    width: auto !important;
    inline-size: min(100%, calc((100vw - 58px) / 2)) !important;
    max-width: calc((100vw - 58px) / 2) !important;
    min-width: 0 !important;
    min-inline-size: 0 !important;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
  }

  .dish-image {
    height: clamp(100px, 29vw, 120px) !important;
    min-height: 100px;
    margin-bottom: 0;
    border: 0;
  }

  .dish-body {
    padding: 7px 8px 8px;
  }

  .dish-card h3 {
    display: -webkit-box;
    min-height: 36px;
    margin-bottom: 4px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 14px;
    line-height: 1.28;
  }

  .dish-time {
    margin-bottom: 5px;
    font-size: 11px;
  }

  .card-actions {
    gap: 3px;
    margin-top: 5px;
  }

  .card-actions button,
  .card-actions [data-action="fav"] {
    min-height: 22px;
    padding: 2px 6px;
    font-size: 10.5px;
  }

  .image-add,
  .image-fav {
    top: 0;
    width: 22px;
    height: 22px;
    font-size: 17px;
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(0, 0, 0, 0.16);
  }

  .image-add {
    right: 0;
  }

  .image-fav {
    left: 0;
  }

  .home-board-shell {
    display: block !important;
    max-width: 100%;
    overflow-x: hidden;
  }

  .home-main-sections,
  .meal-modules,
  .hand-section,
  .meal-module,
  .module-head,
  .card-grid,
  .search-card-grid,
  .module-grid {
    max-width: 100%;
    overflow-x: hidden;
  }

  .module-actions {
    max-width: calc(100vw - 42px);
  }

  .card-grid,
  .search-card-grid,
  .module-grid {
    max-width: calc(100vw - 50px);
  }

  .tomorrow-sidebar {
    position: fixed !important;
    left: 8px;
    right: 8px;
    bottom: 8px;
    top: auto;
    max-width: none;
    max-height: 52px;
    overflow: hidden;
    gap: 8px;
    padding: 7px;
    border: 1px solid rgba(92, 80, 61, 0.14);
    border-radius: 12px;
    background: rgba(251, 245, 234, 0.96);
    z-index: 20;
  }

  .tomorrow-sidebar.open {
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }

  .drawer-toggle {
    display: block !important;
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 14px;
  }

  .tomorrow-sidebar:not(.open) .sidebar-card {
    display: none !important;
  }

  .tomorrow-sidebar .nutrition-plate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .week-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blind-box-grid,
  .recipe-detail-grid {
    grid-template-columns: 1fr !important;
  }

  body {
    padding-bottom: 74px;
  }
}
