/* ═══════════════════════════════════════════════════════
   styles.css — Invoice DApp complete stylesheet
   ═══════════════════════════════════════════════════════ */

:root {
  --fd: 'Syne', sans-serif;
  --fb: 'Outfit', sans-serif;
  --fm: 'JetBrains Mono', monospace;
  --bg0: #f4f4f8; --bg1: #ffffff; --bg2: #ededf3; --bgh: rgba(244,244,248,0.92);
  --bd: #dcdce4;  --bds: #e6e6ed;
  --t1: #0f0f22;  --t2: #58587a;  --t3: #9494b0;
  --ac: #c49800;  --acr: 196,152,0;
  --acbg: rgba(196,152,0,0.08); --acbd: rgba(196,152,0,0.28); --acgl: rgba(196,152,0,0.14);
  --ok: #15803d;  --okbg: rgba(21,128,61,0.09);  --okbd: rgba(21,128,61,0.28);
  --er: #dc2626;  --erbg: rgba(220,38,38,0.09);  --erbd: rgba(220,38,38,0.28);
  --warn: #d97706; --warnbg: rgba(217,119,6,0.09); --warnbd: rgba(217,119,6,0.28);
  --sh1: 0 1px 4px rgba(0,0,0,0.05);
  --sh2: 0 4px 18px rgba(0,0,0,0.08);
  --sh3: 0 10px 40px rgba(0,0,0,0.12);
  --r: 14px; --rs: 9px;
}

.dark {
  --bg0: #06060e; --bg1: #0e0e1a; --bg2: #161628; --bgh: rgba(6,6,14,0.92);
  --bd: #222238;  --bds: #1a1a2e;
  --t1: #e8e8f0;  --t2: #7878a0;  --t3: #484868;
  --ac: #F0B90B;  --acr: 240,185,11;
  --acbg: rgba(240,185,11,0.07); --acbd: rgba(240,185,11,0.22); --acgl: rgba(240,185,11,0.11);
  --ok: #22c55e;  --okbg: rgba(34,197,94,0.09);  --okbd: rgba(34,197,94,0.28);
  --er: #ef4444;  --erbg: rgba(239,68,68,0.09);  --erbd: rgba(239,68,68,0.28);
  --warn: #f59e0b; --warnbg: rgba(245,158,11,0.09); --warnbd: rgba(245,158,11,0.28);
  --sh1: 0 1px 4px rgba(0,0,0,0.3);
  --sh2: 0 4px 18px rgba(0,0,0,0.4);
  --sh3: 0 10px 40px rgba(0,0,0,0.5);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--fb); background: var(--bg0); color: var(--t1); min-height: 100vh; line-height: 1.5; overflow-x: hidden; }

/* ── Layout ── */
#app { max-width: 468px; margin: 0 auto; padding: 0 16px 80px; min-height: 100vh; }

/* ── Header ── */
header { position: sticky; top: 0; z-index: 30; padding: 13px 0; background: var(--bgh); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--bds); }
.hdr  { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 9px; }
.logo-t { font-family: var(--fd); font-weight: 700; font-size: 14px; letter-spacing: .09em; text-transform: uppercase; color: var(--t2); }
.netb { display: flex; align-items: center; gap: 6px; font-family: var(--fm); font-size: 11px; font-weight: 500; color: var(--t3); background: var(--bg2); border: 1px solid var(--bd); padding: 5px 10px; border-radius: 20px; transition: all .3s; }
.netb.on { color: var(--ok); border-color: var(--okbd); background: var(--okbg); }
.ndot { width: 6px; height: 6px; border-radius: 50%; background: var(--t3); transition: all .3s; flex-shrink: 0; }
.netb.on .ndot { background: var(--ok); box-shadow: 0 0 6px var(--ok); }

/* ── Views ── */
main { padding-top: 26px; }
.view { display: none; }
.view.on { display: block; animation: vIn .38s ease; }

/* ── Animations ── */
@keyframes vIn      { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes stampIn  { from { opacity: 0; transform: translate(-50%,-50%) rotate(-12deg) scale(2.5); } to { opacity: .12; transform: translate(-50%,-50%) rotate(-12deg) scale(1); } }
@keyframes ckDraw   { to { stroke-dashoffset: 0; } }
@keyframes pulse    { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes tIn      { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes tOut     { to { opacity: 0; transform: translateY(-8px) scale(.96); } }

/* ── Typography ── */
.vt { font-family: var(--fd); font-size: 1.55rem; font-weight: 800; margin-bottom: 4px; }
.vs { color: var(--t2); font-size: .92rem; margin-bottom: 22px; }

/* ── Badges ── */
.badge { font-family: var(--fm); font-size: 10px; font-weight: 600; letter-spacing: .06em; padding: 3px 9px; border-radius: 20px; }
.badge.pend { color: var(--t3); background: var(--bg2); border: 1px solid var(--bd); }
.badge.good { color: var(--ok); background: var(--okbg); border: 1px solid var(--okbd); }
.badge.fail { color: var(--er); background: var(--erbg); border: 1px solid var(--erbd); }

/* ── Verify card ── */
.vc { background: var(--bg1); border: 1.5px solid var(--bd); border-radius: var(--r); padding: 20px; margin-bottom: 22px; box-shadow: var(--sh1); transition: border-color .3s; }
.vc.ok { border-color: var(--okbd); }
.vc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.vc-title { font-family: var(--fd); font-size: 12px; font-weight: 700; color: var(--t2); text-transform: uppercase; letter-spacing: .05em; }
.vc-addr { font-family: var(--fm); font-size: 11.5px; color: var(--t1); word-break: break-all; line-height: 1.75; background: var(--bg2); padding: 10px 12px; border-radius: var(--rs); margin-bottom: 11px; border: 1px solid var(--bds); }
.vc-links { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vc-links a, .vc-links button { font-family: var(--fm); font-size: 11px; font-weight: 500; color: var(--ac); text-decoration: none; background: none; border: none; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.vc-links a:hover, .vc-links button:hover { text-decoration: underline; }
.vsep { color: var(--bd); font-size: 10px; }
.vc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; margin-top: 13px; border-radius: var(--rs); border: 1.5px solid var(--acbd); background: var(--acbg); color: var(--ac); font-family: var(--fb); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; }
.vc-btn:hover:not(:disabled) { background: rgba(var(--acr),.14); }
.vc-btn:disabled { opacity: .4; cursor: not-allowed; }
.vc-res { margin-top: 11px; font-size: 13px; font-weight: 500; display: flex; align-items: flex-start; gap: 7px; line-height: 1.5; }
.vc-res.ok { color: var(--ok); } .vc-res.fail { color: var(--er); }

/* ── Form ── */
.fg { margin-bottom: 18px; }
.fl { display: block; font-family: var(--fm); font-size: 11px; font-weight: 500; color: var(--t3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.fl .opt { font-weight: 400; opacity: .6; text-transform: none; letter-spacing: 0; }
input, textarea { width: 100%; padding: 13px 15px; background: var(--bg2); border: 1.5px solid var(--bd); border-radius: var(--rs); color: var(--t1); font-family: var(--fb); font-size: 16px; transition: border-color .2s, box-shadow .2s; outline: none; resize: vertical; -webkit-appearance: none; }
input::placeholder, textarea::placeholder { color: var(--t3); }
input:focus, textarea:focus { border-color: var(--ac); box-shadow: 0 0 0 3px var(--acgl); }
textarea { min-height: 76px; }
.amt-w { position: relative; }
.amt-w .cur { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-family: var(--fm); font-size: 13px; font-weight: 600; color: var(--ac); pointer-events: none; }
.amt-w input { padding-left: 54px; font-family: var(--fm); font-weight: 500; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 22px; border-radius: var(--rs); border: none; font-family: var(--fb); font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn:active { transform: scale(.97) !important; }
.bf { width: 100%; }
.bp { background: var(--ac); color: #000; }
.bp:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 20px var(--acgl); }
.bo { background: var(--acbg); color: var(--ac); border: 1.5px solid var(--acbd); }
.bo:hover:not(:disabled) { background: rgba(var(--acr),.14); }
.bg-t { background: transparent; color: var(--t2); padding: 10px 0; }
.bg-t:hover { color: var(--t1); }
.bk { background: var(--ok); color: #fff; }
.bk:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; filter: none !important; }
.sp    { width: 15px; height: 15px; border: 2px solid rgba(0,0,0,.2);    border-top-color: #000;        border-radius: 50%; animation: spin .65s linear infinite; flex-shrink: 0; }
.sp-ac { width: 15px; height: 15px; border: 2px solid rgba(var(--acr),.25); border-top-color: var(--ac); border-radius: 50%; animation: spin .65s linear infinite; flex-shrink: 0; }

/* ── Invoice card ── */
.ic { position: relative; overflow: hidden; background: var(--bg1); border: 1.5px solid var(--bd); border-radius: var(--r); padding: 26px; box-shadow: var(--sh2); margin-bottom: 20px; }
.ic-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 19px; }
.ic-tag { font-family: var(--fm); font-size: 11px; font-weight: 600; color: var(--t3); letter-spacing: .06em; }
.ic-num { font-family: var(--fm); font-size: 13px; font-weight: 500; color: var(--t2); margin-top: 2px; }
.st { font-family: var(--fm); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; }
.st-p { color: var(--ac); background: var(--acbg); border: 1px solid var(--acbd); }
.st-w { color: #3b82f6; background: rgba(59,130,246,.09); border: 1px solid rgba(59,130,246,.22); animation: pulse 1.5s infinite; }
.st-d { color: var(--ok); background: var(--okbg); border: 1px solid var(--okbd); }
.st-x { color: var(--er); background: var(--erbg); border: 1px solid var(--erbd); }
.ic-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px dashed var(--bd); }
.ml { font-family: var(--fm); font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.mv { font-size: 14px; font-weight: 500; }
.ic-body { margin-bottom: 20px; }
.ic-sec { margin-bottom: 13px; }
.ic-sec .sl { font-family: var(--fm); font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 5px; }
.ic-sec p { font-size: 14px; color: var(--t2); line-height: 1.6; }
.ic-tot { display: flex; justify-content: space-between; align-items: center; padding: 15px 0 0; border-top: 2px solid var(--bd); }
.ic-tot-l { font-family: var(--fm); font-size: 11px; color: var(--t3); text-transform: uppercase; letter-spacing: .06em; }
.ic-tot-v { font-family: var(--fd); font-size: 1.7rem; font-weight: 800; color: var(--ac); }
.ic-tot-v .u { font-size: .65em; font-weight: 600; opacity: .7; margin-left: 3px; }
.ic-inr { font-family: var(--fm); font-size: 11px; color: var(--t3); margin-top: 3px; }
.ic-expiry { margin-top: 12px; padding: 8px 12px; background: var(--warnbg); border: 1px solid var(--warnbd); border-radius: var(--rs); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; }
.ic-expiry span { font-family: var(--fm); font-size: 10px; color: var(--warn); font-weight: 500; }
.ic-expiry .countdown { font-weight: 700; }
.paid-s { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-12deg); font-family: var(--fd); font-size: 3.5rem; font-weight: 800; color: var(--ok); letter-spacing: .15em; border: 4px solid var(--ok); padding: 2px 20px; border-radius: 10px; pointer-events: none; }
.paid-s.show { display: block; animation: stampIn .5s ease forwards; }

/* ── Share ── */
.share-sec { margin-bottom: 20px; }
.share-sec .lbl { font-family: var(--fm); font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 9px; text-align: center; }
.share-prev { background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--rs); padding: 13px; margin-bottom: 11px; max-height: 150px; overflow-y: auto; font-family: var(--fm); font-size: 11px; line-height: 1.75; color: var(--t2); white-space: pre-wrap; word-break: break-word; }

/* ── Divider ── */
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; color: var(--t3); font-family: var(--fm); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--bd); }

/* ── Payment section ── */
.ps { margin-bottom: 22px; }
.no-w { text-align: center; padding: 16px; margin-bottom: 13px; background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--rs); }
.no-w p { font-size: 13px; color: var(--t2); line-height: 1.6; }

/* ── Wallet gate status ── */
.gate-box { border-radius: var(--rs); padding: 12px 15px; margin-bottom: 13px; font-family: var(--fb); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.gate-box.checking { background: var(--bg2); border: 1px solid var(--bd); color: var(--t2); }
.gate-box.blocked  { background: var(--erbg); border: 1px solid var(--erbd); color: var(--er); font-weight: 500; }
.gate-box.open     { background: var(--okbg); border: 1px solid var(--okbd); flex-direction: column; align-items: flex-start; gap: 0; }
.gate-checks { display: flex; flex-direction: column; gap: 4px; }
.gc { font-family: var(--fm); font-size: 11px; font-weight: 500; }
.gc.ok { color: var(--ok); }
.gc.fail { color: var(--er); }

/* ── Wallet info bar ── */
.wi { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--rs); padding: 12px 15px; margin-bottom: 13px; }
.wa-r { display: flex; align-items: center; gap: 8px; }
.w-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); flex-shrink: 0; }
.w-addr { font-family: var(--fm); font-size: 13px; color: var(--t2); }
.w-bal { font-family: var(--fm); font-size: 12px; color: var(--t3); }
.w-bal strong { color: var(--ac); font-weight: 600; }
.w-bal .low { color: var(--er) !important; }
.w-name { font-family: var(--fm); font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.w-bnb { font-family: var(--fm); font-size: 10px; color: var(--t3); margin-top: 2px; }
.w-disc { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--bd); background: transparent; color: var(--t3); font-family: var(--fm); font-size: 10px; cursor: pointer; transition: all .2s; touch-action: manipulation; }
.w-disc:hover { color: var(--er); border-color: var(--erbd); }

/* ── Manual payment ── */
.m-tog { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 11px; margin-top: 14px; background: none; border: none; font-family: var(--fb); font-size: 13px; font-weight: 500; color: var(--t3); cursor: pointer; transition: color .2s; touch-action: manipulation; }
.m-tog:hover { color: var(--t2); }
.m-tog .ar { transition: transform .3s; }
.m-tog.open .ar { transform: rotate(180deg); }
.m-body { display: none; margin-top: 13px; background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--r); padding: 18px; }
.m-body.show { display: block; animation: vIn .3s ease; }
.m-lbl { font-family: var(--fm); font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.a-box { display: flex; align-items: center; gap: 8px; background: var(--bg1); border: 1px solid var(--bd); border-radius: var(--rs); padding: 10px 12px; margin-bottom: 14px; word-break: break-all; }
.a-box code { font-family: var(--fm); font-size: 11px; color: var(--t1); flex: 1; line-height: 1.65; }
.cp-btn { flex-shrink: 0; padding: 6px 12px; border-radius: 6px; border: none; background: var(--acbg); color: var(--ac); font-family: var(--fm); font-size: 11px; font-weight: 600; cursor: pointer; transition: background .2s; touch-action: manipulation; }
.cp-btn:hover { background: rgba(var(--acr),.16); }
.qr-w { display: flex; justify-content: center; margin: 14px 0; padding: 14px; background: #fff; border-radius: var(--rs); }
.m-steps { margin-top: 15px; }
.m-steps h4 { font-family: var(--fd); font-size: 13px; font-weight: 600; color: var(--t2); margin-bottom: 9px; }
.m-steps ol { padding-left: 18px; }
.m-steps li { font-size: 13px; color: var(--t2); margin-bottom: 6px; line-height: 1.5; }
.m-steps li strong { color: var(--ac); font-weight: 600; }
.warn-box { margin-top: 11px; padding: 10px 12px; background: var(--warnbg); border: 1px solid var(--warnbd); border-radius: var(--rs); font-size: 12px; color: var(--warn); font-weight: 500; line-height: 1.5; }

/* ── Contract info ── */
.ct { margin-top: 14px; padding: 12px; background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--rs); }
.ct-r { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ct-r:last-child { margin-bottom: 0; }
.ct-r span { font-family: var(--fm); font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .05em; }
.ct-r a, .ct-r code { font-family: var(--fm); font-size: 11px; color: var(--t2); text-decoration: none; }
.ct-r a:hover { color: var(--ac); text-decoration: underline; }

/* ── Blocked / error view ── */
.blocked-w { text-align: center; padding: 50px 20px; }
.blocked-ico { font-size: 56px; margin-bottom: 16px; }
.blocked-t { font-family: var(--fd); font-size: 1.3rem; font-weight: 800; margin-bottom: 10px; color: var(--er); }
.blocked-msg { font-size: 14px; color: var(--t2); line-height: 1.65; max-width: 320px; margin: 0 auto; }

/* ── Success ── */
.suc-w { text-align: center; padding-top: 40px; }
.suc-ico { margin: 0 auto 22px; width: 80px; height: 80px; }
.suc-ico circle { stroke-dasharray: 157; stroke-dashoffset: 157; animation: ckDraw .6s ease .1s forwards; }
.suc-ico .ck { stroke-dasharray: 48; stroke-dashoffset: 48; animation: ckDraw .4s ease .5s forwards; }
.suc-t { font-family: var(--fd); font-size: 1.5rem; font-weight: 800; margin-bottom: 7px; color: var(--ok); }
.suc-a { font-family: var(--fd); font-size: 2rem; font-weight: 700; margin-bottom: 26px; }
.suc-a .unit { font-size: .6em; color: var(--t3); font-weight: 500; margin-left: 4px; }
.tx-box { background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--rs); padding: 14px 15px; margin-bottom: 26px; text-align: left; }
.tx-r { display: flex; justify-content: space-between; align-items: center; }
.tx-r span { font-family: var(--fm); font-size: 11px; color: var(--t3); text-transform: uppercase; letter-spacing: .06em; }
.tx-r a { font-family: var(--fm); font-size: 12px; color: var(--ac); text-decoration: none; display: flex; align-items: center; gap: 4px; }
.tx-r a:hover { text-decoration: underline; }

/* ── Toast ── */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 600; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: 90vw; max-width: 360px; align-items: center; }
.toast { pointer-events: auto; padding: 11px 18px; border-radius: 10px; font-family: var(--fb); font-size: 13px; font-weight: 500; box-shadow: var(--sh3); animation: tIn .3s ease; width: 100%; text-align: center; }
.toast.info    { background: var(--bg1); color: var(--t1); border: 1px solid var(--bd); }
.toast.success { background: #064e1f;   color: #d1fae5;   border: 1px solid rgba(34,197,94,.3); }
.toast.error   { background: #7f1d1d;   color: #fee2e2;   border: 1px solid rgba(239,68,68,.3); }
.toast.warn    { background: #78350f;   color: #fef3c7;   border: 1px solid rgba(245,158,11,.3); }
.toast.out { animation: tOut .3s ease forwards; }

/* ════════════ WALLET MODAL ════════════ */
#wModal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0); pointer-events: none; transition: background .25s; }
#wModal.show { background: rgba(0,0,0,.55); pointer-events: all; backdrop-filter: blur(4px); }
.wm-sheet { position: relative; width: 100%; max-width: 468px; background: var(--bg1); border-radius: 22px 22px 0 0; padding-bottom: max(env(safe-area-inset-bottom),24px); box-shadow: 0 -8px 40px rgba(0,0,0,.28); transform: translateY(100%); transition: transform .32s cubic-bezier(.22,1,.36,1); }
#wModal.show .wm-sheet { transform: translateY(0); }
.wm-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--bd); margin: 12px auto 0; }
.wm-hdr { padding: 15px 18px 10px; display: flex; align-items: center; justify-content: space-between; }
.wm-title { font-family: var(--fd); font-size: 17px; font-weight: 700; }
.wm-close { background: none; border: none; cursor: pointer; color: var(--t3); padding: 6px; border-radius: 7px; display: flex; line-height: 1; touch-action: manipulation; }
.wm-close:hover { color: var(--t1); background: var(--bg2); }
.wm-scroll { max-height: 65vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wm-scroll::-webkit-scrollbar { width: 3px; }
.wm-scroll::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 3px; }
.wm-grid { padding: 0 12px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wm-sep { grid-column: 1/-1; display: flex; align-items: center; gap: 8px; color: var(--t3); font-family: var(--fm); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; padding: 8px 4px 2px; }
.wm-sep::before, .wm-sep::after { content: ''; flex: 1; height: 1px; background: var(--bd); }
.wi-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 13px 10px; border-radius: 12px; border: 1.5px solid var(--bd); background: var(--bg2); cursor: pointer; transition: border-color .18s, background .18s, transform .18s; position: relative; text-align: center; -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; }
.wi-btn:active { transform: scale(.95); background: var(--acbg); }
.wi-btn.hit { border-color: rgba(var(--acr),.22); }
.wi-btn.install { border-style: dashed; opacity: .7; }
.wi-live { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.wi-ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; overflow: hidden; flex-shrink: 0; }
.wi-name { font-family: var(--fb); font-size: 12px; font-weight: 600; color: var(--t1); line-height: 1.3; }
.wi-sub { font-family: var(--fm); font-size: 9px; color: var(--t3); margin-top: 1px; }
.wi-india { display: inline-block; font-family: var(--fm); font-size: 8px; font-weight: 600; padding: 2px 5px; border-radius: 7px; margin-top: 2px; color: var(--warn); background: var(--warnbg); border: 1px solid var(--warnbd); }
.wm-hint { grid-column: 1/-1; text-align: center; padding: 10px 4px 4px; font-size: 12.5px; color: var(--t3); font-family: var(--fb); line-height: 1.55; }
.wm-hint a { color: var(--ac); text-decoration: none; font-weight: 600; }
.wm-conn { padding: 32px 20px 26px; text-align: center; }
.wm-conn .big-sp { width: 54px; height: 54px; border: 3px solid var(--acbg); border-top-color: var(--ac); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 20px; }
.wm-conn-title { font-family: var(--fd); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.wm-conn-sub { font-size: 13px; color: var(--t2); line-height: 1.5; font-family: var(--fb); }
.wm-conn-hint { font-family: var(--fm); font-size: 11px; color: var(--t3); margin-top: 8px; }
.wm-cancel { margin-top: 16px; background: none; border: none; font-size: 13px; color: var(--t3); cursor: pointer; font-family: var(--fb); padding: 6px 12px; border-radius: 6px; touch-action: manipulation; }
.wm-cancel:hover { color: var(--er); }
.wm-err { padding: 24px 20px; text-align: center; }
.wm-err-ico { font-size: 40px; margin-bottom: 14px; }
.wm-err-title { font-family: var(--fd); font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.wm-err-msg { background: var(--erbg); border: 1px solid var(--erbd); border-radius: var(--rs); padding: 10px 13px; font-family: var(--fm); font-size: 11px; color: var(--er); margin-bottom: 18px; word-break: break-word; text-align: left; line-height: 1.6; }
.wm-qr-body { padding: 4px 16px 20px; }
.wm-qr-card { background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--r); padding: 18px; text-align: center; }
.wm-qr-note { font-size: 12.5px; color: var(--t2); margin-top: 12px; font-family: var(--fb); line-height: 1.55; }
.wm-qr-apps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.wm-qr-app { font-family: var(--fm); font-size: 10px; padding: 3px 8px; border-radius: 8px; background: var(--bg1); border: 1px solid var(--bd); color: var(--t2); }
.wm-back-btn { background: none; border: none; font-family: var(--fb); font-size: 13px; color: var(--t3); cursor: pointer; padding: 4px 0; display: flex; align-items: center; gap: 4px; touch-action: manipulation; }
.wm-back-btn:hover { color: var(--t2); }

/* ── Responsive ── */
@media (max-width: 380px) {
  .ic-meta    { grid-template-columns: 1fr; }
  .ic-tot-v   { font-size: 1.4rem; }
  .ic         { padding: 18px; }
  .vc         { padding: 14px; }
  .wm-grid    { grid-template-columns: 1fr 1fr; }
}
