/* medsure: deep teal. No white or cream surfaces anywhere. */
:root {
  --page: #04201E;
  --bg: #08302C;     /* phone background */
  --panel: #0E423D;  /* cards */
  --raise: #15554E;  /* inputs, secondary buttons */
  --line: #227068;
  --fg: #F0F7F5;
  --muted: #9FC2BC;
  --acc: #37D6A4; --acc-hi: #6AF0C4; --acc-lo: rgba(55,214,164,.18);
  --ok: #37D6A4; --warn: #FFB25C; --bad: #FF8A80;
  --blue: #1C6E8C;
  --film: #0B3A35;   /* photo tiles */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: Nunito, system-ui, sans-serif; font-size: 16px; line-height: 1.45; }
button { font: inherit; color: inherit; }
input[type=checkbox], input[type=radio] { accent-color: var(--acc); width: 18px; height: 18px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.wm { font-weight: 400; font-size: 21px; letter-spacing: -.01em; white-space: nowrap; }
.wm b { color: var(--acc); }
.navbtns { display: flex; gap: 6px; }
.nb { white-space: nowrap; border: 1px solid var(--line); background: var(--raise); border-radius: 8px; padding: 5px 9px; font-weight: 400; font-size: 13px; cursor: pointer; }
.nb.chat { border-color: var(--acc); color: var(--acc); background: transparent; }
.nb.home { background: var(--acc); color: var(--bg); border-color: var(--acc); }
.freehour { width: 100%; font-size: 12px; font-weight: 400; color: var(--warn); }
.scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.scroll > * { flex-shrink: 0; }
.foot { text-align: center; font-size: 11px; color: var(--muted); padding: 6px 0 10px; border-top: 1px solid var(--line); }
.foot button { background: none; border: 0; padding: 0; font-size: 11px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.plaque { background: var(--raise); border-bottom: 3px solid var(--acc); text-align: center; font-weight: 400; font-size: 18px; letter-spacing: .04em; border-radius: 8px; padding: 11px 12px; margin: 0; }
.sec { font-weight: 400; font-size: 13px; letter-spacing: .1em; color: var(--acc-hi); margin-top: 4px; }
p { margin: 0; }
.btn { display: block; width: 100%; border: 0; border-radius: 10px; padding: 13px 14px; font-weight: 400; font-size: 16px; cursor: pointer; text-align: center; background: var(--acc); color: var(--bg); }
.btn.navy { background: var(--blue); color: var(--fg); }
.btn.line { background: transparent; color: var(--fg); border: 1.5px solid var(--line); }
.btn.bad { background: var(--bad); color: #2A0A08; }
.btn.big { padding: 17px; font-size: 18px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%; }
button.card { cursor: pointer; }
button.card:hover { border-color: var(--acc); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ct { font-weight: 400; }
.badge { font-size: 13px; font-weight: 400; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.b-ok { background: rgba(55,214,164,.16); color: var(--ok); }
.b-warn { background: rgba(255,178,92,.16); color: var(--warn); }
.b-bad { background: rgba(255,138,128,.16); color: var(--bad); }
.b-grey { background: rgba(159,194,188,.16); color: var(--muted); }
.b-acc { background: var(--acc); color: var(--bg); }
.menu { display: flex; flex-direction: column; gap: 8px; }
.menu .card { flex-direction: row; justify-content: space-between; align-items: center; }
/* A row the person chooses with a radio or a tick reads left to right: the dot, then the words. */
.menu label.card { justify-content: flex-start; gap: 10px; }
.menu .card .ct::before { content: attr(data-i); margin-right: 10px; }
.chev { color: var(--muted); font-weight: 400; }
.notice { border: 1px solid var(--ok); background: rgba(55,214,164,.10); border-radius: 12px; padding: 11px 13px; display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; text-align: left; width: 100%; cursor: pointer; color: var(--fg); }
.notice.warn { border-color: var(--warn); background: rgba(255,178,92,.10); }
.notice.bad { border-color: var(--bad); background: rgba(255,138,128,.10); }
.notice span:first-child { font-size: 20px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 400; }
.field input, .field select, .field textarea { font: inherit; color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--raise); width: 100%; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.tick { display: flex; gap: 8px; align-items: center; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 9px 4px; font-weight: 400; cursor: pointer; }
.seg button.on { background: var(--acc); color: var(--bg); }
.more { background: none; border: 0; padding: 0; color: var(--acc-hi); font-weight: 400; cursor: pointer; }
.link { background: none; border: 0; padding: 0; color: var(--acc-hi); font-weight: 400; text-decoration: underline; cursor: pointer; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tabs button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px; font-weight: 400; cursor: pointer; }
.tabs button.on { background: var(--acc); color: var(--bg); border-color: var(--acc); }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; }
.msg.them { background: var(--panel); border: 1px solid var(--line); align-self: flex-start; }
.msg.me { background: var(--blue); align-self: flex-end; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -8px 30px rgba(0,0,0,.35); }
.sheet[hidden] { display: none; }
/* photo tiles */
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph { background: var(--film); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.ph svg { width: 100%; height: auto; display: block; border-radius: 6px; background: #072B27; }
.ph small { color: var(--muted); font-size: 11px; font-weight: 400; }
.viewfinder { border: 2px solid var(--acc); border-radius: 12px; padding: 8px; background: #061F1C; position: relative; }
.viewfinder svg { width: 100%; height: auto; display: block; }
.vf-label { position: absolute; top: 10px; left: 12px; font-size: 11px; font-weight: 400; color: var(--acc); }
.shutter { width: 64px; height: 64px; border-radius: 50%; background: var(--acc); border: 4px solid var(--bg); box-shadow: 0 0 0 2px var(--acc); margin: 4px auto 0; cursor: pointer; }
.matchrow { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.matchrow svg { width: 54px; height: 40px; background: #072B27; border-radius: 6px; }
.lock { font-size: 12px; color: var(--muted); }
.big-ok { font-size: 44px; text-align: center; }
.btn.ring { font-size: 19px; padding: 18px 14px; line-height: 1.3; background: #fff; color: #8A2018; }
.btn.ring.quiet { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); }
.pulse { font-size: 46px; animation: p 1s infinite; }
@keyframes p { 0%,100% { opacity: 1 }
50% { opacity: .35 }
}
@media (max-width: 820px) { .map { position: static; order: 2; max-height: none; }

}
/* medsure, the real app. The look is the agreed mock-up; the phone frame it was drawn in is gone, so the
   app fills the screen on a phone and sits in a column on a computer. */
.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; max-width: 560px; margin: 0 auto;
  background: var(--bg); background-image: radial-gradient(100% 30% at 50% -6%, rgba(55,214,164,.13), transparent 60%); }
.top { position: sticky; top: 0; z-index: 3; }
.scroll { flex: 1; }
.ringing .top, .ringing .foot { background: var(--bad); }
.ringing { animation: pulse 1s infinite alternate; }
@keyframes pulse { from { box-shadow: inset 0 0 0 0 rgba(255,138,128,0); } to { box-shadow: inset 0 0 0 6px rgba(255,138,128,.55); } }
.err { color: var(--bad); font-weight: 400; }
.err:empty { display: none; }
.ok { color: var(--acc); font-weight: 400; }
.spin { opacity: .6; pointer-events: none; }
.hidden { display: none !important; }
.askinstall { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; padding: 18px; }
.askinstall[hidden] { display: none; }
.askbox { width: 100%; max-width: 360px; background: var(--bg); border: 2px solid var(--acc); border-radius: 16px; padding: 22px 18px 18px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.askbox img { width: 72px; height: 72px; border-radius: 50%; display: block; margin: 0 auto; }
.askbox h2 { margin: 0; font-size: 20px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 528px; margin: 0 auto; background: var(--raise);
  border: 1px solid var(--acc); color: var(--fg); border-radius: 10px; padding: 12px 14px; font-weight: 400; z-index: 60; }
.toast[hidden] { display: none; }
.tinyline { text-align: center; font-size: 11px; color: var(--muted); padding: 8px 0 12px; }
.tinyline a { color: var(--muted); }

/* The MAR chart: the grid a GP, a pharmacist or an inspector asks for. It scrolls sideways on a phone. */
table.mar { border-collapse: collapse; font-size: 13px; background: var(--panel); }
table.mar th, table.mar td { border: 1px solid var(--line); padding: 5px 4px; text-align: center; white-space: nowrap; }
table.mar thead th { background: var(--raise); font-size: 12px; position: sticky; top: 0; }
table.mar th.mar-med { text-align: left; min-width: 150px; white-space: normal; font-weight: 400; }
table.mar th.mar-med b { font-weight: 400; }
table.mar td { font-weight: 400; min-width: 34px; }
td.mar-ok { background: rgba(55,214,164,.18); }
td.mar-warn { background: rgba(255,178,92,.20); color: var(--warn); }
td.mar-bad { background: rgba(255,138,128,.18); color: var(--bad); }
td.mar-empty { background: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(159,194,188,.14) 4px, rgba(159,194,188,.14) 8px); }
table.mar sup { font-size: 9px; }
/* A wide table scrolls inside its own box instead of stretching the whole page. In a flex column a child
   will not shrink below its content unless min-width is set to 0, which is what made the chart overflow. */
.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; }
/* The plain list for a handover: a fixed-width face so the times line up down the page. */
.plain { font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace; color: var(--fg);
  background: var(--raise); border: 1px solid var(--line); border-radius: 8px;
  /* A line too long for the phone wraps rather than running off the side: a handover is read,
     not scrolled sideways. text-indent would only shift the block's first line, not each entry. */
  padding: 12px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* The page for an ambulance crew: a red button nobody has to look for, and plain tables. */
.btn.amb { background: var(--bad); color: #2A0A08; font-size: 17px; }
table.para { width: 100%; border-collapse: collapse; font-size: 14px; }
table.para th, table.para td { border: 1px solid var(--line); padding: 6px 7px; text-align: left; vertical-align: top; }
table.para thead th { background: var(--raise); font-size: 13px; }
table.para th { font-weight: 400; white-space: nowrap; }
.flag { display: inline-block; border: 1px solid var(--bad); color: var(--bad); border-radius: 4px; padding: 0 5px; font-size: 11px; font-weight: 400; margin: 2px 3px 0 0; white-space: nowrap; }
b.op { background: rgba(255,138,128,.2); padding: 1px 4px; border-radius: 3px; }

/* "Check before you pay" in MedSure's teal (standard wallet, 1 Dec 2026). No white or cream surfaces. */
.cbp-sheet { --cbp-bg: var(--bg); --cbp-fg: var(--fg); --cbp-acc: var(--acc); --cbp-acc-fg: var(--bg); --cbp-line: var(--line); --cbp-bad: var(--bad); --cbp-ok: var(--ok); }
.cbp-plaque { background: var(--raise); }
.cbp-card { background: var(--panel); }

/* Rules 29 and 31: the one landing menu (2 Dec 2026). No bold on any of it (rule 30). */
.banner { background: linear-gradient(135deg, var(--panel), var(--raise)); border: 1px solid var(--line); border-bottom: 3px solid var(--acc); border-radius: 14px; padding: 18px 14px; text-align: center; }
.banner .big { font-size: 36px; letter-spacing: -.02em; font-weight: 400; }
.banner .big span { color: var(--acc); }
.banner p { color: var(--muted); margin: 2px 0 0; }
.select { text-align: center; margin: 0; }
.menu .card.mi { cursor: pointer; padding: 13px 14px; }
.menu .card.mi .ct { font-weight: 400; }
.menu .card.mi .side { color: var(--muted); font-size: 14px; white-space: nowrap; }
.menu .card.mi .side.warnline { color: var(--warn); }
.signedas { text-align: center; margin: 0; }
.link.plain { font-weight: 400; }
.note { border-top: 1px solid var(--line); padding-top: 10px; margin: 0; }
.tabs.acct button { font-weight: 400; }
#needacct .askbox p { margin: 0; font-size: 18px; }

/* Rule 30 (2 Dec 2026): no bold, except a few words picked out inside a sentence (b.hl). */
b, strong, h1, h2, h3, h4, th { font-weight: 400; }
b.hl { font-weight: 800; }

/* Rule 32: Understandings with OszTech (the shared understandings.js). Number on the same line as its point; tick box at the top of its sentence. */
.osz-u { display: flex; flex-direction: column; gap: 10px; }
.osz-u p { margin: 0; }
.osz-u-head { display: flex; gap: 6px; align-items: baseline; }
.osz-u-tick { align-items: flex-start; margin-top: 6px; }
.osz-u-tick input { margin-top: 4px; flex-shrink: 0; }

/* Rule 28: the CodeCatch box on Create an account. */
.cc-before { gap: 8px; }
.cc-before p { margin: 0; }
