/* مغایرت‌یار — SoftwareTrain
 * رنگ‌ها: آبی دفتر کل (دفاتر)، سبز بانک (صورتحساب)، زعفرانی (منتظر تأیید)، اناری (باز/اختلاف)
 */
@font-face{font-family:"MGY Estedad";src:url(fonts/estedad-arabic-400-normal.woff2) format("woff2");font-weight:400;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:"MGY Estedad";src:url(fonts/estedad-arabic-500-normal.woff2) format("woff2");font-weight:500;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:"MGY Estedad";src:url(fonts/estedad-arabic-700-normal.woff2) format("woff2");font-weight:700;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:"MGY Estedad";src:url(fonts/estedad-arabic-800-normal.woff2) format("woff2");font-weight:800;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:"MGY Estedad";src:url(fonts/estedad-latin-400-normal.woff2) format("woff2");font-weight:400 500;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F,U+20AC,U+2212}
@font-face{font-family:"MGY Estedad";src:url(fonts/estedad-latin-700-normal.woff2) format("woff2");font-weight:700 800;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F,U+20AC,U+2212}

.mgy{
  --ink:#172033; --ink-2:#56617A; --ink-3:#8A93A6;
  --paper:#F3F5F9; --surface:#FFFFFF; --line:#E1E6EE; --line-2:#CBD3DF;
  --book:#2B4C9B; --book-soft:#EAF0FB; --book-mid:#B9C9EC;
  --bank:#0F7B6C; --bank-soft:#E2F3EF; --bank-mid:#A7D8CE;
  --saffron:#B57A00; --saffron-soft:#FBF1D6; --saffron-mid:#E9C46A;
  --pome:#B4232E; --pome-soft:#FBE8E9;
  --r-lg:22px; --r-md:14px; --r-sm:10px;
  --shadow:0 1px 2px rgba(23,32,51,.06),0 8px 24px -12px rgba(23,32,51,.18);
  direction:rtl;text-align:right;color:var(--ink);
  font-family:"MGY Estedad",Tahoma,sans-serif;font-size:15px;line-height:1.75;font-weight:400;
  max-width:1180px;margin:0 auto;position:relative;container:mgy/inline-size;
  -webkit-font-smoothing:antialiased;
}
.mgy *,.mgy *::before,.mgy *::after{box-sizing:border-box}
.mgy h2,.mgy h3,.mgy h4,.mgy h5,.mgy p{margin:0;font-family:inherit;color:inherit;letter-spacing:0}
.mgy button,.mgy input,.mgy select{font-family:inherit;font-size:inherit}
.mgy a{color:var(--book)}
.mgy :focus-visible{outline:3px solid var(--book-mid);outline-offset:2px;border-radius:6px}
.mgy-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.mgy-ic{width:1.15em;height:1.15em;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- سربرگ ---------- */
.mgy-top{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.mgy-brand{display:flex;align-items:center;gap:10px}
.mgy-brand strong{font-size:20px;font-weight:800}
.mgy-mark{width:36px;height:36px;border-radius:11px;background:var(--ink);display:grid;align-content:center;gap:5px;padding:0 8px;flex:none}
.mgy-mark i{display:block;height:5px;border-radius:3px}
.mgy-mark i:first-child{background:#8FB0F2;margin-left:6px}
.mgy-mark i:last-child{background:#6FD0BE;margin-right:6px}
.mgy-top-side{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.mgy-pill{display:inline-flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);padding:6px 14px;border-radius:99px;font-size:13px;font-weight:500;white-space:nowrap}
.mgy-pill.is-sub{background:var(--bank);border-color:var(--bank);color:#fff}
.mgy-pill.is-out{border-color:var(--pome);color:var(--pome)}
.mgy-dots{display:inline-flex;gap:4px}
.mgy-dots i{width:8px;height:8px;border-radius:50%;background:var(--line-2)}
.mgy-dots i.on{background:var(--bank)}

/* ---------- دکمه‌ها ---------- */
.mgy-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--ink);color:#fff!important;border:1px solid var(--ink);border-radius:var(--r-sm);padding:9px 18px;font-weight:700;font-size:14px;cursor:pointer;text-decoration:none!important;line-height:1.4;transition:background .15s,transform .1s,box-shadow .15s;white-space:nowrap}
.mgy-btn:hover{background:#26324B}
.mgy-btn:active{transform:translateY(1px)}
.mgy-btn:disabled{background:var(--line-2);border-color:var(--line-2);color:#fff;cursor:not-allowed;transform:none}
.mgy-btn.is-ghost{background:var(--surface);color:var(--ink)!important;border-color:var(--line-2)}
.mgy-btn.is-ghost:hover{border-color:var(--ink)}
.mgy-btn.is-quiet{background:transparent;border-color:transparent;color:var(--ink-2)!important}
.mgy-btn.is-quiet:hover{background:rgba(23,32,51,.06);color:var(--ink)!important}
.mgy-btn.is-sm{padding:6px 13px;font-size:13px;border-radius:9px}
.mgy-btn.is-lg{padding:14px 30px;font-size:16px;border-radius:14px;box-shadow:0 10px 24px -12px rgba(23,32,51,.55)}
.mgy-btn.is-lg:disabled{box-shadow:none}
.mgy-link{display:inline-flex;align-items:center;gap:6px;background:none;border:0;padding:4px 2px;color:var(--book);font-weight:500;font-size:13px;cursor:pointer}
.mgy-link:hover{text-decoration:underline}
.mgy-icbtn{width:36px;height:36px;display:inline-grid;place-items:center;border-radius:10px;border:1px solid var(--line);background:var(--surface);color:var(--ink-2);cursor:pointer;transition:.15s}
.mgy-icbtn:hover{border-color:var(--ink-2);color:var(--ink)}
.mgy-icbtn.is-yes{background:var(--bank);border-color:var(--bank);color:#fff}
.mgy-icbtn.is-yes:hover{background:#0B6457}
.mgy-icbtn.is-no:hover{border-color:var(--pome);color:var(--pome);background:var(--pome-soft)}
.mgy-spin{width:16px;height:16px;border-radius:50%;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;animation:mgy-rot .7s linear infinite}
@keyframes mgy-rot{to{transform:rotate(360deg)}}

/* ---------- بنر ---------- */
.mgy-banner{display:flex;align-items:center;gap:14px;background:var(--book-soft);border-radius:var(--r-md);padding:14px 18px;margin-bottom:18px;font-size:14px}
.mgy-banner>.mgy-ic{width:22px;height:22px;color:var(--book)}
.mgy-banner>div:nth-child(2){flex:1}
.mgy-banner span{color:var(--ink-2)}
.mgy-banner-act{display:flex;gap:8px}
.mgy-banner.is-warn{background:var(--saffron-soft)}
.mgy-banner.is-warn>.mgy-ic{color:var(--saffron)}

/* ---------- صحنه: دو طرف روبه‌رو ---------- */
.mgy-stage{background:var(--paper);border-radius:var(--r-lg);padding:22px}
.mgy-face{display:grid;grid-template-columns:1fr 64px 1fr;align-items:stretch}
.mgy-side{background:var(--surface);border-radius:var(--r-md);padding:18px;border-top:4px solid var(--c);box-shadow:var(--shadow);display:flex;flex-direction:column;gap:14px;min-width:0}
.mgy-side.is-book{--c:var(--book);--c-soft:var(--book-soft);--c-mid:var(--book-mid)}
.mgy-side.is-bank{--c:var(--bank);--c-soft:var(--bank-soft);--c-mid:var(--bank-mid)}
.mgy-side-head{display:flex;gap:10px;align-items:flex-start}
.mgy-swatch{width:10px;height:10px;border-radius:3px;background:var(--c);margin-top:9px;flex:none}
.mgy-side-head h3{font-size:18px;font-weight:800}
.mgy-side-head p{font-size:13px;color:var(--ink-2)}
.mgy-drop{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:4px;min-height:124px;border:2px dashed var(--line-2);border-radius:12px;padding:20px;cursor:pointer;transition:border-color .15s,background .15s}
.mgy-drop:hover,.mgy-drop.is-over,.mgy-drop:focus-within{border-color:var(--c);background:var(--c-soft)}
.mgy-drop strong{font-size:15px;font-weight:700}
.mgy-drop>span:last-child{font-size:12.5px;color:var(--ink-3)}
.mgy-drop-ic{width:48px;height:48px;border-radius:50%;background:var(--c-soft);color:var(--c);display:grid;place-items:center;margin-bottom:6px;transition:transform .2s}
.mgy-drop.is-over .mgy-drop-ic{transform:translateY(-4px)}
.mgy-drop-ic .mgy-ic{width:24px;height:24px}
.mgy-file{display:flex;align-items:center;gap:12px;background:var(--c-soft);border-radius:12px;padding:12px}
.mgy-file-ic{width:40px;height:40px;border-radius:10px;background:var(--c);color:#fff;display:grid;place-items:center;flex:none}
.mgy-file-ic .mgy-ic{width:22px;height:22px}
.mgy-file-meta{flex:1;min-width:0;display:flex;flex-direction:column}
.mgy-file-meta strong{font-weight:700;unicode-bidi:plaintext;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mgy-file-meta span{font-size:12.5px;color:var(--ink-2)}
.mgy-map-sum{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.mgy-chip{display:inline-flex;gap:6px;align-items:baseline;border:1px solid var(--line);border-radius:99px;padding:2px 10px;font-size:12.5px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mgy-chip em{font-style:normal;color:var(--ink-3)}
.mgy-chip.is-missing{border-color:var(--pome);color:var(--pome);background:var(--pome-soft)}
.mgy-map{display:grid;grid-template-columns:1fr 1fr;gap:10px 12px;padding-top:12px;border-top:1px dashed var(--line)}
.mgy-field{display:flex;flex-direction:column;gap:4px;min-width:0}
.mgy-field>span{font-size:12.5px;color:var(--ink-2);font-weight:500}
.mgy-field input,.mgy-field select{width:100%;height:40px;padding:0 12px;border:1px solid var(--line-2);border-radius:10px;background:var(--surface);color:var(--ink);font-size:14px;transition:border-color .15s}
.mgy-field input:hover,.mgy-field select:hover{border-color:var(--ink-3)}
.mgy-field input:focus,.mgy-field select:focus{outline:none;border-color:var(--book);box-shadow:0 0 0 3px var(--book-soft)}
.mgy-field input::placeholder{color:var(--ink-3)}
.mgy-num{text-align:left}

/* درز وسط: نشانه‌ی کنار هم گذاشتن دو طرف */
.mgy-seam{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:18px 0}
.mgy-seam-line{flex:1;width:2px;background:repeating-linear-gradient(to bottom,var(--line-2) 0 6px,transparent 6px 12px)}
.mgy-seam-knot{width:42px;height:42px;border-radius:50%;background:var(--surface);border:2px solid var(--line-2);display:grid;place-items:center;color:var(--ink-3);font-weight:800;font-size:14px}
.mgy-seam.is-done .mgy-seam-line{background:linear-gradient(to bottom,var(--book),var(--bank))}
.mgy-seam.is-done .mgy-seam-knot{background:var(--ink);border-color:var(--ink);color:#fff}

/* تنظیمات */
.mgy-settings-wrap{margin-top:18px;background:var(--surface);border-radius:var(--r-md);padding:14px 16px;border:1px solid var(--line)}
.mgy-settings{display:grid;grid-template-columns:1.1fr 1.1fr .9fr auto auto;gap:12px;align-items:end}
.mgy-settings.is-more{grid-template-columns:1fr 1fr auto;margin-top:12px;padding-top:14px;border-top:1px dashed var(--line)}
.mgy-more{height:40px}
.mgy-stepper{display:flex;align-items:center;height:40px;border:1px solid var(--line-2);border-radius:10px;overflow:hidden;background:var(--surface)}
.mgy-stepper button{width:38px;height:100%;border:0;background:transparent;color:var(--ink-2);cursor:pointer;display:grid;place-items:center}
.mgy-stepper button:hover{background:var(--paper);color:var(--ink)}
.mgy-stepper output{min-width:62px;text-align:center;font-weight:700;font-size:14px}
.mgy-switch{display:inline-flex;align-items:center;gap:10px;height:40px;cursor:pointer;font-size:14px;white-space:nowrap}
.mgy-switch input{position:absolute;opacity:0;width:1px;height:1px}
.mgy-switch-ui{width:40px;height:23px;border-radius:99px;background:var(--line-2);position:relative;transition:background .2s;flex:none}
.mgy-switch-ui::after{content:"";position:absolute;top:3px;right:3px;width:17px;height:17px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:transform .2s}
.mgy-switch input:checked+.mgy-switch-ui{background:var(--bank)}
.mgy-switch input:checked+.mgy-switch-ui::after{transform:translateX(-17px)}
.mgy-switch input:focus-visible+.mgy-switch-ui{outline:3px solid var(--book-mid);outline-offset:2px}

.mgy-cta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:18px}
.mgy-hint{font-size:13px;color:var(--ink-2)}

/* ---------- معرفی ---------- */
.mgy-hero{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:28px;align-items:center;background:var(--ink);color:#fff;border-radius:var(--r-lg);padding:34px 36px;margin-bottom:18px;overflow:hidden}
.mgy-hero h2{font-size:34px;font-weight:800;line-height:1.35;max-width:18ch}
.mgy-hero-text>p{color:#C3CBDB;font-size:15.5px;margin-top:10px!important;max-width:56ch}
.mgy-proof{list-style:none;margin:18px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.mgy-proof li{display:flex;align-items:center;gap:10px;font-size:14px;color:#E6EAF2}
.mgy-proof .mgy-ic{color:#6FD0BE}
.mgy-hero-cta{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:22px}
.mgy-hero .mgy-btn.is-lg{background:#fff;color:var(--ink)!important;border-color:#fff;box-shadow:none}
.mgy-hero .mgy-btn.is-lg:hover{background:#E8EDF6}
.mgy-hero .mgy-btn.is-quiet{color:#C9D0DE!important}
.mgy-hero .mgy-btn.is-quiet:hover{background:rgba(255,255,255,.08);color:#fff!important}
.mgy-hero-note{font-size:13px;color:#9AA4B8;margin-top:10px!important}
.mgy-hero-note a{color:#AFC4F5}
.mgy-hero-art{justify-self:center;width:100%;max-width:360px}
.mgy-hero-art svg{width:100%;height:auto;display:block}
.mgy-hero-art .t{font-family:inherit;font-size:12px;font-weight:700}
.mgy-hero-art .t.b{fill:#AFC4F5} .mgy-hero-art .t.k{fill:#7FD8C7}
.mgy-hero-art .r.book{fill:#24365F} .mgy-hero-art .r.bank{fill:#15453F}
.mgy-hero-art .r.is-open{fill:none;stroke:#E4646E;stroke-width:1.5;stroke-dasharray:4 3}
.mgy-hero-art .ln{fill:rgba(255,255,255,.28)}
.mgy-hero-art .lk{fill:none;stroke-width:2;stroke-dasharray:140;stroke-dashoffset:140;animation:mgy-draw .7s ease-out var(--d) forwards}
.mgy-hero-art .lk.is-c{stroke:#3FB8A3} .mgy-hero-art .lk.is-s{stroke:#E9C46A}
@keyframes mgy-draw{to{stroke-dashoffset:0}}

/* ---------- بخش‌های پایین صفحه ---------- */
.mgy-steps,.mgy-plans,.mgy-faq{margin-top:44px}
.mgy-sec-title{font-size:22px;font-weight:800;margin-bottom:6px!important}
.mgy-sec-sub{color:var(--ink-2);font-size:14px;margin-bottom:16px!important;max-width:70ch}
.mgy-steps ol{list-style:none;margin:14px 0 0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:14px;counter-reset:none}
.mgy-steps li{display:flex;gap:12px;align-items:flex-start;background:var(--paper);border-radius:var(--r-md);padding:16px}
.mgy-steps li b{width:30px;height:30px;border-radius:50%;background:var(--ink);color:#fff;display:grid;place-items:center;font-weight:800;flex:none;font-size:14px}
.mgy-steps li strong{display:block;font-size:15px;font-weight:800}
.mgy-steps li p{font-size:13.5px;color:var(--ink-2)}
.mgy-plan-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;align-items:stretch}
.mgy-plan{position:relative;display:flex;flex-direction:column;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);padding:22px 20px}
.mgy-plan h4{font-size:16px;font-weight:800;color:var(--ink-2)}
.mgy-price{display:flex;align-items:baseline;gap:8px}
.mgy-price b{font-size:40px;font-weight:800;line-height:1.1}
.mgy-price span{color:var(--ink-2);font-size:14px}
.mgy-plan p{font-size:13.5px;color:var(--ink-2);flex:1}
.mgy-plan .mgy-btn{width:100%;margin-top:6px}
.mgy-plan.is-best{border:2px solid var(--bank);box-shadow:0 14px 34px -20px rgba(15,123,108,.6)}
.mgy-plan.is-best .mgy-btn{background:var(--bank);border-color:var(--bank)}
.mgy-plan.is-best .mgy-btn:hover{background:#0B6457}
.mgy-plan-tag{position:absolute;top:-12px;left:18px;background:var(--bank);color:#fff;font-size:12px;font-weight:700;padding:2px 12px;border-radius:99px}
.mgy-faq>div{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.mgy-faq details{background:var(--paper);border-radius:var(--r-sm);padding:0 16px}
.mgy-faq summary{list-style:none;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:13px 0;cursor:pointer;font-weight:700;font-size:14.5px}
.mgy-faq summary::-webkit-details-marker{display:none}
.mgy-faq summary .mgy-ic{transition:transform .2s;color:var(--ink-3)}
.mgy-faq details[open] summary .mgy-ic{transform:rotate(180deg)}
.mgy-faq details p{font-size:14px;color:var(--ink-2);padding-bottom:14px}

/* ---------- نتایج ---------- */
.mgy-results{margin-top:28px;scroll-margin-top:20px}
.mgy-notes{background:var(--book-soft);border-radius:var(--r-sm);padding:10px 16px;font-size:13.5px;margin-bottom:12px}
.mgy-notes.is-warn{background:var(--saffron-soft)}
.mgy-notes summary{cursor:pointer;font-weight:500}
.mgy-notes ul{margin:8px 0 0;padding-right:20px}

.mgy-meter{background:var(--ink);color:#fff;border-radius:var(--r-lg);padding:24px 26px 20px;margin-bottom:18px}
.mgy-meter-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap}
.mgy-meter-head>div:first-child{display:flex;align-items:baseline;gap:14px}
.mgy-meter-num{font-size:64px;font-weight:800;line-height:1}
.mgy-meter-num.is-zero{width:58px;height:58px;border-radius:50%;background:var(--bank);display:grid;place-items:center;align-self:center}
.mgy-meter-num.is-zero .mgy-ic{width:32px;height:32px;stroke-width:3}
.mgy-meter-head span{color:#B8C1D4;font-size:15px}
.mgy-meter-diff{text-align:left;display:flex;flex-direction:column}
.mgy-meter-diff span{font-size:12.5px}
.mgy-meter-diff strong{font-size:18px;font-weight:800}
.mgy-meter-diff.is-ok strong{color:#6FD0BE}
.mgy-meter-diff.is-bad strong{color:#FF9AA2}
.mgy-bar{display:flex;height:12px;border-radius:99px;overflow:hidden;background:#2A3550;margin:18px 0 12px;gap:2px}
.mgy-bar i{display:block;width:var(--w);transition:width .5s}
.mgy-bar .is-conf{background:#3FB8A3}
.mgy-bar .is-sugg{background:var(--saffron-mid)}
.mgy-bar .is-open{background:#E4646E}
.mgy-meter.is-anim .mgy-bar i{animation:mgy-grow .9s cubic-bezier(.2,.7,.2,1) both}
.mgy-meter.is-anim .mgy-bar .is-sugg{animation-delay:.15s}
.mgy-meter.is-anim .mgy-bar .is-open{animation-delay:.3s}
@keyframes mgy-grow{from{width:0}}
.mgy-legend{display:flex;gap:20px;flex-wrap:wrap;font-size:13px;color:#C9D0DE}
.mgy-legend span{display:inline-flex;align-items:center;gap:8px}
.mgy-legend span::before{content:"";width:10px;height:10px;border-radius:3px}
.mgy-legend .is-conf::before{background:#3FB8A3}
.mgy-legend .is-sugg::before{background:var(--saffron-mid)}
.mgy-legend .is-open::before{background:#E4646E}

.mgy-tabs{display:inline-flex;gap:4px;background:var(--paper);border-radius:14px;padding:5px;flex-wrap:wrap;margin-bottom:16px}
.mgy-tabs button{display:inline-flex;align-items:center;gap:8px;border:0;background:transparent;padding:8px 16px;border-radius:10px;font-weight:500;font-size:14px;color:var(--ink-2);cursor:pointer;transition:.15s}
.mgy-tabs button:hover{color:var(--ink)}
.mgy-tabs button.is-on{background:var(--surface);color:var(--ink);font-weight:700;box-shadow:0 1px 3px rgba(23,32,51,.12)}
.mgy-count{min-width:24px;padding:0 7px;border-radius:99px;background:var(--line);font-size:12px;font-weight:700;text-align:center;line-height:20px}
.mgy-count.is-hot{background:var(--saffron);color:#fff}

.mgy-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.mgy-toolbar p{font-size:13.5px;color:var(--ink-2);max-width:70ch}
.mgy-toolbar-act{display:flex;gap:8px}

/* جفت‌ها */
.mgy-cols,.mgy-pair{display:grid;grid-template-columns:minmax(0,1fr) 150px minmax(0,1fr) 84px;gap:0 12px;align-items:center}
.mgy-cols{font-size:12.5px;font-weight:700;padding:0 16px 6px}
.mgy-cols .is-book{color:var(--book)} .mgy-cols .is-bank{color:var(--bank)}
.mgy-pairs{display:flex;flex-direction:column;gap:8px}
.mgy-pair{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);padding:12px 16px;transition:border-color .15s}
.mgy-pair:hover{border-color:var(--line-2)}
.mgy-pair-side{display:flex;flex-direction:column;gap:6px;min-width:0}
.mgy-bridge{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;text-align:center}
.mgy-bridge::before{content:"";position:absolute;top:13px;inset-inline:-6px;height:2px;background:linear-gradient(to left,var(--book-mid),var(--bank-mid))}
.mgy-rule{position:relative;background:var(--surface);border:1px solid var(--line-2);border-radius:99px;padding:1px 10px;font-size:12px;font-weight:500;white-space:nowrap}
.mgy-pair.is-near .mgy-rule,.mgy-pair.is-ref .mgy-rule{border-color:var(--saffron-mid);background:var(--saffron-soft);color:#7A5200}
.mgy-pair.is-group .mgy-rule{border-color:#C9BDF0;background:#F1EDFC;color:#4F3AA8}
.mgy-pair.is-manual .mgy-rule{border-color:var(--bank-mid);background:var(--bank-soft);color:var(--bank)}
.mgy-bridge small{font-size:11.5px;color:var(--ink-3)}
.mgy-pair-act{display:flex;gap:6px;justify-content:flex-end}
.mgy-item{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:10px;align-items:baseline;min-width:0}
.mgy-amt{font-weight:700;white-space:nowrap;direction:ltr;unicode-bidi:isolate}
.mgy-amt.is-neg{color:var(--pome)}
.mgy-date{font-size:12.5px;color:var(--ink-2);white-space:nowrap}
.mgy-desc{font-size:12.5px;color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.mgy-empty{text-align:center;padding:40px 20px;background:var(--paper);border-radius:var(--r-md)}
.mgy-empty-ic{width:48px;height:48px;border-radius:50%;background:var(--bank-soft);color:var(--bank);display:inline-grid;place-items:center;margin-bottom:8px}
.mgy-empty strong{display:block;font-size:16px}
.mgy-empty p{color:var(--ink-2);font-size:13.5px}

/* اقلام باز */
.mgy-open-tip{margin-bottom:10px}
.mgy-open{display:grid;grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr);align-items:start}
.mgy-open-seam{align-self:stretch;margin:0 auto;width:2px;background:repeating-linear-gradient(to bottom,var(--line-2) 0 6px,transparent 6px 12px)}
.mgy-ocol{background:var(--surface);border:1px solid var(--line);border-top:4px solid var(--c);border-radius:var(--r-md);overflow:hidden}
.mgy-ocol.is-book{--c:var(--book);--c-soft:var(--book-soft)}
.mgy-ocol.is-bank{--c:var(--bank);--c-soft:var(--bank-soft)}
.mgy-ocol-head{display:flex;align-items:flex-start;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
.mgy-ocol-head>div{flex:1}
.mgy-ocol-head h4{font-size:15px;font-weight:800}
.mgy-ocol-head p{font-size:12.5px;color:var(--ink-2)}
.mgy-ocol-sum{direction:ltr;unicode-bidi:isolate;white-space:nowrap}
.mgy-orows{max-height:520px;overflow:auto}
.mgy-orow{display:grid;grid-template-columns:22px minmax(0,1fr);gap:10px;align-items:center;padding:10px 16px;border-bottom:1px solid #EEF1F5;cursor:pointer;transition:background .12s}
.mgy-orow:hover{background:var(--paper)}
.mgy-orow.is-sel{background:var(--c-soft)}
.mgy-orow:focus-within{outline:3px solid var(--book-mid);outline-offset:-3px}
.mgy-box{width:20px;height:20px;border-radius:6px;border:2px solid var(--line-2);display:grid;place-items:center;color:transparent;transition:.12s}
.mgy-box .mgy-ic{width:14px;height:14px;stroke-width:3}
.mgy-orow.is-sel .mgy-box{background:var(--c);border-color:var(--c);color:#fff}
.mgy-ocol-empty{padding:30px 16px;text-align:center;color:var(--ink-3)}
.mgy-selbar{position:sticky;bottom:14px;z-index:5;margin-top:14px;display:flex;align-items:center;gap:16px;flex-wrap:wrap;background:var(--ink);color:#fff;border-radius:16px;padding:12px 18px;box-shadow:0 16px 40px -16px rgba(23,32,51,.6)}
.mgy-selbar-s{display:flex;flex-direction:column;line-height:1.4}
.mgy-selbar-s span{font-size:12px;color:#B8C1D4}
.mgy-selbar-s strong{direction:ltr;unicode-bidi:isolate}
.mgy-selbar-s.is-book strong{color:#AFC4F5} .mgy-selbar-s.is-bank strong{color:#7FD8C7}
.mgy-selbar-mid{flex:1;text-align:center;font-size:13px;color:#FFB3B9}
.mgy-eq{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--bank);color:#fff;font-size:20px;font-weight:800}
.mgy-selbar .mgy-btn{background:#fff;color:var(--ink)!important;border-color:#fff}
.mgy-selbar .mgy-btn:disabled{background:#3A4663;border-color:#3A4663;color:#8A93A6!important}
.mgy-selbar .mgy-link{color:#C9D0DE}

/* صورت مغایرت: برگه‌ی رسمی */
.mgy-sheet{background:var(--surface);border:1px solid var(--line);border-radius:6px;max-width:860px;margin:0 auto;padding:40px 44px 30px;box-shadow:var(--shadow)}
.mgy-sheet header{text-align:center;border-bottom:2px solid var(--ink);padding-bottom:14px;margin-bottom:18px}
.mgy-sheet header h3{font-size:22px;font-weight:800}
.mgy-sheet header p{color:var(--ink-2);font-size:14px}
.mgy-sheet table{width:100%;border-collapse:collapse;font-size:14px}
.mgy-sheet-main thead th{font-size:13px;color:var(--ink-2);font-weight:700;padding:6px 8px;border-bottom:1px solid var(--line-2);text-align:right}
.mgy-sheet-main th[scope=row]{font-weight:500;text-align:right;padding:10px 8px;border-bottom:1px solid #EEF1F5}
.mgy-sheet-main td{text-align:left;direction:ltr;padding:10px 8px;border-bottom:1px solid #EEF1F5;white-space:nowrap}
.mgy-sheet-main td:nth-of-type(1){border-left:1px solid var(--line);padding-left:16px}
.mgy-sheet-main tr.is-total th,.mgy-sheet-main tr.is-total td{font-weight:800;border-top:2px solid var(--ink);border-bottom:3px double var(--ink)}
.mgy-sheet-verdict{text-align:center;font-weight:700;margin:18px 0 6px;padding:8px;border-radius:8px}
.mgy-sheet-verdict.is-ok{color:var(--bank);background:var(--bank-soft)}
.mgy-sheet-verdict.is-bad{color:var(--pome);background:var(--pome-soft)}
.mgy-sheet-detail{margin-top:20px}
.mgy-sheet-detail h5{font-size:14px;font-weight:800;margin-bottom:6px}
.mgy-sheet-detail td{padding:6px 8px;border-bottom:1px solid #EEF1F5;font-size:13px;vertical-align:top}
.mgy-sheet-detail td.d{white-space:nowrap;color:var(--ink-2);width:1%}
.mgy-sheet-detail td.n{white-space:nowrap;direction:ltr;text-align:left;width:1%;font-weight:700}
.mgy-sheet footer{display:grid;grid-template-columns:1fr 1fr;gap:40px;margin-top:44px}
.mgy-sheet footer div{border-top:1px solid var(--ink-3);padding-top:6px;text-align:center;font-size:13px;color:var(--ink-2)}
.mgy-sheet-credit{text-align:center;font-size:11.5px;color:var(--ink-3);margin-top:20px!important}

.mgy-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:10px;background:var(--ink);color:#fff;padding:11px 18px;border-radius:12px;z-index:99999;font-size:14px;box-shadow:0 12px 30px -10px rgba(0,0,0,.5);animation:mgy-toast .25s ease-out;transition:opacity .4s}
.mgy-toast .mgy-ic{color:#6FD0BE}
.mgy-toast.err{background:var(--pome)} .mgy-toast.err .mgy-ic{color:#fff}
.mgy-toast.out{opacity:0}
@keyframes mgy-toast{from{opacity:0;transform:translate(-50%,10px)}}

/* ---------- واکنش‌گرا ---------- */
@container mgy (max-width:900px){
  .mgy-hero{grid-template-columns:1fr;padding:26px 22px}
  .mgy-hero-art{max-width:340px}
  .mgy-steps ol,.mgy-plan-grid{grid-template-columns:1fr}
  .mgy-plan.is-best{order:-1}
  .mgy-plan:first-child{order:1}
  .mgy-settings{grid-template-columns:1fr 1fr}
  .mgy-settings .mgy-more{grid-column:1/-1;justify-self:start}

  .mgy-settings{grid-template-columns:1fr 1fr}
  .mgy-settings.is-more{grid-template-columns:1fr}
  .mgy-cols{display:none}
  .mgy-pair{grid-template-columns:1fr;gap:10px}
  .mgy-bridge{flex-direction:row;justify-content:center;gap:8px}
  .mgy-bridge::before{display:none}
  .mgy-pair-act{justify-content:flex-start}
  .mgy-pair-side::before{font-size:11.5px;font-weight:700}
  .mgy-pair-side.is-book::before{content:"دفاتر";color:var(--book)}
  .mgy-pair-side.is-bank::before{content:"بانک";color:var(--bank)}
}
@container mgy (max-width:720px){
  .mgy-hero h2{font-size:26px}
  .mgy-hero-art{display:none}

  .mgy-stage{padding:14px}
  .mgy-open{grid-template-columns:1fr;gap:14px}
  .mgy-open-seam{display:none}
  .mgy-meter-num{font-size:48px}
  .mgy-map{grid-template-columns:1fr}
  .mgy-sheet{padding:24px 16px}
  .mgy-item{grid-template-columns:auto auto;}
  .mgy-desc{grid-column:1/-1}
}
@container mgy (max-width:720px){
  .mgy-face{grid-template-columns:1fr 34px 1fr}
  .mgy-side{padding:14px}
  .mgy-seam-knot{width:30px;height:30px;font-size:12px}
}
@container mgy (max-width:560px){
  .mgy-face{grid-template-columns:1fr}
  .mgy-seam{flex-direction:row;padding:6px 0}
  .mgy-seam-line{height:2px;width:auto;background:repeating-linear-gradient(to left,var(--line-2) 0 6px,transparent 6px 12px)}
  .mgy-seam.is-done .mgy-seam-line{background:linear-gradient(to left,var(--book),var(--bank))}
  .mgy-drop{min-height:104px}
}
@media (prefers-reduced-motion:reduce){
  .mgy *,.mgy *::before,.mgy *::after{animation:none!important;transition:none!important}
}
@media print{
  body *{visibility:hidden}
  .mgy-print,.mgy-print *{visibility:visible}
  .mgy-print{position:absolute;inset:0 0 auto 0;box-shadow:none;border:0;max-width:none}
  .noprint{display:none!important}
}
