/* Veckomenyn. Phone first: one column that fills the screen and is merely centred on wider ones. */

:root {
  --enamel: #EEF3EF;
  --paper: #FBFDFB;
  --spruce: #14312B;
  --spruce-2: #1F4239;
  --spruce-soft: #4B635D;
  --mist: #C5D6CE;
  --lingon: #BE2347;
  --lingon-wash: #F6DDE3;
  --dill: #2F7A4A;
  --dill-wash: #E3EFE6;
  --butter: #F4CB4E;
  --fog: #CFDAD3;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabs-height: 70px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--enamel); color: var(--spruce); font: 400 16px/1.45 var(--text); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--butter); outline-offset: 2px; }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom) + 12px); }
body.no-tabs #app { padding-bottom: 24px; }

/* ---- bottom tab bar ---- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--paper); border-top: 1px solid var(--fog); padding-bottom: env(safe-area-inset-bottom); }
.tabs-inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 4px 8px; }
.tabs a { display: grid; justify-items: center; gap: 1px; min-height: 52px; align-content: center; text-decoration: none; font-size: 12px; font-weight: 500; color: var(--spruce-soft); }
.tabs a span { font-size: 19px; line-height: 1.15; padding: 0 14px; border-radius: 99px; }
.tabs a[aria-current="page"] { color: var(--spruce); font-weight: 700; }
.tabs a[aria-current="page"] span { background: var(--butter); }
body.no-tabs .tabs { display: none; }

/* ---- shared pieces ---- */
.page-head { padding: 22px 18px 6px; }
.page-head h1 { font-weight: 800; font-size: 27px; line-height: 1.05; margin-bottom: 6px; }
.page-head p { color: var(--spruce-soft); font-size: 14px; }
.block { background: var(--paper); border-radius: 22px; margin: 12px 12px 0; padding: 16px; }
.block h2 { font-weight: 800; font-size: 19px; margin-bottom: 2px; }
.hint { font-size: 13px; color: var(--spruce-soft); margin-bottom: 12px; }
.section-label { font: 600 15px var(--display); color: var(--spruce-soft); margin: 22px 18px 6px; }
.fine { font-size: 12px; color: var(--spruce-soft); padding: 12px 22px 0; text-align: center; }
.banner { margin: 12px 12px 0; padding: 12px 16px; border-radius: 16px; background: var(--butter); font-size: 14px; font-weight: 500; }
.banner.failed { background: var(--lingon-wash); color: var(--lingon); }
.banner.quiet { background: var(--dill-wash); color: var(--dill); }
.banner button { margin-top: 8px; }
.btn { min-height: 48px; padding: 0 20px; border-radius: 16px; border: 2px solid var(--spruce); background: none; font-weight: 700; font-size: 16px; }
.btn.solid { background: var(--spruce); color: var(--paper); }
.btn.gold { background: var(--butter); border-color: var(--butter); color: var(--spruce); }
.btn.small { min-height: 44px; font-size: 14px; border-radius: 14px; padding: 0 14px; }
.btn:disabled { border-color: var(--fog); color: var(--spruce-soft); cursor: default; background: none; }
.btn.block-wide { width: 100%; }
.empty { margin: 40px 24px; text-align: center; color: var(--spruce-soft); }
.empty h2 { color: var(--spruce); font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--fog); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.avatar.yes { background: var(--dill); color: #fff; }
.avatar.no { background: var(--lingon); color: #fff; }
.avatar.gold { background: var(--butter); }
.photo { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--fog); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .fallback { padding: 12px 16px; text-align: center; font: 600 15px var(--display); color: var(--spruce-soft); }

.toast { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom) + 10px); z-index: 30; max-width: 536px; margin: 0 auto; background: var(--spruce); color: var(--paper); border-radius: 16px; padding: 12px 16px; font-size: 14px; animation: rise-in .25s ease both; }
.toast.error { background: var(--lingon); }

/* ---- login ---- */
.login { min-height: 100dvh; display: grid; align-content: center; padding: 24px 20px; gap: 18px; }
.login .mark { font: 800 36px/1 var(--display); letter-spacing: -0.03em; }
.login p.lede { color: var(--spruce-soft); }
.login form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
.field input, .field textarea, .add input { min-height: 50px; border-radius: 14px; border: 2px solid var(--fog); background: #fff; padding: 0 14px; font-size: 16px; }
.field textarea { min-height: 96px; padding: 12px 14px; line-height: 1.4; resize: vertical; width: 100%; }
.form-error { color: var(--lingon); font-weight: 500; font-size: 14px; min-height: 20px; }

/* ---- voting: pinned top ---- */
.top { position: sticky; top: 0; z-index: 10; background: var(--spruce); color: var(--paper); padding: 16px 18px 10px; border-radius: 0 0 26px 26px; }
.hello { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hello h1 { font-weight: 800; font-size: 24px; line-height: 1.05; }
.clock { text-align: right; flex: none; }
.clock small { display: block; color: var(--mist); font-size: 12px; }
.clock .num { font: 800 27px/1 var(--display); color: var(--butter); font-variant-numeric: tabular-nums; }
.plates { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.plate { background: none; border: 0; padding: 4px 0; min-height: 52px; color: inherit; }
.plate .dish { width: 32px; height: 32px; margin: 0 auto 2px; border-radius: 50%; border: 2.5px solid #5C7A72; display: grid; place-items: center; font-size: 14px; }
.plate[data-state="liked"] .dish { background: var(--dill); border-color: var(--dill); }
.plate[data-state="disliked"] .dish { background: var(--lingon); border-color: var(--lingon); }
.plate[data-state="new"] .dish { border-color: var(--butter); border-style: dashed; }
.plate small { font-size: 11px; color: var(--mist); }
.strip { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px 2px; font-size: 14px; color: var(--spruce-soft); }
.strip b { color: var(--spruce); }
.tonight-link { display: flex; align-items: center; gap: 12px; margin: 10px 12px 0; padding: 8px 14px 8px 8px; background: var(--paper); border-radius: 16px; text-decoration: none; font-size: 14px; }
.tonight-link .photo { width: 46px; height: 46px; border-radius: 12px; flex: none; }
.tonight-link b { display: block; font-size: 12px; font-weight: 500; color: var(--spruce-soft); }
.tonight-link span.name { font-weight: 700; }

/* ---- a day's card ---- */
.day { background: var(--paper); border-radius: 22px; margin: 10px 12px 0; overflow: hidden; scroll-margin-top: 150px; }
.day > .photo { height: 160px; }
.day .dayname { position: absolute; left: 12px; top: 12px; background: var(--paper); border-radius: 99px; padding: 3px 12px; font-size: 14px; font-weight: 700; }
.day .tag { position: absolute; right: 12px; top: 12px; max-width: 62%; background: var(--butter); border-radius: 14px; padding: 3px 10px; font-size: 12px; font-weight: 500; }
.day .body { padding: 14px 16px 16px; }
.day h2 { font-weight: 800; font-size: 21px; line-height: 1.15; margin-bottom: 6px; }
.facts { font-size: 14px; color: var(--spruce-soft); display: flex; gap: 6px 14px; flex-wrap: wrap; }
.facts b { color: var(--spruce); }
.por { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 8px 8px 8px 14px; background: var(--enamel); border-radius: 16px; font-size: 14px; }
.por small { display: block; color: var(--spruce-soft); font-size: 12px; }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button { width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--spruce); background: var(--paper); font-size: 20px; font-weight: 700; }
.stepper button:disabled { border-color: var(--fog); color: var(--fog); }
.stepper b { font: 800 22px var(--display); min-width: 34px; text-align: center; }
details.ingredients { margin: 6px 0 12px; font-size: 14px; }
details.ingredients summary { padding: 10px 0; font-weight: 500; cursor: pointer; min-height: 44px; }
details.ingredients ul { margin: 0 0 8px; padding-left: 18px; color: var(--spruce-soft); }
.votes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vote { min-height: 52px; border-radius: 16px; border: 2px solid var(--spruce); background: none; font-weight: 700; font-size: 17px; }
.vote:active { transform: scale(.96); }
.vote.like[aria-pressed="true"] { background: var(--dill); border-color: var(--dill); color: #fff; }
.vote.dislike[aria-pressed="true"] { background: var(--lingon); border-color: var(--lingon); color: #fff; }
.vote:disabled { opacity: .5; cursor: default; }
.who { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 13px; color: var(--spruce-soft); }
.state-note { margin-top: 10px; font-size: 14px; font-weight: 500; }
.state-note.finding { color: var(--lingon); }
.state-note.attention { color: var(--lingon); background: var(--lingon-wash); border-radius: 12px; padding: 10px 12px; }
.state-note.settled { color: var(--spruce-soft); }

/* ---- today ---- */
.tonight { background: var(--spruce); color: var(--paper); border-radius: 0 0 26px 26px; padding: 18px 18px 20px; }
.tonight .hi { font-size: 14px; color: var(--mist); }
.tonight h1 { font-weight: 800; font-size: 25px; line-height: 1.05; margin: 2px 0 14px; }
.tonight .photo { height: 200px; border-radius: 20px; }
.tonight h2 { font-weight: 800; font-size: 26px; line-height: 1.1; margin: 14px 0 8px; }
.when { display: flex; align-items: center; gap: 14px; background: var(--spruce-2); border-radius: 18px; padding: 12px 16px; }
.when small { display: block; font-size: 12px; color: var(--mist); }
.when strong { font: 800 34px/1 var(--display); color: var(--butter); font-variant-numeric: tabular-nums; }
.when p { font-size: 14px; color: var(--mist); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.stats div { background: var(--spruce-2); border-radius: 16px; padding: 10px 10px 9px; }
.stats strong { display: block; font: 800 17px/1.15 var(--display); }
.stats small { font-size: 11.5px; color: var(--mist); line-height: 1.2; display: block; margin-top: 2px; }
.stats .save { background: var(--dill); }
.stats .save small { color: var(--dill-wash); }
.tonight .btn { margin-top: 14px; display: grid; place-items: center; text-decoration: none; }
.ticks label { display: flex; gap: 12px; align-items: center; min-height: 48px; border-top: 1px solid var(--fog); font-size: 15px; }
.ticks label:first-of-type { border-top: 0; }
.ticks input { width: 22px; height: 22px; accent-color: var(--dill); flex: none; }
.ticks input:checked + span { color: var(--spruce-soft); text-decoration: line-through; }
.mini { background: var(--paper); border-radius: 16px; margin: 0 12px 6px; padding: 8px; display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; }
.mini .photo { width: 54px; height: 54px; border-radius: 12px; }
.mini .photo .fallback { display: none; }
.mini b { display: block; font-size: 13px; color: var(--spruce-soft); font-weight: 500; }
.mini span.name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.mini em { font-style: normal; font-size: 12px; color: var(--spruce-soft); padding-right: 6px; white-space: nowrap; }
.mini.past { opacity: .55; }
.mini.is-today { outline: 2px solid var(--butter); }

/* ---- past dinners ---- */
.chips { display: flex; gap: 8px; padding: 12px 18px 0; overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; min-height: 44px; padding: 0 14px; border-radius: 99px; border: 2px solid var(--fog); background: none; font-weight: 500; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--spruce); border-color: var(--spruce); color: var(--paper); }
.row { background: var(--paper); border-radius: 18px; margin: 0 12px 8px; padding: 10px; display: grid; grid-template-columns: 76px 1fr; gap: 12px; }
.row .photo { width: 76px; height: 76px; border-radius: 12px; }
.row .photo .fallback { display: none; }
.row h3 { font-weight: 800; font-size: 17px; line-height: 1.15; margin: 2px 0 4px; }
.meta { font-size: 13px; color: var(--spruce-soft); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.meta .avatar { width: 20px; height: 20px; font-size: 10px; }
.row .wide { grid-column: 1 / -1; }
.row .note { grid-column: 1 / -1; font-size: 13px; color: var(--spruce-soft); }
.asked { grid-column: 1 / -1; background: var(--dill-wash); color: var(--dill); border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; animation: pop .35s ease; }
.asked button { background: none; border: 0; text-decoration: underline; font-weight: 500; min-height: 44px; color: var(--spruce); }
.shade { position: fixed; inset: 0; z-index: 40; background: rgba(13, 31, 27, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease both; }
.sheet { background: var(--paper); width: 100%; max-width: 560px; border-radius: 26px 26px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 86dvh; overflow-y: auto; animation: rise .32s cubic-bezier(.2, .9, .3, 1) both; }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--fog); margin: 0 auto 12px; }
.sheet h3 { font-size: 19px; font-weight: 800; margin-bottom: 2px; }
.sheet p { font-size: 14px; color: var(--spruce-soft); margin-bottom: 10px; }
.sheet .opt { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 8px; background: none; border: 0; border-top: 1px solid var(--fog); padding: 0 4px; font-size: 15px; text-align: left; }
.sheet .opt b { width: 48px; flex: none; }
.sheet .opt span { color: var(--spruce-soft); font-size: 14px; }
.sheet .cancel { width: 100%; min-height: 48px; margin-top: 8px; border-radius: 14px; border: 0; background: var(--enamel); font-weight: 700; font-size: 15px; }

/* ---- shopping ---- */
.store-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.store-head span { font-size: 13px; color: var(--spruce-soft); }
.item { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; min-height: 52px; border-top: 1px solid var(--fog); font-size: 15px; }
.item input { width: 22px; height: 22px; accent-color: var(--dill); }
.item small { display: block; font-size: 12px; color: var(--spruce-soft); }
.item .price { font-weight: 700; white-space: nowrap; }
.item:has(input:checked) .what { color: var(--spruce-soft); text-decoration: line-through; }
.totals { display: grid; gap: 4px; font-size: 15px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font: 800 20px var(--display); margin-top: 6px; }
.totals .saved { color: var(--dill); font-weight: 700; }

/* ---- my food ---- */
.rule { display: inline-block; font: 700 12px var(--text); letter-spacing: 0; border-radius: 99px; padding: 1px 9px; margin-left: 6px; vertical-align: middle; }
.rule.hard { background: var(--lingon-wash); color: var(--lingon); }
.rule.soft { background: var(--dill-wash); color: var(--dill); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { min-height: 44px; padding: 0 14px; border-radius: 99px; border: 2px solid var(--fog); background: none; font-size: 15px; font-weight: 500; transition: background .15s, border-color .15s; }
.choice:active { transform: scale(.95); }
.choice[aria-pressed="true"] { background: var(--lingon); border-color: var(--lingon); color: #fff; }
.choice[aria-pressed="true"]::before { content: "✕ "; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tagged { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px 0 14px; border-radius: 99px; background: var(--enamel); font-size: 15px; max-width: 100%; overflow-wrap: anywhere; }
.tagged button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--fog); font-size: 14px; flex: none; }
.add { display: flex; gap: 8px; margin-top: 10px; }
.add input { flex: 1; min-width: 0; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.everyone { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.everyone li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--fog); overflow-wrap: anywhere; }
.everyone li:first-child { border-top: 0; }
.everyone span { color: var(--spruce-soft); }
.savebar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom)); z-index: 15; background: var(--paper); border-top: 1px solid var(--fog); }
.savebar > div { max-width: 560px; margin: 0 auto; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.savebar span { flex: 1; font-size: 13px; color: var(--spruce-soft); }
.savebar span.error { color: var(--lingon); font-weight: 500; }
.logout { display: block; margin: 24px auto 0; background: none; border: 0; text-decoration: underline; color: var(--spruce-soft); min-height: 44px; }

/* ---- motion: each answers something the member just did, except the plates laid once on load ---- */
@keyframes lay { from { transform: translateY(10px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { 0% { transform: scale(.55); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes press { 50% { transform: scale(.95); } }
@keyframes slide-out { to { transform: translateX(-110%) rotate(-4deg); opacity: 0; } }
@keyframes slide-in { from { transform: translateX(60%) rotate(3deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes steam { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes rise-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tick { 50% { transform: scale(1.06); } }
.plates.first .plate { animation: lay .45s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: calc(var(--i) * 60ms + 150ms); }
.plate.pop .dish { animation: pop .4s cubic-bezier(.2, .9, .3, 1.4); }
.vote.done { animation: press .25s ease; }
.day.leaving { animation: slide-out .4s ease-in forwards; }
.day.arriving { animation: slide-in .5s cubic-bezier(.2, .9, .3, 1.1) both; }
.state-note.finding { animation: steam 1.2s ease-in-out infinite; }
.clock.soon .num { animation: tick 1s ease-in-out infinite; color: #FF8A6B; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
