/* Family Board (ORDER BOARD-1). One stylesheet for the screen (/tv, body.tv) and the phone app (/b, body.app).
   Old devices first: no flex gap, no inset, no aspect-ratio, no clamp, no dvh (Safari 12, WebView 80, Silk). */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f4f1ea; color: #1f2328; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.bk-dots { display: inline-block; white-space: nowrap; vertical-align: middle; }
.bk-dot { display: inline-block; width: .62em; height: .62em; border-radius: 50%; margin-right: .18em; vertical-align: middle; }
.bk-all { background: transparent; border: 2px solid #8a8f98; }
.bk-wx { width: 1.6em; height: 1.6em; vertical-align: middle; }

/* ================= the screen ================= */
body.tv { --bg: #f4f1ea; --card: #ffffff; --ink: #1f2328; --mute: #5f6670; --line: #e3ddd1; --today: #fff4d6; --accent: #c2410c;
  background: var(--bg); color: var(--ink); overflow: hidden; height: 100%; font-size: 2vmin; }
body.tv.dark { --bg: #111418; --card: #1b2027; --ink: #eef1f5; --mute: #9aa4b2; --line: #2b323c; --today: #2b2617; --accent: #fb923c; }
html.tvh, html.tvh body { height: 100%; }
.tv-wrap { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; padding: 2vmin 2.4vmin 1.2vmin;
  -webkit-transition: -webkit-transform 1s; transition: transform 1s; }
.tv-head { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 1.2vmin; border-bottom: 2px solid var(--line); }
.tv-time { font-size: 4.6em; font-weight: 700; line-height: .95; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tv-time small { font-size: .38em; font-weight: 600; margin-left: .2em; color: var(--mute); letter-spacing: 0; }
.tv-date { font-size: 1.55em; font-weight: 600; margin-top: .25em; color: var(--mute); }
.tv-name { font-size: 1em; color: var(--mute); margin-top: .2em; }
.tv-legend { margin-top: .35em; font-size: 1em; font-weight: 600; }
.tv-legend span { display: inline-block; margin-right: .9em; white-space: nowrap; }
.tv-wx { display: flex; align-items: flex-end; text-align: right; }
.tv-now { font-size: 2.6em; font-weight: 700; margin-right: .5em; white-space: nowrap; }
.tv-now .bk-wx { width: 1.15em; height: 1.15em; margin-right: .1em; vertical-align: -.15em; }
.tv-days { display: flex; }
.tv-day3 { text-align: center; margin-left: 1.1em; font-size: 1.05em; line-height: 1.25; }
.tv-day3 b { display: block; color: var(--mute); font-weight: 600; }
.tv-day3 .bk-wx { width: 1.8em; height: 1.8em; }
.tv-main { -webkit-box-flex: 1; flex: 1 1 auto; min-height: 0; position: relative; margin-top: 1.4vmin; }
.tv-page { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; }
.tv-nav { display: flex; justify-content: center; padding-top: 1vmin; }
.tv-nav button { border: 0; background: transparent; color: var(--mute); font-size: 1.05em; font-weight: 600; padding: .45em 1em; margin: 0 .2em; border-radius: 999px; }
.tv-nav button.on { background: var(--ink); color: var(--bg); }
.tv-foot { position: absolute; right: 2.4vmin; bottom: 1vmin; font-size: .85em; color: var(--mute); }
.tv-status { display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: #3bb273; margin-left: .5em; vertical-align: middle; }
.tv-status.poll { background: #f0a202; } .tv-status.offline { background: #e4572e; }
.tv-add { position: absolute; right: 1vmin; top: 1vmin; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; padding: .45em 1em; font-size: 1em; }

/* week: day columns (landscape), day rows (portrait) */
.wk { display: flex; height: 100%; }
.wk-day { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; background: var(--card); border-radius: 1.2vmin; margin-right: .9vmin; padding: .9vmin .8vmin; overflow: hidden; }
.wk-day:last-child { margin-right: 0; }
.wk-day.today { background: var(--today); box-shadow: inset 0 0 0 3px var(--accent); }
.wk-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .6vmin; }
.wk-h b { font-size: 1.25em; } .wk-h span { color: var(--mute); font-weight: 600; }
.ev { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: .45vmin .3vmin; margin: 0 0 .3vmin; border-radius: .6vmin; line-height: 1.25; }
.ev-t { display: block; font-size: .85em; color: var(--mute); font-weight: 600; }
.ev-n { display: block; font-size: 1.02em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-wrap: break-word; }
.ev.allday { color: #fff; background: #5f6670; margin-bottom: .4vmin; }
.ev.allday .ev-n { font-size: .95em; }
.ev.imp .ev-n { font-weight: 500; }
.more { color: var(--mute); font-size: .9em; padding-left: .3vmin; }
@media (orientation: portrait) {
  body.tv { font-size: 2.3vmin; }
  .wk { display: flex; flex-direction: column; overflow: hidden; }
  .wk-day { margin: 0 0 .8vmin; display: flex; padding: .8vmin 1vmin; min-height: 6.5vmin; -webkit-box-flex: 1; flex: 1 1 0; }
  .wk-day:last-child { margin-bottom: 0; }
  .wk-h { display: block; width: 18%; min-width: 7em; margin: 0; }
  .wk-h span { display: block; }
  .wk-evs { -webkit-box-flex: 1; flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-content: flex-start; }
  .wk-evs .ev { width: auto; max-width: 48%; margin-right: 1.2vmin; }
  .tv-time { font-size: 4em; }
  .tv-day3 { margin-left: .7em; }
}

/* month */
.mo { display: flex; flex-direction: column; height: 100%; }
.mo-h, .mo-row { display: flex; }
.mo-h div { -webkit-box-flex: 1; flex: 1 1 0; text-align: center; color: var(--mute); font-weight: 700; padding-bottom: .5vmin; }
.mo-row { -webkit-box-flex: 1; flex: 1 1 0; min-height: 0; }
.mo-c { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; background: var(--card); margin: 0 .5vmin .5vmin 0; border-radius: .8vmin; padding: .4vmin .5vmin; overflow: hidden; font-size: .85em; }
.mo-c.out { opacity: .45; } .mo-c.today { background: var(--today); box-shadow: inset 0 0 0 3px var(--accent); }
.mo-c b { display: block; font-size: 1.1em; }
.mo-e { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }

/* today */
.td { display: flex; height: 100%; }
.td-col { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; background: var(--card); border-radius: 1.2vmin; padding: 1.4vmin 1.8vmin; margin-right: 1.2vmin; overflow: hidden; }
.td-col:last-child { margin-right: 0; }
.td h2, .ml h2, .ch h2 { margin: 0 0 1vmin; font-size: 1.5em; }
.td .ev { font-size: 1.35em; margin-bottom: .8vmin; }
.td-meal { font-size: 1.6em; font-weight: 700; margin: .4em 0 1em; word-wrap: break-word; }
.td-empty, .empty { color: var(--mute); font-size: 1.1em; }
@media (orientation: portrait) { .td { display: block; } .td-col { margin: 0 0 1.2vmin; height: calc(50% - .6vmin); } .td-col:last-child { margin-bottom: 0; } }

/* chores: one column per person, round buttons in the person's colour */
.ch { display: flex; height: 100%; }
.ch-p { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; background: var(--card); border-radius: 1.2vmin; margin-right: 1vmin; padding: 1.2vmin; text-align: center; overflow: hidden; }
.ch-p:last-child { margin-right: 0; }
.ch-name { font-size: 1.45em; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-stars { font-size: 1.25em; font-weight: 700; color: #b7791f; margin: .2em 0 .8em; }
.ch-list { display: flex; flex-wrap: wrap; justify-content: center; }
.ch-b { width: 9.5em; margin: 0 .5em 1.1em; border: 0; background: transparent; padding: 0; text-align: center; }
.ch-c { display: block; width: 6.2em; height: 6.2em; margin: 0 auto .4em; border-radius: 50%; border: .45em solid currentColor; position: relative; background: transparent;
  -webkit-transition: background .25s, -webkit-transform .2s; transition: background .25s, transform .2s; }
.ch-b.done .ch-c { background: currentColor; }
.ch-c svg { position: absolute; left: 50%; top: 50%; width: 3em; height: 3em; margin: -1.5em 0 0 -1.5em; opacity: 0; }
.ch-b.done .ch-c svg { opacity: 1; }
.ch-t { display: block; color: var(--ink); font-weight: 600; font-size: 1.05em; line-height: 1.2; word-wrap: break-word; }
.ch-s { display: block; color: #b7791f; font-weight: 700; font-size: .95em; }
.ch-b:active .ch-c { -webkit-transform: scale(.94); transform: scale(.94); }
.burst { position: fixed; pointer-events: none; font-size: 3em; font-weight: 800; color: #f5b301; text-shadow: 0 2px 8px rgba(0,0,0,.25);
  -webkit-animation: burst 1.2s ease-out forwards; animation: burst 1.2s ease-out forwards; z-index: 30; }
@-webkit-keyframes burst { 0% { opacity: 0; -webkit-transform: translateY(0) scale(.6); } 20% { opacity: 1; -webkit-transform: translateY(-10px) scale(1.15); } 100% { opacity: 0; -webkit-transform: translateY(-90px) scale(1); } }
@keyframes burst { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; transform: translateY(-10px) scale(1.15); } 100% { opacity: 0; transform: translateY(-90px) scale(1); } }
@media (orientation: portrait) { .ch { display: block; } .ch-p { margin: 0 0 1vmin; } .ch-list { justify-content: flex-start; } .ch-b { width: 7.5em; } .ch-c { width: 4.8em; height: 4.8em; } }

/* meals and lists */
.ml { display: flex; height: 100%; }
.ml-meals { -webkit-box-flex: 1.2; flex: 1.2 1 0; min-width: 0; background: var(--card); border-radius: 1.2vmin; padding: 1.4vmin; margin-right: 1.2vmin; overflow: hidden; position: relative; }
.ml-lists { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.ml-row { display: flex; padding: .55vmin 0; border-bottom: 1px solid var(--line); font-size: 1.05em; }
.ml-row.today { font-weight: 700; }
.ml-d { width: 4.5em; flex: 0 0 auto; color: var(--mute); font-weight: 700; }
.ml-x { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; padding-right: .6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-x i { font-style: normal; color: var(--mute); font-size: .85em; margin-right: .3em; }
.ml-tonight { font-size: 1.75em; font-weight: 800; margin: .1em 0 .6em; word-wrap: break-word; }
.ls { background: var(--card); border-radius: 1.2vmin; padding: 1.2vmin 1.4vmin; margin-bottom: 1.2vmin; overflow: hidden; position: relative; -webkit-box-flex: 1; flex: 1 1 0; min-height: 0; }
.ls:last-child { margin-bottom: 0; }
.ls-i { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: .35vmin 0; font-size: 1.1em; line-height: 1.3; word-wrap: break-word; }
.ls-i:before { content: ""; display: inline-block; width: .9em; height: .9em; border: 2px solid var(--mute); border-radius: .25em; margin-right: .5em; vertical-align: -.1em; }
.ls-i.done { color: var(--mute); text-decoration: line-through; }
.ls-i.done:before { background: var(--mute); }
@media (orientation: portrait) { .ml { display: block; } .ml-meals { margin: 0 0 1.2vmin; height: 52%; } .ml-lists { height: calc(48% - 1.2vmin); } }

/* the pairing screen and the lock card */
.pair { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4vmin; }
.pair-box { max-width: 60em; }
.pair h1 { font-size: 2.2em; margin: 0 0 .4em; }
.pair p { font-size: 1.3em; color: var(--mute); margin: 0 0 1em; line-height: 1.4; }
.pair-code { font-size: 6em; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; margin: .1em 0 .2em; }
.pair-qr { width: 22vmin; height: 22vmin; background: #fff; border-radius: 1vmin; padding: .6vmin; }
.pair-qr img { width: 100%; height: 100%; display: block; }
.pair-row { display: flex; align-items: center; justify-content: center; }
.pair-row > div { margin: 0 2.5vmin; }

/* a dialog on the screen and in the app */
.dlg { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 3vmin; }
.dlg-box { background: var(--card, #fff); color: var(--ink, #1f2328); border-radius: 16px; padding: 22px; width: 100%; max-width: 560px; max-height: 90%; overflow: auto; -webkit-overflow-scrolling: touch; }
.dlg-box h3 { margin: 0 0 12px; font-size: 1.35em; word-wrap: break-word; }
.dlg-box p { margin: 0 0 10px; line-height: 1.45; word-wrap: break-word; }
.dim { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: #000; opacity: .62; pointer-events: none; z-index: 15; }
.toast { position: fixed; left: 50%; bottom: 24px; -webkit-transform: translateX(-50%); transform: translateX(-50%); background: #1f2328; color: #fff;
  padding: 10px 16px; border-radius: 12px; z-index: 40; font-weight: 600; max-width: 90%; }

/* ================= forms (screen dialogs and the app) ================= */
.f { display: block; margin: 0 0 12px; }
.f > span { display: block; font-size: .9em; font-weight: 600; margin-bottom: 5px; color: #4b5260; }
.f input[type=text], .f input[type=date], .f input[type=time], .f input[type=number], .f select, .f textarea, .inp {
  display: block; width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid #cfd4dc; border-radius: 10px; background: #fff; color: #1f2328; font-size: 16px; }
.f textarea { min-height: 80px; resize: vertical; }
.row2 { display: flex; } .row2 > * { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; margin-right: 10px; } .row2 > *:last-child { margin-right: 0; }
.chips { display: flex; flex-wrap: wrap; }
.chip { border: 1.5px solid #cfd4dc; background: #fff; color: #1f2328; border-radius: 999px; padding: 7px 13px; margin: 0 6px 6px 0; font-weight: 600; font-size: 15px; }
.chip.on { background: #1f2328; color: #fff; border-color: #1f2328; }
.sw { display: inline-block; width: 30px; height: 30px; border-radius: 50%; margin: 0 7px 7px 0; border: 3px solid transparent; }
.sw.on { border-color: #1f2328; box-shadow: inset 0 0 0 2px #fff; }
.btn { display: inline-block; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; font-size: 16px; background: #1f2328; color: #fff; min-height: 46px; }
.btn.alt { background: #e9e5dc; color: #1f2328; } .btn.warn { background: #b42318; color: #fff; } .btn.wide { display: block; width: 100%; }
.btns { display: flex; justify-content: flex-end; margin-top: 14px; } .btns .btn { margin-left: 10px; }
.err { color: #b42318; font-weight: 600; margin: 6px 0; }

/* ================= the phone app ================= */
body.app { background: #f4f1ea; padding-bottom: 76px; font-size: 16px; }
.ap-top { position: -webkit-sticky; position: sticky; top: 0; z-index: 5; background: #f4f1ea; padding: 12px 16px 8px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; justify-content: space-between; }
.ap-top h1 { font-size: 20px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-top .live { font-size: 13px; color: #5f6670; white-space: nowrap; margin-left: 10px; }
.ap-main { padding: 4px 16px 16px; max-width: 760px; margin: 0 auto; }
.ap-tabs { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #e3ddd1; display: flex; z-index: 6; padding-bottom: env(safe-area-inset-bottom, 0px); }
.ap-tabs button { -webkit-box-flex: 1; flex: 1 1 0; border: 0; background: transparent; padding: 9px 2px 10px; font-size: 12px; font-weight: 600; color: #5f6670; min-width: 0; }
.ap-tabs button svg { display: block; width: 24px; height: 24px; margin: 0 auto 2px; }
.ap-tabs button.on { color: #c2410c; }
.card { background: #fff; border-radius: 14px; padding: 14px; margin: 0 0 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card h2 { font-size: 17px; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; }
.card h2 .lnk { font-size: 14px; }
.lnk { border: 0; background: transparent; color: #c2410c; font-weight: 700; padding: 6px 0; font-size: 15px; }
.li { display: flex; align-items: center; padding: 10px 0; border-top: 1px solid #f0ece4; width: 100%; text-align: left; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; }
.li:first-of-type { border-top: 0; }
.li-m { -webkit-box-flex: 1; flex: 1 1 auto; min-width: 0; }
.li-m b { display: block; font-weight: 600; word-wrap: break-word; }
.li-m small { display: block; color: #5f6670; font-size: 13px; margin-top: 2px; word-wrap: break-word; }
.li-r { margin-left: 10px; color: #5f6670; font-size: 14px; white-space: nowrap; }
.tick { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid currentColor; margin-right: 12px; flex: 0 0 auto; position: relative; background: transparent; padding: 0; }
.tick.on { background: currentColor; }
.tick.on:after { content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; -webkit-transform: rotate(45deg); transform: rotate(45deg); }
.sq { width: 24px; height: 24px; border-radius: 6px; border: 2px solid #8a8f98; margin-right: 12px; flex: 0 0 auto; background: transparent; padding: 0; position: relative; }
.sq.on { background: #8a8f98; }
.day-h { font-size: 14px; font-weight: 700; color: #5f6670; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.day-h.today { color: #c2410c; }
.qa { display: flex; margin-bottom: 8px; } .qa .inp { -webkit-box-flex: 1; flex: 1 1 auto; margin-right: 8px; min-width: 0; }
.trial { background: #fff4d6; border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; font-weight: 600; }
.note { color: #5f6670; font-size: 14px; line-height: 1.45; }
.linkbox { font-size: 13px; word-break: break-all; background: #f4f1ea; border-radius: 8px; padding: 8px 10px; margin: 8px 0; color: #4b5260; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #f0ece4; margin-left: 6px; }
.seg { display: flex; background: #e9e5dc; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.seg button { -webkit-box-flex: 1; flex: 1 1 0; border: 0; background: transparent; padding: 8px 4px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.seg button.on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.hero { text-align: center; padding: 30px 10px; }
.hero h1 { font-size: 24px; margin: 0 0 8px; } .hero p { color: #5f6670; margin: 0 0 16px; line-height: 1.5; }
.pv { position: relative; width: 100%; padding-bottom: 62.5%; border-radius: 10px; overflow: hidden; background: #111; margin-bottom: 10px; }
.pv iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; }
