/* Клиентский портал InvestKomek — дизайн 3a (десктоп) и 4a (телефон).
   Цвета — те же токены, что у лендинга. */
:root{
  --paper:#F6F7FC; --card:#FFFFFF; --ink:#131C3D; --muted:#5C6683; --line:#E4E8F3;
  --brand:#2B4AD8; --brand-deep:#1E36A8; --brand-soft:#EDF1FF;
  --accent:#0FA971; --accent-deep:#0B8459; --accent-soft:#E8F7F1; --accent-bright:#2FD69B;
  --warn:#B25E09; --warn-soft:#FDF1E3; --warn-line:#F2D3AE; --warn-bg:#FFFBF5;
  --deep:#1B2757; --deep-muted:#B7C0E0; --deep-line:rgba(255,255,255,.12);
  --shadow-s:0 1px 2px rgba(19,28,61,.05),0 6px 18px rgba(19,28,61,.06);
  --shadow-l:0 2px 4px rgba(19,28,61,.05),0 22px 54px rgba(19,28,61,.10);
}
*{box-sizing:border-box}
[hidden]{display:none !important}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.65 "Manrope",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased}
a{color:var(--brand-deep);text-decoration:none}
a:hover{color:var(--brand)}
button,input,textarea,select{font:inherit;color:inherit}
h1,h2,h3{margin:0;letter-spacing:-.02em}
p{margin:0}
.wrap{width:min(1120px,100% - 40px);margin-inline:auto}
@media (max-width:760px){.wrap{width:calc(100% - 32px)}}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
:focus-visible{outline:3px solid rgba(43,74,216,.45);outline-offset:2px;border-radius:6px}

/* ───── кнопки и плашки ───── */
.btn{appearance:none;border:1px solid transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:700;font-size:14.5px;padding:11px 22px;border-radius:999px;white-space:nowrap;text-decoration:none;transition:.15s ease;min-height:44px}
.btn:disabled{opacity:.55;cursor:default}
.btn-primary{background:var(--brand);color:#fff;box-shadow:0 8px 20px rgba(43,74,216,.22)}
.btn-primary:hover:not(:disabled){background:#2443C8;color:#fff}
.btn-line{background:var(--card);border-color:var(--line);color:var(--ink)}
.btn-line:hover:not(:disabled){border-color:#C9D0E3;color:var(--ink)}
.btn-white{background:#fff;color:var(--ink)}
.btn-ghost-dark{border-color:rgba(255,255,255,.22);color:#fff;background:transparent}
.btn-ghost-dark:hover{color:#fff;border-color:rgba(255,255,255,.4)}
.btn-sm{padding:8px 16px;min-height:38px;font-size:14px}
.pill{display:inline-flex;align-items:center;font-size:12.5px;font-weight:700;padding:5px 12px;border-radius:999px;white-space:nowrap}
.tone-empty{background:var(--paper);color:var(--muted)}
.tone-review{background:var(--brand-soft);color:var(--brand-deep)}
.tone-ok{background:var(--accent-soft);color:var(--accent-deep)}
.tone-fix{background:var(--warn-soft);color:var(--warn)}
.eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--brand-deep)}
.eyebrow::before{content:"";width:22px;height:2px;background:var(--accent);border-radius:2px}
.eyebrow.warn{color:var(--warn)}
.eyebrow.warn::before{background:var(--warn)}
.muted{color:var(--muted)}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow-s)}

/* ───── вход ───── */
.login{min-height:100vh;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.login-side{background:var(--deep);color:#fff;position:relative;overflow:hidden;padding:48px;display:flex;flex-direction:column;justify-content:space-between;gap:40px}
.login-side h1{font-size:40px;font-weight:800;line-height:1.15;max-width:15ch}
.login-side p{color:var(--deep-muted);max-width:42ch;margin-top:14px}
.login-side ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;color:#DCE2F5;font-size:15px}
.login-side li::before{content:"✓";color:var(--accent-bright);font-weight:800;margin-right:10px}
.login-main{display:grid;place-items:center;padding:40px 24px}
.login-box{width:min(420px,100%);display:flex;flex-direction:column;gap:18px}
.login-box h2{font-size:28px;font-weight:800}
.field{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:14px}
.field input{font-size:17px;padding:13px 16px;border-radius:12px;border:1px solid var(--line);background:var(--card);font-weight:600}
.field input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(43,74,216,.14)}
.pw{position:relative;display:flex}
.pw input{flex:1;min-width:0;padding-right:96px}
.pw-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);appearance:none;border:0;background:none;color:var(--brand-deep);font:inherit;font-size:13px;font-weight:700;padding:8px 10px;border-radius:8px;cursor:pointer}
.pw-eye:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
.dlg .field input{font-size:16px}
.check{display:flex;gap:10px;align-items:flex-start;font-size:13.5px;color:var(--muted)}
.check input{margin-top:3px;width:18px;height:18px;flex:none}
.error{color:#B42318;font-size:14px;font-weight:600}
.note{font-size:13.5px;color:var(--muted)}
.demo-link{appearance:none;background:none;border:0;padding:0;color:var(--brand-deep);font-weight:700;cursor:pointer;align-self:flex-start}
@media (max-width:860px){
  .login{grid-template-columns:1fr}
  .login-side{padding:32px 20px 28px;gap:20px}
  .login-side h1{font-size:28px}
  .login-side ul{display:none}
}
.deco{position:absolute;right:-60px;top:-40px;width:520px;height:520px;pointer-events:none}
@media (max-width:760px){.deco{right:-90px;top:0;width:300px;height:300px}}

/* ───── шапка ───── */
.topbar{background:var(--deep);border-bottom:1px solid rgba(255,255,255,.08)}
.topbar .wrap{display:flex;align-items:center;gap:22px;min-height:68px}
.topbar img{height:32px;width:auto;display:block}
.topbar .title{color:var(--deep-muted);font-size:14px;font-weight:600;white-space:nowrap;padding-left:22px;border-left:1px solid rgba(255,255,255,.14)}
.top-right{margin-left:auto;display:flex;align-items:center;gap:18px}
.langs{display:flex;gap:4px;font-size:13px;font-weight:700}
.langs button{appearance:none;border:0;background:none;color:var(--deep-muted);padding:4px 8px;border-radius:6px;cursor:pointer}
.langs button[aria-pressed="true"]{background:rgba(255,255,255,.12);color:#fff}
.who{display:flex;align-items:center;gap:10px;color:#fff;font-weight:700;font-size:14.5px;appearance:none;border:0;background:none;cursor:pointer;padding:0}
.avatar{width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;display:grid;place-items:center;font-weight:800;font-size:13px;flex:none}
.menu{position:absolute;right:0;top:calc(100% + 8px);background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-l);padding:6px;min-width:220px;z-index:20}
.menu button,.menu a{display:block;width:100%;text-align:left;appearance:none;border:0;background:none;padding:10px 12px;border-radius:8px;cursor:pointer;font-weight:600;font-size:14.5px;color:var(--ink)}
.menu button:hover,.menu a:hover{background:var(--paper)}
.menu .phone{padding:8px 12px;color:var(--muted);font-size:13px}

/* ───── тёмный блок ───── */
.hero{background:var(--deep);color:#fff;position:relative;overflow:hidden}
.hero-in{padding:52px 0 44px;position:relative;display:flex;flex-direction:column;gap:40px}
.hero-top{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:48px;align-items:end}
.hero-text{display:flex;flex-direction:column;gap:14px}
.hello{color:var(--deep-muted);font-size:15px;font-weight:600}
.hero h1{font-size:44px;font-weight:800;letter-spacing:-.03em;line-height:1.12;text-wrap:pretty}
.meta{color:var(--deep-muted);font-size:15px}
.switch select{appearance:none;background:rgba(255,255,255,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B7C0E0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center/16px;border:1px solid var(--deep-line);color:#fff;border-radius:10px;padding:8px 38px 8px 12px;font-weight:600;font-size:14px;max-width:100%}
.switch option{color:var(--ink)}
.mgr{background:rgba(255,255,255,.06);border:1px solid var(--deep-line);border-radius:18px;padding:20px;display:flex;flex-direction:column;gap:14px}
.mgr-row{display:flex;gap:14px;align-items:center}
.mgr-ava{width:52px;height:52px;border-radius:50%;background:linear-gradient(160deg,#EDF1FF,#E8F7F1);display:grid;place-items:center;font-weight:800;color:var(--brand-deep);flex:none;overflow:hidden}
.mgr-ava img{width:100%;height:100%;object-fit:cover}
.mgr-name{font-weight:700;font-size:16px}
.mgr-sub{color:var(--deep-muted);font-size:13.5px}
.mgr-btns{display:flex;gap:8px}
.mgr-btns .btn{flex:1}
.mgr-icons{display:none}
.terms{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid var(--deep-line);border-bottom:1px solid var(--deep-line)}
.term{padding:20px 0;display:flex;flex-direction:column;gap:2px}
.term span{color:var(--deep-muted);font-size:13px;font-weight:600}
.term b{font-size:26px;font-weight:800;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.term b.accent{color:var(--accent-bright)}
.steps{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px;list-style:none;margin:0;padding:0}
.steps li{display:flex;flex-direction:column;gap:10px}
.bar{height:4px;border-radius:4px;background:rgba(255,255,255,.18);display:block}
.steps .done .bar,.steps-bars .done{background:var(--accent-bright)}
.steps .current .bar,.steps-bars .current{background:#fff}
.step-name{font-size:13.5px;line-height:1.35;font-weight:600;color:var(--deep-muted)}
.done .step-name{color:#fff}
.current .step-name{color:#fff;font-weight:800}
.step-date{font-size:12.5px;color:var(--deep-muted)}
.steps-mobile{display:none}
.closed-note{background:rgba(255,255,255,.08);border:1px solid var(--deep-line);border-radius:14px;padding:14px 18px;color:#fff;font-weight:600}

/* ───── основная часть ───── */
main.wrap{padding:48px 0 72px;display:flex;flex-direction:column;gap:40px}
.need{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:32px;box-shadow:var(--shadow-l);display:grid;grid-template-columns:280px minmax(0,1fr);gap:40px}
.todo-head{display:flex;flex-direction:column;gap:10px}
.todo-head h2{font-size:26px;font-weight:800;line-height:1.2}
.todo-head p{color:var(--muted);font-size:15px}
.todo-row{display:flex;align-items:center;gap:18px;padding:18px 0;border-top:1px solid var(--line)}
.todo-row:first-child{border-top:0;padding-top:0}
.todo-row .grow{flex:1;min-width:0}
.todo-row .name{font-weight:700;font-size:16px}
.sub{color:var(--muted);font-size:14px;text-wrap:pretty;overflow-wrap:anywhere}
.sub.fix{color:var(--warn)}

.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tab{appearance:none;border:0;background:none;cursor:pointer;padding:12px 14px;margin-bottom:-1px;font-weight:700;font-size:15.5px;color:var(--muted);border-bottom:2px solid transparent;display:flex;align-items:center;gap:8px;white-space:nowrap;flex:none;min-height:48px}
.tab[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--brand)}
.count{font-size:12px;padding:0 8px;border-radius:999px;background:var(--brand-soft);color:var(--brand-deep)}
.count.warn{background:var(--warn-soft);color:var(--warn)}
.panel{display:flex;flex-direction:column;gap:12px;padding-top:24px}

.docs-head{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.legend{display:flex;gap:20px;font-size:13px;color:var(--muted);flex-wrap:wrap}
.legend span{display:flex;align-items:center;gap:8px}
.legend i{width:12px;height:12px;border-radius:4px;display:block}
.doc{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:18px 20px;display:flex;align-items:center;gap:18px;box-shadow:0 1px 2px rgba(19,28,61,.05)}
.doc.fix{border-color:var(--warn-line);background:var(--warn-bg)}
.doc .grow{flex:1;min-width:0}
.doc .name{font-weight:700;font-size:15.5px}
.doc .files{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:13.5px}
.doc-actions{display:flex;align-items:center;gap:12px;flex:none}
.doc-actions .btn{min-width:112px}
.marks{display:flex;gap:6px;flex:none}
.mark{width:24px;height:24px;border-radius:7px;display:grid;place-items:center;flex:none}
.mark svg{width:15px;height:15px;fill:none;stroke:#fff;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}
.mark.up{background:var(--brand)}
.mark.ok{background:var(--accent)}
.mark.fix{background:var(--warn);color:#fff;font-weight:900;font-size:14px}
.mark.none{border:2px solid #C9D0E3}
.mark.wait{border:2px solid var(--line)}
.uploading{font-size:13.5px;color:var(--brand-deep);font-weight:600}

.timeline{padding:8px 28px}
.work{display:grid;grid-template-columns:40px 110px minmax(0,1fr);gap:20px;padding:20px 0;border-bottom:1px solid var(--line);align-items:start}
.work:last-child{border-bottom:0}
.tick{width:28px;height:28px;border-radius:50%;background:var(--accent-soft);display:grid;place-items:center}
.tick svg{width:15px;height:15px;fill:none;stroke:var(--accent-deep);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.work .date{font-weight:700;font-size:14.5px}
.work .who{color:var(--muted);font-size:13px}
.work .title{font-weight:700;font-size:16px;line-height:1.4}
.work .detail{color:var(--muted);font-size:14.5px;margin-top:4px;text-wrap:pretty}
.empty-state{padding:28px;text-align:center;color:var(--muted)}

.papers-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:24px;align-items:start}
.papers{padding:4px 28px}
.paper{display:flex;align-items:center;gap:16px;padding:18px 0;border-bottom:1px solid var(--line)}
.paper:last-child{border-bottom:0}
.paper-ico{width:42px;height:42px;border-radius:12px;background:var(--brand-soft);color:var(--brand-deep);display:grid;place-items:center;flex:none}
.paper-ico svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.paper .grow{flex:1;min-width:0}
.paper .name{font-weight:700;font-size:15.5px}
.paper .sum{font-weight:800;font-size:16px;font-variant-numeric:tabular-nums;white-space:nowrap}
.paper-actions{display:flex;gap:8px;align-items:center;flex:none}
.link-btn{appearance:none;border:0;background:none;padding:0;font-weight:700;font-size:14px;color:var(--brand-deep);cursor:pointer;white-space:nowrap}
.decision{padding:24px;display:flex;flex-direction:column;gap:10px}
.decision h3{font-size:17px;font-weight:700}
.decision .lead{font-weight:700;font-size:16px;line-height:1.4}
.decision.approved{border-color:#BFE8D6}

.chat{max-width:820px;padding:28px;display:flex;flex-direction:column;gap:14px}
.msgs{display:flex;flex-direction:column;gap:14px;max-height:56vh;overflow-y:auto;padding-right:4px}
.msg{display:flex}
.msg.mine{justify-content:flex-end}
.bubble{max-width:72%;background:var(--paper);border-radius:16px;padding:12px 16px;display:flex;flex-direction:column;gap:2px;white-space:pre-wrap;overflow-wrap:anywhere}
.mine .bubble{background:var(--brand-soft)}
.bubble .by{font-size:12.5px;color:var(--muted)}
.bubble .by b{color:var(--ink)}
.chat form{display:flex;gap:10px;margin-top:8px}
.chat textarea{flex:1;min-width:0;font-size:15.5px;background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:12px 14px;resize:none;min-height:48px;max-height:160px}

footer{background:var(--card);border-top:1px solid var(--line)}
footer .wrap{padding:24px 0;display:flex;justify-content:space-between;gap:16px;color:var(--muted);font-size:13px;flex-wrap:wrap}
footer a{color:var(--ink);font-weight:700}

/* ───── окно подписи ───── */
dialog{border:0;border-radius:20px;padding:0;width:min(480px,calc(100% - 32px));box-shadow:var(--shadow-l);color:var(--ink)}
dialog::backdrop{background:rgba(19,28,61,.45)}
.dlg{padding:28px;display:flex;flex-direction:column;gap:16px}
.dlg h3{font-size:21px;font-weight:800}
.dlg .choices{display:flex;flex-direction:column;gap:10px}
.choice{appearance:none;text-align:left;border:1px solid var(--line);background:var(--card);border-radius:14px;padding:16px;cursor:pointer;display:flex;flex-direction:column;gap:2px}
.choice:hover{border-color:var(--brand)}
.choice b{font-size:15.5px}
.choice span{font-size:13.5px;color:var(--muted)}
.dlg-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}

.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:12px 20px;border-radius:12px;font-weight:600;font-size:14.5px;box-shadow:var(--shadow-l);z-index:50;max-width:calc(100% - 32px)}
.loading{min-height:60vh;display:grid;place-items:center;color:var(--muted)}

/* ───── телефон (4a) ───── */
@media (max-width:760px){
  .topbar{display:none}
  .hero-in{padding:52px 0 24px;gap:20px}
  .hero-top{grid-template-columns:1fr;gap:20px}
  .hero-text{gap:8px}
  .hello{font-size:14px}
  .hero h1{font-size:28px;line-height:1.15}
  .meta{font-size:13.5px}
  .mobile-bar{display:flex !important;align-items:center;gap:12px;position:relative}
  .mobile-bar img{height:26px;width:auto}
  .mobile-bar .langs{margin-left:auto;font-size:12.5px;gap:2px}
  .mobile-bar .avatar{width:32px;height:32px;font-size:12px}
  .terms{grid-template-columns:1fr 1fr;border-bottom:0}
  .term{padding:12px 0;border-bottom:1px solid var(--deep-line)}
  .term span{font-size:12.5px}
  .term b{font-size:19px}
  .steps{display:none}
  .steps-mobile{display:flex;flex-direction:column;gap:10px}
  .steps-mobile .row{display:flex;justify-content:space-between;gap:10px;font-size:13.5px;line-height:1.4}
  .steps-mobile .row span{color:var(--deep-muted);white-space:nowrap}
  .steps-bars{display:flex;gap:4px}
  .steps-bars i{flex:1;height:4px;border-radius:4px;background:rgba(255,255,255,.18)}
  .mgr{border-radius:16px;padding:14px;flex-direction:row;align-items:center;gap:12px}
  .mgr-row{flex:1;min-width:0;gap:12px}
  .mgr-ava{width:44px;height:44px}
  .mgr-name{font-size:15px}
  .mgr-sub{font-size:12.5px}
  .mgr-btns{display:none}
  .mgr-icons{display:flex;gap:8px}
  .icon-btn{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;flex:none;background:#fff;color:var(--ink)}
  .icon-btn.ghost{background:transparent;border:1px solid rgba(255,255,255,.22);color:#fff}
  .icon-btn svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
  main.wrap{padding:20px 0 32px;gap:20px}
  .need{grid-template-columns:1fr;gap:4px;padding:20px;border-radius:18px}
  .todo-head h2{font-size:21px;margin:4px 0 8px}
  .todo-head p{display:none}
  .todo-row{flex-direction:column;align-items:stretch;gap:10px;padding:14px 0}
  .todo-row:first-child{border-top:1px solid var(--line);padding-top:14px}
  .todo-row .name{font-size:15px;line-height:1.4}
  .todo-row .btn{min-height:48px;font-size:15px}
  .tabs{margin:0 -16px;padding:0 16px;gap:2px}
  .tab{padding:12px 10px;font-size:14.5px}
  .panel{padding-top:16px;gap:10px}
  .docs-head .legend{display:none}
  .legend-bottom{display:flex !important}
  .doc{flex-wrap:wrap;padding:14px;gap:12px;align-items:flex-start}
  .doc .grow{flex-basis:calc(100% - 60px)}
  .doc .name{font-size:14.5px;line-height:1.4}
  .doc .sub{font-size:13px}
  .marks{gap:4px;padding-top:1px}
  .mark{width:22px;height:22px;border-radius:6px}
  .doc-actions{width:100%;justify-content:space-between}
  .doc-actions .btn{min-width:0}
  .timeline{padding:18px}
  .work{grid-template-columns:26px minmax(0,1fr);gap:12px;padding:0 0 18px;border:0}
  .work .when{display:none}
  .work .date-m{display:block !important;font-size:12px;color:var(--muted);font-weight:600}
  .work .title{font-size:14.5px}
  .work .detail{font-size:13.5px}
  .papers-grid{grid-template-columns:1fr;gap:12px}
  .papers{padding:4px 16px}
  .paper{flex-wrap:wrap;gap:12px;padding:14px 0}
  .paper .grow{flex-basis:calc(100% - 54px)}
  .paper-ico{width:38px;height:38px;border-radius:10px}
  .paper .name{font-size:14.5px;line-height:1.35}
  .paper-actions{width:100%;padding-left:50px;flex-wrap:wrap}
  .paper .sum{font-size:13.5px}
  .decision{padding:18px}
  .chat{padding:16px;border-radius:16px}
  .bubble{max-width:85%}
  .chat textarea{border-radius:24px;padding:12px 16px;background:var(--card)}
  footer{background:none;border:0}
  footer .wrap{justify-content:center;text-align:center;font-size:12px;padding:8px 0 24px}
}
.mobile-bar,.legend-bottom,.date-m{display:none}
.m-only{display:none}
@media (max-width:760px){.d-only{display:none !important}.m-only{display:inline}}
/* 4a: на телефоне карточка менеджера — под этапами */
@media (max-width:760px){
  .hero-top{display:contents}
  .mobile-bar{order:0}.hero-text{order:1}.closed-note{order:2}.terms{order:3}.steps-mobile{order:4}.mgr{order:5}
}
