/* Mailcoms Team: phone first. Mailcoms colours: navy #153B65, pink-red #FF3458, cream #FAF6EF, teal #00B3A6. */
:root {
  --navy: #153B65; --pink: #FF3458; --cream: #FAF6EF; --teal: #00B3A6; --ink: #1d2533; --muted: #5b6370; --line: #e3e0d8;
  --card: #fff; --ok: #0f7b5f; --ok-bg: #e5f5ef; --warn: #9a5b00; --warn-bg: #fff3dc; --bad: #b42335; --bad-bg: #fde8ea;
  --radius: 12px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
a { color: var(--navy); }
h1 { font-size: 22px; margin: 4px 0 14px; color: var(--navy); }
h2 { font-size: 17px; margin: 0 0 10px; color: var(--navy); }
h3 { font-size: 15px; margin: 16px 0 6px; }
p { margin: 0 0 10px; }
.loading { padding: 40px 20px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* the frame */
.top { background: var(--navy); color: #fff; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px; display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; }
.top .brand { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.top .co { font-size: 12px; opacity: .8; margin-left: auto; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(92px + var(--safe-b)); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: var(--safe-b); z-index: 6; }
.tabs a { flex: 1; text-align: center; padding: 9px 2px 8px; font-size: 11.5px; color: var(--muted); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; justify-content: center; }
.tabs a svg { width: 24px; height: 24px; }
.tabs a.on { color: var(--pink); font-weight: 600; }
@media (min-width: 760px) { .tabs { max-width: 640px; margin: 0 auto; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; } }

/* cards and bits */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.tight { padding: 4px 16px; }
.big { font-size: 34px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; color: var(--navy); }
.list .it { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list .it:last-child { border-bottom: 0; }
.list .it .mid { flex: 1; min-width: 0; }
.list .it .t1 { font-weight: 600; }
.list .it .t2 { font-size: 13px; color: var(--muted); }
.list a.it { color: inherit; text-decoration: none; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card h2 { text-decoration: underline; text-underline-offset: 3px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eef0f3; color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.note { background: #eef4fb; border-left: 4px solid var(--navy); padding: 10px 12px; border-radius: 6px; font-size: 14px; margin: 10px 0; }
.note.warn { background: var(--warn-bg); border-color: var(--warn); } .note.bad { background: var(--bad-bg); border-color: var(--bad); } .note.ok { background: var(--ok-bg); border-color: var(--ok); }

/* forms */
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
input, select, textarea { width: 100%; min-width: 0; max-width: 100%; font: inherit; font-size: 16px; padding: 12px; border: 1px solid #cfd3da; border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 14px 0; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.two > div { min-width: 0; }
input[type=date] { min-width: 0; display: block; -webkit-appearance: none; appearance: none; min-height: 48px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 16px; padding: 12px 18px; border-radius: 10px; border: 1px solid #cfd3da; background: #fff; color: var(--ink); cursor: pointer; min-height: 48px; text-decoration: none; }
.btn.pri { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.block { width: 100%; margin-top: 14px; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: default; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.actions .btn { min-height: 64px; flex-direction: column; font-size: 15px; }
.link { background: none; border: 0; color: var(--navy); font: inherit; text-decoration: underline; cursor: pointer; padding: 6px 0; }
.err { color: var(--bad); font-size: 14px; margin-top: 8px; min-height: 1em; }

/* sign in */
.signin { max-width: 420px; margin: 0 auto; padding: 32px 20px; }
.signin .logo { width: 64px; height: 64px; border-radius: 16px; display: block; margin: 0 auto 14px; }
.signin h1 { text-align: center; }
.codebox { letter-spacing: 10px; font-size: 26px; text-align: center; font-weight: 700; }

/* who's in grid */
.grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grid table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.grid th, .grid td { padding: 7px 5px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid th { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.grid td.name, .grid th.name { text-align: left; position: sticky; left: 0; background: #fff; font-weight: 600; padding-right: 10px; }
.grid td.off { background: var(--warn-bg); color: var(--warn); font-weight: 600; border-radius: 4px; }
.grid td.mine { background: #e7eef8; color: var(--navy); font-weight: 600; }
.grid td.bh { background: #eef0f3; color: var(--muted); }
.grid td.nw { color: #c2c6cd; }
.grid tr.me td.name { color: var(--pink); }

/* handbook text */
.doc h2 { margin-top: 18px; } .doc h3 { color: var(--navy); }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 8px 0 14px; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc ol, .doc ul { padding-left: 22px; } .doc li { margin: 4px 0; }
.doc blockquote, .doc .tr-call { background: #eef4fb; border-left: 4px solid var(--navy); margin: 10px 0; padding: 8px 12px; border-radius: 6px; }
.pager { display: flex; gap: 10px; justify-content: space-between; margin-top: 10px; }
.pager .btn { flex: 1; font-size: 14px; }

/* toast */
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--safe-b)); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; z-index: 20; }
#toast.on { opacity: 1; } #toast.bad { background: var(--bad); }

/* the staff-room tablet */
body.kiosk { background: var(--navy); color: #fff; }
.k-wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }
.k-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.k-time { font-size: 56px; font-weight: 700; line-height: 1; }
.k-date { font-size: 18px; opacity: .85; }
.k-title { font-size: 20px; opacity: .85; }
.k-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.k-name { background: #fff; color: var(--ink); border: 0; border-radius: 14px; padding: 18px 14px; font: inherit; font-size: 20px; font-weight: 600; min-height: 84px; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; }
.k-dot { width: 14px; height: 14px; border-radius: 50%; background: #c2c6cd; flex: none; }
.k-dot.working { background: #19b37a; } .k-dot.break { background: #f0a020; }
.k-panel { background: #fff; color: var(--ink); border-radius: 18px; padding: 28px; max-width: 520px; margin: 20px auto; text-align: center; }
.k-panel h2 { font-size: 26px; }
.k-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0; }
.k-dots span { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--navy); }
.k-dots span.on { background: var(--navy); }
.k-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.k-pad button { font: inherit; font-size: 30px; font-weight: 600; min-height: 76px; border-radius: 14px; border: 1px solid var(--line); background: var(--cream); color: var(--ink); cursor: pointer; }
.k-acts { display: grid; gap: 14px; margin-top: 10px; }
.k-acts .btn { min-height: 76px; font-size: 22px; }
.k-done { font-size: 30px; font-weight: 700; color: var(--ok); }
.k-foot { margin-top: 18px; font-size: 14px; opacity: .8; text-align: center; }
.k-queue { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 8px 12px; display: inline-block; margin-top: 8px; }
