:root {
  --bg: #0d1117; --panel: #161b22; --panel2: #1c232d; --line: #2a3340; --text: #e6edf3; --muted: #8b98a8;
  --accent: #c8102e; --good: #3fb950; --ok: #d29922; --bad: #f85149; --blue: #58a6ff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, "Segoe UI", sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 10px 20px;
         background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; }
nav a.active, nav a:hover { color: var(--text); background: var(--panel2); text-decoration: none; }
.capture { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; white-space: nowrap; }
.hstat { display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.gdot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
#gameState.on .gdot { background: var(--good); box-shadow: 0 0 0 3px #3fb95033; }
#gameState { color: var(--muted); } #gameState.on { color: var(--text); }
.capture .switch { line-height: 1; height: 32px; }
.snapchip { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel2); border: 1px solid var(--line);
            border-radius: 12px; padding: 2px 10px; }
.snapchip:hover { color: var(--text); text-decoration: none; border-color: var(--muted); }
@media (max-width: 1100px) { #lastCap { display: none; } }
@media (max-width: 700px) { .capture .glbl, .capture .switch span:last-child { display: none; } }
button { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 7px 14px; font-weight: 600;
         cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
button.secondary { background: var(--panel2); border: 1px solid var(--line); }
main { padding: 20px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--muted); font-weight: 600; text-transform: uppercase;
     letter-spacing: .04em; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px;
        min-width: 0; overflow: hidden; }
.cardhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.cardhead h2 { margin: 0; }
.btn { display: inline-block; padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--text); }
.btn.secondary { background: var(--panel2); border: 1px solid var(--line); }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.disabled { opacity: .4; pointer-events: none; }
.matchnav { display: flex; gap: 8px; margin-bottom: 14px; }
.small { font-size: 12px; margin-top: 8px; }
tr.clickrow { cursor: pointer; }
tr.group td { text-align: left; font-weight: 700; color: var(--muted); background: var(--bg); padding-top: 14px;
              text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
/* team form: fixed layout so long competition names truncate instead of overflowing the card */
table.form { table-layout: fixed; }
table.form td { overflow: hidden; text-overflow: ellipsis; padding: 6px 4px; }
table.form td.date { width: 86px; } table.form td:nth-child(2) { width: 22px; }
table.form td:nth-child(4) { width: 40px; } table.form td:nth-child(5) { width: 32px; }
table.form td.comp { width: 76px; } table.form td.stats { width: 28px; }
table.form td.ko { width: 48px; color: var(--muted); }
table.form td.rank { width: 22px; color: var(--muted); font-weight: 700; }
table.form td.sparkcell { width: 52px; } table.form td:last-child:has(.rating) { width: 52px; }
.small0 { font-size: 11px; white-space: normal; }
table.form td.opp { white-space: normal; width: auto; } /* opponent takes whatever is left; long names wrap */
.formstr a:hover { text-decoration: none; opacity: .8; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.filters input#search, select { padding: 6px 8px; background: var(--bg); color: var(--text); border: 1px solid var(--line);
                                border-radius: 6px; }
.filters input#search { min-width: 240px; }
td.where { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.cmpsel { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cmpsel select { min-width: 280px; }
table.cmp td, table.cmp th { text-align: center; } table.cmp td.l { text-align: left; }
.win { color: var(--good) !important; font-weight: 700; }
.pitch { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.prow { display: flex; gap: 6px; justify-content: center; }
.pcell { flex: 0 1 110px; border-radius: 6px; padding: 6px; text-align: center; font-size: 12px; }
.pcell { color: #0d1117; font-weight: 600; }
.pcell b { display: block; font-size: 12px; }
.pcell span { color: #0d1117; }
.pcell span span { color: #0d1117 !important; text-decoration: underline; }
.card.wide { grid-column: 1 / -1; }
.kpis { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 12px; }
.kpi .v { font-size: 24px; font-weight: 700; }
.kpi .l { color: var(--muted); font-size: 12px; }
/* boxed KPI tiles: keep the key numbers in focus */
.kpis.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.kpi.tile { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.kpi.tile .v { font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; }
.kpi.tile.wide { grid-column: span 2; }
.kpi.tile .v .rating { font-size: 16px; vertical-align: middle; }
.kpi.tile .l { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; margin-top: 2px; }
.kbar { height: 4px; background: var(--bg); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.kbar span { display: block; height: 100%; border-radius: 2px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; cursor: pointer; user-select: none; position: sticky; top: 0;
     background: var(--panel); }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
tr:hover td { background: var(--panel2); }
.scroll { overflow-x: auto; }
.rating { display: inline-block; min-width: 38px; text-align: center; padding: 1px 6px; border-radius: 4px; font-weight: 700;
          color: #0d1117; }
.r-hi { background: #3fb950; } .r-mid { background: #a3c94f; } .r-ok { background: #d29922; } .r-lo { background: #f0883e; }
.r-bad { background: #f85149; }
.res { display: inline-block; width: 22px; text-align: center; border-radius: 4px; font-weight: 700; color: #0d1117; }
.res.W { background: var(--good); } .res.D { background: var(--ok); } .res.L { background: var(--bad); }
.formstr .res { margin-right: 3px; }
.bar { position: relative; height: 8px; background: var(--panel2); border-radius: 4px; min-width: 60px; }
.bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--panel2); color: var(--muted);
        font-size: 12px; }
.pill.excellent, .pill.improving { color: var(--good); } .pill.dipping { color: var(--bad); }
.up { color: var(--good); } .down { color: var(--bad); }
.alert { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.alert .k { width: 140px; color: var(--ok); }
table.saves { max-width: 820px; margin: 8px 0; } table.saves tr.on td { background: var(--panel2); }
table.saves td { white-space: normal; vertical-align: middle; }
td.snapbtns { text-align: right; white-space: nowrap; } td.snapbtns button { margin-left: 4px; }
button.danger { color: var(--bad); border-color: var(--bad); }
.newgame { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); max-width: 640px; }
.newgame h3 { margin: 0 0 4px; font-size: 15px; }
.newgame select { width: 100%; max-width: 480px; }
form.settings.newgame label.toggle { display: flex; align-items: center; gap: 8px; color: var(--text); }
form.settings.newgame label.toggle input { width: auto; }
.warn { margin: 12px 0 8px; padding: 10px 12px; border-left: 3px solid var(--ok); background: var(--bg); border-radius: 6px;
        color: var(--text); font-size: 13px; line-height: 1.5; }
.healthbanner { margin: 12px 20px 0; padding: 12px 16px; border: 1px solid var(--bad); border-left-width: 4px; border-radius: 8px;
                background: var(--panel); line-height: 1.5; }
.healthbanner details { margin: 6px 0; } .healthbanner ul { margin: 4px 0; padding-left: 18px; }
.score { display: inline-block; min-width: 30px; text-align: center; padding: 1px 6px; border-radius: 4px; font-weight: 700;
         color: #0d1117; background: var(--c); }
.rolebars { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 8px; }
.rb { display: grid; grid-template-columns: 120px 1fr 32px; align-items: center; gap: 10px; }
.rb .l { color: var(--muted); font-size: 13px; } .rb b { text-align: right; }
.rb .bar { height: 10px; }
/* Settings sections */
.setnav { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.secpane { display: flex; flex-direction: column; gap: 16px; }
.secpane.hidden { display: none; }
/* ⓘ info popovers */
.info { position: relative; display: inline-flex; align-items: center; justify-content: center; margin-left: 6px;
        width: 16px; height: 16px; border-radius: 50%; font-size: 12px; line-height: 1; color: var(--muted);
        cursor: help; vertical-align: middle; text-transform: none; letter-spacing: 0; font-weight: 400; }
.info:hover, .info:focus, .info.open { color: var(--text); outline: none; }
.infotip { display: none; position: absolute; z-index: 30; top: calc(100% + 6px); left: -8px; width: max-content; max-width: 320px;
           padding: 9px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
           box-shadow: 0 8px 24px #0009; color: var(--text); font-size: 12.5px; line-height: 1.5; white-space: normal;
           text-align: left; cursor: default; font-weight: 400; text-transform: none; letter-spacing: normal; z-index: 70; }
.infotip b { color: var(--text); } .infotip code { font-size: 11.5px; word-break: break-all; }
.info:hover .infotip, .info:focus .infotip, .info.open .infotip { display: block; }
.info.right .infotip { left: auto; right: -8px; }
th .info { margin-left: 3px; }
.inj { color: var(--bad); font-size: 12px; white-space: nowrap; }
.injline { color: var(--bad); margin-top: 4px; font-weight: 600; }
.swaps { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.nextgrid { display: grid; gap: 4px 20px; grid-template-columns: 1fr; align-items: start; }
.nextgrid .sub { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
                 margin-bottom: 4px; }
@media (min-width: 1000px) {
  .card.span2 { grid-column: span 2; }
  .nextgrid { grid-template-columns: 1fr 1fr; }
}
.swap { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 8px;
        padding: 6px 10px; }
.swap.must { border-left-color: var(--bad); }
.swap .arrow { color: var(--muted); margin: 0 4px; }
.spark { display: inline-flex; gap: 2px; align-items: flex-end; height: 18px; vertical-align: middle; }
.spark i { width: 5px; background: var(--blue); border-radius: 1px; }
.attrs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.attrs .row { display: flex; justify-content: space-between; padding: 2px 0; }
.attrs .val { font-weight: 700; min-width: 24px; text-align: right; }
.a20 { color: #3fb950; } .a15 { color: #a3c94f; } .a10 { color: var(--text); } .a5 { color: var(--muted); }
form.settings label { display: block; margin: 12px 0 4px; color: var(--muted); }
form.settings input { width: 100%; max-width: 480px; padding: 8px; background: var(--bg); color: var(--text);
                      border: 1px solid var(--line); border-radius: 6px; }
textarea { width: 100%; max-width: 480px; padding: 8px; background: var(--bg); color: var(--text); border: 1px solid var(--line);
           border-radius: 6px; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); }
.switch input { display: none; }
.switch .knob { position: relative; width: 28px; height: 16px; border-radius: 8px; background: var(--line); transition: background .15s; }
.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
                       background: #fff; transition: transform .15s; }
.switch input:checked + .knob { background: var(--good); }
.switch input:checked + .knob::after { transform: translateX(12px); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.provider { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 16px; max-width: 720px; }
.provider .opt { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; cursor: pointer;
                 background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.provider .opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.provider .opt input { grid-row: span 2; accent-color: var(--accent); }
.provider .opt .muted { font-size: 12px; }
.models { display: flex; flex-direction: column; gap: 6px; max-width: 720px; }
.model, form.settings label.model { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; cursor: pointer;
         background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0 !important; }
.model.on { border-color: var(--accent); }
.model input { grid-row: span 2; width: auto !important; accent-color: var(--accent); }
.model .mname { color: var(--text); font-weight: 600; }
.model .mdesc { grid-column: 2 / 4; font-size: 12px; }
.model .mdesc b { color: var(--good); font-weight: 500; }
.pill.rec { color: var(--good); font-size: 11px; }
.meter { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.meter i { width: 8px; height: 12px; border-radius: 2px; background: var(--line); }
.meter span { margin-left: 4px; min-width: 88px; }
.meter.u1 i.f { background: var(--good); } .meter.u2 i.f { background: #a3c94f; }
.meter.u3 i.f { background: var(--ok); } .meter.u4 i.f { background: var(--bad); }
textarea.prompt { max-width: 900px; font-size: 12.5px; }
.gptbtn { background: #000; color: #fff; border: 1px solid #444; border-radius: 22px; padding: 10px 20px; font-size: 14px; }
.gptbtn:hover { border-color: #888; }
/* AI coach */
.coachbtn { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 8px;
            border-radius: 24px; padding: 12px 18px; font-size: 15px; box-shadow: 0 8px 24px #0009; }
.coachbtn:hover { filter: brightness(1.1); }
.coach { position: fixed; right: 20px; bottom: 20px; z-index: 45; width: min(440px, calc(100vw - 32px));
         height: min(640px, calc(100vh - 100px)); display: flex; flex-direction: column; background: var(--panel);
         border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 48px #000c; animation: zgrow .15s ease-out; }
.coach.hidden, .coachbtn.hidden { display: none; }
.coachhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 14px;
             border-bottom: 1px solid var(--line); }
.coachhead .pill { margin-left: 4px; color: var(--good); } .coachhead .pill.down { color: var(--ok); }
.coachtools { display: flex; gap: 2px; }
.iconbtn { background: none; color: var(--muted); padding: 4px 8px; font-size: 15px; }
.iconbtn:hover { color: var(--text); background: var(--panel2); }
.coachlog { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.coachintro p { color: var(--muted); margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.after { margin-top: 4px; }
.chip { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 5px 10px;
        font-weight: 500; font-size: 12.5px; text-align: left; }
.chip:hover { border-color: var(--blue); }
.msg { max-width: 92%; padding: 8px 12px; border-radius: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.err { border-color: var(--bad); }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 4px 0 6px; padding-left: 20px; } .msg li { margin: 2px 0; }
.msg h4 { margin: 8px 0 4px; font-size: 13px; }
.msg code { background: var(--bg); padding: 0 4px; border-radius: 3px; }
table.mdt { margin: 4px 0; font-size: 12px; } table.mdt th, table.mdt td { padding: 3px 6px; text-align: left; position: static; }
.msgmeta { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.hist { display: flex; flex-direction: column; gap: 6px; }
.histhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.histrow { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
           background: var(--panel2); cursor: pointer; }
.histrow:hover { border-color: var(--blue); } .histrow.on { border-color: var(--accent); }
.histmain { flex: 1; min-width: 0; } .histmain > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typing { color: var(--muted); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.coachform { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.coachform textarea { flex: 1; max-width: none; resize: none; font: inherit; }
@media (max-width: 600px) { .coach { right: 8px; bottom: 8px; height: calc(100vh - 80px); } .coachbtn span { display: none; } }
.toast { position: fixed; right: 20px; bottom: 84px; z-index: 60; background: var(--panel2); border: 1px solid var(--line);
         padding: 12px 16px; border-radius: 8px; max-width: 420px; }
.toast.err { border-color: var(--bad); }
.hidden { display: none; }
.empty { color: var(--muted); padding: 24px; text-align: center; }
canvas { max-height: 320px; }
.chartbox { position: relative; cursor: zoom-in; border-radius: 8px; transition: box-shadow .15s; }
.chartbox:hover { box-shadow: 0 0 0 1px var(--line); }
.chartbox .zhint { position: absolute; top: 4px; right: 6px; font-size: 11px; color: var(--muted); opacity: 0;
                   transition: opacity .15s; pointer-events: none; }
.chartbox:hover .zhint { opacity: 1; }
.chartzoom { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: flex;
             align-items: center; justify-content: center; animation: zfade .15s ease-out; }
.zpanel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px 16px;
          display: flex; flex-direction: column; box-shadow: 0 16px 48px #000b; animation: zgrow .18s ease-out; }
/* sized per chart shape and to the window, so the enlarged chart is responsive */
.zpanel.square { width: min(84vh, 94vw, 860px); height: min(84vh, 94vw, 860px); }
@media (max-width: 600px) { .zhead .muted { display: none; } .zpanel { padding: 10px; } }
.zpanel.wide { width: min(1240px, 92vw); height: min(640px, 76vh); }
.zhead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 6px; }
.ztitle { font-size: 16px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.zhead .muted { font-size: 12px; }
.zbody { position: relative; flex: 1; min-height: 0; }
.zbody canvas { max-height: none; }
@keyframes zfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes zgrow { from { transform: scale(.96); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0 10px; border-bottom: 1px solid var(--line); }
.tab { background: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0;
       padding: 8px 12px; font-weight: 600; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }

/* ---- phone companion */
.offline { font-size: 12px; font-weight: 600; color: var(--ok); border: 1px solid var(--ok); border-radius: 12px; padding: 2px 8px; }
.pairout:not(.hidden) { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.pairout #qr { background: #fff; padding: 10px; border-radius: 8px; line-height: 0; }
.pairout code { word-break: break-all; }
details.setup { margin-top: 14px; } details.setup summary { cursor: pointer; color: var(--blue); }
details.setup li { margin: 6px 0; } details.setup code { word-break: break-all; }
@media (max-width: 700px) {
  header { gap: 10px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .capture { gap: 10px; }
  /* the page tabs become a bottom bar, thumb-reachable */
  nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-wrap: nowrap; overflow-x: auto; gap: 2px;
        background: var(--panel); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { flex: 1 0 auto; text-align: center; font-size: 13px; padding: 8px 9px; }
  main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 12px; overflow-x: auto; }
  .kpi.tile.wide { grid-column: 1 / -1; }
  .filters input#search, .cmpsel select, select { min-width: 0; max-width: 100%; }
  .filters input#search { flex: 1 1 100%; }
  .coachbtn { right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .coach { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; z-index: 50;
           padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .toast { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .healthbanner { margin: 8px 12px; }
}
.paircode { font: 700 28px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; margin: 2px 0 8px; }
