/* Кабинет клиента ProfitStats — стиль по утверждённому макету (ref.jpg, 28.09.2026) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+20BD; }

:root {
  --bg: #F5F5F8; --card: #fff; --line: #ECECF2; --line2: #E2E2EA;
  --ink: #16161D; --ink2: #3A3A48; --mute: #6B6B80; --mute2: #9A9AAE;
  --vio: #7C3AED; --vio-d: #6D28D9; --vio-l: #F3EEFE; --vio-l2: #EDE4FD; --vio-m: #C4B0F7;
  --green: #22A35A; --green-l: #E8F7EE; --red: #E5484D; --red-l: #FDECEC; --orange: #E8762B; --orange-l: #FEF1E6;
  --r: 16px; --r-s: 12px; --r-xs: 10px; --tap: 44px;
  --sh: 0 1px 2px rgba(20, 20, 40, .04), 0 4px 16px rgba(20, 20, 40, .04);
  --side: 262px; --aside: 330px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--vio); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
.hidden { display: none !important; }
.mute { color: var(--mute); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 20px; padding: 14px 20px 14px 14px;
  min-height: 100vh; max-width: 1680px; margin: 0 auto; }
.side { position: sticky; top: 14px; height: calc(100vh - 28px); background: var(--card); border-radius: var(--r);
  box-shadow: var(--sh); display: flex; flex-direction: column; padding: 20px 12px 12px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 21px; letter-spacing: -.03em;
  padding: 2px 10px 22px; color: var(--ink); text-decoration: none; }
.logo .bars { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.logo .bars i { display: block; width: 5px; border-radius: 2px; background: var(--vio); }
.logo .bars i:nth-child(1) { height: 11px; opacity: .75 } .logo .bars i:nth-child(2) { height: 17px; opacity: .88 }
.logo .bars i:nth-child(3) { height: 22px }
.nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 10px 0 12px;
  border-radius: var(--r-s); color: var(--ink2); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.nav a:hover { background: #F7F5FC; }
.nav a.on { background: var(--vio-l); color: var(--vio); font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--vio); }
.nav a .i { color: currentColor; }
.nav .badge { margin-left: auto; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--vio-l2); color: var(--vio); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.nav a.on .badge { background: #E4D8FC; }
.badge.orange { background: var(--orange-l); color: var(--orange); font-weight: 500; font-size: 10.5px; padding: 0 6px; height: 22px; }
.badge.green { background: var(--green-l); color: var(--green); }
.badge.red { background: var(--red-l); color: var(--red); }
.badge.gray { background: #F0F0F4; color: var(--mute); }
.side .who { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 4px; display: flex;
  align-items: center; gap: 12px; }
.who .nm { font-weight: 600; font-size: 14px; line-height: 1.3; }
.who .co { font-size: 12.5px; color: var(--mute); line-height: 1.3; }
.who button { margin-left: auto; }
.ava { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600;
  background: linear-gradient(135deg, #EDE4FD, #D9C8FB); color: var(--vio-d); overflow: hidden; font-size: 15px; }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava.lg { width: 72px; height: 72px; font-size: 24px; }

.main { min-width: 0; padding-top: 6px; }
.top { display: flex; align-items: center; gap: 12px; min-height: 52px; margin-bottom: 6px; }
.top h1 { font-size: 30px; font-weight: 700; line-height: 1.15; margin-right: auto; }
.iconbtn { position: relative; width: var(--tap); height: var(--tap); border-radius: var(--r-s); border: 1px solid var(--line2);
  background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--ink2); }
.iconbtn:hover { border-color: var(--vio-m); color: var(--vio); }
.iconbtn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px #fff; }
.pill { display: inline-flex; align-items: center; gap: 10px; height: var(--tap); padding: 0 18px; border-radius: var(--r-s);
  border: 1px solid var(--line2); background: var(--card); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.pill .i { color: var(--vio); }

/* ---------- этапы ---------- */
.stages { display: grid; grid-template-columns: repeat(7, 1fr); margin: 8px 0 18px; position: relative; }
.stg { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  font-size: 13px; color: var(--ink2); }
.stg::before { content: ""; position: absolute; top: 15px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px;
  background: var(--line2); }
.stg:first-child::before { display: none; }
.stg.done::before, .stg.cur::before { background: var(--vio); }
.stg .c { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line2); background: #fff;
  display: grid; place-items: center; font-size: 13px; color: var(--mute); z-index: 1; }
.stg.done .c { background: var(--vio); border-color: var(--vio); color: #fff; }
.stg.cur .c { background: var(--vio); border-color: var(--vio); color: #fff; font-weight: 600;
  box-shadow: 0 0 0 4px var(--vio-l2); }
.stg .t { font-weight: 500; line-height: 1.25; }
.stg.cur .t { font-weight: 600; color: var(--ink); }
.stg .dl { font-size: 12px; color: var(--mute); margin-top: -4px; }
.stg .c .i { width: 16px; height: 16px; stroke-width: 2.4; }

/* ---------- сетка раздела ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) var(--aside); gap: 20px; align-items: start; }
.aside { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 20px; }
.card.pad0 { padding: 0; }
.card h2 { font-size: 21px; font-weight: 700; }
.card h3 { font-size: 16px; font-weight: 700; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-h h2, .card-h h3 { margin-right: auto; }
.card-h a.more { color: var(--ink2); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.card-h a.more:hover { background: var(--vio-l); color: var(--vio); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

.bar { height: 8px; border-radius: 99px; background: #EEEEF3; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8B5CF6, var(--vio)); }
.bar.lg { height: 10px; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
  padding: 0 18px; border-radius: var(--r-xs); border: 1px solid transparent; background: var(--vio); color: #fff;
  font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--vio-d); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line2); font-weight: 500; }
.btn.ghost:hover { border-color: var(--vio-m); color: var(--vio); }
.btn.soft { background: var(--vio-l); color: var(--vio); font-weight: 500; }
.btn.soft:hover { background: var(--vio-l2); }
.btn.danger { background: var(--red-l); color: var(--red); border-color: #F8C9CA; font-weight: 500; }
.btn.danger:hover { background: #FBDADB; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--vio); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(124, 58, 237, .45); cursor: pointer; font-size: 13.5px; font-weight: 500; }
.link.on { color: var(--orange); text-decoration-color: rgba(232, 118, 43, .5); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink2); }
.in, textarea.in, select.in { width: 100%; min-height: var(--tap); padding: 10px 14px; border: 1px solid var(--line2);
  border-radius: var(--r-xs); background: #fff; outline: none; font-size: 15px; color: var(--ink); }
textarea.in { resize: vertical; line-height: 1.6; min-height: 120px; }
.in:focus { border-color: var(--vio); box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.form { display: grid; gap: 14px; }
.form.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.err { color: var(--red); font-size: 13.5px; }

/* ---------- интервью ---------- */
.blocks-nav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px; scrollbar-width: thin; }
.blocks-nav button { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line2); background: #fff; cursor: pointer; font-size: 13.5px;
  font-weight: 500; color: var(--ink2); }
.blocks-nav button.on { background: var(--vio); border-color: var(--vio); color: #fff; }
.blocks-nav button .n { font-size: 12px; opacity: .7; }
.blocks-nav button.full:not(.on) { border-color: #BFE6CD; }
.blocks-nav button.full:not(.on) .n { color: var(--green); opacity: 1; }
.iv-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.iv-head h2 { margin-right: auto; }
.iv-head .cnt { font-size: 14px; font-weight: 500; color: var(--ink2); white-space: nowrap; }
.iv-head .ivbar { width: 140px; }
.q { border: 1px solid var(--line); border-radius: var(--r-s); padding: 18px 18px 14px; background: #fff; }
.q + .q { margin-top: 14px; }
.q-t { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.q-t .num { flex: none; width: 28px; height: 28px; border-radius: 8px; background: #F2F2F6; display: grid;
  place-items: center; font-size: 13px; font-weight: 600; color: var(--ink2); }
.q-t .tx { font-weight: 600; font-size: 15.5px; line-height: 1.4; padding-top: 2px; }
.q-t .tx .req { color: var(--vio); margin-left: 2px; }
.q-t .hint { font-weight: 400; font-size: 13.5px; color: var(--mute); margin-top: 4px; }
.q textarea.in { min-height: 96px; }
.q-f { display: flex; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.saved { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--mute); }
.saved .ok { width: 20px; height: 20px; border-radius: 50%; background: var(--green); display: grid; place-items: center;
  color: #fff; }
.saved .ok .i { width: 13px; height: 13px; stroke-width: 3; }
.saved.wait .ok { background: var(--mute2); }
.saved.fail { color: var(--red); } .saved.fail .ok { background: var(--red); }
.q-f .voice-btn { margin-left: auto; }
.rec { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line2); border-radius: var(--r-s);
  padding: 10px 12px 10px 16px; min-height: 60px; background: #fff; }
.rec .rdot { width: 32px; height: 32px; border-radius: 50%; background: var(--red-l); display: grid; place-items: center; flex: none; }
.rec .rdot i { width: 14px; height: 14px; border-radius: 50%; background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(.75); opacity: .6; } }
.rec .time { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; min-width: 48px; }
.rec .left { font-size: 12px; color: var(--mute); white-space: nowrap; }
.rec canvas { flex: 1; min-width: 60px; height: 40px; }
.rec .stop { background: var(--red-l); color: var(--red); border: 1px solid #F8C9CA; font-weight: 500; }
.rec .stop:hover { background: #FBDADB; }
.rec .stop .sq { width: 12px; height: 12px; border-radius: 2px; background: var(--red); }
.busy { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-s); background: var(--vio-l);
  color: var(--vio-d); font-size: 14px; font-weight: 500; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--vio-m); border-top-color: var(--vio);
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.player { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line2); border-radius: var(--r-s);
  padding: 8px 10px 8px 12px; margin-bottom: 10px; background: #fff; }
.player .pp { width: 32px; height: 32px; border-radius: 50%; background: var(--vio); border: 0; color: #fff; display: grid;
  place-items: center; cursor: pointer; flex: none; }
.player .pp .i { width: 14px; height: 14px; fill: #fff; stroke: none; }
.player .track { position: relative; flex: 1; height: 4px; border-radius: 4px; background: #E6E6EE; cursor: pointer; }
.player .track::after { content: ""; position: absolute; inset: -12px 0; }
.player .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--vio); width: 0; }
.player .track b { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--vio); left: 0; box-shadow: 0 0 0 3px #fff; }
.player .tm { font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.player .spd { min-width: 52px; height: 32px; border-radius: 16px; border: 0; background: #F0F0F4; font-weight: 600;
  font-size: 13px; cursor: pointer; }
.player .menu { width: 32px; height: 32px; border: 0; background: none; cursor: pointer; border-radius: 8px; color: var(--ink2);
  display: grid; place-items: center; }
.player .menu:hover { background: #F2F2F6; }
.ai-note { display: flex; align-items: center; gap: 10px; background: var(--vio-l); color: var(--vio-d); font-size: 13.5px;
  font-weight: 500; padding: 9px 14px; border-radius: var(--r-xs) var(--r-xs) 0 0; border: 1px solid var(--vio-l2);
  border-bottom: 0; }
.ai-note + textarea.in { border-top-left-radius: 0; border-top-right-radius: 0; }
.ai-note .i { color: var(--vio); }
.v-err { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--red-l); color: #B42318;
  padding: 10px 14px; border-radius: var(--r-xs); font-size: 13.5px; margin-bottom: 10px; }
.v-err .btn { margin-left: auto; }
.older { font-size: 13px; margin: -2px 0 10px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 16px;
  border: 1px solid var(--line2); border-radius: 999px; cursor: pointer; font-size: 14px; background: #fff; user-select: none; }
.choices label:hover { border-color: var(--vio-m); }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices label.on { background: var(--vio-l); border-color: var(--vio); color: var(--vio-d); font-weight: 500; }
.choices label .ck { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--mute2); display: grid;
  place-items: center; flex: none; }
.choices label.radio .ck { border-radius: 50%; }
.choices label.on .ck { background: var(--vio); border-color: var(--vio); color: #fff; }
.choices label .ck .i { width: 12px; height: 12px; stroke-width: 3; }
.links-list { display: flex; flex-direction: column; gap: 10px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) var(--tap); gap: 8px; }
.q-extra { margin-top: 10px; }
.iv-nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 16px; flex-wrap: wrap; }

/* ---------- боковые карточки ---------- */
.mgr { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.mgr .nm { font-weight: 700; font-size: 16px; }
.mgr .ps { color: var(--mute); font-size: 14px; }
.thumb { display: block; border-radius: var(--r-xs); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16/10;
  background: #F2F2F6; margin-bottom: 12px; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.pay-l { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; font-size: 14.5px; }
.pay-l b { font-size: 17px; }
.pay-bar { display: flex; align-items: center; gap: 12px; }
.pay-bar .bar { flex: 1; }
.pay-bar span { font-size: 13.5px; color: var(--ink2); }
.tl { position: relative; display: flex; flex-direction: column; gap: 14px; padding-left: 20px; }
.tl::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--vio-l2); }
.tl > div { position: relative; display: grid; grid-template-columns: 84px 1fr; gap: 8px; font-size: 13.5px; }
.tl > div::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--vio); box-shadow: 0 0 0 3px var(--vio-l); }
.tl .d { color: var(--ink2); font-weight: 500; white-space: nowrap; }
.tl .x { color: var(--ink2); }

/* ---------- списки ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.li .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--vio-l); color: var(--vio); display: grid;
  place-items: center; flex: none; }
.li .b { min-width: 0; flex: 1; }
.li .b .t { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.li .b .s { font-size: 13px; color: var(--mute); }
.task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-s); background: var(--vio-l);
  color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.task + .task { margin-top: 8px; }
.task .i { color: var(--vio); }
.task .due { margin-left: auto; font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.task.ours { background: #F4F4F7; }
.empty { text-align: center; color: var(--mute); padding: 28px 12px; font-size: 14.5px; }
.empty .i { width: 36px; height: 36px; color: var(--mute2); margin-bottom: 8px; stroke-width: 1.4; }
.loadfail { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r-s);
  background: var(--red-l); color: #B42318; font-weight: 500; }
.loadfail .btn { margin-left: auto; }
.turn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-s); font-weight: 500; }
.turn.client { background: var(--orange-l); color: #9A4A12; }
.turn.us { background: var(--green-l); color: #146C3B; }

/* ---------- дизайны ---------- */
.dz { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.dz-img { position: relative; border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--line); background: #F2F2F6;
  cursor: crosshair; user-select: none; }
.dz-img img { display: block; width: 100%; height: auto; pointer-events: none; }
.pin { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50% 50% 50% 4px;
  background: var(--vio); color: #fff; font-size: 12.5px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(80, 30, 160, .35); border: 2px solid #fff; cursor: pointer; }
.pin.new { background: var(--orange); }
.pin.admin { background: #0EA5E9; }
.cm { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.cm:first-child { border-top: 0; }
.cm .n { width: 24px; height: 24px; border-radius: 50%; background: var(--vio); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; flex: none; }
.cm .n.admin { background: #0EA5E9; }
.cm .n.gen { background: var(--mute2); }
.cm .who { font-size: 12px; color: var(--mute); }
.cm .del { margin-left: auto; }
.vers { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.st-review { background: var(--orange-l); color: var(--orange); }
.st-approved { background: var(--green-l); color: var(--green); }
.st-rework { background: #F0F0F4; color: var(--mute); }

/* ---------- чат ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 420px; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; }
.msg { max-width: 72%; padding: 10px 14px; border-radius: 14px; background: #F2F2F6; font-size: 14.5px; white-space: pre-wrap;
  overflow-wrap: anywhere; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.mine { align-self: flex-end; background: var(--vio); color: #fff; border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.msg .m { font-size: 11.5px; opacity: .7; margin-top: 4px; text-align: right; }
.msg a { color: inherit; font-weight: 600; }
.composer { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.composer textarea { min-height: var(--tap); height: var(--tap); max-height: 160px; resize: none; }
.day { align-self: center; font-size: 12px; color: var(--mute); background: #F2F2F6; padding: 3px 10px; border-radius: 99px; }

/* ---------- таблица ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--mute); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tblwrap { overflow-x: auto; }
.chart svg { width: 100%; height: auto; display: block; }
.note { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-s); background: #F4F4F7;
  color: var(--ink2); font-size: 13.5px; }

/* ---------- всплывающее ---------- */
.pop { position: absolute; z-index: 30; width: 360px; max-width: calc(100vw - 24px); background: #fff; border-radius: var(--r);
  box-shadow: 0 12px 40px rgba(20, 20, 40, .18); border: 1px solid var(--line); padding: 8px; }
.pop .it { display: block; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--ink); text-decoration: none; }
.pop .it:hover { background: #F7F5FC; }
.pop .it.new { background: var(--vio-l); }
.pop .it .d { font-size: 12px; color: var(--mute); }
.modal-bg { position: fixed; inset: 0; background: rgba(20, 20, 35, .42); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: var(--r); width: 100%; max-width: 480px; padding: 22px; max-height: calc(100vh - 32px);
  overflow-y: auto; box-shadow: 0 20px 60px rgba(20, 20, 40, .25); }
.modal h3 { font-size: 19px; margin-bottom: 14px; }
.modal .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: #1E1E2A; color: #fff;
  padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); }
.toast.err { background: #B42318; }
.cred { background: #F7F5FC; border: 1px dashed var(--vio-m); border-radius: var(--r-s); padding: 14px; font-size: 14.5px;
  overflow-wrap: anywhere; }
.cred code { font-size: 15px; font-weight: 600; }

/* ---------- мобильная панель ---------- */
.tabbar { display: none; }
.mtop { display: none; }

/* ---------- адаптив ---------- */
@media (max-width: 1279px) {
  :root { --aside: 300px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dz { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  :root { --side: 208px; }
  .shell { gap: 16px; padding: 12px 14px 12px 12px; }
  .top h1 { font-size: 26px; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  body { font-size: 15px; }
  .shell { display: block; padding: 0 12px calc(84px + env(safe-area-inset-bottom)); }
  .side { display: none; }
  .mtop { display: flex; align-items: center; gap: 10px; padding: 10px 0 4px; }
  .mtop .logo { padding: 0; font-size: 19px; margin-right: auto; }
  .top { margin: 6px 0 4px; min-height: 0; }
  .top h1 { font-size: 23px; }
  .top .pill, .top .iconbtn { display: none; }
  .stages { display: flex; overflow-x: auto; gap: 0; margin: 6px -12px 12px; padding: 0 12px 4px; scrollbar-width: none; }
  .stg { flex: 0 0 88px; font-size: 12px; }
  .aside, .grid2, .grid3, .form.two { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .q { padding: 14px 14px 12px; }
  .iv-head { flex-wrap: wrap; gap: 8px 12px; }
  .iv-head .ivbar { width: 100%; order: 3; }
  .task { flex-wrap: wrap; }
  .task > span:not(.due) { flex: 1 1 60%; }
  .q-f { gap: 10px 14px; }
  .q-f .voice-btn { margin-left: 0; width: 100%; min-height: 52px; font-size: 15.5px; }
  .rec { flex-wrap: wrap; gap: 10px 14px; padding: 12px; }
  .rec canvas { order: 5; flex-basis: 100%; }
  .rec .stop { margin-left: auto; min-height: 52px; padding: 0 24px; font-size: 15.5px; }
  .link-row { grid-template-columns: minmax(0, 1fr) var(--tap); }
  .link-row .in:nth-child(2) { grid-column: 1; }
  .link-row .btn { grid-row: 1; grid-column: 2; }
  .msg { max-width: 88%; }
  .chat { height: calc(100vh - 210px); }
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: blur(8px); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; min-height: 52px; color: var(--mute); text-decoration: none; font-size: 11px; font-weight: 500; background: none; border: 0;
    border-radius: 12px; cursor: pointer; }
  .tabbar .on { color: var(--vio); background: var(--vio-l); }
  .tabbar .dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
  .tbl.resp thead { display: none; }
  .tbl.resp tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tbl.resp td { border: 0; padding: 0; text-align: left !important; }
  .tbl.resp td[data-l]::before { content: attr(data-l) ": "; color: var(--mute); font-size: 12.5px; }
  .pop { position: fixed; left: 12px !important; right: 12px; top: 60px !important; width: auto; }
}

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 420px; padding: 32px 28px; }
.auth .logo { justify-content: center; padding: 0 0 20px; }
.auth h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.auth p.lead { text-align: center; color: var(--mute); margin: 0 0 22px; font-size: 14.5px; }
