/* Стиль по proverengrp.ru: Segoe UI, тёмно-синий текст, светло-голубой фон, оранжевый акцент */
:root {
  --bg: #edf3f8;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --fg: #0f172a;
  --fg-2: #1e293b;
  --muted: #475569;
  --muted-2: #64748b;
  --line: #cbd5e1;
  --line-2: #e2e8f0;
  --brand: #7fbad3;
  --brand-dark: #4b89a9;
  --brand-soft: rgba(127, 186, 211, .15);
  --accent: #ed6b20;
  --accent-soft: rgba(237, 107, 32, .1);
  --cta: #ff7a00;
  --navy: #0f172a;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px rgba(15, 23, 42, .06);
  --cta-shadow: 0 10px 15px -3px rgba(255, 149, 0, .25), 0 4px 6px -2px rgba(255, 149, 0, .2);
  --radius: .875rem;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font: 15px/1.55 "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.hidden { display: none !important; }
.only-mobile { display: none !important; }

/* header; в полноэкранном режиме Telegram отдаёт безопасные отступы через CSS-переменные */
.top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line-2);
  padding-top: calc(10px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); }
#fsBtn { color: var(--muted); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--fg); text-decoration: none; white-space: nowrap; }
.brand img { width: 28px; height: 28px; }
.brand span { font-size: 16px; }
.tabs { display: flex; flex: 1; max-width: 520px; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.tab { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--muted); padding: 8px 6px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.tab.active { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 8px; color: var(--fg); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:active { background: var(--surface-2); }
#menuBtn { display: none; }
.eyebrow { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 9999px; padding: 3px 10px; margin-bottom: 8px; }

/* layout */
.body { display: flex; flex: 1; min-height: 0; position: relative; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; overflow-y: auto; padding: 6px 0 24px; }

/* sidebar */
.sidebar { width: 300px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; background: var(--surface); }
.sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-weight: 700; font-size: 16px; border-bottom: 1px solid var(--line-2); }
.sidebar-actions { display: flex; gap: 4px; align-items: center; }
.session-list { overflow-y: auto; flex: 1; padding: 8px; }
.session { padding: 10px 12px; border-radius: 10px; cursor: pointer; margin-bottom: 4px; border: 1px solid transparent; }
.session:hover { background: var(--surface-2); }
.session.active { background: var(--brand-soft); border-color: rgba(127, 186, 211, .5); }
.session .t { font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--fg); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.session .d { color: var(--muted-2); font-size: 12px; margin-top: 5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 9px; border-radius: 9999px; background: var(--surface-2); color: var(--muted); }
.badge.running, .badge.queued { background: var(--accent-soft); color: var(--accent); }
.badge.done { background: #dcfce7; color: #166534; }
.badge.error { background: #fee2e2; color: #991b1b; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.running .dot, .badge.queued .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* messages */
.messages { flex: 1; overflow-y: auto; padding: 14px 12px 6px; }
.messages > * { max-width: 860px; }
.messages .msg.user { margin-left: auto; }
.messages.static { flex: none; overflow: visible; }
.msg { max-width: 88%; margin: 0 0 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); word-wrap: break-word; }
.msg.user { background: var(--navy); color: #fff; border-color: var(--navy); margin-left: auto; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg.assistant { border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.msg .meta { color: var(--muted-2); font-size: 11.5px; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.msg .meta .who { font-weight: 700; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.msg.assistant h2 { font-size: 16px; margin: 14px 0 6px; color: var(--fg); }
.msg.assistant h3 { font-size: 14.5px; margin: 10px 0 4px; color: var(--fg-2); }
.msg.assistant h2:first-child, .msg.assistant h3:first-child { margin-top: 0; }
.msg.assistant p { margin: 6px 0; color: var(--fg-2); }
.msg.assistant ul { margin: 4px 0 8px 18px; padding: 0; }
.msg.assistant li { margin: 3px 0; }
.msg.assistant hr { border: 0; border-top: 2px solid var(--accent-soft); margin: 14px 0; }
.msg.assistant pre { white-space: pre-wrap; font-size: 12px; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; overflow-x: auto; }
.msg.assistant .tbl { overflow-x: auto; margin: 8px 0 10px; }
.msg.assistant table { border-collapse: collapse; width: 100%; font-size: 13px; }
.msg.assistant th, .msg.assistant td { border: 1px solid var(--line-2); padding: 6px 8px; text-align: left; vertical-align: top; }
.msg.assistant th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.msg.assistant td:not(:first-child) { white-space: nowrap; }
.msg.assistant a { color: var(--brand-dark); }

/* отчёт по разделам */
.report .hero { padding: 4px 0 10px; }
.report .hero p { font-size: 15px; }
.report details { border-top: 1px solid var(--line-2); padding: 2px 0; }
.report details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 11px 0; font-weight: 700; font-size: 15px; color: var(--fg); }
.report details > summary::-webkit-details-marker { display: none; }
.report details > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted-2); border-bottom: 2px solid var(--muted-2); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-left: 2px; }
.report details[open] > summary::before { transform: rotate(45deg); }
.report details > div { padding: 0 0 10px; }
.report details > div > *:first-child { margin-top: 0; }

/* дашборд проверки */
.dash { margin: 0 12px 10px; }
.dash .vcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.dash .vcard .vname { font-weight: 700; font-size: 16px; }
.dash .vcard .vsub { color: var(--muted-2); font-size: 12.5px; margin-top: 2px; }
.dash .vbig { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; padding: 8px 14px; border-radius: 10px; border: 1px solid transparent; }
.dash .vbig.good { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.dash .vbig.warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.dash .vbig.bad { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.dash .vbig.critical { background: #991b1b; color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 68px; }
.tile .l { font-size: 11.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .03em; font-weight: 700; }
.tile .v { font-size: 17px; font-weight: 700; color: var(--fg); margin-top: 3px; line-height: 1.2; word-break: break-word; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tile.good { border-left-color: #16a34a; }
.tile.warn { border-left-color: #d97706; }
.tile.bad { border-left-color: #dc2626; }
.tile .v .ic { font-size: 13px; margin-right: 4px; }
.dash .cost { margin-top: 8px; font-size: 12px; color: var(--muted-2); }
.msg.assistant code { background: var(--surface-2); padding: 0 4px; border-radius: 4px; font-size: 13px; }
.msg .actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

.empty { margin: 24px auto; max-width: 360px; text-align: center; padding: 26px 20px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.empty .icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-dark); display: flex; align-items: center; justify-content: center; }
.empty h3 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.empty ol { text-align: left; margin: 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; }
.empty ol li { margin: 5px 0; }

.job-bar { margin: 0 12px 8px; padding: 11px 14px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 13.5px; display: flex; gap: 10px; align-items: center; }
.job-bar.error { background: #fee2e2; color: #991b1b; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.status { margin: 0 12px 8px; color: var(--muted); font-size: 13px; }
.status.error { color: #b91c1c; }

/* composer */
.composer { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line-2); }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.attach { color: var(--muted); padding: 9px 6px; }
textarea#input { flex: 1; min-width: 0; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: var(--fg); background: var(--surface); max-height: 140px; outline: none; }
textarea#input:focus { border-color: var(--brand-dark); box-shadow: 0 0 0 3px var(--brand-soft); }
.send-btn { border: 0; width: 42px; height: 42px; border-radius: 10px; background: var(--cta); color: #fff; box-shadow: var(--cta-shadow); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.send-btn svg { margin-left: 2px; }
.send-btn:disabled { opacity: .5; box-shadow: none; }
.pdf-badge { display: inline-flex; gap: 8px; align-items: center; background: var(--brand-soft); color: var(--fg); border-radius: 8px; padding: 6px 10px; margin: 0 0 8px 44px; font-size: 13px; max-width: calc(100% - 44px); }
.pdf-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-badge button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 2px; }

/* cards */
.card { margin: 10px 12px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.card-title { font-weight: 700; font-size: 16.5px; margin-bottom: 8px; }
.card p { margin: 0 0 10px; }
.card.profile { display: flex; gap: 14px; align-items: center; }
.card.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.card.dark .muted { color: #cbd5e1; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-dark); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: none; }
.muted { color: var(--muted); font-size: 13.5px; }
.access { margin-bottom: 12px; }
.access .pill { display: inline-block; margin-bottom: 8px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); color: var(--fg); outline: none; }
.row input:focus { border-color: var(--brand-dark); box-shadow: 0 0 0 3px var(--brand-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 9999px; padding: 7px 13px; font-size: 13.5px; cursor: pointer; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: .375rem; padding: 9px 14px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-primary { background: var(--cta); color: #fff; border-color: var(--cta); box-shadow: var(--cta-shadow); }
.btn-primary:hover { background: var(--accent); }
.btn-block { display: block; width: 100%; padding: 13px; font-size: 15.5px; }
.btn:disabled { opacity: .5; box-shadow: none; }
.cp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.counter { flex: none; text-align: right; font-size: 12px; color: var(--muted-2); line-height: 1.3; }
.counter b { display: block; font-size: 22px; color: var(--accent); font-weight: 700; line-height: 1.1; }
.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.counters .stat { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.counters .stat b { display: block; font-size: 22px; color: var(--navy); line-height: 1.1; }
.counters .stat span { font-size: 12.5px; color: var(--muted); }
.messages.static .msg.assistant { max-width: 100%; margin: 0 12px 12px; }
.messages.static .msg.user { margin: 0 12px 12px auto; }
.verdict { display: inline-block; font-weight: 700; padding: 4px 12px; border-radius: 9999px; margin-bottom: 8px; font-size: 13px; }
.verdict.ok { background: #dcfce7; color: #166534; }
.verdict.warn { background: #fef3c7; color: #92400e; }
.verdict.bad { background: #fee2e2; color: #991b1b; }
/* тарифы, бонус, удаление */
.plans { display: grid; gap: 8px; }
.plan { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
.plan.current { border-color: var(--accent); background: var(--accent-soft); }
.plan .pn { font-weight: 700; font-size: 14px; }
.plan .pd { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.plan .pp { font-weight: 700; white-space: nowrap; }
.plan .btn { white-space: nowrap; }
.card.bonus { border-color: var(--accent); }
.steps { margin: 6px 0 10px; padding-left: 20px; }
.steps li { margin: 8px 0; }
.steps li.done { color: #166534; }
.steps li.done::marker { content: "✔ "; }
.session { position: relative; padding-right: 30px; }
.session .del { position: absolute; top: 8px; right: 6px; border: 0; background: transparent; color: var(--muted-2); font-size: 15px; line-height: 1; padding: 4px 6px; border-radius: 6px; cursor: pointer; opacity: .6; }
.session .del:hover { background: #fee2e2; color: #991b1b; opacity: 1; }
.pay-row { padding: 9px 0; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.pay-row:first-child { border-top: 0; }
.overlay { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; z-index: 50; font-size: 16px; }
.backdrop { display: none; }

@media (max-width: 760px) {
  #menuBtn { display: inline-flex; }
  .only-mobile { display: inline-flex !important; }
  .brand span { display: none; }
  .sidebar { position: absolute; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); z-index: 20; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 4px 0 24px rgba(15, 23, 42, .18); }
  .sidebar.open { transform: translateX(0); }
  .backdrop.open { display: block; position: absolute; inset: 0; background: rgba(15, 23, 42, .35); z-index: 10; }
  .msg { max-width: 92%; }
}
@media (min-width: 761px) {
  .messages { padding: 18px 24px 8px; }
  .msg.user { max-width: 60%; }
  .msg.assistant { max-width: 760px; }
}

/* вход на сайте через бота, бесплатный месяц, тарифы (03.11.2026) */
.login-card { max-width: 380px; width: 100%; margin: 0; text-align: center; display: grid; gap: 12px; justify-items: center; }
.login-card p { margin: 0; }
.login-logo { width: 48px; height: 48px; }
.login-card .btn-primary { width: 100%; padding: 12px; font-size: 15.5px; }
.login-back { text-decoration: none; }
.card.profile .logout { margin-left: auto; }
.steps a.btn { text-decoration: none; display: inline-block; }
.plan .pold { font-size: 12px; color: var(--muted); text-decoration: line-through; font-weight: 400; }
.plan .sale { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 9999px; padding: 1px 7px; vertical-align: 1px; }
.pw-form { display: grid; gap: 8px; width: 100%; }
.pw-form input { width: 100%; border: 1px solid var(--line); border-radius: .5rem; padding: 10px 12px; font: inherit; }

/* Почтовый вход и привязка аккаунта */
#authTabs, #emailModes { margin: 12px 0; gap: 6px; flex-wrap: wrap; }
#emailForm input { width: 100%; min-width: 0; }
#emailCode { letter-spacing: .18em; font-size: 20px; }
#emailError { overflow-wrap: anywhere; }
#accountAuth { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.profile #emailForm { width: 100%; }
.card.profile > div { min-width: 0; }
.profile #accInfo { overflow-wrap: anywhere; }
#telegramLogin { width: 100%; }
