:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #16181d;
  --muted: #6b7280;
  --border: #e3e6eb;
  --primary: #0f7a4a;
  --primary-hover: #0c6640;
  --primary-text: #ffffff;
  --accent: #1d4ed8;
  --ok: #0f7a4a;
  --ok-bg: #e6f4ec;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --warn: #9a6700;
  --warn-bg: #fff4d6;
  --info-bg: #e8effd;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1d2129;
    --text: #e8eaee;
    --muted: #9aa3b2;
    --border: #2a2f3a;
    --primary: #22a06b;
    --primary-hover: #2bb87c;
    --primary-text: #06140d;
    --accent: #6b9bff;
    --ok: #3ccf8e;
    --ok-bg: #11291e;
    --bad: #ff7b72;
    --bad-bg: #2d1514;
    --warn: #f0b429;
    --warn-bg: #2b2310;
    --info-bg: #17223a;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 .6rem; }
h2 { font-size: 1.05rem; margin: 1.1rem 0 .6rem; }
.card h2:first-child, .card .row-between:first-child h2 { margin-top: 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 600; }
.c { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.warn-text { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- Header --- */
.topbar { display: flex; align-items: center; gap: 1.25rem; padding: 0 1.25rem; height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); min-width: 0; flex: none; max-width: 260px; }
.brand:hover { text-decoration: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { background: var(--primary); color: var(--primary-text); border-radius: 8px; padding: .2rem .45rem; font-size: .75rem; letter-spacing: .06em; flex: none; }
.brand-lg { font-size: 1.1rem; margin-bottom: 1rem; justify-content: center; display: flex; }
.nav { display: flex; align-items: center; gap: .15rem; height: 100%; }
.nav > a, .nav-item { display: inline-flex; align-items: center; gap: .3rem; height: 100%; padding: 0 .75rem; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; border-top: 2px solid transparent; white-space: nowrap; }
.nav > a:hover, .nav-item:hover { color: var(--text); text-decoration: none; }
.nav > a.active, .nav-item.active { color: var(--text); border-bottom-color: var(--primary); }
.caret { width: 12px; height: 12px; transition: transform .12s; }
.who { margin-left: auto; display: flex; align-items: center; gap: .75rem; min-width: 0; }
.who form { margin: 0; }
.who-name { font-weight: 500; white-space: nowrap; }

.dropdown { position: relative; height: 100%; display: flex; align-items: center; }
.dropdown > summary { list-style: none; cursor: pointer; user-select: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown[open] .caret { transform: rotate(180deg); }
.dropdown-panel { position: absolute; top: calc(100% + 4px); left: 0; min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 24, 40, .14); padding: .35rem; display: flex; flex-direction: column; z-index: 20; }
.dropdown-right { left: auto; right: 0; }
.dropdown-panel a { padding: .6rem .75rem; border-radius: 8px; color: var(--text); font-weight: 500; }
.dropdown-panel a:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-panel a.active { background: var(--ok-bg); color: var(--primary); }
.menu-mobile { display: none; }
.menu-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface); }
.menu-btn svg { width: 22px; height: 22px; }
.menu-mobile[open] .menu-btn { background: var(--surface-2); }
.menu-user { display: flex; flex-direction: column; padding: .5rem .75rem .6rem; font-weight: 600; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.menu-sep { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: .6rem .75rem .25rem; border-top: 1px solid var(--border); margin-top: .3rem; }
.menu-logout { width: 100%; text-align: left; font: inherit; font-weight: 500; color: var(--bad); background: none; border: 0; border-top: 1px solid var(--border); margin-top: .3rem; padding: .7rem .75rem; cursor: pointer; border-radius: 0 0 8px 8px; }
.menu-logout:hover { background: var(--bad-bg); }

/* --- Layout --- */
.page { max-width: 1240px; margin: 0 auto; padding: 1.25rem; }
.page-center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row-gap { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row-gap form { margin: 0; }
.row-gap.nowrap { flex-wrap: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* --- Forms --- */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; color: var(--muted); margin-bottom: .75rem; }
label.check { flex-direction: row; align-items: center; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem; min-height: 42px; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; min-height: 0; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input:disabled { background: var(--surface-2); color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; border-radius: 10px; padding: .6rem 1rem; min-height: 42px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, opacity .12s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-link { background: none; color: var(--accent); padding-left: 0; border: 0; }
.btn-sm { min-height: 34px; padding: .35rem .7rem; font-size: .88rem; }
.btn-lg { min-height: 50px; padding: .75rem 1.3rem; font-size: 1.02rem; }
.btn-xl { min-height: 62px; font-size: 1.15rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: not-allowed; }

.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.flash-ok { background: var(--ok-bg); color: var(--ok); }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; padding: .2rem .5rem; border-radius: 6px; }
.badge-demo { background: var(--warn-bg); color: var(--warn); }
.badge-live { background: var(--ok-bg); color: var(--ok); }

/* --- Statuses --- */
.status { display: inline-block; font-size: .78rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.status-lg { font-size: .95rem; padding: .35rem .85rem; }
.status-pending { background: var(--info-bg); color: var(--accent); }
.status-success { background: var(--ok-bg); color: var(--ok); }
.status-declined, .status-failed { background: var(--bad-bg); color: var(--bad); }
.status-expired { background: var(--surface-2); color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
.dot-pending { background: var(--accent); }
.dot-success { background: var(--ok); }
.dot-declined, .dot-failed { background: var(--bad); }

/* --- Sign in --- */
.login { width: 100%; max-width: 400px; }
.login h1 { text-align: center; }

/* --- Terminal --- */
.pos { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.pos-form { padding: 1.5rem; }
.methods { border: 0; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 220px)); gap: .6rem; }
.methods legend { font-size: .88rem; color: var(--muted); margin-bottom: .4rem; padding: 0; }
.method { margin: 0; cursor: pointer; position: relative; min-width: 0; }
.method input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.method-body { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); transition: border-color .12s, background .12s; min-height: 60px; }
.method-text { min-width: 0; display: flex; flex-direction: column; }
.method-body strong { display: flex; align-items: center; gap: .35rem; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.method-body small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.method-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.method-icon svg { width: 20px; height: 20px; }
.method input:checked + .method-body { border-color: var(--primary); background: var(--ok-bg); }
.method input:checked + .method-body .method-icon { background: var(--primary); color: var(--primary-text); }
.method input:focus-visible + .method-body { outline: 2px solid var(--accent); outline-offset: 2px; }

[data-method="mobile_money"] .only-card, [data-method="card"] .only-mpesa { display: none !important; }

.amount-row { margin-bottom: .75rem; }
.amount-label { margin: 0 0 .3rem; }
.amount-box { display: flex; align-items: center; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); padding: 0 .75rem 0 0; }
.amount-box:focus-within, .amount-box.is-target { border-color: var(--accent); }
.amount-box input { flex: 1; border: 0; font-size: 2.3rem; font-weight: 700; padding: .4rem .9rem; min-height: 72px; font-variant-numeric: tabular-nums; background: transparent; }
.amount-box input:focus { outline: none; }
.amount-cur { font-size: 1.2rem; font-weight: 700; color: var(--muted); }
.amount-cur-select { width: auto; font-weight: 700; font-size: 1.05rem; }
.hint { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.key { font: inherit; font-size: 1.3rem; font-weight: 600; min-height: 54px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.key:hover { background: var(--border); }
.key:active { transform: scale(.98); }

.phone-row { margin-bottom: .75rem; }
.phone-box { display: flex; align-items: stretch; border-radius: 10px; }
.phone-box.is-target .phone-prefix, .phone-box.is-target input { border-color: var(--accent); }
.phone-box input:focus { outline: none; }
.phone-prefix { display: flex; align-items: center; padding: 0 .75rem; border: 1px solid var(--border); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface-2); color: var(--text); font-weight: 600; }
.phone-box input { flex: 1; border-radius: 0 10px 10px 0; font-size: 1.1rem; letter-spacing: .02em; }

.more { margin-bottom: 1rem; }
.more summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-bottom: .6rem; }

.totals { width: 100%; border-collapse: collapse; }
.totals td { padding: .35rem 0; border-bottom: 1px solid var(--border); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent a { display: flex; align-items: center; gap: .7rem; padding: .55rem .25rem; border-bottom: 1px solid var(--border); color: var(--text); }
.recent a:hover { background: var(--surface-2); text-decoration: none; }
.recent li:last-child a { border-bottom: 0; }
.recent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.recent-main small { color: var(--muted); }
.empty-shift { max-width: 520px; margin: 3rem auto; text-align: center; padding: 2rem; }
.demo-help table td { padding: .2rem .5rem .2rem 0; vertical-align: top; }
.demo-help table td:first-child { font-family: var(--mono); white-space: nowrap; }

/* --- Payment screen --- */
.pay { max-width: 860px; margin: 0 auto; }
.pay-main { padding: 1.5rem; }
.pay-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; flex-wrap: wrap; }
.pay-amount { font-size: 2.3rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.15; }
.pay-amount span { font-size: 1.2rem; color: var(--muted); font-weight: 600; }
.wait, .outcome, .hpp { display: flex; gap: 1.25rem; align-items: flex-start; }
.wait p, .outcome p { margin: .3rem 0 .8rem; }
.outcome svg { width: 56px; height: 56px; flex: none; }
.outcome-ok { color: var(--ok); }
.outcome-bad svg { color: var(--bad); }
.outcome h1 { color: inherit; }
.outcome-ok p { color: var(--muted); }
.pulse { width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--info-bg); color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.pulse svg { width: 30px; height: 30px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(29, 78, 216, .25); } 50% { box-shadow: 0 0 0 12px rgba(29, 78, 216, 0); } }
.spinner { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 4px solid var(--border); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pulse, .spinner { animation: none; } }
.qr { width: 240px; height: 240px; background: #fff; border-radius: 12px; padding: 8px; border: 1px solid var(--border); flex: none; }
.hpp-text { min-width: 0; }
.steps { padding-left: 1.2rem; margin: .5rem 0 1rem; }
.steps li { margin-bottom: .3rem; }
.otp-form { display: flex; gap: .5rem; max-width: 360px; margin-bottom: .25rem; }
.otp-form input { font-size: 1.4rem; letter-spacing: .3em; text-align: center; font-weight: 700; }
.ua-html { width: 100%; min-height: 160px; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: .8rem; }
.pay-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.pay-actions form { margin: 0; }
.live { margin-left: auto; }
.events { padding-left: 1.2rem; margin: .75rem 0; }
.events li { margin-bottom: .45rem; }
.tag { font-family: var(--mono); font-size: .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0 .3rem; }
.raw summary { cursor: pointer; color: var(--muted); font-size: .8rem; }
.raw pre { font-family: var(--mono); font-size: .75rem; background: var(--surface-2); padding: .6rem; border-radius: 8px; overflow: auto; max-height: 320px; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .75rem 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; min-width: 0; }
.meta.wide { grid-template-columns: minmax(130px, max-content) 1fr; }
details > summary { cursor: pointer; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); padding: .55rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters label { margin: 0; min-width: 140px; }
.filters .grow { flex: 1; min-width: 180px; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .3rem .75rem; font-size: .88rem; }
form.inline { display: flex; gap: .4rem; margin: 0; }
form.inline input { min-width: 140px; }

/* --- Admin: settings and methods --- */
.page-head { margin-bottom: 1rem; align-items: flex-end; }
.page-head h1 { margin: .2rem 0 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1rem; }
.field { min-width: 0; margin-bottom: .6rem; }
.field > label { margin-bottom: .3rem; }
.field-wide { grid-column: 1 / -1; }
.field .hint, .field .source { margin: .3rem 0 0; }
.source { font-size: .78rem; color: var(--accent); }
.field-error { color: var(--bad); font-size: .82rem; margin: .3rem 0 0; }
.has-error input, .has-error select { border-color: var(--bad); }
.btn-inline { min-height: 0; padding: 0 .2rem; font-size: .85rem; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; padding: .75rem 0; background: var(--bg); margin-bottom: 1rem; z-index: 2; }
.methods-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 0 1rem; }
.method-card h2 { margin: 0; }
.method-card.is-off { opacity: .65; }
.method-card .row-gap { margin-top: .5rem; }
.adapter-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.adapter { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border: 1px dashed var(--border); border-radius: 12px; color: var(--text); }
.adapter:hover { border-color: var(--primary); background: var(--ok-bg); text-decoration: none; }
.methods .badge { vertical-align: middle; font-size: .62rem; }

.checks { display: flex; flex-direction: column; gap: .2rem; margin-bottom: 1rem; }
.checks .check { color: var(--text); font-size: .95rem; margin: 0; padding: .35rem 0; gap: .5rem; }
.open-shift { max-width: 360px; margin: 0 auto; text-align: left; }
.open-shift .btn { width: 100%; }

/* --- Receipt --- */
.receipt-body { background: var(--bg); }
.receipt { width: 300px; margin: 1.5rem auto; background: #fff; color: #000; padding: 1.25rem 1rem; font-family: var(--mono); font-size: 12.5px; border-radius: 6px; }
.receipt h1 { font-size: 15px; text-align: center; margin: 0 0 .25rem; }
.receipt p { margin: .25rem 0; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: .6rem 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: .12rem 0; vertical-align: top; }
.receipt td:last-child { text-align: right; overflow-wrap: anywhere; }
.receipt-total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; }

@media print {
  .topbar, .no-print, .flash { display: none !important; }
  body, .receipt-body { background: #fff; }
  .card { box-shadow: none; border: 0; }
  .receipt { margin: 0; padding: 0; }
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  .topbar { gap: .75rem; }
  .nav > a, .nav-item { padding: 0 .55rem; }
  .who-name { display: none; }
}
@media (max-width: 900px) {
  .pos { grid-template-columns: 1fr; }
}
/* Phones and small tablets: the menu hides behind one button. */
@media (max-width: 760px) {
  .topbar { height: 52px; padding: 0 .75rem; gap: .5rem; }
  .brand { max-width: none; flex: 1; }
  .nav-desktop, .who-name, .who-logout { display: none; }
  .who { margin-left: 0; gap: .5rem; }
  .menu-mobile { display: flex; }
  .dropdown-panel { min-width: 230px; }
  .dropdown-panel a { padding: .75rem; }
}
@media (max-width: 600px) {
  .page { padding: .6rem; }
  .card { padding: 1rem; }
  .grid-2, .fields { grid-template-columns: 1fr; }
  .methods-list { grid-template-columns: 1fr; }
  .wait, .outcome, .hpp { flex-direction: column; }
  .qr { width: 100%; max-width: 260px; height: auto; align-self: center; }
  .live { margin-left: 0; }

  /* Terminal: the whole payment form fits on one phone screen. */
  .pos-form { padding: .75rem; margin-bottom: .75rem; }
  .methods { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: .6rem; }
  .methods legend, .amount-label, .phone-row .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .method-body { min-height: 52px; padding: .45rem .55rem; gap: .5rem; }
  .method-icon { width: 30px; height: 30px; border-radius: 8px; }
  .method-icon svg { width: 18px; height: 18px; }
  .method-body strong { font-size: .95rem; }
  .methods .badge { padding: .1rem .3rem; font-size: .58rem; }
  .amount-row { margin-bottom: .5rem; }
  .amount-box input { font-size: 1.8rem; min-height: 56px; padding: .2rem .75rem; }
  .hint { margin-top: .25rem; font-size: .75rem; }
  .phone-row { margin-bottom: .5rem; }
  .phone-box input, .phone-prefix { min-height: 46px; }
  .keypad { gap: .4rem; margin-bottom: .6rem; }
  .key { min-height: 46px; font-size: 1.2rem; }
  .more { margin-bottom: .6rem; }
  .more summary { margin-bottom: .3rem; font-size: .85rem; }
  .btn-xl { min-height: 52px; font-size: 1.05rem; }
}
/* Short phones (iPhone SE and similar): squeeze the keypad a bit more. */
@media (max-width: 600px) and (max-height: 700px) {
  .amount-box input { min-height: 48px; font-size: 1.6rem; }
  .phone-box input, .phone-prefix { min-height: 42px; }
  .key { min-height: 40px; }
  .keypad { gap: .35rem; }
  .btn-xl { min-height: 48px; }
}
/* Customer name and comment: one line each, above the keypad. */
.cust-row { display: grid; grid-template-columns: 1fr; gap: 0; }
.cust-row label { margin-bottom: .75rem; min-width: 0; }
.more input { margin-top: .1rem; }
@media (max-width: 600px) {
  .cust-row label { margin-bottom: .5rem; }
  .cust-row .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cust-row input { min-height: 42px; font-size: .95rem; }
}
@media (max-width: 600px) and (max-height: 700px) {
  .cust-row label { margin-bottom: .4rem; }
  .cust-row input { min-height: 38px; padding-top: .4rem; padding-bottom: .4rem; }
  .key { min-height: 38px; }
  .methods { margin-bottom: .5rem; }
  .more { margin-bottom: .5rem; }
}
/* iOS: a quick double tap on the keypad must not zoom the page.
   Pinch-to-zoom keeps working. */
html, body { touch-action: manipulation; }
button, .btn, .key, .method, summary, a, label { touch-action: manipulation; }
/* iOS Safari zooms into any field whose text is smaller than 16px on focus. */
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; }
  .cust-row input, .amount-cur-select { font-size: 16px; }
}
/* iOS: holding a finger on a key or button must not select its text or open
   the Copy / Translate menu. Input fields keep normal selection. */
button, .btn, .key, .keypad, .method, .methods, summary, .nav, .dropdown-panel a, .menu-btn, .brand {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
input, textarea, select { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.key:active { background: var(--border); }
