/* Плавающий калькулятор TELCON (tc_calc1). Все стили внутри #tcw / #tcw-btn, чтобы не задевать сайт. */
#tcw-btn,#tcw{
  --tcw-panel:#fff; --tcw-text:#1d2430; --tcw-muted:#6b7585; --tcw-line:#e3e7ee; --tcw-line2:#aeb8c5;
  --tcw-accent:#0b63ce; --tcw-key:#f1f3f7; --tcw-key-h:#e4e8ef; --tcw-strip:#dfe4ea;
  --tcw-shadow:0 12px 40px rgba(20,30,50,.18);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
#tcw,#tcw *,#tcw-btn,#tcw-btn *{box-sizing:border-box}
#tcw *{line-height:inherit;float:none;text-shadow:none}
#tcw button,#tcw input,#tcw select{font-family:inherit;font-size:inherit;margin:0;text-transform:none;letter-spacing:normal;
  box-shadow:none;min-height:0;height:auto;line-height:1.3;float:none;outline-offset:0;text-shadow:none}
#tcw button{width:auto}

/* --- кнопка --- */
#tcw-btn{position:fixed;top:14px;right:18px;z-index:9990;width:28px;height:28px;border-radius:50%;border:0;padding:0;margin:0;
  background:#1056cc;color:#fff;box-shadow:0 4px 14px rgba(20,30,50,.25);cursor:pointer;display:flex;align-items:center;justify-content:center}
#tcw-btn:hover{filter:brightness(1.08)}
#tcw-btn svg{width:15px;height:15px;display:block}
/* кнопка в шапке сайта: как аватар пользователя — синий кружок 28 px в ячейке 40 px */
.tc-hdr__icons .tcw-hb{order:99;border:0;background:none;padding:0;margin:0;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px}
.tcw-hb .tcw-hb-c{width:28px;height:28px;border-radius:50%;background:#1056cc;color:#fff;display:inline-flex;align-items:center;justify-content:center;transition:box-shadow .15s}
.tcw-hb svg{width:15px;height:15px;display:block}
.tcw-hb:hover .tcw-hb-c,.tcw-hb.tcw-hb-on .tcw-hb-c{box-shadow:0 0 0 3px rgba(16,86,204,.22)}

/* --- окно --- */
#tcw{position:fixed;top:84px;right:18px;z-index:9991;width:360px;max-height:calc(100vh - 100px);background:var(--tcw-panel);
  border:1px solid var(--tcw-line);border-radius:14px;box-shadow:var(--tcw-shadow);display:none;padding:0;margin:0;flex-direction:column;overflow:hidden;
  color:var(--tcw-text);font-size:15px;line-height:1.4;text-align:left}
#tcw.tcw-open{display:flex;animation:tcw-in .18s ease-out;view-transition-name:tcw}
#tcw.tcw-open.tcw-keep{animation:none}
#tcw.tcw-open.tcw-slow{animation:tcw-in .45s ease-out}
/* переход между страницами сайта: страница меняется как обычно (без эффектов), окно калькулятора остаётся на месте */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation:none}
::view-transition-group(tcw){animation:none}
::view-transition-old(tcw){display:none}
::view-transition-new(tcw){animation:none}
@keyframes tcw-in{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){#tcw.tcw-open{animation:none}}
#tcw .tcw-top{display:flex;align-items:center;justify-content:space-between;padding:10px 12px 4px;cursor:move;user-select:none;background:var(--tcw-strip)}
#tcw .tcw-top b{font-size:15px;font-weight:700}
#tcw .tcw-tr{display:flex;align-items:center;gap:6px}
#tcw .tcw-x{border:0;background:none;color:var(--tcw-muted);font-size:22px;cursor:pointer;line-height:1;padding:2px 6px}
#tcw .tcw-lang{display:flex;border:1px solid var(--tcw-line2);border-radius:7px;overflow:hidden}
#tcw .tcw-lang button{border:0;background:transparent;color:var(--tcw-muted);font-size:11px;font-weight:700;padding:3px 7px;cursor:pointer;border-radius:0}
#tcw .tcw-lang button+button{border-left:1px solid var(--tcw-line2)}
#tcw .tcw-lang button.tcw-on{background:var(--tcw-panel);color:var(--tcw-accent)}

/* вкладки в стиле Chrome */
#tcw .tcw-tabs{display:flex;padding:4px 12px 0;background:var(--tcw-strip)}
#tcw .tcw-tab{position:relative;flex:1;border:0;background:none;padding:8px 6px 9px;cursor:pointer;color:var(--tcw-muted);
  font-size:13px;font-weight:600;border-radius:10px 10px 0 0}
#tcw .tcw-tab:not(.tcw-on):hover{background:rgba(127,140,160,.18)}
#tcw .tcw-tab:not(.tcw-on)+.tcw-tab:not(.tcw-on)::before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:1px;background:var(--tcw-line2)}
#tcw .tcw-tab.tcw-on{background:var(--tcw-panel);color:var(--tcw-text);z-index:1}
#tcw .tcw-tab.tcw-on::before,#tcw .tcw-tab.tcw-on::after{content:"";position:absolute;bottom:0;width:10px;height:10px;pointer-events:none}
#tcw .tcw-tab.tcw-on::before{left:-10px;background:radial-gradient(circle at 0 0,transparent 9.5px,var(--tcw-panel) 10px)}
#tcw .tcw-tab.tcw-on::after{right:-10px;background:radial-gradient(circle at 100% 0,transparent 9.5px,var(--tcw-panel) 10px)}

#tcw .tcw-body{padding:12px;overflow:auto}
#tcw .tcw-pane{display:none}
#tcw .tcw-pane.tcw-on{display:block}

/* калькулятор */
#tcw .tcw-disp{background:var(--tcw-key);border-radius:10px;padding:8px 12px;margin-bottom:10px;text-align:right}
#tcw .tcw-expr{min-height:20px;color:var(--tcw-muted);font-size:14px;word-break:break-all}
#tcw .tcw-res{font-size:30px;font-weight:700;word-break:break-all}
#tcw .tcw-keys{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
#tcw .tcw-k{border:0;background:var(--tcw-key);color:var(--tcw-text);border-radius:9px;height:44px;font-size:18px;cursor:pointer;padding:0}
#tcw .tcw-k:hover{background:var(--tcw-key-h)}
#tcw .tcw-k.tcw-op{color:var(--tcw-accent);font-weight:700}
#tcw .tcw-k.tcw-eq{background:var(--tcw-accent);color:#fff}
#tcw .tcw-k.tcw-sm{font-size:14px}
#tcw .tcw-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}
#tcw .tcw-mini{border:1px solid var(--tcw-line);background:var(--tcw-panel);color:var(--tcw-text);border-radius:8px;padding:5px 10px;font-size:13px;cursor:pointer}
#tcw .tcw-mini:hover{border-color:var(--tcw-accent);color:var(--tcw-accent)}
#tcw .tcw-hist{margin-top:10px;border-top:1px dashed var(--tcw-line);padding-top:8px;max-height:110px;overflow:auto;font-size:13px}
#tcw .tcw-hist div{display:flex;justify-content:space-between;gap:8px;padding:3px 0;color:var(--tcw-muted);cursor:pointer}
#tcw .tcw-hist div:hover{color:var(--tcw-text)}
#tcw .tcw-tiny{font-size:12px;color:var(--tcw-muted)}

/* поля */
#tcw label,#tcw .tcw-lbl{display:block;font-size:12px;color:var(--tcw-muted);margin:0 0 3px;font-weight:400;padding:0}
#tcw input,#tcw select{display:block;width:100%;border:1px solid var(--tcw-line);background:var(--tcw-panel);color:var(--tcw-text);
  border-radius:8px;padding:7px 9px;font-size:15px}
#tcw input:focus,#tcw select:focus{outline:2px solid #e8f1fc;border-color:var(--tcw-accent)}
#tcw .tcw-g2{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}
#tcw .tcw-g3{display:grid;grid-template-columns:1fr 1fr 1.1fr;gap:6px;margin-bottom:6px}
#tcw .tcw-gc{display:grid;grid-template-columns:1fr 84px;gap:6px;margin-bottom:6px}

/* блоки «Деньги» */
#tcw .tcw-blk{border:1px solid var(--tcw-line2);border-radius:10px;padding:8px 10px 9px;margin-bottom:8px}
#tcw .tcw-blk-h{display:inline-block;font-size:11px;font-weight:700;color:var(--tcw-text);text-transform:uppercase;letter-spacing:.04em;
  margin-bottom:7px;padding-bottom:2px;border-bottom:1px solid var(--tcw-accent)}
#tcw .tcw-blk .tcw-g2{gap:6px;margin-bottom:6px}
#tcw .tcw-blk label{font-size:11px;margin-bottom:2px}
#tcw .tcw-blk input,#tcw .tcw-blk select{padding:5px 8px;font-size:14px}
#tcw .tcw-r{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 14px;background:var(--tcw-key);border-radius:8px;padding:6px 10px;font-size:12px;color:var(--tcw-muted)}
#tcw .tcw-r b{font-size:14px;color:var(--tcw-text);font-weight:700}
#tcw .tcw-r b.tcw-main{font-size:17px;color:var(--tcw-accent)}
#tcw .tcw-rates{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;margin-top:6px;font-size:11px;color:var(--tcw-muted)}
#tcw .tcw-rates span{display:inline-flex;align-items:center;gap:3px}
#tcw .tcw-rates input{display:inline-block;width:64px;padding:1px 4px;font-size:11px;border:1px dashed var(--tcw-line);border-radius:5px;background:transparent;color:var(--tcw-muted)}
#tcw .tcw-rates input:focus{color:var(--tcw-text);border-style:solid}

/* архив */
#tcw .tcw-out{background:var(--tcw-key);border-radius:10px;padding:10px 12px;margin-bottom:8px}
#tcw .tcw-out .tcw-big{font-size:22px;font-weight:700}
#tcw .tcw-out .tcw-sub{font-size:13px;color:var(--tcw-muted)}
#tcw .tcw-kv{display:flex;justify-content:space-between;gap:8px;font-size:14px;padding:2px 0}

/* диски из каталога */
#tcw .tcw-disks{margin:4px 0 8px}
#tcw .tcw-d{display:flex;justify-content:space-between;gap:10px;align-items:center;border:1px solid var(--tcw-line2);border-radius:9px;padding:7px 10px;margin-bottom:6px;font-size:13px}
#tcw .tcw-d a{color:var(--tcw-text);text-decoration:none}
#tcw .tcw-d a:hover{color:var(--tcw-accent);text-decoration:underline}
#tcw .tcw-d-s{font-size:12px;color:var(--tcw-muted);margin-top:2px}
#tcw .tcw-d-p{text-align:right;white-space:nowrap;font-size:12px;color:var(--tcw-muted)}
#tcw .tcw-d-p b{font-size:14px;color:var(--tcw-text)}
#tcw .tcw-ok{color:#1a8a4a}#tcw .tcw-arr{color:#b25e00}#tcw .tcw-ord{color:var(--tcw-muted)}
/* размер за правый нижний угол */
#tcw .tcw-top,#tcw .tcw-tabs,#tcw .tcw-body{zoom:var(--tcw-z,1)}
#tcw .tcw-rs{position:absolute;right:0;bottom:0;width:18px;height:18px;cursor:nwse-resize;z-index:2;touch-action:none;opacity:.7;
  background:linear-gradient(135deg,transparent 0 55%,var(--tcw-muted) 55% 60%,transparent 60% 70%,var(--tcw-muted) 70% 75%,transparent 75% 85%,var(--tcw-muted) 85% 90%,transparent 90%)}
#tcw .tcw-rs:hover{opacity:1}

/* кнопка у выделенного числа на странице */
#tcw-sel{position:fixed;z-index:9992;display:none;gap:4px;padding:3px;margin:0;background:#fff;border:1px solid #aeb8c5;border-radius:9px;
  box-shadow:0 6px 20px rgba(20,30,50,.22);font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;line-height:1.3}
#tcw-sel.tcw-open{display:flex}
#tcw-sel button{display:inline-flex;align-items:center;gap:5px;margin:0;width:auto;height:auto;min-height:0;float:none;
  background:#0b63ce;color:#fff;border:1px solid #0b63ce;border-radius:6px;padding:4px 9px;font:600 12px/1.3 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  text-transform:none;letter-spacing:normal;box-shadow:none;text-shadow:none;cursor:pointer;white-space:nowrap}
#tcw-sel button:hover{filter:brightness(1.08)}
#tcw-sel button.tcw-add{background:#fff;color:#0b63ce}
#tcw-sel svg{width:14px;height:14px;display:block}

@media (max-width:600px),(pointer:coarse){#tcw-sel{display:none !important}}
@media (max-width:600px){
  #tcw-btn{top:auto;bottom:16px;right:16px}
  #tcw{top:auto !important;bottom:0;right:0 !important;left:0 !important;width:100% !important;max-height:88vh !important;border-radius:14px 14px 0 0;--tcw-z:1 !important}
  #tcw .tcw-top{cursor:default}
  #tcw .tcw-rs{display:none}
}
@media print{#tcw,#tcw-btn{display:none !important}}
