/* SGV Battery Warranty Claim Builder — screen styles.
   Forest green + mint on off-white paper. Print rules live in print.css. */

:root{
  --forest:#0e4d3a; --forest-2:#14663f; --mint:#10b981;
  --mint-soft:#e8f6ef; --mint-line:#cfe9dd;
  --ink:#182a22; --muted:#6b7d74; --paper:#f4f8f6; --card:#ffffff;
  --line:#e4ece8; --radius:12px;
  --ok:#15803d;  --ok-bg:#e7f6ec;
  --warn:#a16207; --warn-bg:#fdf3d7;
  --bad:#b91c1c;  --bad-bg:#fbe9e7;
  --info:#1e6fb8; --info-bg:#e6f0fa;

  /* Latin faces first, then the Chinese fallbacks that ship with Windows. */
  --font:"PT Root UI",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Helvetica,Arial,
         "Microsoft YaHei","PingFang SC","Noto Sans SC","Hiragino Sans GB",sans-serif;
  --mono:"Cascadia Mono",Consolas,"SFMono-Regular",Menlo,monospace;

  /* category colours — identical on screen and in print */
  --c-no-comms:#e11d48;  --c-no-comms-bg:#ffe4e6;  --c-no-comms-ink:#9f1239;
  --c-no-charge:#f59e0b; --c-no-charge-bg:#fef3c7; --c-no-charge-ink:#92400e;
  --c-cutoff:#3b82f6;    --c-cutoff-bg:#dbeafe;    --c-cutoff-ink:#1e3a8a;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:var(--font); color:var(--ink); background:var(--paper);
  font-size:15px; line-height:1.55; -webkit-font-smoothing:antialiased;
  -webkit-text-size-adjust:100%;
}
/* iOS zooms the whole page in whenever it focuses a field under 16px */
input,select,textarea,button{font-size:16px}
a{color:var(--forest-2)}
h1,h2,h3{margin:0 0 .4em; line-height:1.25; font-weight:650}
h1{font-size:1.5rem} h2{font-size:1.15rem} h3{font-size:1rem}
p{margin:0 0 .8em}
small{font-size:.82rem}

/* ---------- layout ---------- */
.wrap{max-width:1180px; margin:0 auto; padding:0 20px 64px}

.topbar{
  background:linear-gradient(180deg,var(--forest) 0%,var(--forest-2) 100%);
  color:#fff; padding:14px 0; margin-bottom:24px;
  box-shadow:0 2px 10px rgba(14,77,58,.18);
}
.topbar .wrap{display:flex; align-items:center; gap:16px; padding-bottom:0}
.topbar img{height:38px; width:auto; display:block; background:#fff; border-radius:8px; padding:4px 8px}
.topbar .title{font-weight:650; font-size:1.05rem; letter-spacing:.2px}
.topbar .sub{opacity:.8; font-size:.82rem}
.topbar .spacer{flex:1}
.topbar a{color:#fff; text-decoration:none}
/* buttons in the header keep their own colours — ".topbar a" would otherwise
   paint a ghost button's label white on its white background */
.topbar a.btn-ghost{color:var(--forest)}
.topbar a.btn-danger{color:var(--bad)}

.langpick{display:flex; gap:2px; background:rgba(255,255,255,.14); border-radius:999px; padding:3px}
.langpick a{
  padding:4px 12px; border-radius:999px; font-size:.82rem; line-height:1.4;
  color:#eaf6f0; text-decoration:none; white-space:nowrap;
}
.langpick a.on{background:#fff; color:var(--forest); font-weight:600}

/* ---------- cards ---------- */
.card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:20px; margin-bottom:20px; box-shadow:0 1px 2px rgba(16,40,32,.04);
}
.card > h2:first-child{margin-top:0}
.card-head{display:flex; align-items:center; gap:12px; margin-bottom:14px}
.card-head h2{margin:0; flex:1}

details.card > summary{
  cursor:pointer; font-weight:650; font-size:1.15rem; list-style:none;
  display:flex; align-items:center; gap:10px;
}
details.card > summary::-webkit-details-marker{display:none}
details.card > summary::before{content:"▸"; color:var(--mint); font-size:.9em}
details.card[open] > summary::before{content:"▾"}
details.card > summary + *{margin-top:16px}

/* ---------- forms ---------- */
label{display:block; font-size:.8rem; font-weight:600; color:var(--muted); margin-bottom:4px}
input[type=text],input[type=email],input[type=tel],input[type=number],input[type=date],
input[type=file],select,textarea{
  width:100%; padding:8px 10px; font:inherit; font-size:.92rem; color:var(--ink);
  background:#fff; border:1px solid var(--line); border-radius:8px;
}
input:focus,select:focus,textarea:focus{
  outline:none; border-color:var(--mint); box-shadow:0 0 0 3px var(--mint-soft);
}
textarea{resize:vertical; min-height:70px; line-height:1.5}
.grid{display:grid; gap:14px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:820px){.g2,.g3,.g4{grid-template-columns:1fr}}
.field{min-width:0}
.hint{font-size:.78rem; color:var(--muted); margin-top:4px}
.actions{display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:16px}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:7px; padding:9px 16px;
  font:inherit; font-size:.9rem; font-weight:600; border-radius:8px; cursor:pointer;
  border:1px solid transparent; background:var(--forest); color:#fff; text-decoration:none;
  transition:background .12s ease, border-color .12s ease;
}
.btn:hover{background:var(--forest-2)}
.btn-mint{background:var(--mint)} .btn-mint:hover{background:#0ea371}
.btn-ghost{background:#fff; color:var(--forest); border-color:var(--mint-line)}
.btn-ghost:hover{background:var(--mint-soft)}
.btn-danger{background:#fff; color:var(--bad); border-color:#f1c9c5}
.btn-danger:hover{background:var(--bad-bg)}
.btn-sm{padding:5px 11px; font-size:.82rem}
.btn-lg{padding:12px 22px; font-size:1rem}

/* ---------- flash ---------- */
.flash{padding:11px 15px; border-radius:9px; margin-bottom:12px; font-size:.9rem; border:1px solid}
.flash.ok{background:var(--ok-bg); border-color:#bfe3cb; color:var(--ok)}
.flash.warn{background:var(--warn-bg); border-color:#eed99b; color:var(--warn)}
.flash.error{background:var(--bad-bg); border-color:#f1c9c5; color:var(--bad)}

/* ---------- counts ---------- */
.counts{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:20px}
@media(max-width:820px){.counts{grid-template-columns:repeat(2,1fr)}}
.count{
  background:var(--card); border:1px solid var(--line); border-left:5px solid var(--muted);
  border-radius:var(--radius); padding:14px 16px;
}
.count .n{font-size:1.9rem; font-weight:700; line-height:1.1}
.count .l{font-size:.78rem; color:var(--muted); font-weight:600}
.count.NO_COMMS{border-left-color:var(--c-no-comms)}
.count.NO_CHARGE{border-left-color:var(--c-no-charge)}
.count.CUTOFF{border-left-color:var(--c-cutoff)}
.count.TOTAL{border-left-color:var(--forest); background:var(--mint-soft)}

/* ---------- report picture slots ---------- */
.imgslots{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px}
@media(max-width:900px){.imgslots{grid-template-columns:repeat(2,minmax(0,1fr))}}
.imgslot{
  background:var(--paper); border:1px solid var(--line); border-radius:10px;
  padding:10px; display:flex; flex-direction:column; gap:8px;
}
.imgslot-lbl{font-size:.78rem; font-weight:700; color:var(--forest)}
.imgslot img{
  width:100%; height:140px; object-fit:cover; border-radius:7px;
  background:#e9eeec; border:1px solid var(--line);
}
.imgslot-empty{
  height:140px; display:flex; align-items:center; justify-content:center;
  border:1px dashed var(--line); border-radius:7px; color:var(--muted); font-size:.8rem;
}
.imgslot input[type=file]{font-size:.78rem; padding:6px}
.imgslot .checkline{font-size:.78rem}

/* ---------- needs-review ---------- */
.review-banner{
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
  background:var(--warn-bg); border:1px solid #eed99b; border-left:5px solid var(--warn);
  border-radius:var(--radius); padding:13px 16px; margin-bottom:20px; color:#6b4a08;
}
.review-banner > div:first-child{flex:1; min-width:240px}
.review-banner strong{display:block; color:var(--warn); font-size:.95rem}
.review-banner div div{font-size:.85rem; margin-top:2px}
.review-banner .btn{background:var(--warn); border-color:var(--warn)}
.review-banner .btn:hover{background:#8a5406}
.brow.review{background:#fffdf6}
.tag.review{background:var(--warn-bg); color:var(--warn); border-color:#eed99b}

/* ---------- chips ---------- */
.chip{
  display:inline-block; padding:2px 10px; border-radius:999px;
  font-size:.75rem; font-weight:650; white-space:nowrap; border:1px solid transparent;
}
.chip.NO_COMMS{background:var(--c-no-comms-bg); color:var(--c-no-comms-ink); border-color:var(--c-no-comms)}
.chip.NO_CHARGE{background:var(--c-no-charge-bg); color:var(--c-no-charge-ink); border-color:var(--c-no-charge)}
.chip.CUTOFF{background:var(--c-cutoff-bg); color:var(--c-cutoff-ink); border-color:var(--c-cutoff)}
.tag{
  display:inline-block; padding:1px 8px; border-radius:5px; font-size:.7rem;
  font-weight:650; background:var(--mint-soft); color:var(--forest); border:1px solid var(--mint-line);
}
.tag.grey{background:#eef2f0; color:var(--muted); border-color:var(--line)}
.tag.on{background:var(--ok-bg); color:var(--ok); border-color:#bfe3cb}
.tag.off{background:#f3f5f4; color:var(--muted); border-color:var(--line)}

/* ---------- battery list ---------- */
.toolbar{display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:14px}
.toolbar .grow{flex:1; min-width:200px}

.blist{display:flex; flex-direction:column; gap:10px}
.brow{
  display:grid; grid-template-columns:74px 1fr auto; gap:14px; align-items:center;
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:11px 14px; border-left:5px solid var(--muted);
}
.brow.NO_COMMS{border-left-color:var(--c-no-comms)}
.brow.NO_CHARGE{border-left-color:var(--c-no-charge)}
.brow.CUTOFF{border-left-color:var(--c-cutoff)}
.brow:target{box-shadow:0 0 0 3px var(--mint-soft)}
@media(max-width:700px){.brow{grid-template-columns:60px 1fr}}

.thumb{
  width:74px; height:74px; border-radius:9px; object-fit:cover; display:block;
  background:#eef2f0; border:1px solid var(--line);
}
.thumb.empty{
  display:flex; align-items:center; justify-content:center;
  color:var(--muted); font-size:.68rem; text-align:center; padding:4px;
}
.bmain{min-width:0}
.bserial{font-weight:700; font-size:1.02rem; display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.bmeta{display:flex; gap:7px; align-items:center; flex-wrap:wrap; margin-top:4px}
.bsum{
  font-size:.84rem; color:var(--muted); margin-top:5px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.brow .quick{display:flex; gap:7px; align-items:center; flex-wrap:wrap; justify-content:flex-end}
.brow .quick select,.brow .quick input{width:auto; font-size:.82rem; padding:5px 8px}
.brow .quick input.serial{width:130px}
.brow .quick input.pct{width:70px}

.empty-state{text-align:center; color:var(--muted); padding:34px 20px}

/* ---------- diagnostics panel ---------- */
.stats{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px}
@media(max-width:820px){.stats{grid-template-columns:repeat(2,1fr)}}
.stat{background:var(--paper); border:1px solid var(--line); border-radius:9px; padding:9px 12px}
.stat .l{font-size:.72rem; color:var(--muted); font-weight:650; text-transform:uppercase; letter-spacing:.4px}
.stat .v{font-size:1.02rem; font-weight:650; margin-top:1px}

.verdict{display:inline-block; padding:4px 13px; border-radius:999px; font-weight:700; font-size:.85rem}
.verdict.defective{background:var(--bad-bg); color:var(--bad)}
.verdict.attention{background:var(--warn-bg); color:var(--warn)}
.verdict.discharged{background:var(--info-bg); color:var(--info)}
.verdict.healthy{background:var(--ok-bg); color:var(--ok)}
.verdict.no_response{background:#eef2f0; color:var(--muted)}

.flaglist{list-style:none; padding:0; margin:10px 0 0; display:flex; flex-wrap:wrap; gap:7px}
.flaglist li{
  background:var(--bad-bg); color:var(--bad); border:1px solid #f1c9c5;
  padding:3px 10px; border-radius:7px; font-size:.8rem; font-weight:600;
}
.reasonlist{margin:10px 0 0; padding-left:20px; font-size:.88rem; color:var(--ink)}

.chartbox{position:relative; height:230px; margin-top:14px}
.chart-fallback{
  display:none; height:100%; align-items:center; justify-content:center;
  background:var(--paper); border:1px dashed var(--line); border-radius:9px;
  color:var(--muted); font-size:.85rem;
}
.chartbox.failed canvas{display:none}
.chartbox.failed .chart-fallback{display:flex}

/* ---------- photo matching workbench ---------- */
.matcher{
  display:grid; grid-template-columns:minmax(0,1fr) minmax(340px,440px); gap:20px;
  margin-bottom:20px; align-items:start;
}
@media(max-width:900px){.matcher{grid-template-columns:1fr}}

.mphoto{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:12px; display:flex; flex-direction:column; gap:10px;
}
.mphoto-frame{
  position:relative; overflow:hidden; border-radius:8px; background:#f2f5f4;
  cursor:zoom-in; height:72vh; min-height:340px;
}
.mphoto-frame img{
  width:100%; height:100%; object-fit:contain; display:block;
  transition:transform .12s ease-out;
}
/* click to magnify — serial labels on the packs are small */
.mphoto-frame.zoomed{cursor:zoom-out}
.mphoto-frame.zoomed img{transform:scale(3)}
.mphoto-zoomhint{
  position:absolute; right:8px; bottom:8px; padding:2px 9px; border-radius:999px;
  background:rgba(24,42,34,.72); color:#fff; font-size:.72rem; pointer-events:none;
}
.mphoto-foot{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.mphoto-foot .spacer{flex:1}
.mphoto-foot .mono{font-size:.74rem; color:var(--muted); overflow-wrap:anywhere}

.mpick{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:14px; display:flex; flex-direction:column; gap:10px;
  position:sticky; top:16px;
}
.msearch{
  width:100%; padding:12px 14px; font:inherit; font-size:1.05rem; font-weight:600;
  border:2px solid var(--mint-line); border-radius:9px; background:#fff;
}
.msearch:focus{outline:none; border-color:var(--mint); box-shadow:0 0 0 3px var(--mint-soft)}
.mtools{display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:.8rem}
.mtools .spacer{flex:1}

.mlist{
  list-style:none; margin:0; padding:0; max-height:52vh; overflow-y:auto;
  border:1px solid var(--line); border-radius:9px;
}
.mrow{
  display:flex; align-items:center; gap:10px; padding:9px 12px; cursor:pointer;
  border-bottom:1px solid var(--line);
}
.mrow:last-child{border-bottom:none}
.mrow:hover{background:var(--mint-soft)}
.mrow.on{background:var(--mint-soft); box-shadow:inset 3px 0 0 var(--mint)}
.mrow-main{display:flex; align-items:center; gap:7px; flex-wrap:wrap; flex:1; min-width:0}
.mrow-serial{font-weight:700; font-size:.95rem}
.mrow-state{font-size:.72rem; color:var(--ok); font-weight:650; white-space:nowrap}
.mrow-state.warn{color:var(--warn)}
.mrow.has-photo{background:#fcfcfb}
.mnone{padding:18px; text-align:center; color:var(--muted); font-size:.9rem}

/* ---------- sign in ---------- */
/* grid, not flex: a flex child will not shrink below its own width, which
   pushed the box off the right of a 390px phone screen */
.loginpage{
  display:grid; place-items:center; align-content:center;
  min-height:100vh; min-height:100dvh; padding:20px;
  background:linear-gradient(160deg,var(--forest) 0%,#0a3a2b 100%);
}
.loginbox{
  width:100%; max-width:380px; min-width:0; background:var(--card);
  border-radius:16px; padding:24px 20px; box-shadow:0 10px 40px rgba(0,0,0,.25);
}
.loginbox p{overflow-wrap:break-word}
.loginbox h1{font-size:1.25rem; margin-bottom:4px}
.loginlogo{height:40px; width:auto; display:block; margin-bottom:16px}
.loginbox .field{margin-bottom:14px}
.loginbox input{padding:12px 12px}

/* the yes/no card when checking a photo that is already attached */
.vcard{
  background:var(--mint-soft); border:1px solid var(--mint-line);
  border-radius:10px; padding:14px;
}
.vcard-q{font-weight:700; font-size:1rem; color:var(--forest); margin-bottom:10px}
.vcard-lbl{
  font-size:.7rem; font-weight:700; color:var(--muted);
  text-transform:uppercase; letter-spacing:.5px;
}
.vcard-serial{
  font-size:1.5rem; font-weight:700; line-height:1.2; margin:2px 0 6px;
  display:flex; align-items:center; gap:8px; flex-wrap:wrap; word-break:break-all;
}
.vcard-serial .tag{font-size:.7rem}
.vcard-meta{display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px}
.vcard-actions{display:flex; gap:9px; flex-wrap:wrap}
.vcard-actions .btn{flex:1; justify-content:center; min-width:150px}
.vcard-drop{
  margin-top:12px; padding-top:10px; border-top:1px solid var(--mint-line);
  align-items:flex-start; font-size:.84rem;
}
.vcard-drop .hint{margin-top:2px}
kbd{
  display:inline-block; padding:0 5px; border-radius:4px; font-family:var(--mono);
  font-size:.72em; background:rgba(0,0,0,.16); border:1px solid rgba(0,0,0,.12);
}
.vsep{
  text-align:center; font-size:.8rem; color:var(--muted); font-weight:600;
  margin:4px 0 -2px;
}

/* stage tabs + how much of the pile is done */
.stagebar{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px}
.stagebar .stage{
  display:inline-flex; align-items:center; gap:8px; padding:7px 14px;
  border:1px solid var(--line); border-radius:999px; background:var(--card);
  color:var(--muted); text-decoration:none; font-size:.85rem; font-weight:650;
}
.stagebar .stage .n{
  background:#eef2f0; color:var(--muted); border-radius:999px;
  padding:0 8px; font-size:.78rem;
}
.stagebar .stage.on{background:var(--forest); border-color:var(--forest); color:#fff}
.stagebar .stage.on .n{background:rgba(255,255,255,.22); color:#fff}
.stagebar .stage.empty{opacity:.5}

.progress{
  position:relative; flex:1; min-width:180px; height:26px;
  background:#e6ece9; border:1px solid var(--line);
  border-radius:999px; overflow:hidden;
}
.progress-bar{height:100%; background:linear-gradient(90deg,var(--forest),var(--mint)); transition:width .3s}
.progress-label{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size:.78rem; font-weight:700; color:var(--ink);
}

/* ---------- misc ---------- */
.mono{font-family:var(--mono); font-size:.86em}
.muted{color:var(--muted)}
.nowrap{white-space:nowrap}
.divider{height:1px; background:var(--line); margin:18px 0}
.photo-preview{max-width:100%; max-height:340px; border-radius:10px; border:1px solid var(--line); display:block}
.inline-form{display:inline}
.checkline{display:flex; align-items:center; gap:8px; font-size:.88rem; color:var(--ink); font-weight:500}
.checkline input{width:auto}
.checkline label{margin:0; font-size:.88rem; font-weight:500; color:var(--ink)}

/* ================================================================== *
 *  PHONES
 *  Everything below is about one-handed use on a phone: single column,
 *  tap targets you can actually hit, and the buttons that matter within
 *  thumb reach at the bottom of the screen.
 * ================================================================== */
@media (max-width: 720px) {

  body{font-size:16px}
  .wrap{padding:0 12px 40px}

  /* header: logo + title on the first line, controls wrap onto a second */
  .topbar{padding:10px 0; margin-bottom:14px}
  .topbar .wrap{gap:8px; flex-wrap:wrap}
  .topbar img{height:28px; padding:3px 6px}
  .topbar .title{font-size:.95rem; line-height:1.25}
  .topbar .sub{font-size:.72rem; line-height:1.3}
  .topbar > .wrap > div:not(.spacer):not(.langpick){min-width:0; flex:1 1 auto}
  .topbar .spacer{flex:1 1 100%; height:0}
  .langpick{flex:1 1 auto}
  .langpick a{padding:7px 10px; flex:1; text-align:center}
  .topbar form.inline-form{flex:0 0 auto}
  .topbar .btn-ghost{padding:7px 12px; min-height:36px}

  /* long option labels give a <select> a huge intrinsic width */
  select{max-width:100%; min-width:0; text-overflow:ellipsis}

  .card{padding:14px; border-radius:10px; margin-bottom:14px}
  h1{font-size:1.25rem} h2{font-size:1.05rem}

  /* one column everywhere — two-up form fields are unusable at this width */
  .grid.g2,.grid.g3,.grid.g4{grid-template-columns:1fr}
  .counts{grid-template-columns:repeat(2,1fr); gap:10px}
  .count{padding:11px 12px}
  .count .n{font-size:1.5rem}

  /* comfortable targets: 44px is the smallest reliable tap area */
  .btn{padding:12px 16px; min-height:44px}
  .btn-sm{padding:9px 13px; min-height:38px; font-size:.85rem}
  .btn-lg{padding:14px 20px; min-height:50px}
  input[type=text],input[type=email],input[type=tel],input[type=number],
  input[type=date],input[type=password],select,textarea{padding:11px 12px; min-height:44px}
  input[type=file]{padding:11px 12px}
  .checkline input[type=checkbox]{width:22px; height:22px}

  /* the report buttons and other action rows go full width */
  .actions{gap:8px}
  .actions .btn,.actions .btn-lg{flex:1 1 100%; justify-content:center}

  /* ---- battery list: stack instead of a 3-column grid ---- */
  .brow{
    grid-template-columns:64px 1fr; gap:10px; padding:10px 12px;
    row-gap:10px; align-items:start;
  }
  .thumb{width:64px; height:64px}
  .bserial{font-size:1.05rem}
  .bsum{-webkit-line-clamp:3}
  .brow .quick{
    grid-column:1 / -1; justify-content:stretch; gap:8px;
    padding-top:10px; border-top:1px solid var(--line); flex-wrap:wrap;
  }
  .brow .quick input.serial{flex:1 1 100%; width:auto}
  .brow .quick select{flex:1 1 100%; width:100%}
  .brow .quick input.pct{flex:0 0 84px; width:84px}
  .brow .quick .btn{flex:1 1 0; justify-content:center; min-width:0}

  .toolbar{gap:8px}
  .toolbar .grow{flex:1 1 100%}
  .toolbar select,.toolbar .btn{flex:1 1 auto}

  /* ---- photo workbench ---- */
  .matcher{grid-template-columns:1fr; gap:12px}
  .mphoto{padding:8px}
  .mphoto-frame{height:52vh; min-height:260px}
  .mphoto-foot{gap:6px}
  .mphoto-foot .mono{flex:1 1 100%; order:3}
  .mphoto-foot .btn{flex:1 1 0}
  .mpick{position:static; padding:12px}
  .msearch{padding:14px; font-size:1.1rem}
  .mlist{max-height:44vh}
  .mrow{padding:12px; min-height:52px}

  /* Yes/No are the whole job on this screen — keep them under the thumb */
  .vcard-actions{position:sticky; bottom:0; z-index:5}
  .vcard-actions .btn{flex:1 1 100%; min-height:52px; font-size:1rem}
  .vcard-actions .btn kbd{display:none}     /* no keyboard on a phone */
  .vcard-serial{font-size:1.35rem}

  .stagebar{gap:6px}
  .stagebar .stage{flex:1 1 auto; justify-content:center; padding:9px 10px; font-size:.8rem}
  .progress{flex:1 1 100%}

  .review-banner{padding:12px; gap:10px}
  .review-banner .btn{flex:1 1 100%; justify-content:center}

  .stats{grid-template-columns:repeat(2,1fr)}
  .photo-preview{max-height:44vh}
  .chartbox{height:200px}
}

/* very small phones */
@media (max-width: 400px) {
  .counts{grid-template-columns:1fr}
  .brow{grid-template-columns:52px 1fr}
  .thumb{width:52px; height:52px}
}

/* landscape phone: the photo would otherwise fill the screen on its own */
@media (max-width: 900px) and (orientation: landscape) {
  .mphoto-frame{height:70vh}
  .mlist{max-height:38vh}
}
