:root {
  color-scheme: light;
  --background: #f4ceb1;
  --surface: #fff0de;
  --surface-strong: #fff8ef;
  --text: #594035;
  --muted: #8b7165;
  --line: #e7cbb5;
  --accent: #dc6044;
  --accent-dark: #c75245;
  --secondary: #83bbc0;
  --secondary-dark: #365d60;
  --shadow: 0 7px 16px rgb(91 57 39 / 14%);
  --app-font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  font-family: var(--app-font-family);
  font-size: var(--app-font-size, 16px);
  font-synthesis: none;
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 5%, rgb(255 239 225 / 76%) 0 9rem, transparent 9.1rem),
    linear-gradient(180deg, #f8dcc6 0%, var(--background) 100%);
  background-attachment: fixed;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
[hidden] { display: none !important; }

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}

.screen--center { display: grid; place-items: center; }

.loading-mark, .brand-mark {
  display: block;
  object-fit: cover;
}

.loading-mark {
  width: 64px;
  height: 64px;
  margin-inline: auto;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.login-card {
  width: min(100%, 420px);
  padding: 32px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgb(255 240 222 / 94%);
  box-shadow: var(--shadow);
}

.eyebrow, .view-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
}

.login-card h1 {
  margin: 6px 0 10px;
  font-size: clamp(2rem, 10vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-description {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.7;
}

.form-stack, .menu-form { display: grid; gap: 10px; }
label { margin-top: 8px; font-weight: 700; }

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-strong);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input { min-height: 50px; padding: 0 14px; }

textarea {
  min-height: 190px;
  padding: 14px;
  line-height: 1.7;
  resize: vertical;
}

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(220 96 68 / 16%);
}

.button {
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
}

.button--primary {
  margin-top: 12px;
  color: white;
  background: var(--accent);
  box-shadow: 0 8px 18px rgb(199 82 69 / 18%);
}

.button--primary:active { background: var(--accent-dark); }
.button:disabled { opacity: 0.6; }

.form-message {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: var(--accent-dark);
  line-height: 1.5;
}

.app-version {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.app-shell { min-height: 100vh; min-height: 100dvh; }

.app-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(60px + env(safe-area-inset-top));
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  border-bottom: 1px solid rgb(199 135 99 / 22%);
  background: rgb(248 220 198 / 90%);
  backdrop-filter: blur(14px);
}

.brand-button, .text-button, .sub-button, .back-button { border: 0; background: transparent; }

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0;
  font-weight: 700;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.text-button {
  min-height: 44px;
  padding: 0 4px 0 12px;
  color: var(--muted);
  font-size: 0.875rem;
}

.settings-button, .logout-icon-button {
  display: grid;
  width: 44px;
  padding: 0;
  place-items: center;
}

.settings-button svg, .logout-icon-button svg {
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.header-actions .text-button + .text-button {
  margin-left: 4px;
  border-left: 1px solid rgb(139 113 101 / 28%);
}

.app-main {
  width: min(100%, 760px);
  margin-inline: auto;
  padding: 20px 14px calc(32px + env(safe-area-inset-bottom));
}

.view { animation: appear 180ms ease-out; }

@keyframes appear {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.calendar-toolbar h1, .edit-heading h1 {
  margin: 3px 0 0;
  font-size: clamp(1.45rem, 7vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.icon-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--secondary-dark);
  background: #c5dfe0;
  box-shadow: 0 3px 7px rgb(71 111 115 / 14%);
}

.weekday-row, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }

.weekday-row {
  padding: 10px 4px 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.72rem;
  text-align: center;
}

.sunday { color: var(--accent-dark); }
.saturday { color: var(--secondary-dark); }

.month-grid {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0 0 18px 18px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.month-day {
  position: relative;
  min-width: 0;
  min-height: 86px;
  padding: 7px 4px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid #eed9c8;
  border-bottom: 1px solid #eed9c8;
  text-align: left;
  touch-action: manipulation;
  background: var(--surface-strong);
}

.month-day:nth-child(7n) { border-right: 0; }
.month-day:nth-last-child(-n + 7) { border-bottom: 0; }

.month-day--outside {
  color: #bda99f;
  background: #fae9da;
}

.month-day--today .day-number { color: white; background: var(--secondary-dark); }

.day-number {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding-inline: 4px;
  border-radius: 9px;
  font-size: 0.78rem;
}

.month-menu {
  display: -webkit-box;
  margin-top: 5px;
  padding: 4px;
  overflow: hidden;
  border-radius: 6px;
  color: #563a32;
  font-size: clamp(0.58rem, 2.4vw, 0.72rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.menu-color-0 { background: #f7c9c3; }
.menu-color-1 { background: #f6d5dc; }
.menu-color-2 { background: #f8d8bd; }
.menu-color-3 { background: #f5e6a8; }
.menu-color-4 { background: #dce9ae; }
.menu-color-5 { background: #bfe3bd; }
.menu-color-6 { background: #bde3d5; }
.menu-color-7 { background: #b9dfe2; }
.menu-color-8 { background: #c9dcef; }
.menu-color-9 { background: #d8cceb; }

.sub-button, .back-button {
  min-height: 44px;
  padding: 0 8px;
  color: var(--accent-dark);
  font-weight: 700;
}

.sub-button {
  display: block;
  margin: -4px auto 14px;
  padding-inline: 16px;
  border-radius: 999px;
  background: #ffe1d8;
}

.week-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 16px;
  padding: 7px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.week-tab {
  min-width: 0;
  min-height: 56px;
  padding: 5px 2px;
  border: 0;
  border-radius: 13px;
  background: transparent;
}

.week-tab span { display: block; }

.week-tab-day {
  margin-bottom: 2px;
  font-size: 0.68rem;
  color: var(--muted);
}

.week-tab-date { font-weight: 700; }
.week-tab--today { color: white; background: var(--secondary-dark); }
.week-tab--today .week-tab-day { color: white; }
.week-reorder-hint {
  margin: 4px 2px 12px;
  color: var(--muted);
  font-size: 0.85rem;
}
.week-list { display: grid; gap: 12px; }

.day-card {
  width: 100%;
  min-height: 104px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: left;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.day-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin-bottom: 10px;
  padding: 0 0 9px;
  border: 0;
  border-bottom: 1px dashed var(--line);
  font-weight: 700;
  text-align: left;
  background: transparent;
}

.edit-symbol { color: var(--accent); font-size: 1.15rem; }

.day-card-menu {
  display: grid;
  gap: 6px;
  margin: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.week-menu-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  padding: 2px 4px 2px 9px;
  border-radius: 7px;
}

.week-menu-item--dragging {
  opacity: 0.4;
}

.week-menu-ghost {
  position: fixed;
  z-index: 31;
  margin: 0;
  box-shadow: 0 6px 18px rgb(60 40 30 / 28%);
  outline: 2px solid var(--accent-dark);
  pointer-events: none;
}

.week-menu-name {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 4px 0;
  border: 0;
  text-align: left;
  overflow-wrap: anywhere;
  background: transparent;
}

.week-menu-move {
  display: grid;
  place-content: center;
  flex: 0 0 48px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #65483e;
  background: rgb(255 255 255 / 58%);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.week-menu-move span:first-child { font-size: 1.2rem; line-height: 1; }
.week-menu-move span:last-child { font-size: 0.68rem; line-height: 1.2; }

.week-menu-step {
  display: flex;
  width: 100%;
  gap: 8px;
  padding-bottom: 4px;
}

.week-menu-step button {
  flex: 1;
  min-height: 44px;
  border: 1px solid rgb(91 64 55 / 25%);
  border-radius: 7px;
  background: rgb(255 255 255 / 72%);
}

.week-menu-step button:disabled { opacity: 0.4; }

.day-card-header:focus-visible,
.week-menu-name:focus-visible,
.week-menu-move:focus-visible,
.week-menu-step button:focus-visible {
  outline: 3px solid var(--accent-dark);
  outline-offset: 2px;
}

.day-card-menu--empty { color: #a2958e; }
.back-button { margin: -6px 0 12px -8px; }
.edit-heading {
  margin: 2px 0 46px;
  text-align: center;
}

.edit-heading h1 { font-weight: 500; }

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

.menu-sheet {
  position: relative;
  min-height: 520px;
  padding: 42px 26px 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notebook-rings {
  position: absolute;
  top: -15px;
  right: 16%;
  left: 16%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 34px;
  pointer-events: none;
}

.notebook-rings span {
  position: relative;
  flex: 0 0 9px;
  height: 34px;
  /* The two recessed ends sit behind the continuous metal loop. */
  background:
    radial-gradient(ellipse 4px 4.5px at 50% 5px,
      #aa724c 0 35%, #c58f61 48%, #e9bf93 76%, transparent 100%),
    radial-gradient(ellipse 4px 4.5px at 50% 29px,
      #a7714d 0 35%, #c58f61 48%, #e9bf93 76%, transparent 100%);
  filter: drop-shadow(0.5px 1px 0.7px rgb(122 82 58 / 16%));
}

.notebook-rings span::before,
.notebook-rings span::after {
  position: absolute;
  box-sizing: border-box;
  content: "";
}

.notebook-rings span::before {
  top: 4px;
  left: 50%;
  width: 3.5px;
  height: 26px;
  border-radius: 3px;
  background: linear-gradient(90deg,
    #c39169 0%, #fce1bb 40%, #f2cea2 66%, #ce9a70 100%);
  box-shadow:
    1.1px 0.8px 1.2px rgb(137 87 53 / 20%),
    inset 0 1px 0 rgb(255 246 226 / 85%);
  transform: translateX(-50%);
}

.notebook-rings span::after {
  /* A short curved toe disappears into the lower hole, behind its rim. */
  top: 25px;
  left: 50%;
  width: 4.5px;
  height: 5px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(110deg, #f9ddb7, #eac297 65%, #bd885e);
  transform: translateX(-50%);
}

.menu-sheet h2,
.meal-section h3 {
  color: var(--accent);
  font-weight: 500;
}

.menu-sheet h2 {
  margin: 0 0 18px;
  font-size: 1.65rem;
}

.dish-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.dish-entry input {
  min-width: 0;
  border-color: var(--line);
  border-radius: 7px;
  background: rgb(255 255 255 / 24%);
}

.dish-entry input::placeholder { color: #c8bbb1; }

.menu-color-picker {
  min-width: 0;
  margin: 8px 0 2px;
  padding: 0;
  border: 0;
}

.menu-color-picker legend {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.menu-color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-color-option {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.menu-color-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.menu-color-swatch {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid rgb(255 255 255 / 80%);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgb(91 64 55 / 18%);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.menu-color-option input:checked + .menu-color-swatch {
  box-shadow: 0 0 0 3px var(--accent-dark);
  transform: scale(0.86);
}

.menu-color-option input:focus-visible + .menu-color-swatch {
  outline: 3px solid rgb(79 133 139 / 35%);
  outline-offset: 4px;
}

.add-dish-button {
  min-width: 64px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: var(--secondary-dark);
  font-weight: 700;
  background: var(--secondary);
}

.recipe-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 1.05rem;
  text-align: left;
}

.recipe-dialog {
  width: min(calc(100% - 32px), 520px);
  max-height: min(720px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 18px 52px rgb(91 57 39 / 30%);
}

.recipe-dialog::backdrop {
  background: rgb(70 55 49 / 36%);
  backdrop-filter: blur(3px);
}

.display-settings-dialog {
  width: min(calc(100% - 28px), 520px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 18px 52px rgb(91 57 39 / 30%);
}

.display-settings-dialog::backdrop {
  background: rgb(70 55 49 / 36%);
  backdrop-filter: blur(3px);
}

.display-settings-panel {
  max-height: calc(100dvh - 28px);
  padding: 22px;
  overflow-y: auto;
}

.display-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.display-settings-header h2 { margin: 0; font-size: 1.4rem; }

.display-settings-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialog-close-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #f8dfd2;
  font-size: 1.4rem;
  line-height: 1;
}

.display-setting-group {
  min-width: 0;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.display-setting-group legend {
  margin-bottom: 10px;
  color: var(--accent-dark);
  font-weight: 700;
}

.display-setting-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.display-setting-options label {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 6px 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  font-size: 0.8rem;
  text-align: center;
}

.display-setting-options input { width: auto; min-height: 0; margin: 0 0 4px; }

.custom-setting-input {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.custom-setting-input input { color: var(--text); font-size: 1rem; }

.font-family-select {
  display: block;
  margin: 0;
}

.font-family-select select {
  width: 100%;
  min-height: 50px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-strong);
  font: inherit;
}

.number-input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 120px) auto;
  align-items: center;
  gap: 8px;
}

.setting-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.display-settings-preview {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 14px;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
}

.display-settings-preview span { color: var(--muted); font-size: 0.7em; }
.display-settings-preview strong { overflow-wrap: anywhere; }

.display-settings-message { min-height: 1.5em; margin: 8px 0 0; }

.request-navigation-button {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--accent-dark);
  background: #f8dfd2;
}

.request-navigation-button svg {
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.display-settings-actions {
  display: grid;
  margin-top: 8px;
}

.recipe-dialog-panel {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  max-height: min(720px, calc(100dvh - 32px));
  padding: 22px;
  overflow: hidden;
}

.recipe-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.recipe-dialog-kicker {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.recipe-dialog-header h2 { margin: 0; font-size: 1.4rem; }

.recipe-dialog-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #f8dfd2;
  font-size: 1.4rem;
  line-height: 1;
}

.recipe-search input {
  width: 100%;
  min-height: 46px;
  border-color: var(--line);
  background: var(--surface-strong);
}

.recipe-tools {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.recipe-color-filter {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.recipe-color-filter legend,
.recipe-sort-control span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.recipe-color-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.recipe-color-filter-option {
  position: relative;
  display: block;
  width: 25px;
  height: 25px;
  cursor: pointer;
}

.recipe-color-filter-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.recipe-filter-swatch {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 2px solid white;
  border-radius: 50%;
  color: var(--muted);
  box-shadow: 0 0 0 1px rgb(91 64 55 / 18%);
  font-size: 0.65rem;
  font-weight: 700;
}

.recipe-filter-swatch--all { background: var(--surface-strong); }

.recipe-color-filter-option input:checked + .recipe-filter-swatch {
  box-shadow: 0 0 0 3px var(--accent-dark);
  transform: scale(0.84);
}

.recipe-color-filter-option input:focus-visible + .recipe-filter-swatch {
  outline: 3px solid rgb(79 133 139 / 35%);
  outline-offset: 4px;
}

.recipe-sort-control {
  display: grid;
}

.recipe-sort-control select {
  min-height: 42px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-strong);
  font: inherit;
}

.recipe-list-message {
  min-height: 1.4em;
  margin: 12px 2px 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.recipe-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 3px 2px 0;
  overflow-y: auto;
  list-style: none;
}

.recipe-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  background: rgb(255 255 255 / 36%);
}

.recipe-option-color {
  width: 24px;
  height: 24px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgb(91 64 55 / 16%);
}

.recipe-option-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.recipe-option-count {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.meal-section {
  min-height: 300px;
  margin-top: 2px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.meal-section h3 {
  margin: 0 0 10px;
  font-size: 1.55rem;
}

.menu-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 7px 8px 7px 12px;
  border: 2px solid transparent;
  border-radius: 9px;
  font-size: 1.05rem;
}

.menu-item--editing-color { border-color: var(--accent-dark); }

.menu-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.menu-item-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.edit-menu-item-button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgb(91 64 55 / 20%);
  border-radius: 7px;
  color: #684a40;
  background: rgb(255 255 255 / 48%);
  font-size: 0.75rem;
}

.remove-dish-button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: white;
  background: #d8787c;
  font-size: 1.4rem;
  line-height: 1;
}

.empty-menu-message {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.edit-message {
  margin: 0;
  text-align: center;
}

.edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 10px 18px 0;
}

.edit-action {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-size: 1.05rem;
  box-shadow: 0 4px 8px rgb(91 57 39 / 16%);
}

.edit-action--cancel {
  color: #c75245;
  background: #ffe1d8;
}

.edit-action--save {
  color: var(--secondary-dark);
  background: var(--secondary);
}

.request-dialog {
  width: min(calc(100% - 28px), 700px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--text);
  background: transparent;
}

.request-dialog::backdrop {
  background: rgb(70 55 49 / 42%);
  backdrop-filter: blur(3px);
}

.request-panel {
  max-height: calc(100dvh - 28px);
  padding: 1px;
  overflow-y: auto;
}

.request-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.request-heading h1 {
  margin: 0;
  color: var(--accent-dark);
  font-size: clamp(1.45rem, 7vw, 2rem);
}

.request-form {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.request-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
}

.request-entry textarea {
  min-height: 92px;
  resize: vertical;
}

.add-request-button {
  min-width: 72px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: var(--secondary-dark);
  background: var(--secondary);
  font-weight: 700;
}

.add-request-button:disabled,
.delete-request-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.request-message {
  min-height: 1.5em;
  margin: 10px 2px 0;
}

.request-list-panel {
  min-height: 280px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgb(255 240 222 / 76%);
  box-shadow: var(--shadow);
}

.request-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.request-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

.request-item-text {
  min-width: 0;
  margin: 0;
  padding: 13px 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.delete-request-button {
  min-width: 64px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--line);
  color: white;
  background: #d8787c;
  font-weight: 700;
}

.empty-request-message {
  margin: 4px 0;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 16px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin-inline: auto;
  padding: 12px 18px;
  border-radius: 999px;
  color: white;
  background: #463731;
  box-shadow: var(--shadow);
  text-align: center;
}

@media (min-width: 600px) {
  .app-main { padding-inline: 24px; }
  .month-day { min-height: 108px; padding: 9px 7px; }
  .month-menu { font-size: 0.75rem; }
}

@media (max-width: 430px) {
  .app-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .header-actions { margin-left: auto; }
  .display-setting-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .request-entry { grid-template-columns: 1fr; }
  .add-request-button { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
