@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-variable.ttf") format("truetype");
  font-style: normal; font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-variable.ttf") format("truetype");
  font-style: normal; font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: Kitchen Aptos;
  src: url("/assets/media/aptos-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Kitchen Aptos;
  src: url("/assets/media/aptos-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --wine: #641b34;
  --wine-dark: #50162b;
  --cream: #fbf7f4;
  --ink: #271f22;
  --muted: #695f62;
  --line: #e6dcda;
  --rose: #f4ebed;
  --white: #fff;
  --rail: 166px;
  --font: "Inter", system-ui, sans-serif;
  --font-title: "Montserrat", var(--font);
  --font-headline: var(--font-title);
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 1rem/1.4 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
svg { display: inline-block; flex-shrink: 0; vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
a { color: var(--wine); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #a35c79; outline-offset: 2px;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { color: var(--wine); font-size: clamp(1.8125rem, 2.5vw, 2.125rem); line-height: 1.1; letter-spacing: -.045em; }
h2 { font-size: 1.3125rem; line-height: 1.2; letter-spacing: -.025em; color: #542638; }
h3 { font-size: 1.1875rem; line-height: 1.16; letter-spacing: -.018em; }
small, .muted, .subtitle { color: var(--muted); }
small { font-size: .875rem; }
time, input[type="number"], .stat { font-variant-numeric: tabular-nums; }
:where(h1,h2,h3,p,li,.row,.btn,.subtitle) { overflow-wrap: break-word; }


.shell { min-height: 100vh; min-height: 100dvh; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 5;
  display: flex; flex-direction: column; overflow-y: auto;
  background: var(--white); border-right: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--wine); font-size: 1.375rem; font-weight: 700; letter-spacing: -.025em; }
.rail .brand { min-height: 60px; padding: 8px 16px; }
.brandmark, .brand > b:first-child:has(svg) {
  flex: 0 0 31px; width: 31px; height: 31px; border-radius: 7px;
  display: inline-grid; place-items: center; color: white; background: var(--wine);
}
.railnav, .rail > nav { display: flex; flex-direction: column; gap: 4px; padding: 17px 9px; }
.nav-link { display: flex; align-items: center; gap: 9px; min-height: 39px; padding: 8px; border: 0; border-radius: 6px; color: #605459; background: transparent; font-size: .9375rem; text-align: left; line-height: 1.2; text-decoration: none; }
.nav-link.active, .nav-link[aria-current="page"] { background: var(--rose); color: var(--wine); font-weight: 700; }
.rail > .logout, .rail > .nav-link:last-child, .rail > footer { margin: auto 9px 12px; }
.app { min-height: 100vh; margin-left: var(--rail); min-width: 0; }
.top { min-height: 58px; padding: 8px 25px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--white); border-bottom: 1px solid var(--line); }
.top .brand, .mobile-nav { display: none; }
.search { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; width: min(240px,100%); min-height: 34px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--muted); font-size: .9375rem; }
.search > input { min-width: 0; flex: 1; padding: 4px 0; border: 0; outline: 0; background: transparent; box-shadow: none; }
.search:focus-within { outline: 2px solid #9c6579; outline-offset: 1px; }
.profile { display: inline-flex; align-items: center; gap: 7px; min-width: 0; margin-left: auto; padding: 5px 3px; border: 0; background: transparent; color: #594b51; font-size: .9375rem; }
.profile svg, .profile > i { color: var(--wine); }
.app main, main.app-main { width: 100%; max-width: 1500px; margin: 0 auto; padding: 23px 25px 38px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.subtitle { margin-top: 4px; font-size: .9375rem; }
.actions, .filters, .chips, .periods { display: flex; align-items: center; gap: 8px; }
.actions { flex-wrap: wrap; }
.filters { flex-wrap: wrap; justify-content: space-between; margin-bottom: 15px; }
.chips { max-width: 100%; flex-wrap: wrap; gap: 4px; }
.periods { display: inline-flex; flex-shrink: 0; padding: 3px; gap: 3px; border: 1px solid #dfd2d6; border-radius: 8px; background: white; }
.periods :is(button,a), .chip { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 13px; border: 0; border-radius: 5px; color: #67585e; background: transparent; text-decoration: none; font-size: .9375rem; line-height: 1.18; }
.periods .chosen, .periods .active, .chip.chosen, .chip.active, .chip[aria-pressed="true"] { font-weight: 700; color: white; background: var(--wine); }
.btn, button.primary, button.subtle, a.primary, a.subtle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px;
  padding: 8px 13px; border: 1px solid #ddc9d1; border-radius: 7px;
  background: white; color: var(--wine); font-size: .9375rem; font-weight: 700; text-decoration: none; line-height: 1.15;
}
button.primary, a.primary, .btn.primary { background: var(--wine); color: white; border-color: var(--wine); }
.btn.subtle, button.subtle, a.subtle { color: var(--wine); background: #fcf7f9; }
.link { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 4px 0; color: var(--wine); border: 0; background: transparent; text-decoration: none; font-weight: 700; }
.summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 80px; padding: 15px 20px; margin: 0 0 15px; border-radius: 11px; color: white; background: var(--wine); }
.summary :is(h1,h2,h3,strong,b) { color: inherit; }
.summary small, .summary .muted, .summary .subtitle { color: #f1dfe6; }
.summary-label { display: flex; align-items: center; gap: 6px; color: #f1dfe6; font-size: .9375rem; margin-bottom: 4px; }
.summary-title { font-size: 1.55rem; font-weight: 700; line-height: 1.12; letter-spacing: -.025em; }
.summary-side { border-left: 1px solid #97596f; padding-left: 20px; }
.summary-side small { display: block; margin-bottom: 2px; }
.pair, .week-grid, .detail-grid { display: grid; align-items: start; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; margin-bottom: 15px; }
.stack { display: grid; gap: 14px; min-width: 0; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: white; min-width: 0; overflow: hidden; }
.panel:has(.meal-row), .panel:has(.checkrow) { border-top: 2px solid #965a70; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head time { color: var(--wine); font-weight: 700; }
.panel-body { padding: 15px 16px; }
.panel-body > p + p { margin-top: .65em; }
.meal-row { display: flex; align-items: center; gap: 15px; min-width: 0; }
.meal-row > :not(.meal-photo) { min-width: 0; }
.meal-row + p { margin-top: .8rem; }
.meal-photo { display: block; flex: 0 0 auto; width: clamp(100px,12.5vw,178px); aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
.state { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 9px; border-radius: 20px; background: #f3edef; color: #67555e; font-size: .875rem; font-weight: 400; line-height: 1.2; }
.state::before { content: ""; display: block; flex: none; width: 5px; height: 5px; border-radius: 100%; background: currentColor; }
.state.cooking { color: #695020; background: #faf0d8; }
.state.ready { color: #385a3a; background: #eaf1e8; }
.state.planned { color: #67555e; background: #f3edef; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.row, .guest-line, .journal-row, .stock-row, .checkrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; min-height: 44px; padding: 9px 0; border: 0; border-bottom: 1px solid #eee5e6; background: transparent; font-size: 1rem; text-align: left; }
.row:last-child, .guest-line:last-child, .journal-row:last-child, .stock-row:last-child, .checkrow:last-child { border-bottom: 0; }
.panel > :is(.row,.guest-line,.journal-row,.stock-row,.checkrow) { padding-right: 16px; padding-left: 16px; }
.row > *, .journal-row > *, .guest-line > *, .stock-row > * { min-width: 0; }
.row time { color: var(--wine); }
.guest-line img, .journal-row img { flex: none; width: 80px; aspect-ratio: 4/3; object-fit: cover; border-radius: 7px; }
.guest-line input[type="number"] { width: 62px; text-align: center; font-weight: 700; color: var(--wine); }
.journal-row { width: 100%; }
.journal-row > div, .guest-line > div { flex: 1; }
.journal-row > div:last-child:not(:first-child), .guest-line > div:last-child:not(:first-child) { flex: initial; }
.stat { color: var(--wine); font-weight: 700; }
.summary .stat { color: white; font-size: 2.125rem; letter-spacing: -.03em; }
.checkrow { justify-content: flex-start; width: 100%; }
.checkrow :is(small,.muted) { margin-left: auto; }
:is(input[type="checkbox"], input[type="radio"]) { width: 1.1rem; height: 1.1rem; accent-color: var(--wine); flex-shrink: 0; }
.stock-low, .stock-out { display: inline-flex; width: fit-content; padding: 2px 8px; border-radius: 12px; font-size: .875rem; }
.stock-low { color: #725123; background: #f8ecd6; }
.stock-out { color: #8a3642; background: #f9e7e8; }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); line-height: 1.5; }
.empty > .btn { margin-top: 10px; }
.food-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.food-card { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 0; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-align: left; text-decoration: none; }
.food-photo { width: 100%; height: clamp(118px,11vw,170px); object-fit: cover; background: var(--rose); }
.food-info { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 11px 14px 13px; min-width: 0; }
.food-info > strong, .food-info > h3 { letter-spacing: -.02em; font-size: 1.2rem; line-height: 1.15; }
.food-info > small:first-child { font-weight: 700; color: #88485c; }
.food-info > small:last-child { margin-top: auto; padding-top: 2px; font-weight: 400; color: var(--muted); }
.week-grid { grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); }
.week-days { display: grid; }
.week-days > :is(button,a) { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 13px; min-width: 0; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: white; color: inherit; }
.week-days .selected, .stock-row.selected { background: var(--rose); color: var(--wine); }
.detail-grid { grid-template-columns: minmax(0,.96fr) minmax(0,1fr); gap: 20px; }
.detail-photo { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; }
.detail-grid .panel-body { padding: 22px 24px; }
.field { display: grid; gap: 5px; margin-bottom: 12px; color: #543c45; font-size: .9375rem; font-weight: 700; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea {
  min-width: 0; max-width: 100%; width: 100%; border: 1px solid #d9cbce; border-radius: 7px;
  padding: 8px 10px; min-height: 38px; color: var(--ink); background: white; font-weight: 400;
}
.search input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { flex: 1; min-height: 30px; padding: 2px 0; border: 0; background: transparent; }
.filters > :is(input,select) { width: auto; }
select { padding-inline-end: 30px; }
textarea { resize: vertical; }
.modal, dialog { max-width: min(540px,calc(100vw - 32px)); max-height: min(88dvh,780px); padding: 0; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: white; box-shadow: 0 16px 60px #3f13282b; }
dialog::backdrop { background: #25192071; }
.modal-inner, dialog > form, dialog > section { padding: 20px; }
.modal h2, dialog h2 { margin-bottom: 14px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 16px; }
.notice { padding: 10px 12px; border-radius: 7px; margin: 8px 0; background: #f5e9ee; color: #62334a; }
.notice:empty { display: none; }
.login { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center; padding: 28px 20px; }
.login-card { width: min(100%,435px); padding: clamp(22px,4vw,38px); border: 1px solid var(--line); border-radius: 16px; background: white; }
.login-card :is(h1,h2) { margin: 17px 0 8px; }
.login-card :is(p,form) + form { margin-top: 16px; }
.login-card .btn { width: 100%; }
.login-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 9px; }
@media (hover:hover) {
  .nav-link:hover:not(.active), .link:hover, .chip:hover:not(.active):not(.chosen) { color: var(--wine-dark); background: #f8f0f3; }
  .btn:hover:not(:disabled), button.subtle:hover { border-color: #b991a0; }
  button.primary:hover:not(:disabled), a.primary:hover { background: var(--wine-dark); }
  .food-card:hover { border-color: #bf9ca8; }
}
@media (min-width: 1600px) {
  .food-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .meal-photo { width: 94px; }
  .pair { gap: 10px; }
  .app main { padding-inline: 17px; }
  .food-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .rail { display: none; }
  .app { margin-left: 0; }
  .top { position: fixed; top: 0; right: 0; left: 0; z-index: 9; min-height: 54px; padding: 3px 15px; gap: 6px; }
  .top .brand { display: inline-flex; font-size: 1.25rem; }
  .top > .search { display: none; }
  .mobile-nav { position: fixed; z-index: 9; inset: auto 0 0; min-height: 65px; padding: 2px 5px max(4px,env(safe-area-inset-bottom)); display: flex; align-items: stretch; justify-content: space-around; background: white; border-top: 1px solid var(--line); }
  .mobile-nav :is(button,a) { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 50px; border: 0; border-radius: 0; padding: 4px 2px; background: white; color: #695c62; font-size: .84rem; line-height: 1.05; text-align: center; text-decoration: none; }
  .mobile-nav :is(.active,[aria-current="page"]) { background: white; color: var(--wine); font-weight: 700; }
  .mobile-nav :is(.active,[aria-current="page"])::before { content: ""; position: absolute; top: -2px; left: calc(50% - 14px); height: 3px; width: 28px; border-radius: 0 0 2px 2px; background: var(--wine); }
  .app main, main.app-main { padding: 72px 15px max(86px,calc(76px + env(safe-area-inset-bottom))); }
  h1 { font-size: 1.8125rem; }
  h2 { font-size: 1.1875rem; }
  h3 { font-size: 1.0625rem; }
  .profile, .btn, .primary, .subtle, .link, .chip, .periods button,
  button:not(.food-card), .search, textarea, select,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { min-height: 44px; }
  button:not(.food-card), .link, .periods a, a.btn { min-width: 44px; }
  .checkrow, label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { min-height: 44px; }
  .page-head { display: flex; align-items: flex-start; margin-bottom: 14px; }
  .page-head > .actions { flex: 1 1 100%; }
  .page-head > .periods { flex: 1 1 100%; }
  .periods :is(button,a) { min-height: 44px; flex: 1; }
  .actions, .filters { gap: 7px; }
  .page-head .actions > .periods { flex: 1 1 100%; }
  .chips { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
  .chip { white-space: nowrap; }
  .summary { min-height: 72px; padding: 12px 14px; margin-bottom: 12px; gap: 10px; }
  .summary-title { font-size: 1.35rem; }
  .summary-side { padding-left: 9px; font-size: .9375rem; }
  .pair, .week-grid, .detail-grid { grid-template-columns: minmax(0,1fr); gap: 12px; margin-bottom: 13px; }
  .panel-head { min-height: 45px; padding: 10px 13px; }
  .panel-body, .detail-grid .panel-body { padding: 13px 14px; }
  .meal-row { gap: 11px; }
  .meal-photo { width: clamp(85px,27vw,117px); }
  .card-foot { padding: 9px 14px; }
  .food-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .food-photo { height: clamp(84px,24vw,150px); }
  .food-info { padding: 7px 9px 9px; gap: 3px; }
  .food-info > strong, .food-info > h3 { font-size: 1.04rem; line-height: 1.12; }
  .food-info > small { font-size: .83rem; }
  .guest-line, .journal-row { gap: 8px; }
  .guest-line img, .journal-row img { width: 57px; }
  .detail-photo { max-height: 220px; }
  .modal, dialog { max-width: calc(100% - 20px); max-height: 88dvh; width: 100%; }
  .modal-inner, dialog > form, dialog > section { padding: 16px; }
  .field input[type="text"], .field input[type="number"], .field select, .field textarea { font-size: 1rem; }
}
