
:root{
  --bg:#f3f6fb;
  --card:#ffffff;
  --text:#101828;
  --muted:#667085;
  --line:#e4e7ec;
  --primary:#0f172a;
  --primary-2:#1d4ed8;
  --soft:#f8fafc;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  background:linear-gradient(180deg,#eff4ff 0%,#f8fafc 220px,var(--bg) 100%);
  color:var(--text);
}
.page-shell{padding:20px 14px 36px}
.container{
  max-width:1160px;margin:0 auto;background:var(--card);padding:28px;border-radius:24px;
  box-shadow:0 12px 40px rgba(16,24,40,.08);
}
.report{max-width:1040px}
.app-hero{overflow:hidden}
.auth-shell{min-height:100vh;display:flex;align-items:center;justify-content:center}
.auth-card{max-width:520px}
.topbar{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin-bottom:18px;flex-wrap:wrap}
.topbar form{margin:0}
.hero-badge,.topline{display:inline-block;font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:#1d4ed8;font-weight:800;background:#eff6ff;border:1px solid #bfdbfe;padding:6px 10px;border-radius:999px;margin-bottom:12px}
h1{margin:0 0 12px;font-size:34px;line-height:1.08;color:#0f172a}
h2{margin:30px 0 12px;font-size:21px;border-bottom:1px solid var(--line);padding-bottom:8px;color:#172554}
h3{margin-top:22px}
p{line-height:1.6;margin:0 0 10px}
.hero-sub{font-size:16px;color:var(--muted);max-width:880px}
.feature-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:24px 0}
.feature-card{background:var(--soft);border:1px solid var(--line);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:8px}
.feature-card strong{font-size:15px;color:#0f172a}
.feature-card span{font-size:14px;color:var(--muted);line-height:1.45}
.form-card{margin-top:18px;background:#fff;border:1px solid var(--line);border-radius:22px;padding:22px}
.section-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.section-head h2{margin:0;border:0;padding:0;font-size:20px;color:#111827}
.section-head p{margin:0;color:var(--muted);font-size:14px}
.section-head.compact{margin-top:18px}
.dropzone{
  display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  border:2px dashed #bfd2ff;background:linear-gradient(180deg,#f8fbff 0%,#f8fafc 100%);
  border-radius:20px;padding:28px 18px;cursor:pointer;transition:.2s ease;min-height:210px;
}
.dropzone:hover,.dropzone.dragover{border-color:#60a5fa;background:#eff6ff;transform:translateY(-1px)}
.dropzone-icon{width:58px;height:58px;border-radius:50%;background:#dbeafe;color:#1d4ed8;display:flex;align-items:center;justify-content:center;font-size:28px;font-weight:800;margin-bottom:14px}
.dropzone-title{font-size:20px;font-weight:800;color:#0f172a}
.dropzone-subtitle{font-size:15px;color:var(--muted);margin-top:6px}
.dropzone-note{font-size:13px;color:#98a2b3;margin-top:10px}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.file-list{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.file-chip{display:flex;align-items:center;gap:10px;max-width:100%;padding:10px 12px;border-radius:14px;background:#f8fafc;border:1px solid var(--line)}
.file-chip-name{font-weight:700;color:#111827;word-break:break-word}
.file-chip-size{font-size:12px;color:var(--muted);white-space:nowrap}
.person{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px 18px;
  background:#f8fafc;border:1px solid var(--line);border-radius:14px;padding:14px;margin:16px 0;
}
.stats-grid,.cardrow{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin:20px 0}
.card{background:#f8fafc;border:1px solid var(--line);border-radius:18px;padding:16px;min-height:110px;display:flex;flex-direction:column;justify-content:center}
.card.accent{border-top:4px solid #f97316;background:#fff8f2}
.num{font-size:28px;font-weight:800;color:#0f172a;margin-bottom:6px;line-height:1.05;word-break:break-word}
.grade{background:#eff6ff;border:1px solid #bfdbfe;border-radius:18px;padding:18px;margin:18px 0}
.grade-title{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:#1e40af;font-weight:800}
.grade-value{font-size:30px;font-weight:900;color:#1e3a8a;margin:6px 0}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--line);border-radius:16px;background:white}
table{width:100%;border-collapse:collapse;margin:0;font-size:14px;min-width:680px}
th,td{border-bottom:1px solid var(--line);padding:10px 12px;vertical-align:top}
tr:last-child td{border-bottom:0}
th{background:#f8fafc;text-align:left;color:#334155;position:sticky;top:0;z-index:1}
.badge{display:inline-block;border-radius:999px;padding:4px 9px;font-weight:700;font-size:12px;white-space:nowrap}
.badge.Норма{background:#dcfce7;color:#166534}
.badge.Внимание{background:#fef3c7;color:#92400e}
.badge.Риск{background:#fee2e2;color:#991b1b}
label{display:block;margin:14px 0 6px;font-weight:700;color:#111827}
input,select,textarea{width:100%;padding:12px 14px;border:1px solid #d0d5dd;border-radius:12px;background:#fff;font:inherit;color:inherit}
textarea{resize:vertical}
button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--primary);color:#fff;text-decoration:none;border:0;border-radius:12px;padding:13px 18px;font-weight:700;cursor:pointer;min-height:48px}
.btn.secondary{background:#475569;color:#fff}
.btn.ghost{background:#fff;color:#0f172a;border:1px solid var(--line)}
.btn.slim{min-height:40px;padding:9px 13px;font-size:14px}
.links .btn,.top-actions .btn{margin-right:10px;margin-bottom:10px}
.history-links{display:flex;gap:10px;flex-wrap:wrap}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.check{font-weight:600;display:flex;gap:10px;align-items:flex-start;margin-top:14px}
.check input{width:auto;margin-top:3px}
.warnbox{background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;padding:12px 14px;border-radius:12px;margin:14px 0}
.disclaimer{font-size:12px;color:var(--muted);border-top:1px solid var(--line);margin-top:24px;padding-top:12px}
.no-print{margin-bottom:16px}
.topnav a{text-decoration:none;font-weight:600}
a{color:#1d4ed8}
ul,ol{padding-left:20px}
.actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.bottom-actions{margin-top:22px}

@media (max-width: 980px){
  .stats-grid,.cardrow{grid-template-columns:repeat(3,minmax(0,1fr))}
  .feature-row{grid-template-columns:1fr}
}
@media (max-width: 720px){
  .page-shell{padding:12px 10px 28px}
  .container{padding:18px;border-radius:18px}
  h1{font-size:28px}
  .hero-sub{font-size:15px}
  .grid2{grid-template-columns:1fr}
  .section-head{align-items:flex-start}
  .dropzone{min-height:180px;padding:22px 14px}
  .dropzone-title{font-size:18px}
  .stats-grid,.cardrow{grid-template-columns:repeat(2,minmax(0,1fr))}
  .card{min-height:96px;padding:14px}
  .num{font-size:24px}
  button,.btn{width:100%}
  .topbar{justify-content:stretch}
  .topbar form{width:100%}
  .links .btn,.top-actions .btn{margin-right:0}
}
@media (max-width: 420px){
  .stats-grid,.cardrow{grid-template-columns:1fr}
  h1{font-size:24px}
  .grade-value{font-size:24px}
  .dropzone-icon{width:50px;height:50px;font-size:24px}
}
@media print{
  body{background:#fff;padding:0}
  .page-shell{padding:0}
  .container{box-shadow:none;border-radius:0;max-width:none;padding:0}
  .no-print,.links,.top-actions{display:none}
  .cardrow,.stats-grid{grid-template-columns:repeat(3,1fr)}
  table{font-size:12px}
  .table-wrap{overflow:visible;border:0}
}

.muted-note{color:#667085;font-size:14px;line-height:1.45;margin:6px 0 12px;}

.btn.danger{background:#b42318;color:#fff}
.danger-actions{align-items:center}
.link-button{background:none;border:0;padding:0;margin:0;color:#1d4ed8;text-decoration:underline;cursor:pointer;font:inherit;min-height:0;width:auto}
.danger-text{color:#b42318}
.history-links form{margin:0}

@media (max-width: 720px){
  .table-wrap{border-radius:14px;overflow-x:auto}
  table{font-size:13px;min-width:760px}
  th,td{padding:9px 10px}
  .history-links{flex-direction:column;gap:6px}
  .history-links a,.history-links button{font-size:14px}
}

@media (max-width: 520px){
  .report .table-wrap{margin-left:-8px;margin-right:-8px;border-left:0;border-right:0;border-radius:0}
  table{min-width:820px}
  .stats-grid .card .num{font-size:22px}
  .muted-note{font-size:13px}
}

.pdn-card{background:#f8fafc;border:1px solid var(--line);border-radius:18px;padding:18px;margin:18px 0}
.pdn-card h2{margin-top:0}
.pdn-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.pdn-grid div{background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px}
.pdn-grid b{display:block;color:#334155;font-size:13px;margin-bottom:6px}
.pdn-grid span{display:block;font-weight:800;font-size:20px;color:#0f172a}
@media (max-width: 720px){.pdn-grid{grid-template-columns:1fr}.pdn-grid span{font-size:18px}}

.intro-card{background:#f0fdf4;border:1px solid #bbf7d0;color:#14532d;border-radius:18px;padding:16px 18px;margin:18px 0;font-size:16px;line-height:1.55}
.good-card{border-top:4px solid #22c55e;background:#f0fdf4}
.good-card .num{color:#166534}
.pdn-input-row{display:flex;align-items:center;gap:10px;margin:8px 0 12px;max-width:420px}
.pdn-input-row input{flex:1}
.pdn-input-row span{font-weight:800;color:#475467}
.pdn-output{margin-top:10px}
.pdn-result{border-radius:16px;padding:14px 16px;border:1px solid var(--line);display:flex;flex-direction:column;gap:6px}
.pdn-result b{font-size:20px}
.pdn-result span{line-height:1.45}
.pdn-result small{color:#475467}
.pdn-good{background:#f0fdf4;border-color:#bbf7d0;color:#14532d}
.pdn-warn{background:#fffbeb;border-color:#fde68a;color:#92400e}
.pdn-bad{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.badge.Требует{background:#fef3c7;color:#92400e}
.subnum{font-size:13px;color:#667085;margin-top:5px}
@media (max-width:720px){.pdn-input-row{max-width:none}.intro-card{font-size:15px}}

/* v39.25 billing + learning */
.billing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  margin: 22px 0;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 18px;
}
.goodbox {
  padding: 16px 18px;
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #166534;
  border-radius: 16px;
  margin: 18px 0;
  font-weight: 700;
}
.compact-card { margin-top: 24px; }
.inline-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.inline-form input {
  flex: 1 1 320px;
}
.learning-flow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0 28px;
}
.learning-flow div {
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  font-weight: 800;
}
.learning-flow span { color: #64748b; font-weight: 800; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
@media (max-width: 720px) {
  .billing-banner { flex-direction: column; align-items: flex-start; }
  .inline-form { display: block; }
  .inline-form input { width: 100%; margin-bottom: 10px; }
}

/* v39.26 consent + legal */
.legal-consent-box {
  margin: 24px 0 10px;
  padding: 18px 20px;
  border: 1px solid #dbe3ef;
  background: #f8fafc;
  border-radius: 18px;
}
.legal-consent-box h2 { margin-top: 0; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
  color: #0f172a;
  line-height: 1.35;
  font-weight: 650;
}
.check-row input { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; }
.check-row.optional { color: #475467; font-weight: 500; }
.payment-consents { flex: 1 1 100%; margin: 6px 0; }
.payment-form { align-items: flex-start; }
.legal-page h1 { margin-bottom: 8px; }
.legal-page h2 { margin-top: 26px; }
.legal-page ul { padding-left: 22px; line-height: 1.55; }
.legal-page p { line-height: 1.6; }
.legal-page code { background:#f1f5f9; padding:2px 5px; border-radius:6px; }


/* v39.27 simplified consent bundle */
.consent-master {
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 16px;
  margin-top: 14px;
}
.consent-master input { width: 22px; height: 22px; margin-top: 2px; }
.consent-details {
  margin: 12px 0 6px;
  padding: 10px 14px;
  border-left: 3px solid #dbeafe;
  background: #ffffff;
  border-radius: 14px;
}
.consent-details .check-row { font-size: 14px; font-weight: 550; }
.compact-master { margin-top: 0; }
.compact-details { flex: 1 1 100%; }
.disabled-soft { opacity: .72; }
@media (max-width: 720px) {
  .consent-master { padding: 12px 14px; }
  .consent-details { padding: 8px 10px; }
}

/* v39.32 Parser Quality Lock */
.warn-card {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
}
.risk-card {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

/* Tariff packages / pricing */
.pricing-shared {
  margin: 8px 0 22px;
  display: grid;
  gap: 10px;
}
.pricing-shared label { font-weight: 700; }
.pricing-shared input[type="email"] {
  width: 100%;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid var(--line, #dbe3ef);
  border-radius: 14px;
  font-size: 15px;
}
.pricing-shared .req { color: #dc2626; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 18px 18px;
  border: 1px solid #dbe3ef;
  border-radius: 20px;
  background: #fff;
  min-height: 220px;
}
.pricing-card.featured {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 55%);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
}
.pricing-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 4px 8px;
  border-radius: 999px;
}
.pricing-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}
.pricing-amount {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.pricing-meta {
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}
.pricing-credits {
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.pricing-form { margin-top: auto; }
.pricing-btn {
  width: 100%;
  justify-content: center;
}
@media (max-width: 720px) {
  .pricing-grid { grid-template-columns: 1fr; }
}
