:root {
  color-scheme: light;
  --bg: #f3f5f0;
  --panel: #ffffff;
  --panel-soft: #f8faf7;
  --ink: #17211c;
  --muted: #66736c;
  --line: #dce4dc;
  --sage: #6d8b75;
  --sage-dark: #365a45;
  --blue: #526a7d;
  --tomato: #be4b3d;
  --tomato-soft: #f8e8e5;
  --shadow: 0 22px 60px rgba(30, 42, 34, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(109, 139, 117, 0.16), transparent 34rem),
    linear-gradient(135deg, #fbfcfa 0%, var(--bg) 58%, #eef4f5 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(360px, 1fr) minmax(360px, 480px);
  gap: 18px;
}

.week-rail,
.today-panel,
.editor-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.week-rail {
  padding: 18px;
  align-self: start;
  position: sticky;
  top: 22px;
}

.brand-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--sage-dark);
  color: #fff;
  font-weight: 900;
}

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

h1 {
  font-size: 1.35rem;
  line-height: 1.1;
}

.brand-row p,
.quiet,
.rss-panel p,
small {
  color: var(--muted);
}

.brand-row p {
  margin-top: 3px;
  font-size: 0.92rem;
}

.icon-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 780;
}

.icon-button.primary {
  border-color: var(--sage-dark);
  background: var(--sage-dark);
  color: white;
}

.icon-button.danger {
  border-color: #e5c7c2;
  background: #fff;
  color: var(--tomato);
}

.icon-button.danger:hover:not(:disabled) {
  border-color: var(--tomato);
  background: var(--tomato-soft);
}

.icon-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.logout-link {
  min-height: 36px;
  margin: -8px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 780;
  text-decoration: none;
}

.logout-link:hover {
  color: var(--sage-dark);
  text-decoration: none;
}

.week-actions {
  margin-top: 10px;
}

.week-list {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.week-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  color: var(--ink);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.week-delete-check {
  width: 18px;
  height: 18px;
  accent-color: var(--tomato);
}

.week-item span,
.week-item small {
  display: grid;
  gap: 3px;
}

.week-item em {
  border-radius: 999px;
  background: #e7eee8;
  color: var(--sage-dark);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
}

.week-item.active {
  border-color: var(--sage-dark);
  background: #edf4ee;
}

.week-item.current em {
  background: var(--tomato-soft);
  color: var(--tomato);
}

.rss-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.section-heading h2 {
  font-size: 1rem;
}

.rss-link {
  display: block;
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #eef4f5;
  color: var(--blue);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.info-link {
  min-height: 42px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  color: var(--sage-dark);
  font-weight: 830;
  text-decoration: none;
}

.info-link:hover {
  border-color: var(--sage);
  background: #f4f8f4;
  color: var(--sage-dark);
  text-decoration: none;
}

.today-panel {
  overflow: hidden;
  min-height: calc(100vh - 44px);
  display: grid;
  grid-template-rows: 230px 1fr;
}

.photo-strip {
  background:
    linear-gradient(180deg, rgba(23, 33, 28, 0.08), rgba(23, 33, 28, 0.34)),
    url("https://images.unsplash.com/photo-1543352634-a1c51d9f1fa7?auto=format&fit=crop&w=1400&q=80") center/cover;
}

.today-content {
  padding: clamp(22px, 4vw, 42px);
}

.today-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.today-top h2 {
  margin-top: 6px;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 0.96;
  max-width: 760px;
}

.week-pill,
.status-dot {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--tomato-soft);
  color: var(--tomato);
  font-weight: 850;
}

.dish-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 12px;
}

.dish-card,
.note-card,
.empty-state {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.dish-card span {
  display: block;
  color: var(--muted);
  font-weight: 760;
  margin-bottom: 12px;
}

.dish-card strong {
  display: block;
  font-size: clamp(1.15rem, 1.45vw, 1.55rem);
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.note-card,
.empty-state {
  grid-column: 1 / -1;
  color: var(--muted);
  min-height: auto;
  line-height: 1.5;
}

.editor-panel {
  align-self: start;
  padding: 20px;
  position: sticky;
  top: 22px;
}

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

.editor-header h2 {
  margin-top: 4px;
  font-size: 1.7rem;
}

.editor-header .icon-button {
  width: auto;
  padding: 0 16px;
}

.week-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 780;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
  min-height: 48px;
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(109, 139, 117, 0.22);
  border-color: var(--sage);
}

.weekend-toggles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px 12px;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.day-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 18px 0;
}

.day-tab {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 2px;
}

.day-tab.active {
  border-color: var(--tomato);
  background: var(--tomato-soft);
}

.day-tab.disabled-day {
  opacity: 0.52;
}

.selected-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.selected-day-head h3 {
  font-size: 1.45rem;
  margin-top: 4px;
}

.status-dot {
  background: #eef1f2;
  color: var(--muted);
}

.status-dot.open {
  background: #e7eee8;
  color: var(--sage-dark);
}

.disabled-note {
  margin-bottom: 12px;
  border-radius: 8px;
  background: #fff7ed;
  color: #8a4b16;
  padding: 10px 12px;
  line-height: 1.45;
}

.day-editor {
  display: grid;
  gap: 10px;
}

.field-block textarea {
  line-height: 1.35;
}

.save-status {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 780;
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 280px 1fr;
  }

  .week-rail {
    position: static;
  }

  .editor-panel {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (min-width: 1321px) {
  .today-top h2 {
    font-size: clamp(2.5rem, 4.2vw, 4.2rem);
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 20px, 620px);
    grid-template-columns: 1fr;
    padding: 10px 0;
  }

  .week-rail,
  .editor-panel {
    position: static;
  }

  .today-panel {
    min-height: auto;
    grid-template-rows: 170px 1fr;
  }

  .today-top,
  .editor-header {
    display: grid;
  }

  .today-top h2 {
    font-size: 2.25rem;
  }

  .dish-board,
  .week-form,
  .weekend-toggles {
    grid-template-columns: 1fr;
  }

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

.display-screen {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(23, 33, 28, 0.54), rgba(23, 33, 28, 0.1) 36rem),
    url("https://images.unsplash.com/photo-1543352634-a1c51d9f1fa7?auto=format&fit=crop&w=2400&q=85") center/cover fixed,
    #edf4ef;
  color: var(--ink);
}

.display-shell {
  width: min(92vw, 3440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(26px, 3vw, 96px) 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(18px, 2vw, 54px);
}

.display-hero {
  min-height: clamp(180px, 18vh, 390px);
  border-radius: 8px;
  padding: clamp(28px, 3.4vw, 96px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 72px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 34px 90px rgba(23, 33, 28, 0.18);
}

.display-kicker {
  color: var(--tomato);
  font-size: clamp(1.05rem, 1.25vw, 2.8rem);
  font-weight: 850;
  text-transform: capitalize;
}

.display-hero h1 {
  margin-top: clamp(8px, 0.8vw, 24px);
  font-size: clamp(3.2rem, 6.5vw, 14rem);
  line-height: 0.9;
  max-width: 11ch;
}

.display-week-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: clamp(12px, 1.15vw, 34px) clamp(18px, 1.7vw, 48px);
  background: var(--tomato-soft);
  color: var(--tomato);
  font-size: clamp(1rem, 1.25vw, 3rem);
  font-weight: 900;
}

.display-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr));
  gap: clamp(14px, 1.4vw, 44px);
  align-content: start;
}

.display-day {
  min-height: clamp(320px, 30vh, 650px);
  border-radius: 8px;
  padding: clamp(22px, 2vw, 62px);
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 24px 70px rgba(23, 33, 28, 0.14);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(18px, 1.5vw, 42px);
}

.display-day.is-today {
  border-color: rgba(190, 75, 61, 0.56);
  background: linear-gradient(180deg, rgba(248, 232, 229, 0.96), rgba(255, 255, 255, 0.94) 38%);
}

.display-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(14px, 1.2vw, 34px);
}

.display-day-head span {
  color: var(--muted);
  font-size: clamp(0.98rem, 1vw, 2.2rem);
  font-weight: 850;
  text-transform: uppercase;
}

.display-day-head h2 {
  margin-top: clamp(4px, 0.5vw, 16px);
  font-size: clamp(1.9rem, 2.8vw, 6rem);
  line-height: 1;
}

.display-day-head strong {
  border-radius: 999px;
  padding: clamp(8px, 0.8vw, 22px) clamp(12px, 1.1vw, 30px);
  background: var(--tomato);
  color: #fff;
  font-size: clamp(0.95rem, 1vw, 2.3rem);
}

.display-menu {
  display: grid;
  gap: clamp(12px, 1vw, 28px);
}

.display-row {
  border-top: 1px solid var(--line);
  padding-top: clamp(12px, 1vw, 28px);
}

.display-row span {
  color: var(--sage-dark);
  font-size: clamp(0.9rem, 0.9vw, 2rem);
  font-weight: 880;
}

.display-row p {
  margin-top: clamp(4px, 0.35vw, 12px);
  font-size: clamp(1.25rem, 1.65vw, 3.75rem);
  line-height: 1.12;
  font-weight: 860;
  overflow-wrap: anywhere;
}

.display-note,
.display-empty {
  border-radius: 8px;
  padding: clamp(12px, 1vw, 30px);
  background: #eef4f5;
  color: var(--blue);
  font-size: clamp(1rem, 1.1vw, 2.5rem);
  font-weight: 760;
  line-height: 1.35;
}

@media (min-width: 2200px) {
  .display-days {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .display-screen {
    background-attachment: scroll;
  }

  .display-shell {
    width: min(100% - 20px, 680px);
    padding: 10px 0;
  }

  .display-hero {
    display: grid;
    min-height: auto;
  }

  .display-hero h1 {
    font-size: 3rem;
  }

  .display-week-badge {
    justify-self: start;
  }

  .display-day {
    min-height: auto;
  }
}
