/* Our Moon Education brand (HANDOFF 7.8, DESIGN 7.3).
   Contrast: body text slate on white (6.2:1); white on teal only for large or
   bold text and buttons; yellow only on teal or slate, large; blue for links. */
:root {
  --teal: #128f8b; --teal-d: #0d6e6b; --mint: #aad4cd; --mint-l: #e8f4f2; --yellow: #e4eb62;
  --pink: #d166a7; --blue: #4867ef; --slate: #496763; --slate-d: #2f4442; --white: #fff;
  --line: #d7e4e2; --bg: #f6faf9; --amber: #b86e00; --amber-bg: #fff4dc; --red: #b3261e; --red-bg: #fde8e6;
  --r: 14px; --shadow: 0 1px 2px rgba(20, 50, 48, .08), 0 4px 14px rgba(20, 50, 48, .08);
  --head: 'Raleway', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --body: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 16px/1.45 var(--body); color: var(--slate-d); background: var(--bg); -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--head); color: var(--slate-d); margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
h1 small, h2 small { font: 400 .9rem var(--body); color: var(--slate); }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { border: 1.5px solid var(--line); border-radius: 10px; padding: .55em .7em; background: #fff; min-height: 44px; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; border-color: var(--teal); }
label { display: block; margin: .6em 0; font-weight: 600; color: var(--slate-d); }
label > input, label > select, label > textarea { margin-top: .3em; font-weight: 400; }
label.check, label.inline { display: flex; align-items: center; gap: .5em; font-weight: 400; }
label.check input, label.inline input[type=checkbox] { width: 22px; height: 22px; min-height: 0; }
label.inline input[type=number] { width: 6em; }
.r { text-align: right; } .c { text-align: center; } .center { text-align: center; }
.muted { color: var(--slate); } .small { font-size: .9rem; } .pad { padding: 1rem; } .hint { color: var(--slate); font-size: .92rem; }
.loading { padding: 2rem; color: var(--slate); }
.tag { display: inline-block; padding: .05em .5em; border-radius: 999px; background: var(--mint-l); color: var(--slate-d); font-size: .78rem; font-weight: 700; }

/* buttons: at least 48 px to touch (DESIGN 4) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 48px; padding: .5em 1.1em; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--slate-d); }
.btn:hover { border-color: var(--teal); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-d); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #f0c7c3; }
.btn.big { min-height: 56px; font-size: 1.1rem; padding: .6em 1.4em; }
.btn.huge { width: 100%; min-height: 64px; font-size: 1.25rem; }
.btn.small { min-height: 36px; padding: .25em .7em; font-size: .9rem; }
.btn.google { background: var(--teal); border-color: var(--teal); color: #fff; width: 100%; }
.iconbtn { border: 0; background: none; font-size: 1.6rem; cursor: pointer; }
button.ghost { border: 0; background: none; color: var(--blue); cursor: pointer; text-decoration: underline; min-height: 44px; }

/* sign-in */
.staff-auth { min-height: 100%; display: grid; place-items: center; background: var(--teal); padding: 1.5rem; }
.signin { background: var(--slate-d); color: #fff; border-radius: 22px; padding: 2rem 1.6rem; width: min(420px, 100%); text-align: center; box-shadow: var(--shadow); }
.signin h1 { color: #fff; font-size: 1.6rem; }
.signin .wm-y { color: var(--yellow); letter-spacing: .06em; font-weight: 800; } .signin .wm-w { color: #fff; font-weight: 600; }
.signin .note { background: rgba(255, 255, 255, .1); border-radius: 10px; padding: .6em .8em; }
.signin .hint { color: #dfeceb; }
.moon { display: inline-block; width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); box-shadow: inset -9px -3px 0 0 var(--teal); flex: none; }
.signin .moon { box-shadow: inset -12px -4px 0 0 var(--slate-d); }
.moon.big { width: 64px; height: 64px; box-shadow: inset -22px -6px 0 0 var(--slate-d); margin-bottom: .6rem; }

/* staff layout: top bar, rail, main */
.staff { display: grid; grid-template: 'top top' auto 'rail main' 1fr / 84px 1fr; height: 100vh; height: 100dvh; }
.bar-top { grid-area: top; display: flex; align-items: center; gap: .7rem; padding: .4rem .9rem; background: var(--teal); color: #fff; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: #fff; margin-right: .4rem; }
.wm { display: flex; flex-direction: column; line-height: 1.05; }
.wm b { font: 800 1.05rem var(--head); color: var(--yellow); letter-spacing: .06em; } .wm small { font: 600 .8rem var(--head); color: #fff; }
.counter-pill { background: #fff; color: var(--teal-d); border: 0; border-radius: 999px; padding: .35em 1em; font-weight: 800; min-height: 40px; cursor: pointer; }
.pill { border-radius: 999px; padding: .3em .8em; font-weight: 700; font-size: .9rem; display: inline-flex; gap: .35em; align-items: center; border: 0; min-height: 36px; }
.pill.warn { background: var(--amber-bg); color: #6b3f00; } .pill.info { background: #fff; color: var(--teal-d); cursor: pointer; } .pill.danger { background: var(--red-bg); color: var(--red); cursor: pointer; }
.me { margin-left: auto; display: flex; flex-direction: column; text-align: right; line-height: 1.1; font-weight: 700; }
.me small { font-weight: 400; color: #e6f2f1; }
.bar-top .btn.ghost { color: #fff; background: var(--teal-d); border-color: var(--teal-d); text-decoration: none; }
.rail { grid-area: rail; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: .3rem; padding: .5rem .35rem; }
.rail a { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .6rem .2rem; border-radius: 12px; color: var(--slate); text-decoration: none; font-size: .78rem; font-weight: 700; }
.rail a.on { background: var(--mint-l); color: var(--teal-d); }
.smain { grid-area: main; overflow: auto; }

/* till */
.till { display: grid; grid-template-columns: 1fr minmax(300px, 380px); height: 100%; }
.menu { padding: .8rem; overflow: auto; }
.menu-top { display: flex; align-items: center; gap: .6rem; justify-content: space-between; margin-bottom: .6rem; flex-wrap: wrap; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .3rem 0; }
.chips button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .45em 1.05em; min-height: 44px; font-weight: 700; cursor: pointer; }
.chips button.on { background: var(--slate-d); color: #fff; border-color: var(--slate-d); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; }
.pgrid.marking .ptile { outline: 2px dashed var(--amber); }
.ptile { position: relative; display: flex; flex-direction: column; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); padding: .5rem; cursor: pointer; box-shadow: var(--shadow); min-height: 150px; }
.ptile:active { transform: scale(.98); }
.ptile.out { opacity: .5; } .ptile.out .pframe { filter: grayscale(1); }
.pframe { display: block; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--mint-l); }
.pframe.big { aspect-ratio: auto; min-height: 220px; }
.ph { display: grid; place-items: center; width: 100%; height: 100%; }
.ph img { width: 100%; height: 100%; object-fit: contain; }
.ph.none { font: 800 2rem var(--head); color: var(--teal); }
.pt-name { font-weight: 700; margin: .4rem 0 .15rem; line-height: 1.2; }
.pt-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; }
.pt-meta b { color: var(--teal-d); font-size: 1.05rem; }
.pt-in { position: absolute; top: .4rem; right: .4rem; background: var(--pink); color: #fff; border-radius: 999px; min-width: 30px; height: 30px; display: grid; place-items: center; font-weight: 800; }
.order { background: #fff; border-left: 1px solid var(--line); padding: .9rem; display: flex; flex-direction: column; gap: .55rem; overflow: auto; }
.olines { flex: 1; overflow: auto; min-height: 80px; }
.oline { border-bottom: 1px solid var(--line); padding: .5rem 0; }
.ol-main { display: flex; justify-content: space-between; gap: .5rem; }
.ol-sub { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; flex-wrap: wrap; }
.lqty { display: inline-flex; align-items: center; gap: .3rem; }
.lqty button { width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-size: 1.3rem; font-weight: 800; cursor: pointer; }
.lqty b { min-width: 2ch; text-align: center; }
.notebtn { border: 0; background: none; color: var(--blue); cursor: pointer; display: inline-flex; gap: .3em; align-items: center; min-height: 40px; text-align: left; }
.notebtn.has { color: #8a2a64; font-weight: 700; }
.ototal { display: flex; justify-content: space-between; font: 800 1.4rem var(--head); border-top: 2px solid var(--slate-d); padding-top: .5rem; }
.methods { display: flex; gap: .4rem; }
.method { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .5rem; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; min-height: 64px; cursor: pointer; }
.method.on { border-color: var(--teal); background: var(--mint-l); color: var(--teal-d); }
.tender input { font-size: 1.4rem; font-weight: 700; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.quick .btn { padding: .3em; }
.change { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; }
.change b { font: 800 1.6rem var(--head); color: var(--teal-d); }
.empty-state { text-align: center; color: var(--slate); padding: 2rem 1rem; }
.banner { padding: .7em 1em; border-radius: 12px; margin: 0 0 .7rem; display: flex; gap: .5em; align-items: center; }
.banner.warn { background: var(--amber-bg); color: #6b3f00; } .banner.ok { background: var(--mint-l); }

/* kitchen board */
.board { display: grid; grid-template-columns: 1fr minmax(240px, 30%); gap: 1rem; padding: .9rem; min-height: 100%; }
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; align-items: start; }
.ticket { background: #fff; border-radius: var(--r); border-top: 8px solid var(--teal); box-shadow: var(--shadow); padding: .7rem; display: flex; flex-direction: column; gap: .4rem; }
.ticket[data-level=amber] { border-top-color: #e0a100; background: #fffaf0; }
.ticket[data-level=red] { border-top-color: var(--red); background: #fff6f5; }
.ticket header { display: flex; justify-content: space-between; align-items: baseline; }
.tno { font: 800 2rem var(--head); }
.since { font-weight: 800; color: var(--slate); }
.ticket[data-level=red] .since { color: var(--red); } .ticket[data-level=amber] .since { color: var(--amber); }
.ticket ul { margin: 0; padding: 0; list-style: none; font-size: 1.1rem; }
.ticket li { padding: .2rem 0; border-bottom: 1px dashed var(--line); }
.ticket li em { display: block; font-style: normal; font-weight: 700; color: #8a2a64; font-size: .95rem; }
.tnote { margin: 0; font-weight: 700; color: #8a2a64; }
.col.ready { background: var(--slate-d); color: #fff; border-radius: var(--r); padding: .8rem; }
.col.ready h2 { color: var(--yellow); }
.col.ready .muted { color: #d6e6e4; }
.calling { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.call { background: var(--teal); color: #fff; border: 0; border-radius: 12px; padding: .7rem .3rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.call b { font: 800 2.2rem var(--head); color: var(--yellow); }
.call small { color: #e6f2f1; }

/* pages, tables, admin */
.page { padding: 1rem 1.2rem 3rem; max-width: 1100px; }
.bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.bar h1 { margin: 0 auto 0 0; }
.bar input[type=search], .bar input[type=date], .bar select { width: auto; }
.stats { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--slate); } .stats .warn { color: var(--amber); font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
th { font-size: .85rem; color: var(--slate); font-weight: 700; }
td.r, th.r { text-align: right; }
.list { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1rem; }
.list.narrow { max-width: 460px; }
.list tr.click { cursor: pointer; } .list tr.click:hover { background: var(--mint-l); }
.list tr.low td { background: var(--amber-bg); }
.list tr.sum td, table tr.sum td { font-weight: 800; border-top: 2px solid var(--slate-d); }
.list td.empty { text-align: center; color: var(--slate); padding: 1.5rem; }
.thumb .ph, .thumb .ph.none { width: 54px; height: 42px; border-radius: 8px; overflow: hidden; background: var(--mint-l); font-size: 1.1rem; }
.acts { white-space: nowrap; text-align: right; }
.st { padding: .15em .6em; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--mint-l); }
.st.cancelled, .st.refunded { background: #eee; color: #555; } .st.partly_refunded, .st.part_paid { background: var(--amber-bg); color: #6b3f00; }
.st.published { background: var(--teal); color: #fff; } .st.draft { background: var(--amber-bg); }
.admin { display: flex; flex-direction: column; }
.tabs { display: flex; gap: .2rem; padding: .5rem 1rem 0; border-bottom: 1px solid var(--line); background: #fff; overflow-x: auto; }
.tabs a { padding: .7rem .9rem; text-decoration: none; color: var(--slate); font-weight: 700; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--teal-d); border-bottom-color: var(--teal); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; margin: .5rem 0 1.2rem; }
.card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: .8rem; display: flex; flex-direction: column; }
.card span { color: var(--slate); font-size: .88rem; } .card b { font: 800 1.35rem var(--head); }
.card.hl { background: var(--teal); } .card.hl span, .card.hl b { color: #fff; }
.note { padding: .7em 1em; border-radius: 12px; background: var(--mint-l); }
.note.warn { background: var(--amber-bg); color: #6b3f00; } .note.ok { background: var(--mint-l); }
.inline-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.2rem; }
.inline-form label { margin: 0; flex: 1 1 180px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.narrow { max-width: 520px; }
.counter-form { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.row { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.row.left { justify-content: flex-start; }
.photo-tool { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: start; }
.photo-acts { display: flex; flex-direction: column; gap: .4rem; }

/* dialogs and toasts */
.modal-wrap { position: fixed; inset: 0; background: rgba(20, 40, 38, .55); display: grid; place-items: center; padding: 1rem; z-index: 20; }
.modal { background: #fff; border-radius: 18px; padding: 1.2rem; width: min(560px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow); }
.modal.wide { width: min(980px, 100%); } .modal.center { text-align: center; }
.counter-choice { display: grid; gap: .7rem; margin: 1rem 0; }
.receipt { max-width: 360px; margin: 0 auto; }
.receipt .ono { font: 800 3.6rem var(--head); margin: .2rem 0; color: var(--teal-d); }
.receipt td { padding: .3rem 0; } .receipt .foot { color: var(--slate); }
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .4rem; z-index: 30; width: min(560px, 92vw); }
.toast { background: var(--slate-d); color: #fff; padding: .75em 1em; border-radius: 12px; box-shadow: var(--shadow); display: flex; gap: .7rem; align-items: center; justify-content: space-between; }
.toast.ok { background: var(--teal-d); } .toast.error { background: var(--red); }
.toast .btn { background: #fff; color: var(--slate-d); }

/* phone: one column, order below */
@media (max-width: 820px) {
  .staff { grid-template: 'top' auto 'main' 1fr 'rail' auto / 1fr; }
  .rail { flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line); }
  .till { grid-template-columns: 1fr; height: auto; }
  .order { border-left: 0; border-top: 1px solid var(--line); }
  .board { grid-template-columns: 1fr; }
  .me { display: none; }
  .two, .photo-tool { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Public food board. Artwork and palette from the May 2025 brand guide. */
.menu-width { width: min(100% - 2rem, 70rem); margin-inline: auto; }
.public-menu { min-height: 100%; background: var(--mint-l); }
.menu-header { min-height: 6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.menu-brand { display: inline-flex; border-radius: .5rem; overflow: hidden; }
.menu-brand img { width: 7.5rem; height: auto; display: block; }
.menu-staff-link { min-height: 44px; display: inline-flex; align-items: center; gap: .45em; color: var(--slate-d); font-weight: 700; text-underline-offset: .25em; }
.menu-hero {
  border-radius: clamp(1rem, 3vw, 2rem);
  background: var(--slate-d);
  padding: clamp(1.6rem, 5vw, 4.5rem);
  color: white;
}
.menu-hero h1 { max-width: 14ch; margin: .16em 0 .2em; font-size: clamp(2.35rem, 8vw, 5.9rem); line-height: 1.02; letter-spacing: -.05em; color: white; }
.menu-hero p { margin: 0; max-width: 40ch; font-size: clamp(1rem, 2.6vw, 1.25rem); }
.menu-hero .menu-date { color: var(--yellow); font-size: .95rem; font-weight: 700; }
.menu-date:empty, .menu-status:empty { display: none; }
.menu-content { padding-block: 1.5rem 4rem; }
.menu-counter-title { font-size: 1.3rem; margin: .5rem 0; }
.menu-counter-list, .menu-filters { display: flex; flex-wrap: wrap; gap: .55rem; }
.menu-service { margin: .7rem 0 .9rem; color: var(--slate-d); }
.menu-content button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 999px; border: 1px solid var(--slate); background: white; color: var(--slate-d); padding: .45rem 1rem; cursor: pointer; font-weight: 700; }
.menu-counter-list button[aria-pressed=true] { background: var(--slate-d); color: white; border-color: var(--slate-d); }
.menu-filters button[aria-pressed=true] { background: var(--yellow); border-color: var(--slate-d); }
.public-menu :is(a, button):focus-visible { outline: 3px solid var(--slate-d); outline-offset: 3px; }
.menu-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); align-items: start; gap: 1rem; }
.menu-category, .menu-empty, .menu-status { background: white; border: 1px solid var(--line); padding: 1rem 1.15rem; margin: 1rem 0 0; border-radius: 1rem; }
.menu-category h3 { color: var(--slate-d); padding-bottom: .55rem; margin: 0; }
.menu-category ul { list-style: none; padding: 0; margin: 0; }
.menu-dish { border-top: 1px solid var(--line); padding: .75rem 0; display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.menu-dish p { margin: .2rem 0 0; color: var(--slate); font-size: .94rem; overflow-wrap: anywhere; }
.menu-dish-price { display: grid; gap: .25rem; justify-items: end; white-space: nowrap; }
.menu-dish-price small { color: var(--slate-d); background: var(--mint-l); padding: .1rem .5rem; border-radius: .5rem; }
.menu-status p { margin: 0 0 .6rem; }
.brand-icon { flex: none; border-radius: 6px; }
.signin-logo { display: block; width: min(12rem, 80%); height: auto; margin: 0 auto 1rem; border-radius: 8px; }
.signin .signin-menu-link { color: inherit; text-underline-offset: .2em; }
.counter-pill small { display: block; font-weight: 400; line-height: 1.2; }
.counter-choice button { display: grid; gap: .3rem; text-align: left; justify-items: start; padding: .8rem 1rem; }
.counter-choice button small { font-size: .86rem; font-weight: 400; }
.receipt-flow { font-weight: 700; margin: .35rem 0; }
.boot-screen { min-height: min(70vh, 36rem); display: grid; place-content: center; justify-items: center; text-align: center; gap: .4rem; padding: 2rem 1rem; }
.boot-screen img { width: 9rem; height: auto; border-radius: .5rem; margin-bottom: .6rem; }
.boot-screen h1, .boot-screen p { margin: 0; }
.menu-placeholder { display: grid; gap: .65rem; margin-top: .85rem; }
.menu-placeholder span { height: .85rem; width: min(20rem, 80%); background: var(--mint-l); border-radius: 999px; animation: menu-pulse 1.3s ease-in-out infinite alternate; }
.menu-placeholder span:nth-child(2) { width: min(16rem, 65%); }
.menu-placeholder span:nth-child(3) { width: min(18rem, 70%); }
@keyframes menu-pulse { to { opacity: .52; } }
@media (prefers-reduced-motion: reduce) { .menu-placeholder span { animation: none; } }
