:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #15171a;
  --muted: #6c727f;
  --line: #e7e9ee;
  --primary: #111827;
  --primary-text: #ffffff;
  --accent: #eaf7ef;
  --accent-text: #146c35;
  --warning: #fff4d6;
  --warning-text: #7a5200;
  --shadow: 0 18px 45px rgba(15, 23, 42, .07);
  --radius: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #636363;
  color: var(--text);
  line-height: 1.5;
}

.page {
  width: min(960px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 16px 0;
}

.hero {
  padding: 30px 24px;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
}

.brand {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}

h1, h2, h3 { margin: 0 0 12px; line-height: 1.15; }
h1 { font-size: clamp(34px, 7vw, 54px); letter-spacing: -0.04em; margin-top: 18px; }
h2 { font-size: 24px; letter-spacing: -0.02em; }
p { margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 18px; max-width: 680px; }
.muted { color: var(--muted); }

.hero-actions, .downloads {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn, .download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
  text-decoration: none;
  font-weight: 650;
}

.btn.primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.download {
  background: #f8fafc;
}

.notice {
  background: var(--accent);
  color: var(--accent-text);
  border-color: #ccebd7;
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid.two .card { margin: 0; }

.steps {
  padding-left: 22px;
  margin: 0;
}
.steps li { margin: 8px 0; }

.warning {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--warning);
  color: var(--warning-text);
  font-weight: 650;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  font-size: 15px;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
  background: #f8fafc;
}

tr:last-child td { border-bottom: 0; }

.master {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
}

.result {
  border-radius: 18px;
  border: 1px solid #d7e8ff;
  background: #f1f7ff;
  padding: 16px;
}

.result h3 { margin-bottom: 8px; }
.result .pill {
  display: inline-flex;
  margin: 4px 6px 8px 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d7e8ff;
  font-weight: 750;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 750; }
.faq details p { color: var(--muted); margin-top: 10px; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  padding: 18px 6px 0;
}
.footer a { color: var(--muted); }

@media (max-width: 760px) {
  .page { width: min(100% - 20px, 960px); padding-top: 14px; }
  .card { border-radius: 20px; padding: 18px; margin: 10px 0; }
  .grid.two { grid-template-columns: 1fr; gap: 10px; }
  h2 { font-size: 21px; }
  table { font-size: 14px; }
  th, td { padding: 10px 8px; }
  .btn, .download { width: 100%; }
  .footer { flex-direction: column; }
}

/* SAFEDJI footer */
.safedji-footer {
  width: min(100%, 920px);
  margin: 18px auto 34px;
  padding: 0 16px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.35;
}

.safedji-footer-copy {
  text-align: center;
}

.safedji-footer-telegram {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111111;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.16s ease, background 0.16s ease;
}

.safedji-footer-telegram:hover {
  transform: translateY(-1px);
  background: #ffffff;
}

.safedji-footer-telegram svg,
.safedji-footer-telegram svg:not(:root) {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  display: block;
  flex: 0 0 24px;
}

.safedji-footer-telegram svg path {
  fill: currentColor;
}

@media (max-width: 520px) {
  .safedji-footer {
    margin-top: 14px;
    margin-bottom: 28px;
    font-size: 12px;
    gap: 10px;
  }
}

/* Footer final: like order.safedji.ru */
.safedji-footer {
  width: min(calc(100% - 48px), 920px) !important;
  margin: 24px auto 34px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  color: rgba(0, 0, 0, 0.34) !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.safedji-footer-copy {
  text-align: left !important;
  color: rgba(0, 0, 0, 0.34) !important;
}

.safedji-footer-telegram {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: rgba(0, 0, 0, 0.55) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
  padding: 0 !important;
}

.safedji-footer-telegram:hover {
  transform: none !important;
  background: transparent !important;
  color: rgba(0, 0, 0, 0.72) !important;
}

.safedji-footer-telegram svg {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  display: block !important;
}

.safedji-footer-telegram svg path {
  fill: currentColor !important;
}

@media (max-width: 520px) {
  .safedji-footer {
    width: calc(100% - 32px) !important;
    margin-top: 18px !important;
    margin-bottom: 28px !important;
    font-size: 12px !important;
  }
}

/* Reduce bottom gap before footer */
.safedji-footer {
  margin-top: 8px !important;
  margin-bottom: 28px !important;
}

main {
  padding-bottom: 0 !important;
}

.card:last-of-type {
  margin-bottom: 10px !important;
}

/* Font final: exactly like order.safedji.ru */
html,
body,
button,
input,
select,
textarea,
a,
p,
div,
span,
li,
td,
th,
h1,
h2,
h3,
h4 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
}

/* Main title thinner */
.hero h1,
h1 {
  font-weight: 500 !important;
  letter-spacing: -0.035em !important;
}

.hero h1,
h1 {
  font-weight: 400 !important;
}


/* Typography tuning */
h2,
.card h2,
.section-title {
  font-weight: 500 !important;
  letter-spacing: -0.02em !important;
}

/* Quick start warning: thinner */
.warning,
.warning *,
.alert,
.alert *,
.notice,
.notice *,
.quick-warning,
.quick-warning * {
  font-weight: 400 !important;
}

/* Setup wizard: thinner */
#setup,
#setup *,
#wizard,
#wizard *,
#calculator,
#calculator *,
#configurator,
#configurator *,
.settings-master,
.settings-master *,
.setup-master,
.setup-master *,
.setup-wizard,
.setup-wizard *,
.wizard,
.wizard *,
.calculator,
.calculator *,
.configurator,
.configurator *,
.result,
.result *,
.output,
.output *,
.calc-result,
.calc-result *,
.setup-result,
.setup-result * {
  font-weight: 400 !important;
}

/* Wizard headings/selects should not be bold */
#setup h2,
#wizard h2,
#calculator h2,
#configurator h2,
.settings-master h2,
.setup-master h2,
.setup-wizard h2,
.wizard h2,
.calculator h2,
.configurator h2 {
  font-weight: 500 !important;
}

#setup h3,
#wizard h3,
#calculator h3,
#configurator h3,
.settings-master h3,
.setup-master h3,
.setup-wizard h3,
.wizard h3,
.calculator h3,
.configurator h3 {
  font-weight: 500 !important;
}

/* Large select text in wizard */
select,
option,
.setup-master select,
.setup-wizard select,
.settings-master select,
.wizard select,
.calculator select,
.configurator select {
  font-weight: 500 !important;
}

/* Pills / result badges in wizard */
.badge,
.pill,
.chip,
.step-badge,
.result-badge,
.setup-result .badge,
.setup-result .pill,
.setup-result .chip,
.calc-result .badge,
.calc-result .pill,
.calc-result .chip {
  font-weight: 500 !important;
}

/* Paragraph text inside result card */
.result p,
.output p,
.calc-result p,
.setup-result p,
.wizard p,
.calculator p,
.configurator p {
  font-weight: 400 !important;
}

/* Master labels thinner */
.master label {
  font-weight: 400 !important;
  letter-spacing: -0.015em !important;
}

.master label > select {
  font-weight: 500 !important;
}

/* If browser inherits bold from parent */
.master label:not(:has(select)) {
  font-weight: 400 !important;
}

/* Master labels weight 500 */
.master label {
  font-weight: 500 !important;
}

.master label:not(:has(select)) {
  font-weight: 500 !important;
}

/* P2 flight time table header */
.p2-flight-time table thead th {
  font-weight: 500 !important;
  color: #000000 !important;
}

/* Files download links weight */
.downloads .download,
.download {
  font-weight: 500 !important;
}

/* FAQ items thinner */
.faq details,
.faq details *,
.faq summary {
  font-weight: 400 !important;
}

/* Wizard ovals: wider horizontally */
.master .pill,
.master .badge,
.master .chip,
.master .result-pill,
.master .result-badge,
.master .setup-pill,
.master .setup-badge,
.master-output .pill,
.master-output .badge,
.master-output .chip,
.result .pill,
.result .badge,
.result .chip,
.calc-result .pill,
.calc-result .badge,
.calc-result .chip,
.setup-result .pill,
.setup-result .badge,
.setup-result .chip {
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* Wizard ovals text weight 400 */
.master .pill,
.master .badge,
.master .chip,
.master .result-pill,
.master .result-badge,
.master .setup-pill,
.master .setup-badge,
.master-output .pill,
.master-output .badge,
.master-output .chip,
.result .pill,
.result .badge,
.result .chip,
.calc-result .pill,
.calc-result .badge,
.calc-result .chip,
.setup-result .pill,
.setup-result .badge,
.setup-result .chip {
  font-weight: 400 !important;
}

/* Hero badge vertical padding */
.hero .eyebrow,
.hero .badge,
.hero-badge,
.eyebrow {
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  line-height: 1 !important;
}

.hero .eyebrow,
.hero .badge,
.hero-badge,
.eyebrow {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

/* SAFEDJI HELP badge compact */
.brand {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  line-height: 1 !important;
}

/* Restore SAFEDJI HELP badge size */
.brand {
  padding: 6px 10px !important;
  line-height: normal !important;
}

/* Reduce spacing around SAFEDJI HELP badge, not inside it */
.hero {
  padding-top: 22px !important;
}

.hero h1 {
  margin-top: 10px !important;
}

/* Reduce hero bottom spacing */
.hero {
  padding-bottom: 18px !important;
}

.hero {
  padding-bottom: 14px !important;
}

/* Restore hero bottom spacing */
.hero {
  padding-bottom: 30px !important;
}

/* Reduce hero bottom spacing */
.hero {
  padding-bottom: 18px !important;
}

/* Reduce bottom spacing in "Главное" section */
.main-card {
  padding-bottom: 16px !important;
}

/* Compact "Главное" section */
.notice.card {
  padding-bottom: 12px !important;
}

.notice.card p:last-child {
  margin-bottom: 0 !important;
}

/* Restore hero bottom spacing */
.hero {
  padding-bottom: 30px !important;
}

.notice.card {
  padding-bottom: 15px !important;
}

.notice.card {
  padding-bottom: 18px !important;
}

.notice.card {
  padding-top: 8px !important;
}

.notice.card {
  padding-top: 15px !important;
}

.notice.card {
  padding-top: 18px !important;
}

/* Compact "Заряд" card bottom */
.charge-card {
  padding-bottom: 12px !important;
}

.charge-card table {
  margin-bottom: 0 !important;
}

.charge-card > *:last-child {
  margin-bottom: 0 !important;
}

/* Compact "Заряд" card bottom */
.charge-card {
  padding-bottom: 8px !important;
}

.charge-card table {
  margin-bottom: 0 !important;
}

.charge-card > *:last-child {
  margin-bottom: 0 !important;
}

/* Compact "Заряд" card bottom */
.charge-card {
  padding-bottom: 6px !important;
}

.charge-card table {
  margin-bottom: 0 !important;
}

.charge-card > *:last-child {
  margin-bottom: 0 !important;
}

/* Desktop: make "Заряд" and "Индикация" cards equal height */
@media (min-width: 760px) {
  .grid.two {
    align-items: stretch !important;
  }

  .grid.two > .card {
    height: 100% !important;
    box-sizing: border-box !important;
  }

  .charge-card {
    padding-bottom: 24px !important;
  }
}

/* Desktop: reduce bottom gap in "Заряд" and "Индикация" cards */
@media (min-width: 760px) {
  .grid.two > .card {
    padding-bottom: 12px !important;
  }

  .grid.two > .card table {
    margin-bottom: 0 !important;
  }

  .grid.two > .card > *:last-child {
    margin-bottom: 0 !important;
  }
}

@media (min-width: 760px) {
  .grid.two > .card {
    padding-bottom: 8px !important;
  }
}

/* Desktop: compact tables in "Заряд" and "Индикация" */
@media (min-width: 760px) {
  .grid.two table th,
  .grid.two table td {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    line-height: 1.25 !important;
  }

  .grid.two .card {
    padding-bottom: 14px !important;
  }

  .grid.two .card table {
    margin-bottom: 0 !important;
  }
}

@media (min-width: 760px) {
  .grid.two table th,
  .grid.two table td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    line-height: 1.2 !important;
  }

  .grid.two .card {
    padding-bottom: 10px !important;
  }
}

/* Compact selected sections bottom spacing */
.placement-card,
.p2-flight-time,
.faq-card {
  padding-bottom: 12px !important;
}

.placement-card > *:last-child,
.p2-flight-time > *:last-child,
.faq-card > *:last-child {
  margin-bottom: 0 !important;
}

.placement-card p:last-child,
.p2-flight-time table:last-child,
.faq-card details:last-child {
  margin-bottom: 0 !important;
}

/* Add bottom spacing only to "Размещение на дроне" */
.placement-card {
  padding-bottom: 20px !important;
}
