:root {
  --ink: #1a1c23;
  --ink-soft: #4a4d57;
  --muted: #868994;
  --paper: #faf8f3;
  --paper-2: #ffffff;
  --line: #e6e2d8;
  --accent: #1f6f5c;       /* глубокий зелёный — доверие, право */
  --accent-dark: #154d40;
  --warn: #c2410c;
  --danger: #b91c1c;
  --high: #b91c1c;
  --medium: #b45309;
  --low: #15803d;
  --shadow: 0 4px 24px rgba(26,28,35,0.08);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Topbar */
.topbar {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 15px; padding: 12px 22px; text-decoration: none;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 6px 18px rgba(31,111,92,.25); }
.btn-ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-ghost:hover { background: rgba(31,111,92,.06); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-block { width: 100%; }

/* Landing hero */
.hero { padding: 72px 0 48px; text-align: center; background: linear-gradient(180deg, #f5f2ea 0%, var(--paper) 100%); }
.hero-badge {
  display: inline-block; background: rgba(31,111,92,.1); color: var(--accent-dark);
  padding: 6px 16px; border-radius: 30px; font-size: 13px; font-weight: 600; margin-bottom: 24px;
}
.hero h1 { font-family: 'Lora', serif; font-size: 52px; line-height: 1.1; font-weight: 700; letter-spacing: -1px; }
.hero h1 .accent { color: var(--accent); font-style: italic; }
.lead { max-width: 620px; margin: 24px auto 0; font-size: 19px; color: var(--ink-soft); }
.hero-actions { margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hero-note { font-size: 14px; color: var(--muted); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 64px 24px; }
.step { text-align: center; }
.step-num {
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px;
  margin: 0 auto 16px;
}
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: 15px; }

/* Features */
.features { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 64px 0; }
.features h2, .pricing h2 { font-family: 'Lora', serif; font-size: 34px; text-align: center; margin-bottom: 40px; }
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feat { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.feat span { font-size: 30px; }
.feat h4 { margin: 12px 0 6px; font-size: 17px; }
.feat p { font-size: 14px; color: var(--ink-soft); }

/* Pricing */
.pricing { padding: 64px 24px; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 900px; margin: 0 auto; }
.price-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px;
  background: var(--paper-2); text-align: center;
}
.price-card.highlight { border: 2px solid var(--accent); box-shadow: var(--shadow); transform: scale(1.03); }
.price-tier { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.price-val { font-family: 'Lora', serif; font-size: 40px; font-weight: 700; margin: 12px 0; }
.price-val span { font-size: 18px; color: var(--muted); }
.price-card ul { list-style: none; margin: 20px 0; text-align: left; }
.price-card li { padding: 7px 0 7px 26px; position: relative; color: var(--ink-soft); font-size: 15px; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }

/* Footer */
.footer { background: var(--ink); color: #b8bcc6; padding: 32px 0; font-size: 14px; text-align: center; }

/* App page */
.app-main { padding: 40px 24px 80px; min-height: calc(100vh - 64px); }
.panel {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px; max-width: 760px; margin: 0 auto 24px; box-shadow: var(--shadow);
}
.panel h1 { font-family: 'Lora', serif; font-size: 32px; margin-bottom: 8px; }
.panel h2 { font-family: 'Lora', serif; font-size: 26px; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 15px; margin-bottom: 24px; }

.quota-badge { font-size: 13px; color: var(--accent-dark); background: rgba(31,111,92,.1); padding: 6px 12px; border-radius: 20px; font-weight: 600; }

/* Dropzone */
.dropzone {
  display: block; border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; cursor: pointer; transition: all .2s;
  background: var(--paper);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(31,111,92,.04); }
.dz-icon { font-size: 44px; }
.dz-title { font-weight: 700; font-size: 18px; margin-top: 12px; }
.dz-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* Parties */
.parties { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.party-btn {
  display: flex; align-items: center; gap: 12px; padding: 18px 22px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper);
  cursor: pointer; font-family: inherit; font-size: 17px; font-weight: 600; color: var(--ink);
  transition: all .15s; text-align: left;
}
.party-btn:hover { border-color: var(--accent); background: rgba(31,111,92,.05); transform: translateX(3px); }
.party-btn .pico { font-size: 22px; }

/* Loader */
.loader {
  width: 48px; height: 48px; border: 4px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; margin: 24px auto; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { text-align: center; color: var(--ink-soft); }

/* Result */
.result-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.chip { background: var(--accent); color: #fff; padding: 5px 14px; border-radius: 20px; font-size: 14px; font-weight: 600; }
.result-block { margin-bottom: 28px; }
.result-block h3 { font-size: 18px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.result-block p { color: var(--ink-soft); }
.result-block.reco { background: rgba(31,111,92,.06); border-radius: 12px; padding: 20px; }
.result-block.reco h3 { border: none; }

.weak-item { border-left: 3px solid var(--line); padding: 12px 0 12px 16px; margin-bottom: 14px; }
.weak-item.high { border-color: var(--high); }
.weak-item.medium { border-color: var(--medium); }
.weak-item.low { border-color: var(--low); }
.weak-item .wt { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.weak-item .sev { font-size: 11px; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.sev.high { background: #fee2e2; color: var(--high); }
.sev.medium { background: #ffedd5; color: var(--medium); }
.sev.low { background: #dcfce7; color: var(--low); }
.weak-item .wd { color: var(--ink-soft); font-size: 15px; margin-top: 4px; }

.case-item { padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.case-item .cs { font-style: italic; color: var(--ink); font-weight: 600; }
.case-item .ct { color: var(--ink-soft); font-size: 15px; margin-top: 6px; }
.case-item .cn { font-size: 13px; color: var(--accent-dark); margin-top: 6px; font-weight: 600; }

.disclaimer { font-size: 13px; color: var(--muted); font-style: italic; margin: 24px 0; padding: 12px; background: var(--paper); border-radius: 8px; }

/* Status */
.status { padding: 14px 18px; border-radius: 10px; margin-top: 20px; font-size: 15px; }
.status.error { background: #fee2e2; color: var(--danger); }
.status.info { background: rgba(31,111,92,.08); color: var(--accent-dark); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(26,28,35,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-box { background: var(--paper-2); border-radius: var(--radius); padding: 36px; max-width: 440px; width: 100%; position: relative; box-shadow: var(--shadow); }
.modal-box h2 { font-family: 'Lora', serif; font-size: 24px; margin-bottom: 8px; }
.modal-close, .modal-box [data-close-auth] { position: absolute; top: 16px; right: 20px; background: none; border: none; font-size: 28px; cursor: pointer; color: var(--muted); line-height: 1; }
.paywall-options { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.pay-btn { flex-direction: column; padding: 16px; }
.pay-btn small { font-weight: 400; font-size: 13px; opacity: .85; margin-top: 2px; }
.auth-note { background: #fef3c7; color: #92400e; padding: 10px 14px; border-radius: 8px; font-size: 14px; margin: 14px 0; }

/* OAuth */
.oauth-list { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.oauth-btn { display: block; text-align: center; padding: 12px; border-radius: 10px; text-decoration: none; font-weight: 600; color: #fff; font-size: 15px; }
.oauth-btn.ya { background: #fc3f1d; }
.oauth-btn.vk { background: #0077ff; }
.oauth-btn.sber { background: #21a038; }
.oauth-btn.tid { background: #ffdd2d; color: #333; }
.divider { text-align: center; position: relative; margin: 20px 0; color: var(--muted); font-size: 14px; }
.divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--line); }
.divider span { background: var(--paper-2); padding: 0 14px; position: relative; }

/* Auth form */
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input { padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 15px; }
.auth-form input:focus { outline: none; border-color: var(--accent); }
.form-error { background: #fee2e2; color: var(--danger); padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 600; text-decoration: none; }

.user-chip { font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.user-chip:hover { color: var(--accent); }
.link-btn { background: none; border: none; color: var(--accent); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

.hidden { display: none !important; }

/* Mobile */
@media (max-width: 760px) {
  .hero h1 { font-size: 36px; }
  .lead { font-size: 17px; }
  .steps, .feat-grid, .price-grid { grid-template-columns: 1fr; }
  .price-card.highlight { transform: none; }
  .panel { padding: 24px; }
  .panel h1 { font-size: 26px; }
}
