/* =========================================================================
   X-DMAIC qr.css — Tạo mã QR /tao-ma-qr/ (page-qr.php, assets/js/qr.js).
   Ý tưởng: bản bông duyệt in — mã QR trên tờ giấy có dấu xén, thước cỡ in và phiếu kiểm trước khi in hàng loạt.
   Lime chỉ cho nút tải. Mọi lớp nằm trong .xd-qr.
   ========================================================================= */
.xd-qr{--qr-line:#E3E6EC;--qr-sub:#525B6E;--qr-muted:#9AA3B2;--qr-ok:#16A34A;--qr-err:#DC2626;--qr-r:24px}
.xd-qr-hero{gap:22px}
.xd-qr-head{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:20px 48px;align-items:end}
.xd-qr-head h1{font-size:var(--xd-t-h1-detail);font-weight:800;line-height:1.08;letter-spacing:-.04em;text-wrap:balance}
.xd-qr-head .xd-lead{max-width:56ch}
.xd-qr-pros{display:flex;flex-wrap:wrap;gap:8px 18px;margin:14px 0 0;padding:0;list-style:none;font-size:14px;font-weight:500}
.xd-qr-pros li{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.xd-qr-pros svg{width:16px;height:16px;flex:none}

/* ---------- Thẻ công cụ ---------- */
.xd-qr .tool{color:var(--xd-ink);display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,440px);background:#fff;border-radius:var(--qr-r);box-shadow:0 30px 70px rgba(1,30,90,.35);overflow:clip;text-align:left}
.xd-qr .ctl{padding:clamp(18px,2.4vw,32px);display:grid;gap:26px;align-content:start}
.xd-qr .grp{display:grid;gap:12px}
.xd-qr .gt{font-size:15px;font-weight:700;display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.xd-qr .gt small{font-size:13px;font-weight:400;color:var(--qr-sub)}
.xd-qr .types{display:flex;flex-wrap:wrap;gap:8px}
.xd-qr .chip{appearance:none;border:1px solid var(--qr-line);background:#fff;color:var(--xd-ink);border-radius:999px;min-height:40px;padding:0 15px;font:inherit;font-size:14px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;gap:7px;transition:border-color .2s,background .2s}
.xd-qr .chip:hover{border-color:#B9C0CC}
.xd-qr .chip[aria-pressed=true]{background:var(--xd-ink);border-color:var(--xd-ink);color:#fff}
.xd-qr .chip svg{width:16px;height:16px}
.xd-qr .fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
.xd-qr .f{display:grid;gap:6px;font-size:13px;font-weight:600;color:var(--qr-sub)}
.xd-qr .f.w{grid-column:1/-1}
.xd-qr .f input,.xd-qr .f select,.xd-qr .f textarea{width:100%;min-height:46px;padding:10px 13px;border:1px solid var(--qr-line);border-radius:12px;background:#fff;font:inherit;font-size:16px;font-weight:400;color:var(--xd-ink)}
.xd-qr .f textarea{min-height:92px;resize:vertical}
.xd-qr .f input:focus,.xd-qr .f select:focus,.xd-qr .f textarea:focus{border-color:var(--xd-blue);outline:none;box-shadow:0 0 0 3px rgba(1,87,255,.15)}
.xd-qr .f input:disabled{background:#F3F4F6;color:var(--qr-muted)}
.xd-qr .hint{font-weight:400;font-size:13px;color:var(--qr-sub)}
.xd-qr .row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.xd-qr .sw{width:34px;height:34px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px var(--qr-line);cursor:pointer;padding:0}
.xd-qr .sw[aria-pressed=true]{box-shadow:0 0 0 2px var(--xd-ink)}
.xd-qr .pick{justify-self:start;width:max-content;display:inline-flex;align-items:center;gap:8px;border:1px solid var(--qr-line);border-radius:999px;padding:4px 12px 4px 4px;font-size:14px;cursor:pointer;min-height:42px;font-variant-numeric:tabular-nums}
.xd-qr .pick input{width:32px;height:32px;border:0;padding:0;background:none;cursor:pointer}
.xd-qr .seg{display:inline-flex;border:1px solid var(--qr-line);border-radius:12px;overflow:hidden;width:max-content}
.xd-qr .seg button{appearance:none;border:0;background:#fff;color:var(--xd-ink);min-width:48px;min-height:44px;padding:0 12px;cursor:pointer;display:grid;place-items:center}
.xd-qr .seg button+button{border-left:1px solid var(--qr-line)}
.xd-qr .seg button[aria-pressed=true]{background:var(--xd-ink);color:#fff}
.xd-qr .seg svg{width:22px;height:22px}
.xd-qr .two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.xd-qr .logo{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.xd-qr .logo .th{width:46px;height:46px;border-radius:10px;border:1px dashed #B9C0CC;display:grid;place-items:center;overflow:hidden;background:var(--xd-paper);flex:none}
.xd-qr .logo .th img{width:100%;height:100%;object-fit:contain}
.xd-qr .btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:999px;border:1px solid var(--qr-line);background:#fff;color:var(--xd-ink);min-height:44px;padding:0 16px;font:inherit;font-size:14px;font-weight:600;cursor:pointer;text-decoration:none;white-space:nowrap}
.xd-qr .btn:hover{border-color:var(--xd-ink)}
.xd-qr .btn:disabled{opacity:.45;cursor:not-allowed}
.xd-qr .btn.lime{background:var(--xd-lime);border-color:var(--xd-lime);min-height:52px;padding:0 24px;font-size:16px;font-weight:700}
.xd-qr .btn.lime:hover{background:var(--xd-lime-hover,#E2F77F)}
.xd-qr .btn svg{width:18px;height:18px}
.xd-qr input[type=range]{width:100%;accent-color:var(--xd-blue);min-height:32px}
.xd-qr .tog{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:500;cursor:pointer}
.xd-qr .tog input{width:20px;height:20px;accent-color:var(--xd-blue)}

/* ---------- Tờ proof ---------- */
.xd-qr .proof{background:var(--xd-paper);border-left:1px solid var(--qr-line);padding:clamp(18px,2.4vw,32px);display:grid;gap:18px;align-content:start;position:sticky;top:0;align-self:start}
.xd-qr .sheet{position:relative;background:#fff;padding:34px;box-shadow:0 1px 0 var(--qr-line),0 12px 30px rgba(11,18,32,.08)}
.xd-qr .sheet::before{content:"";position:absolute;inset:12px;pointer-events:none;background:
 linear-gradient(var(--qr-muted),var(--qr-muted)) 0 10px/10px 1px no-repeat,linear-gradient(var(--qr-muted),var(--qr-muted)) 10px 0/1px 10px no-repeat,
 linear-gradient(var(--qr-muted),var(--qr-muted)) 100% 10px/10px 1px no-repeat,linear-gradient(var(--qr-muted),var(--qr-muted)) calc(100% - 10px) 0/1px 10px no-repeat,
 linear-gradient(var(--qr-muted),var(--qr-muted)) 0 calc(100% - 10px)/10px 1px no-repeat,linear-gradient(var(--qr-muted),var(--qr-muted)) 10px 100%/1px 10px no-repeat,
 linear-gradient(var(--qr-muted),var(--qr-muted)) 100% calc(100% - 10px)/10px 1px no-repeat,linear-gradient(var(--qr-muted),var(--qr-muted)) calc(100% - 10px) 100%/1px 10px no-repeat}
.xd-qr .art{display:grid;place-items:center;min-height:200px}
.xd-qr .art.tr{background:repeating-conic-gradient(#e9ebef 0 25%,#fff 0 50%) 0 0/16px 16px}
.xd-qr .art svg{width:100%;height:auto;display:block;max-height:440px}
.xd-qr .art .empty{padding:70px 10px;color:var(--qr-sub);text-align:center}
.xd-qr .err{display:none;text-align:center;padding:60px 10px;color:var(--qr-err);font-weight:600}
.xd-qr .bad .err{display:block}.xd-qr .bad .art{display:none}
.xd-qr .ruler{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--qr-sub);margin-top:14px}
.xd-qr .ruler i{flex:1;height:9px;border:1px solid var(--qr-muted);border-top:0;background:repeating-linear-gradient(90deg,var(--qr-muted) 0 1px,transparent 1px 10%) 0 0/100% 5px no-repeat}
.xd-qr .ruler b{color:var(--xd-ink);font-weight:700;white-space:nowrap}
.xd-qr .checks{display:grid;margin:0;padding:0;list-style:none;font-size:14px}
.xd-qr .checks li{display:grid;grid-template-columns:20px minmax(0,1fr) auto;gap:10px;align-items:center;padding:9px 0;border-top:1px solid var(--qr-line)}
.xd-qr .checks li:first-child{border-top:0}
.xd-qr .checks .d{width:10px;height:10px;border-radius:50%;background:var(--qr-ok);justify-self:center}
.xd-qr .checks .w .d{background:#F59E0B}.xd-qr .checks .x .d{background:var(--qr-err)}.xd-qr .checks .n .d{background:var(--qr-muted)}
.xd-qr .checks em{font-style:normal;color:var(--qr-sub);font-size:13px;text-align:right}
.xd-qr .dl{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.xd-qr .dl .f{min-width:118px}
.xd-qr .dl .f select{min-height:44px}
.xd-qr .msg{font-size:13px;color:var(--qr-sub);min-height:1.2em;margin:0}

/* ---------- Thanh tải dính đáy (điện thoại) ---------- */
.xd-qr-bar{display:none}

/* ---------- Phần nội dung ---------- */
.xd-qr-band{padding:clamp(48px,6vw,96px) 0}
.xd-qr-band+.xd-qr-band{padding-top:0}
.xd-qr-sh{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:16px 48px;align-items:end;margin-bottom:36px}
.xd-qr-sh h2{font-size:clamp(28px,3.2vw,44px);font-weight:800;line-height:1.1;letter-spacing:-.03em;text-wrap:balance;margin:0}
.xd-qr-sh p{color:var(--qr-sub);font-size:17px;margin:0;text-wrap:pretty}
.xd-qr-rules{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:40px;align-items:start}
.xd-qr-fig{background:#fff;border-radius:var(--qr-r);padding:20px;border:1px solid var(--qr-line);margin:0}
.xd-qr-fig svg{width:100%;height:auto;display:block}
.xd-qr-rl{display:grid;margin:0}
.xd-qr-rl div{padding:18px 0;border-top:1px solid #D5D9E0;display:grid;grid-template-columns:150px minmax(0,1fr);gap:16px}
.xd-qr-rl div:first-child{border-top:0;padding-top:0}
.xd-qr-rl dt{font-size:16px;font-weight:700}
.xd-qr-rl dd{margin:0;color:var(--qr-sub);text-wrap:pretty}
.xd-qr-uses{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 40px;margin:0;padding:0;list-style:none}
.xd-qr-uses li{padding:22px 0;border-top:1px solid #D5D9E0}
.xd-qr-uses h3{font-size:18px;font-weight:700;line-height:1.3;margin:0 0 8px}
.xd-qr-uses p{color:var(--qr-sub);margin:0;text-wrap:pretty}
.xd-qr-cmp{width:100%;border-collapse:collapse;background:#fff;border-radius:var(--qr-r);overflow:hidden;font-size:15px}
.xd-qr-cmp th,.xd-qr-cmp td{text-align:left;padding:16px 20px;border-top:1px solid var(--qr-line);vertical-align:top}
.xd-qr-cmp thead th{border-top:0;background:var(--xd-ink);color:#fff;font-weight:600}
.xd-qr-cmp tbody th{font-weight:600;width:24%}
.xd-qr-faq{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
.xd-qr-faq details{background:#fff;border:1px solid var(--qr-line);border-radius:16px;padding:0 20px}
.xd-qr-faq summary{text-wrap:pretty;cursor:pointer;list-style:none;padding:18px 28px 18px 0;font-weight:600;position:relative}
.xd-qr-faq summary::-webkit-details-marker{display:none}
.xd-qr-faq summary::after{content:"+";position:absolute;right:0;top:14px;font-size:22px;font-weight:400}
.xd-qr-faq details[open] summary::after{content:"−"}
.xd-qr-faq details p{padding:0 0 18px;margin:0;color:var(--qr-sub);text-wrap:pretty}
.xd-qr-cta{border-radius:var(--qr-r);padding:clamp(28px,4vw,56px);display:grid;grid-template-columns:minmax(0,1.4fr) auto;gap:24px 40px;align-items:center}
.xd-qr-cta h2{font-size:clamp(26px,3vw,40px);font-weight:800;line-height:1.1;letter-spacing:-.03em;margin:0;text-wrap:balance}
.xd-qr-cta p{margin:12px 0 0;color:rgba(255,255,255,.92);max-width:46ch;text-wrap:pretty}
.xd-qr-cta .acts{display:grid;gap:12px;justify-items:start}
.xd-qr-cta .tel{font-size:15px;color:#fff;text-decoration:none;font-weight:600;white-space:nowrap}
.xd-qr-cta .tel:hover{text-decoration:underline}
.xd-qr-legal{font-size:13px;color:var(--qr-sub);margin:28px 0 0}

@media (max-width:1020px){.xd-qr .tool{grid-template-columns:minmax(0,1fr) minmax(300px,380px)}.xd-qr .two{grid-template-columns:1fr}.xd-qr-uses{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:860px){
 .xd-qr-head,.xd-qr-sh,.xd-qr-rules,.xd-qr-cta{grid-template-columns:1fr}
 .xd-qr .tool{grid-template-columns:1fr}
 .xd-qr .proof{order:-1;position:static;border-left:0;border-bottom:1px solid var(--qr-line)}
 .xd-qr .art svg{max-height:300px}
 .xd-qr-faq,.xd-qr-uses{grid-template-columns:1fr}
 .xd-qr-bar{display:flex;position:fixed;z-index:9980;left:0;right:0;bottom:0;gap:12px;align-items:center;padding:10px max(16px,4vw) calc(10px + env(safe-area-inset-bottom));background:var(--xd-ink);color:#fff;transform:translateY(110%);transition:transform .35s cubic-bezier(.16,1,.3,1)}
 .xd-qr-bar.on{transform:none}
 .xd-qr-bar .mini{width:44px;height:44px;background:#fff;border-radius:8px;padding:3px;flex:none}
 .xd-qr-bar .mini svg{width:100%;height:100%}
 .xd-qr-bar span{flex:1;font-size:13px;color:rgba(255,255,255,.88)}
 .xd-qr-bar .btn.lime{min-height:46px;padding:0 18px;font-size:15px}
 /* Nút Kè X nhích lên khi thanh tải đang hiện */
 html.xd-qr-bar-on .sm-launcher{bottom:calc(84px + env(safe-area-inset-bottom));transition:bottom .35s}
}
@media (max-width:560px){
 .xd-qr .fields{grid-template-columns:1fr}
 .xd-qr-rl div{grid-template-columns:1fr;gap:4px}
 .xd-qr .sheet{padding:26px}
 .xd-qr-cmp thead{display:none}.xd-qr-cmp tr{display:grid;padding:12px 16px;border-top:1px solid var(--qr-line)}.xd-qr-cmp th,.xd-qr-cmp td{border:0;padding:3px 0;width:auto!important}
 .xd-qr-cmp td::before{content:attr(data-l) ": ";font-weight:600;color:var(--xd-ink)}
}
@media (prefers-reduced-motion:reduce){.xd-qr *,.xd-qr-bar{transition:none!important}}
