/* Mess Hall — view styles: Week, Shopping, Recipes (list, editor, open recipe) and More.
   Shell, tokens and shared components are in styles.css. */

/* ---------- shared bits ---------- */
.kind {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle;
  background: var(--surface-2); color: var(--muted);
}
.kind .ico { width: 13px; height: 13px; }
.kind.fresh { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.kind.keeps { background: color-mix(in srgb, #60a5fa 16%, transparent); color: #60a5fa; }
@media (prefers-color-scheme: light) { .kind.keeps { color: #1d4ed8; } }
.kind.cooked { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.kind.lock { padding: 2px 6px; }
.kind.carried { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.kind.warn { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.n-chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
.wk-hint { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.wk-hint .ico { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; }
.wk-p { margin: -4px 0 12px; font-size: 13.5px; line-height: 1.5; }
.wk-rows .item { min-height: 56px; }
.wk-rows .item .t1, .wk-rows .item .t2 { display: block; white-space: normal; }
.list .item:disabled { opacity: .4; cursor: default; }
.item.sel { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }

/* ---------- Week ---------- */
.wk-head { display: flex; align-items: center; gap: 4px; margin: 2px 0 10px; }
.wk-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 4px 0; }
.wk-title b { font-size: 17px; }
.wk-title .muted { font-size: 12.5px; }
.wk-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.wk-actions > * { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; }
.wk-actions .ico { width: 19px; height: 19px; }
.wk-start { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 16px; margin-bottom: 12px; }
.wk-start > .ico { color: var(--accent); }
.wk-start p { margin: 0 0 8px; line-height: 1.5; }
.wk-count { font-size: 13px; }

.nights { display: flex; flex-direction: column; gap: 8px; }
.night {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 64px; padding: 10px 12px 10px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.night.today { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent) inset; }
.night.past:not(.today) { opacity: .62; }
.night.nocook { background: transparent; border-style: dashed; }
.night.skipped { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.n-day {
  width: 46px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 12px; padding: 5px 0; background: var(--surface-2);
}
.night.today .n-day { background: var(--accent); color: var(--accent-ink); }
.n-dow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.night.today .n-dow { font-size: 9px; letter-spacing: .1px; }
.n-date { font-size: 18px; font-weight: 700; line-height: 1.1; }
.n-day.sm { width: 40px; padding: 3px 0; }
.n-day.sm .n-date { font-size: 15px; }
.n-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.n-name { font-weight: 650; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-off { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--muted); }
.n-bits { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.wk-legend { margin-top: 14px; }

.wk-card { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin-bottom: 12px; }
.wk-card .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wk-card-t { font-weight: 700; font-size: 17px; }
.wk-card .text-btn { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.wk-note { display: flex; align-items: center; gap: 8px; font-size: 14px; border: 0; border-radius: 0; }
.wk-reasons { margin-bottom: 14px; }
.wk-moves { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 8px; }
.wk-moves li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 14.5px; }
.wk-moves .ico { margin-top: 2px; color: var(--accent); }
.wk-search { margin-bottom: 10px; }
.wk-pick-list { flex: 1; min-height: 0; overflow: auto; }

/* ---------- Shopping ---------- */
.sh-add { display: flex; gap: 8px; margin-bottom: 12px; }
.sh-add .icon-btn { width: 46px; height: 46px; }
.sh-progress { display: flex; align-items: center; gap: 10px; margin: 0 2px 4px; font-size: 13px; }
.sh-bar { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.sh-bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .2s; }
.sh-progress .icon-btn { width: 34px; height: 34px; }
.sh-item { cursor: pointer; min-height: 54px; padding-right: 4px; }
.sh-item .sh-t { display: block; overflow-wrap: anywhere; }
.sh-item .t2 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-item.done .sh-t { text-decoration: line-through; color: var(--muted); }
.sh-item.done .t2 { opacity: .6; }
.sh-fresh { display: inline-block; width: 13px; height: 13px; margin-left: 5px; vertical-align: -1px; color: var(--good); }
.sh-who { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sh-more { width: 36px; height: 40px; }
.sh-notes { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.sh-notes p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.sh-notes .ico { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.sh-btn { width: auto; margin-top: 12px; }
.empty > .ico.xl { margin: 0 auto 8px; opacity: .55; }

/* ---------- Recipes ---------- */
.rc-head { display: flex; gap: 8px; align-items: center; margin: 2px 0 10px; }
.rc-search { flex: 1; min-width: 0; position: relative; }
.rc-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.rc-search input:not([type=checkbox]) { padding-left: 36px; }
.rc-add {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 46px; padding: 0 14px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.rc-add .ico { width: 19px; height: 19px; }
.rc-filters { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; scrollbar-width: none; }
.rc-filters .chip { cursor: pointer; }
.rc-bits { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-empty p { margin: 2px 2px 12px; line-height: 1.5; }
.rc-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.wk-rows label.item { cursor: pointer; position: relative; }
.rc-off { opacity: .5; cursor: default !important; }
.rc-reading { display: flex; gap: 14px; align-items: center; padding: 8px 2px 16px; }
.rc-reading .mo-spin { width: 22px; height: 22px; }
.rc-reading p { margin: 0; }

/* the editor */
.ed .field { margin-bottom: 14px; }
.ed-keeps { cursor: pointer; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ed-keeps .mo-t1 { display: flex; align-items: center; gap: 6px; }
.ed-keeps .t2 { display: block; line-height: 1.4; margin-top: 2px; }
.ig-rows { display: flex; flex-direction: column; gap: 6px; }
.ig-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 38px 32px; gap: 6px; align-items: center; }
.ig-row input.ig-text { padding: 9px 10px; }
.ig-row select.ig-sec { padding: 9px 6px; font-size: 13px; }
.ig-fresh, .ig-del { height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.ig-fresh { border: 1px solid var(--line); }
.ig-fresh.on { color: var(--good); border-color: color-mix(in srgb, var(--good) 55%, transparent); background: color-mix(in srgb, var(--good) 12%, transparent); }
.ed-row-btns { display: flex; gap: 14px; margin-top: 6px; }
.ed-row-btns .text-btn { display: inline-flex; align-items: center; gap: 4px; }
.ig-paste { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.field .label .ico { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; color: var(--good); }
.field label .muted, .field .label .muted { font-size: 12px; }
@media (max-width: 380px) { .ig-row { grid-template-columns: minmax(0, 1fr) 84px 36px 28px; } }

/* the open recipe */
.rp { padding-bottom: 12px; }
.rp-name { margin: 4px 0 8px; font-size: 24px; line-height: 1.2; }
.rp-facts { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.rp .ed-keeps { padding: 11px 12px; }
.rp-plan { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 4px; }
.rp-sec { margin: 12px 2px 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.rp-sec:first-child { margin-top: 0; }
.rp-ing { display: flex; gap: 10px; align-items: baseline; padding: 6px 2px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); font-size: 15px; }
.rp-fresh { width: 14px; height: 14px; color: var(--good); flex: none; transform: translateY(2px); }
.rp-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); flex: none; margin: 0 4.5px; transform: translateY(-2px); opacity: .6; }
.rp-none { font-size: 14px; color: var(--muted); line-height: 1.5; }
.rp-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; line-height: 1.5; }
.rp-notes { margin: 0 2px; white-space: pre-wrap; line-height: 1.5; }
.rp-hist { margin: 18px 2px 0; font-size: 12.5px; }

/* ---------- More ---------- */
.mo-page code, .mo-once code {
  font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2); padding: 1px 5px; border-radius: 6px; overflow-wrap: anywhere;
}
.mo-panel { display: flex; flex-direction: column; gap: 12px; }
.mo-panel .field { margin-bottom: 0; }
.mo-state { display: flex; align-items: flex-start; gap: 12px; }
.mo-state > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-self: center; }
.mo-state .muted { font-size: 13px; line-height: 1.45; }
.mo-state-ico {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--muted);
}
.mo-state-ico .ico { width: 20px; height: 20px; }
.mo-state.on .mo-state-ico { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.mo-state.mo-warn .mo-state-ico { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.mo-spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, transparent); border-top-color: var(--accent);
  animation: mo-turn .7s linear infinite;
}
@keyframes mo-turn { to { transform: rotate(360deg); } }
.mo-state > .mo-spin { margin: 11px; }
.mo-sub { margin: 14px 2px 6px; font-size: 12.5px; color: var(--muted); }
.mo-hint { margin: 6px 2px 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.mo-lead { margin: -2px 2px 8px; }
.mo-pref { min-height: 58px; cursor: pointer; }
.mo-t1 { display: block; font-weight: 600; }
.mo-pref .t2 { display: block; }
.mo-switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; margin: 0; cursor: pointer;
  width: 46px; height: 28px; border-radius: 999px; background: var(--line); transition: background .15s;
}
.mo-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .15s;
}
.mo-switch:checked { background: var(--accent); }
.mo-switch:checked::after { transform: translateX(18px); }
.mo-days { display: flex; flex-wrap: wrap; gap: 6px; }
.mo-days .chip { cursor: pointer; min-width: 48px; justify-content: center; }
.mo-staples { display: flex; flex-wrap: wrap; gap: 6px; }
.mo-staples .chip { color: var(--text); padding-right: 4px; }
.mo-staples .chip button { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--muted); }
.mo-panel .sh-add { margin: 0; }
.mo-ico {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--muted);
}
.mo-ico .ico { width: 18px; height: 18px; }
.mo-chev { width: 18px; height: 18px; color: var(--muted); }
.mo-danger, .mo-danger .mo-ico { color: var(--danger); }
.mo-version { margin: 20px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.mo-page .item .t1, .mo-page .item .t2, .mo-server .item .t1, .mo-server .item .t2 { display: block; }
.mo-once {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); font-size: 13.5px; line-height: 1.45;
}
.mo-once .ico { margin-top: 1px; width: 18px; height: 18px; }
.mo-once span { color: var(--text); }
.mo-log {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto;
  max-height: 42dvh;
}
.mo-wrap { display: block; font-size: 13.5px; overflow-wrap: anywhere; }
.login-sub { margin: -10px 0 8px; }
