/* ══════════ ۴۰٫۳۰۴ — «ظاهرِ افسانه»، مرحلهٔ ۱ (legend.js) ══════════
   فقط زیرِ html.legend کار می‌کند و پس از همهٔ شیوه‌نامه‌ها بار می‌شود؛ خاموش ← هیچ اثری ندارد.
   • رنگ‌ها روی حالتِ تاریکِ همیشگی (themePref ← dark) سوار می‌شوند: زمینهٔ تقریباً سیاه، کارتِ تیره، رنگِ نرم‌افزار فیروزه‌ای (--acc/--acc-dk با
     !important، چون htApplyPal رنگِ طیف را روی style ِ ریشه می‌نویسد)؛ نوشتهٔ دکمهٔ اصلی و حالتِ «انتخاب‌شده» همان تیرهٔ formal.css.
   • خانهٔ تعمیرگاه (lg-*): هسته، جمله، خطِ چهار ایستگاهی، یک پیشنهاد، نوارِ فرمان. قلم ≥ ۱۳٫۵؛ حرکت با prefers-reduced-motion خاموش. */

html.legend{--acc:#5EE6FF!important;--acc-dk:#5EE6FF!important;--lg1:#5EE6FF;--lg2:#9B7BFF;--lg3:#FF6BD6}
html.legend[data-theme="dark"]{
  --bg:#06070D;--card:#10121B;--ink:#F2F3F7;--muted:#A2A8BC;--dim:#8C93A8;--line:#1F2231;--line-soft:#171925;
  --brand:#5EE6FF;--brand2:#8BEEFF;--brand-ink:#8BEEFF;--brand-soft:#0C2230;
  --ok:#7CF2B0;--ok-soft:#0E2A20;--warn:#FFC56B;--warn-soft:#2C2210;--bad:#FF8A8A;--bad-soft:#2E1517;
  --side1:#0A0B12;--side2:#0A0B12;--side-ink:#A2A8BC;--sb-bg:#0A0B12;
  --shadow:none;--shadow-lg:0 18px 44px -12px rgba(0,0,0,.8)}
html.legend body{background:radial-gradient(ellipse 60% 30% at 50% 0%,rgba(155,123,255,.13),rgba(6,7,13,0) 70%),#06070D fixed}
html.legend #theme-btn{display:none}
/* گوشی: سربرگِ برنامه با رنگِ نرم‌افزار (نوشتهٔ سفید) پر می‌شد — فیروزه‌ای و ناخوانا؛ در افسانه زمینهٔ تیره و خطِ نازک */
@media(max-width:1000px){html.legend #menubar,html.legend .topbar{background:#0A0B12!important;border-bottom:1px solid var(--line);box-shadow:none}
  html.legend .topbar #page-title,html.legend .topbar .crumb,html.legend .topbar a{color:var(--ink)!important}}
html.legend .btn.primary,html.legend #content .btn.primary{background:#F2F3F7!important;border-color:#F2F3F7!important;color:#06070D!important;border-radius:999px}
html.legend #content .card,html.legend #content .panel{background:rgba(255,255,255,.035);border-color:rgba(255,255,255,.09)}

/* ---------- خانهٔ تعمیرگاه ---------- */
.lg-home{max-width:1100px;margin:0 auto;padding:8px 8px 32px;display:flex;flex-direction:column;align-items:center;gap:26px;text-align:center}
.lg-sw{align-self:stretch;display:flex;justify-content:flex-start}
.lg-core{position:relative;width:150px;height:150px;margin-top:6px}
.lg-ring{position:absolute;inset:0;border-radius:50%;border:1.5px solid transparent;animation:lgSpin 24s linear infinite}
.lg-ring.a{border-top-color:var(--lg1);border-bottom-color:var(--lg2);transform:rotateX(64deg) rotate(0)}
.lg-ring.b{inset:8px;border-left-color:var(--lg3);border-right-color:var(--lg1);animation-duration:33s;animation-direction:reverse;opacity:.8}
.lg-nuc,.lg-nucs{display:block;border-radius:50%;background:radial-gradient(circle at 38% 34%,#FFFFFF,#5EE6FF 38%,#9B7BFF 72%,#3B2A8A)}
.lg-nuc{position:absolute;inset:0;margin:auto;width:58px;height:58px;box-shadow:0 0 38px 8px rgba(94,230,255,.42),0 0 90px 30px rgba(155,123,255,.25);animation:lgBreath 4.6s ease-in-out infinite}
.lg-nucs{width:24px;height:24px;flex:none;box-shadow:0 0 14px 3px rgba(94,230,255,.4)}
.lg-say{margin:0;max-width:760px;font-size:30px;font-weight:300;line-height:1.55;color:var(--ink)}
.lg-say b{font-weight:800;color:var(--lg1)}
.lg-line{align-self:stretch;position:relative;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding-top:4px}
.lg-line::before{content:"";position:absolute;inset-inline:12.5%;top:11px;height:2px;background:linear-gradient(270deg,#A2A8BC,#9B7BFF 45%,#5EE6FF)}
.lg-st{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;padding:0 4px 8px;border:0;background:transparent;color:var(--ink);font:inherit;cursor:pointer;border-radius:18px}
.lg-st:hover{background:rgba(255,255,255,.04)}
.lg-st i{width:16px;height:16px;border-radius:50%;background:#06070D;border:2px solid var(--muted);box-sizing:border-box;margin:3px 0 14px;position:relative;z-index:1}
.lg-st.c2 i{border-color:var(--lg2)}.lg-st.bad i{border-color:var(--bad)}
.lg-st.c1 i{border-color:var(--lg1);background:var(--lg1);box-shadow:0 0 16px 4px rgba(94,230,255,.5)}
.lg-st .lg-n{font-size:78px;font-weight:200;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-1px}
.lg-st .lg-t{font-size:16px;font-weight:500;color:var(--muted)}
.lg-st.c1 .lg-n,.lg-st.c1 .lg-t{color:var(--lg1)}
.lg-late{border:1px solid rgba(255,138,138,.45);background:transparent;color:var(--bad);border-radius:999px;min-height:44px;padding:0 20px;font:inherit;font-size:15px;cursor:pointer}
.lg-sug{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:14px;padding:10px 10px 10px 22px;border-radius:999px;background:rgba(255,255,255,.06);border:1px solid rgba(155,123,255,.55);font-size:16.5px;color:var(--ink)}
.lg-yes{height:44px;padding:0 24px;border:0;border-radius:999px;background:#F2F3F7;color:#06070D;font:inherit;font-weight:800;cursor:pointer}
.lg-ask{align-self:stretch;max-width:820px;margin:0 auto;width:100%;text-align:start}
.lg-ask .hq-ask{background:transparent;border:0;box-shadow:none;padding:0}
.lg-ask .hq-hi{justify-content:center;color:var(--muted)}
.lg-ask .hq-box{border-radius:999px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.18)}
.lg-ask .hq-chips{justify-content:center}
.lg-ask .hq-chip{border-radius:999px}
.lg-ask .hq-chip.p{background:#F2F3F7;color:#06070D;border-color:#F2F3F7;font-weight:800}
.lg-onb{align-self:stretch;text-align:start}
@keyframes lgSpin{to{transform:rotateX(64deg) rotate(360deg)}}
@keyframes lgBreath{0%,100%{transform:scale(1)}50%{transform:scale(1.09)}}
@media (prefers-reduced-motion:reduce){.lg-ring,.lg-nuc{animation:none}}
@media (max-width:700px){
  .lg-home{gap:20px;padding-top:0}
  .lg-core{width:110px;height:110px}
  .lg-nuc{width:42px;height:42px}
  .lg-say{font-size:23px}
  .lg-line{grid-template-columns:1fr;gap:0;justify-items:stretch}
  .lg-line::before{inset-inline:auto;inset-inline-start:19px;top:24px;bottom:24px;width:2px;height:auto;background:linear-gradient(180deg,#A2A8BC,#9B7BFF 45%,#5EE6FF)}
  .lg-st{flex-direction:row;gap:16px;min-height:76px;padding:0 12px;text-align:start}
  .lg-st i{margin:0}
  .lg-st .lg-n{font-size:52px;width:56px;text-align:center}
  .lg-sug{border-radius:24px;padding:12px 16px}
}

/* ---------- ۴۰٫۳۰۵ — پروندهٔ تعمیر در افسانه: سرِ بخش‌ها یک‌دست (بی نوارِ رنگیِ هر بخش) و «همهٔ امکانات» ---------- */
html.legend #modal.rfp .rfp-sec{--acc:var(--lg1);border-top:1px solid var(--line);background:rgba(255,255,255,.03)}
html.legend #modal.rfp .rfp-sec > h4{background:transparent!important;color:var(--ink)!important;border-bottom:1px solid var(--line)}
html.legend #modal.rfp details.rfp-fold > summary{color:var(--muted)!important}
html.legend #modal.rfp .rfp-sec.lg-flash{box-shadow:0 0 0 2px var(--lg1)}
.lg-allw{display:flex;justify-content:flex-end;margin:0 0 8px}
.lg-allw .btn{border-radius:999px;min-height:44px;padding:0 20px;font-size:14.5px}
#lg-allp{position:fixed;inset:0;z-index:9100;background:#06070D;display:flex;flex-direction:column;overflow:hidden}
#lg-allp .lg-ah{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:14px 20px;border-bottom:1px solid var(--line)}
#lg-allp .lg-ah b{font-size:19px;flex:1 1 200px}
#lg-allp .lg-ah input{flex:1 1 220px;max-width:320px;min-height:44px;border-radius:999px;padding:0 18px;font-size:15px}
#lg-allp .lg-ah .btn{border-radius:999px;min-height:44px}
#lg-allp .lg-ab{flex:1;overflow:auto;padding:22px 20px 30px;display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:26px 22px;align-content:start}
#lg-allp .lg-ag{display:flex;flex-direction:column;gap:2px;min-width:0}
#lg-allp .lg-ag h3{display:flex;align-items:center;gap:8px;margin:0 0 8px;font-size:15px;color:var(--muted)}
#lg-allp .lg-ag h3 i{width:10px;height:10px;border-radius:50%;border:2px solid rgba(255,255,255,.3);box-sizing:border-box}
#lg-allp .lg-ag.done h3 i{background:var(--lg2);border-color:var(--lg2)}
#lg-allp .lg-ag.now h3{color:var(--lg1)}
#lg-allp .lg-ag.now h3 i{background:var(--lg1);border-color:var(--lg1)}
#lg-allp .lg-ai{text-align:start;min-height:44px;padding:6px 10px;border:0;border-radius:12px;background:transparent;color:var(--ink);font:inherit;font-size:15.5px;font-weight:300;cursor:pointer}
#lg-allp .lg-ai:hover,#lg-allp .lg-ai:focus-visible{background:rgba(255,255,255,.06);color:var(--lg1)}
@media (max-width:700px){#lg-allp .lg-ab{grid-template-columns:1fr 1fr;gap:20px 12px;padding:16px 14px 24px}#lg-allp .lg-ah input{max-width:none}}

/* ---------- ۴۰٫۳۰۶ — نوارِ «پذیرش با یک جمله» بالای فرمِ پذیرش (intake_say.js) ---------- */
html.legend .isy-bar{display:flex;align-items:center;gap:10px;margin:0 0 14px;padding:6px 6px 6px 16px;border-radius:999px;background:rgba(255,255,255,.07);border:1px solid rgba(155,123,255,.55)}
html.legend .isy-bar input{flex:1;min-width:0;min-height:46px;border:0!important;outline:0;background:transparent!important;color:var(--ink);font-size:16px;box-shadow:none!important}
html.legend .isy-mic{width:46px;height:46px;flex:none;border:0;border-radius:50%;background:linear-gradient(135deg,#5EE6FF,#9B7BFF 55%,#FF6BD6);color:#06070D;display:grid;place-items:center;cursor:pointer}
html.legend .isy-mic.on{box-shadow:0 0 0 4px rgba(94,230,255,.35)}
html.legend .isy-go{border-radius:999px;min-height:46px;padding:0 20px;background:#F2F3F7!important;color:#06070D!important;border:0;font-weight:800}
@media (max-width:700px){html.legend .isy-bar{border-radius:24px;flex-wrap:wrap;padding:8px 10px}html.legend .isy-bar input{flex:1 1 100%;order:-1}}

/* ---------- ۴۰٫۳۰۷ — خانهٔ شرکتی: عددهای پولی (عدد بزرگ + واحدِ کوچک) ---------- */
.lg-line-co .lg-st .lg-n{font-size:58px;display:flex;align-items:baseline;gap:6px;justify-content:center}
.lg-line-co .lg-st .lg-n small{font-size:16px;font-weight:400;letter-spacing:0;color:var(--muted)}
.lg-onb .hx-sec{background:rgba(255,255,255,.03);border:1px solid var(--line);border-radius:16px;padding:6px 14px;margin-top:10px}
@media (max-width:700px){.lg-line-co .lg-st .lg-n{font-size:40px;width:auto;min-width:56px}}
/* سودِ جمله دکمه است («از کجا آمده؟»)؛ نوارِ شمارنده‌های عنوان (live-tiles) در خانهٔ افسانه تکرارِ همان عددهاست */
.lg-sayb{border:0;background:transparent;padding:0;font:inherit;font-weight:800;color:var(--lg1);cursor:pointer;text-decoration:underline dotted 1px;text-underline-offset:8px}
html.legend body:has(.lg-home) #live-tiles{display:none}

/* ---------- ۴۰٫۳۰۸ — شمارِ ایستگاه‌ها متغیر (فروشگاه: ۲ تا ۴) ---------- */
.lg-line{grid-template-columns:repeat(var(--n,4),minmax(0,1fr))}
.lg-line::before{inset-inline:calc(50% / var(--n,4))}
@media (max-width:700px){.lg-line{grid-template-columns:1fr}.lg-line::before{inset-inline-end:auto;inset-inline-start:19px}}
