/* ИИ-диагностика — вау-раздел стоматологии. Всё под .aiscan-scope, чтобы не течь в светлую CRM. */
.aiscan-scope{
  --sbg:#05070d; --scy:#3fd8ff; --scy2:#6ae9ff; --smint:#31e0b0; --sred:#ff4d5e; --samb:#ffb020;
  --stx:#e9f2ff; --stx2:#8ea6c8; --stx3:#5b719a; --sline:rgba(120,180,255,.13);
  --smono:'JetBrains Mono',ui-monospace,monospace;
  position:relative; border-radius:16px; overflow:hidden; color:var(--stx);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(63,216,255,.12), transparent 55%),
    radial-gradient(90% 90% at 50% 120%, rgba(49,224,176,.08), transparent 60%),
    var(--sbg);
  border:1px solid var(--sline);
  font-family:inherit;
}
.aiscan-scope *{box-sizing:border-box}
.aiscan-scope::before{content:'';position:absolute;inset:0;z-index:0;pointer-events:none;opacity:.4;
  background-image:linear-gradient(var(--sline) 1px,transparent 1px),linear-gradient(90deg,var(--sline) 1px,transparent 1px);
  background-size:42px 42px;mask:radial-gradient(120% 90% at 50% 40%,#000 30%,transparent 82%)}

.aiscan-scope .as-head{position:relative;z-index:2;display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:16px 20px;border-bottom:1px solid var(--sline)}
.aiscan-scope .as-mk{display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:-.02em;font-size:16px}
.aiscan-scope .as-mk i{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;font-style:normal;font-weight:800;color:#04121a;background:linear-gradient(135deg,var(--scy),var(--smint));box-shadow:0 0 22px rgba(63,216,255,.5)}
.aiscan-scope .as-chip{font-family:var(--smono);font-size:11px;color:var(--stx2);border:1px solid var(--sline);padding:5px 10px;border-radius:8px;background:rgba(120,180,255,.03);display:flex;gap:7px;align-items:center}
.aiscan-scope .as-chip b{color:var(--stx);font-weight:600}
.aiscan-scope .as-dot{width:7px;height:7px;border-radius:50%;background:var(--smint);box-shadow:0 0 10px var(--smint);animation:asPulse 1.6s infinite}
@keyframes asPulse{50%{opacity:.35}}
.aiscan-scope .as-sp{flex:1}

.aiscan-scope .as-work{position:relative;z-index:2;display:grid;grid-template-columns:1fr 340px;gap:16px;padding:16px}
@media(max-width:900px){.aiscan-scope .as-work{grid-template-columns:1fr}}

.aiscan-scope .as-theatre{position:relative;border:1px solid var(--sline);border-radius:14px;overflow:hidden;min-height:420px;
  background:radial-gradient(90% 90% at 50% 35%,rgba(15,26,48,.55),rgba(6,9,17,.9));box-shadow:inset 0 0 80px rgba(63,216,255,.06)}
.aiscan-scope .as-tlabel{position:absolute;top:12px;left:14px;z-index:5;font-family:var(--smono);font-size:10.5px;letter-spacing:.14em;color:var(--stx2);text-transform:uppercase}
.aiscan-scope .as-tid{position:absolute;top:12px;right:14px;z-index:5;font-family:var(--smono);font-size:10.5px;color:var(--scy);opacity:.8}
.aiscan-scope .as-cn{position:absolute;width:24px;height:24px;border:2px solid var(--scy);opacity:.5;z-index:5}
.aiscan-scope .as-cn.tl{top:11px;left:11px;border-right:0;border-bottom:0;border-radius:6px 0 0 0}
.aiscan-scope .as-cn.tr{top:11px;right:11px;border-left:0;border-bottom:0;border-radius:0 6px 0 0}
.aiscan-scope .as-cn.bl{bottom:11px;left:11px;border-right:0;border-top:0;border-radius:0 0 0 6px}
.aiscan-scope .as-cn.br{bottom:11px;right:11px;border-left:0;border-top:0;border-radius:0 0 6px 0}

.aiscan-scope .as-vp{position:absolute;inset:0;display:grid;place-items:center;perspective:1300px}
.aiscan-scope .as-arch{position:relative;width:88%;max-width:760px;transform-style:preserve-3d;transition:transform .25s ease-out}
.aiscan-scope .as-arch svg{width:100%;height:auto;display:block;overflow:visible}
.aiscan-scope .as-fx{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.aiscan-scope .as-tooth path{transition:fill .35s,filter .35s}
.aiscan-scope .as-tooth.lit path{filter:drop-shadow(0 0 6px rgba(63,216,255,.9))}
.aiscan-scope .as-tooth.f-high path{fill:url(#asRed)!important;filter:drop-shadow(0 0 12px var(--sred))}
.aiscan-scope .as-tooth.f-med path{fill:url(#asAmb)!important;filter:drop-shadow(0 0 12px var(--samb))}
.aiscan-scope .as-tooth.f-ok path{fill:url(#asMint)!important;filter:drop-shadow(0 0 10px var(--smint))}

.aiscan-scope .as-beam{position:absolute;top:0;bottom:0;width:120px;left:-14%;z-index:4;pointer-events:none;opacity:0}
.aiscan-scope .as-beam::before{content:'';position:absolute;top:6%;bottom:6%;left:58px;width:3px;border-radius:3px;background:linear-gradient(var(--scy2),#fff,var(--scy2));box-shadow:0 0 24px 6px var(--scy),0 0 60px 14px rgba(63,216,255,.6)}
.aiscan-scope .as-beam::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(63,216,255,.16) 46%,rgba(63,216,255,.30) 50%,transparent);filter:blur(2px)}
.aiscan-scope .as-beam.run{opacity:1;animation:asBeam var(--as-dur,3400ms) linear forwards}
@keyframes asBeam{from{left:-14%}to{left:104%}}

.aiscan-scope .as-ret{position:absolute;inset:0;z-index:6;pointer-events:none}
.aiscan-scope .as-r{position:absolute;transform:translate(-50%,-50%);opacity:0}
.aiscan-scope .as-r.show{animation:asRetIn .5s cubic-bezier(.2,1.4,.3,1) forwards}
@keyframes asRetIn{from{opacity:0;transform:translate(-50%,-50%) scale(1.9)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}
.aiscan-scope .as-ring{width:58px;height:58px;border-radius:50%;border:1.5px solid currentColor;position:relative;box-shadow:0 0 20px currentColor,inset 0 0 12px currentColor}
.aiscan-scope .as-ring::before,.aiscan-scope .as-ring::after{content:'';position:absolute;background:currentColor}
.aiscan-scope .as-ring::before{top:50%;left:-8px;right:-8px;height:1.5px;transform:translateY(-50%)}
.aiscan-scope .as-ring::after{left:50%;top:-8px;bottom:-8px;width:1.5px;transform:translateX(-50%)}
.aiscan-scope .as-spin{position:absolute;inset:-6px;border-radius:50%;border:1.5px dashed currentColor;opacity:.5;animation:asSpin 6s linear infinite}
@keyframes asSpin{to{transform:rotate(360deg)}}
.aiscan-scope .as-tag{position:absolute;left:66px;top:50%;transform:translateY(-50%);white-space:nowrap;font-family:var(--smono);font-size:10.5px;line-height:1.5;padding:6px 10px;border-radius:8px;background:rgba(6,10,20,.88);border:1px solid currentColor;box-shadow:0 8px 26px rgba(0,0,0,.5)}
.aiscan-scope .as-tag b{display:block;font-size:12px}
.aiscan-scope .as-tag .c{color:#fff;font-weight:700}
.aiscan-scope .as-tag::before{content:'';position:absolute;left:-14px;top:50%;width:14px;height:1.5px;background:currentColor;transform:translateY(-50%)}
.aiscan-scope .as-r.left .as-tag{left:auto;right:66px}
.aiscan-scope .as-r.left .as-tag::before{left:auto;right:-14px}

.aiscan-scope .as-panel{border:1px solid var(--sline);border-radius:14px;background:linear-gradient(180deg,rgba(13,20,38,.66),rgba(7,11,20,.85));display:flex;flex-direction:column;overflow:hidden}
.aiscan-scope .as-ph{padding:16px 18px 13px;border-bottom:1px solid var(--sline)}
.aiscan-scope .as-ph h3{font-size:15px;font-weight:700;display:flex;align-items:center;gap:8px;color:var(--stx)}
.aiscan-scope .as-ph small{display:block;color:var(--stx2);font-size:11.5px;margin-top:3px;font-family:var(--smono)}
.aiscan-scope .as-find{flex:1;overflow:auto;padding:8px 12px;min-height:150px}
.aiscan-scope .as-idle{padding:34px 14px;text-align:center;color:var(--stx2);font-size:12.5px;line-height:1.6}
.aiscan-scope .as-f{display:flex;gap:11px;padding:12px 9px;border-radius:11px;opacity:0;transform:translateX(12px)}
.aiscan-scope .as-f.in{animation:asFindIn .45s ease forwards}
@keyframes asFindIn{to{opacity:1;transform:none}}
.aiscan-scope .as-f__ic{width:32px;height:32px;border-radius:9px;flex-shrink:0;display:grid;place-items:center;font-size:14px;background:rgba(120,180,255,.06);border:1px solid currentColor}
.aiscan-scope .as-f__b{flex:1;min-width:0}
.aiscan-scope .as-f__t{display:flex;align-items:center;gap:7px;font-weight:600;font-size:13px;color:var(--stx)}
.aiscan-scope .as-pill{font-family:var(--smono);font-size:9px;text-transform:uppercase;letter-spacing:.05em;padding:2px 6px;border-radius:20px;border:1px solid currentColor}
.aiscan-scope .as-f__n{color:var(--stx2);font-size:11.5px;line-height:1.45;margin-top:3px}
.aiscan-scope .as-f__m{display:flex;align-items:center;gap:8px;margin-top:6px}
.aiscan-scope .as-bar{flex:1;height:4px;border-radius:3px;background:rgba(120,180,255,.1);overflow:hidden}
.aiscan-scope .as-bar i{display:block;height:100%;width:0;border-radius:3px;background:currentColor;transition:width 1s cubic-bezier(.2,1,.3,1)}
.aiscan-scope .as-f__c{font-family:var(--smono);font-size:11px;color:var(--stx);font-weight:600;width:36px;text-align:right}

.aiscan-scope .as-verdict{border-top:1px solid var(--sline);padding:14px 18px;display:flex;align-items:center;gap:14px;opacity:0;transition:opacity .5s}
.aiscan-scope .as-verdict.in{opacity:1}
.aiscan-scope .as-vr{position:relative;width:68px;height:68px;flex-shrink:0}
.aiscan-scope .as-vr svg{transform:rotate(-90deg)}
.aiscan-scope .as-vr__c{position:absolute;inset:0;display:grid;place-items:center;text-align:center}
.aiscan-scope .as-vr__c b{font-size:18px;font-weight:800;font-family:var(--smono)}
.aiscan-scope .as-vr__c small{font-size:8px;color:var(--stx2);text-transform:uppercase;letter-spacing:.08em}
.aiscan-scope .as-vt b{font-size:13px;color:var(--stx)}
.aiscan-scope .as-vt p{color:var(--stx2);font-size:11.5px;line-height:1.45;margin-top:2px}

.aiscan-scope .as-run{padding:13px 18px 16px}
.aiscan-scope .as-btn{width:100%;border:0;cursor:pointer;font-weight:700;font-size:13.5px;color:#04121a;padding:13px;border-radius:12px;display:flex;align-items:center;justify-content:center;gap:8px;background:linear-gradient(135deg,var(--scy),var(--smint));box-shadow:0 10px 30px rgba(63,216,255,.35);transition:transform .15s,box-shadow .3s,filter .3s;font-family:inherit}
.aiscan-scope .as-btn:hover{transform:translateY(-2px);box-shadow:0 16px 42px rgba(63,216,255,.5)}
.aiscan-scope .as-btn:disabled{filter:grayscale(.5) brightness(.7);cursor:default;transform:none;box-shadow:none}
.aiscan-scope .as-btn svg{width:17px;height:17px}
.aiscan-scope .as-btn--g{background:transparent;color:var(--scy);border:1px solid var(--scy);box-shadow:none;margin-top:9px}
.aiscan-scope .as-btn--g:hover{background:rgba(63,216,255,.08);box-shadow:0 0 22px rgba(63,216,255,.2)}
.aiscan-scope .as-status{position:absolute;bottom:14px;left:14px;z-index:5;font-family:var(--smono);font-size:10.5px;color:var(--scy);letter-spacing:.1em;text-transform:uppercase;opacity:0;transition:opacity .3s}
.aiscan-scope .as-status.on{opacity:1}
.aiscan-scope .as-foot{position:absolute;bottom:12px;right:14px;z-index:5;font-family:var(--smono);font-size:10px;color:var(--stx3);opacity:.7}

/* ── загруженный снимок пользователя ── */
.aiscan-scope .as-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; z-index: 1; display: none; padding: 26px; }
.aiscan-scope.has-photo .as-photo { display: block; }
.aiscan-scope.has-photo .as-arch { display: none; }

/* ── панель загрузки «снизу» ── */
.aiscan-scope .as-upload { position: relative; z-index: 2; margin: 0 16px 16px; display: flex; align-items: center; gap: 16px; padding: 15px 20px; border: 1.5px dashed var(--sline); border-radius: 14px; background: rgba(120,180,255,0.03); transition: border-color .2s, background .2s; }
.aiscan-scope .as-upload.drag { border-color: var(--scy); background: rgba(63,216,255,0.09); }
.aiscan-scope .as-up__ic { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; color: var(--scy); background: rgba(63,216,255,0.08); border: 1px solid rgba(63,216,255,0.2); }
.aiscan-scope .as-up__ic svg { width: 22px; height: 22px; }
.aiscan-scope .as-up__t { flex: 1; min-width: 0; }
.aiscan-scope .as-up__t b { display: block; font-size: 14px; color: var(--stx); }
.aiscan-scope .as-up__t span { font-size: 12px; color: var(--stx2); font-family: var(--smono); }
.aiscan-scope .as-up__actions { display: flex; gap: 10px; flex-shrink: 0; }
.aiscan-scope .as-up__file { cursor: pointer; margin: 0; }
.aiscan-scope .as-up__file, .aiscan-scope .as-up__demo { width: auto; padding: 11px 18px; font-size: 13px; }
@media (max-width: 720px) {
  .aiscan-scope .as-upload { flex-wrap: wrap; }
  .aiscan-scope .as-up__actions { width: 100%; }
  .aiscan-scope .as-up__file, .aiscan-scope .as-up__demo { flex: 1; justify-content: center; }
}

/* ── инфо-зона: как работает + статы ── */
.aiscan-scope .as-info { position: relative; z-index: 2; display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; padding: 0 16px 14px; }
@media (max-width: 900px) { .aiscan-scope .as-info { grid-template-columns: 1fr; } }
.aiscan-scope .as-how, .aiscan-scope .as-stats { border: 1px solid var(--sline); border-radius: 14px; background: linear-gradient(180deg, rgba(13,20,38,.5), rgba(7,11,20,.7)); padding: 16px 18px; }
.aiscan-scope .as-how__h { font-family: var(--smono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--stx2); margin-bottom: 14px; }
.aiscan-scope .as-steps { display: flex; align-items: center; gap: 10px; }
.aiscan-scope .as-step { display: flex; align-items: center; gap: 10px; flex: 1; }
.aiscan-scope .as-step__n { width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; font-family: var(--smono); font-weight: 700; font-size: 12px; color: var(--scy); background: rgba(63,216,255,.1); border: 1px solid rgba(63,216,255,.24); }
.aiscan-scope .as-step b { display: block; font-size: 12.5px; color: var(--stx); line-height: 1.2; }
.aiscan-scope .as-step span { font-size: 10.5px; color: var(--stx2); font-family: var(--smono); }
.aiscan-scope .as-step__arw { color: var(--stx3); margin: 0 2px; }
.aiscan-scope .as-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: center; }
.aiscan-scope .as-stat { text-align: center; }
.aiscan-scope .as-stat b { display: block; font-family: var(--smono); font-size: 20px; font-weight: 700; background: linear-gradient(120deg, var(--scy), var(--smint)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.aiscan-scope .as-stat span { font-size: 10px; color: var(--stx2); }
.aiscan-scope .as-up__btn { width: auto; padding: 11px 20px; font-size: 13px; flex-shrink: 0; }

/* ── тепловая карта ── */
.aiscan-scope .as-heat { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; filter: blur(6px); mix-blend-mode: screen; transition: opacity .4s; }
.aiscan-scope .as-heat.on { opacity: .9; }
.aiscan-scope .as-heatbtn { position: absolute; top: 40px; right: 14px; z-index: 7; display: flex; align-items: center; gap: 6px; font-family: var(--smono); font-size: 10.5px; color: var(--stx2); background: rgba(6,10,20,.7); border: 1px solid var(--sline); border-radius: 8px; padding: 6px 10px; cursor: pointer; transition: .2s; }
.aiscan-scope .as-heatbtn svg { width: 13px; height: 13px; }
.aiscan-scope .as-heatbtn:hover { color: var(--stx); border-color: var(--scy); }
.aiscan-scope .as-heatbtn.on { color: #04121a; background: linear-gradient(135deg, var(--sred), var(--samb)); border-color: transparent; }

/* ── клик по находке → пульс ── */
.aiscan-scope .as-f { cursor: pointer; transition: background .2s; }
.aiscan-scope .as-f:hover, .aiscan-scope .as-f.sel { background: rgba(120,180,255,.06); }
.aiscan-scope .as-r.ping .as-ring { animation: asPing .85s cubic-bezier(.2,1,.3,1); }
@keyframes asPing { 0% { transform: scale(1); } 45% { transform: scale(1.4); box-shadow: 0 0 40px currentColor, inset 0 0 22px currentColor; } 100% { transform: scale(1); } }
.aiscan-scope .as-tooth.zoom path { animation: asToothZoom .85s ease; }
@keyframes asToothZoom { 0%,100% { filter: none; } 50% { filter: drop-shadow(0 0 16px currentColor) brightness(1.4); } }

/* ── полноэкранное сообщение (тизер загрузки) ── */
.aiscan-scope .as-lock { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 24px; background: rgba(4,7,14,.82); backdrop-filter: blur(10px); animation: asLockIn .3s ease; }
@keyframes asLockIn { from { opacity: 0; } to { opacity: 1; } }
.aiscan-scope .as-lock[hidden] { display: none; }
.aiscan-scope .as-lock__box { max-width: 460px; text-align: center; border: 1px solid var(--sline); border-radius: 20px; padding: 40px 36px; background: radial-gradient(120% 90% at 50% -10%, rgba(63,216,255,.14), transparent 60%), linear-gradient(180deg, rgba(15,22,40,.96), rgba(8,12,22,.98)); box-shadow: 0 40px 100px rgba(0,0,0,.6); animation: asLockBox .35s cubic-bezier(.2,1,.3,1); }
@keyframes asLockBox { from { transform: translateY(16px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.aiscan-scope .as-lock__ic { width: 60px; height: 60px; margin: 0 auto 20px; border-radius: 16px; display: grid; place-items: center; color: var(--scy); background: rgba(63,216,255,.1); border: 1px solid rgba(63,216,255,.24); }
.aiscan-scope .as-lock__ic svg { width: 28px; height: 28px; }
.aiscan-scope .as-lock__box h3 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--stx); margin-bottom: 12px; }
.aiscan-scope .as-lock__box p { font-size: 14px; line-height: 1.6; color: var(--stx2); margin-bottom: 26px; }
.aiscan-scope .as-lock__act { display: flex; gap: 12px; justify-content: center; }
.aiscan-scope .as-lock__act .as-btn { width: auto; padding: 13px 22px; text-decoration: none; }
