
:root {
      --primary: #1a6b8a;
      --primary-dark: #0f4c63;
      --accent: #2a9d8f;
      --bg: #f4f7fa;
      --card: #ffffff;
      --text: #2d3436;
      --muted: #636e72;
      --border: #dfe6e9;
      --success: #27ae60;
      --warning: #e67e22;
      --light-blue: #e8f4f8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.65;
}
.header {
      background: linear-gradient(135deg, #1a6b8a 0%, #0f4c63 100%);
      color: white;
      padding: 2.8rem 1.25rem 2.2rem;
      text-align: center;
      position: relative;
      overflow: hidden;
}
.header::after {
      content: "";
      position: absolute;
      bottom: -30px; left: 0; right: 0;
      height: 60px;
      background: var(--bg);
      border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.header h1 { font-size: 1.85rem; margin-bottom: 0.45rem; font-weight: 700; }
.header p { opacity: 0.92; font-size: 1.05rem; max-width: 640px; margin: 0 auto; }
.container { max-width: 920px; margin: 0 auto; padding: 0.5rem 1.15rem 3.5rem; }

.intro {
      background: var(--card);
      border-radius: 14px;
      padding: 1.3rem 1.5rem;
      margin-bottom: 1.8rem;
      border-left: 5px solid var(--accent);
      box-shadow: 0 3px 12px rgba(0,0,0,0.05);
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

.nav-wrap {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
      margin-bottom: 2rem;
}
.nav-group {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 1rem 0.95rem 1.05rem;
      box-shadow: 0 2px 10px rgba(0,0,0,0.04);
      min-width: 0;
}
.nav-group-head {
      display: flex;
      align-items: center;
      gap: 0.55rem;
      margin-bottom: 0.75rem;
      padding-bottom: 0.55rem;
      border-bottom: 1px solid var(--light-blue);
}
.nav-group-icon {
      width: 32px; height: 32px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 1rem;
      flex-shrink: 0;
}
.nav-title {
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--primary-dark);
      font-weight: 700;
      line-height: 1.3;
}
.nav-cards {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
}
.nav-cards.cols-3 {
      grid-template-columns: 1fr 1fr;
}
.nav-card {
      background: #f8fbfc;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 0.75rem 0.5rem;
      text-align: center;
      text-decoration: none;
      color: var(--primary);
      font-weight: 600;
      font-size: 0.8rem;
      line-height: 1.25;
      transition: all 0.2s ease;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.25rem;
      min-height: 68px;
}
.nav-card span.icon { font-size: 1.35rem; line-height: 1; }
.nav-card:hover {
      border-color: var(--primary);
      background: var(--light-blue);
      transform: translateY(-2px);
}

.table-scroll {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin: 1rem 0;
}

.section {
      background: var(--card);
      border-radius: 16px;
      padding: 1.75rem 1.5rem;
      margin-bottom: 1.5rem;
      box-shadow: 0 3px 14px rgba(0,0,0,0.05);
      border: 1px solid var(--border);
      scroll-margin-top: 1rem;
}
.section h2 {
      color: var(--primary);
      font-size: 1.28rem;
      margin-bottom: 1rem;
      padding-bottom: 0.6rem;
      border-bottom: 2px solid var(--light-blue);
      display: flex;
      align-items: center;
      gap: 0.5rem;
}
.section h2 .num {
      background: var(--primary);
      color: white;
      width: 28px; height: 28px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.88rem;
      font-weight: 700;
      flex-shrink: 0;
}
.section h3 {
      font-size: 1.05rem;
      margin: 1.3rem 0 0.5rem;
      color: var(--primary-dark);
}
ul, ol { padding-left: 1.3rem; margin: 0.4rem 0 0.9rem; }
li { margin-bottom: 0.38rem; }
p { margin-bottom: 0.65rem; }

.tip {
      background: #e8f6f3;
      border-radius: 10px;
      padding: 0.9rem 1.1rem;
      margin: 1rem 0;
      font-size: 0.94rem;
      border-left: 4px solid var(--accent);
}
.warning-box {
      background: #fef8f0;
      border-radius: 10px;
      padding: 0.9rem 1.1rem;
      margin: 1rem 0;
      font-size: 0.94rem;
      border-left: 4px solid var(--warning);
}
.do { color: var(--success); font-weight: 600; }
.dont { color: #c0392b; font-weight: 600; }

.scale-table, .diary-table, .print-table {
      width: 100%;
      border-collapse: collapse;
      margin: 1rem 0;
      font-size: 0.88rem;
}
.scale-table th, .scale-table td,
.diary-table th, .diary-table td,
.print-table th, .print-table td {
      border: 1px solid var(--border);
      padding: 0.5rem 0.55rem;
      text-align: left;
      vertical-align: top;
}
.scale-table th, .diary-table th, .print-table th {
      background: var(--light-blue);
      color: var(--primary-dark);
      font-weight: 600;
}
.scale-table tr:nth-child(even),
.diary-table tr:nth-child(even) { background: #fafbfc; }

.print-block {
      background: #fafcfd;
      border: 2px dashed #b0c4ce;
      border-radius: 12px;
      padding: 1.2rem;
      margin: 1.2rem 0;
}
.print-block h4 {
      color: var(--primary);
      margin-bottom: 0.7rem;
      font-size: 1rem;
}
.btn-print {
      display: inline-block;
      background: var(--primary);
      color: white;
      padding: 0.45rem 1rem;
      border-radius: 8px;
      font-size: 0.88rem;
      font-weight: 600;
      text-decoration: none;
      margin-bottom: 0.8rem;
      border: none;
      cursor: pointer;
}
.btn-print:hover { background: var(--primary-dark); }

.exercise-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 1rem;
      margin-top: 1rem;
}
.exercise-card {
      background: #f8fbfc;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1.15rem;
}
.exercise-card .ex-num {
      background: var(--accent);
      color: white;
      width: 26px; height: 26px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      font-weight: 700;
      margin-bottom: 0.45rem;
}
.exercise-card h4 { color: var(--primary-dark); margin-bottom: 0.35rem; font-size: 1rem; }
.exercise-card p { font-size: 0.9rem; color: var(--muted); margin: 0; }
.exercise-visual {
      height: 80px;
      background: linear-gradient(135deg, #e8f4f8, #d4ebe8);
      border-radius: 8px;
      margin-bottom: 0.7rem;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.2rem;
}

.grid-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
      margin: 1rem 0;
}
@media (max-width: 860px) {
      .nav-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
      .grid-2 { grid-template-columns: 1fr; }
      .header {
        padding: 1.55rem 1rem 2.3rem;
      }
      .header::after { height: 36px; bottom: -18px; }
      .header h1 { font-size: 1.32rem; line-height: 1.25; }
      .header p { font-size: 0.92rem !important; line-height: 1.5 !important; }
      .container { padding: 0.15rem 0.8rem 4.2rem; }
      .intro { padding: 1rem 1.05rem; margin-bottom: 1.15rem; font-size: 0.94rem; }
      .section { padding: 1.2rem 1rem; border-radius: 14px; }
      .section h2 { font-size: 1.08rem; align-items: flex-start; }
      .section h2 .num { width: 26px; height: 26px; font-size: 0.8rem; margin-top: 1px; }
      .nav-wrap { gap: 0.75rem; margin-bottom: 1.35rem; }
      .nav-group { padding: 0.85rem 0.75rem 0.95rem; }
      .nav-cards,
      .nav-cards.cols-3 { grid-template-columns: 1fr 1fr; gap: 0.45rem; }
      .nav-card {
        min-height: 56px;
        padding: 0.65rem 0.35rem;
        font-size: 0.74rem;
        border-radius: 10px;
      }
      .nav-card span.icon { font-size: 1.2rem; }
      .exercise-grid { grid-template-columns: 1fr; }
      .print-block { padding: 0.9rem 0.75rem; }
      .scale-table, .diary-table, .print-table { font-size: 0.78rem; min-width: 620px; }
      .btn-print { min-height: 44px; padding: 0.6rem 1rem; }
      .back-to-top {
        width: 44px; height: 44px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        right: 12px;
      }
      .home-btn {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        padding: 0.55rem 0.9rem;
        font-size: 0.88rem;
      }
          }

@media (min-width: 641px) {
      .nav-card { min-height: 72px; }
}

.footer {
      text-align: center;
      padding: 2rem 1rem;
      color: var(--muted);
      font-size: 0.88rem;
      border-top: 1px solid var(--border);
      margin-top: 1.5rem;
}
.footer strong { color: var(--primary); }

.print-note {
      font-size: 0.82rem;
      color: var(--muted);
      margin-top: 0.5rem;
      font-style: italic;
}


.back-to-top {
      position: fixed;
      bottom: 24px;
      right: 20px;
      background: var(--primary);
      color: white;
      width: 46px;
      height: 46px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.3rem;
      text-decoration: none;
      box-shadow: 0 4px 14px rgba(26,107,138,0.35);
      z-index: 999;
      opacity: 0.9;
      transition: background 0.2s, transform 0.2s;
}
.back-to-top:hover {
      background: var(--primary-dark);
      transform: translateY(-2px);
      opacity: 1;
}
.home-btn {
      position: fixed;
      bottom: 24px;
      left: 20px;
      background: var(--primary);
      color: white;
      padding: 0.65rem 1.1rem;
      border-radius: 28px;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.95rem;
      font-weight: 600;
      text-decoration: none;
      box-shadow: 0 4px 14px rgba(26,107,138,0.35);
      z-index: 999;
      opacity: 0.92;
      transition: background 0.2s, transform 0.2s;
}
.home-btn:hover {
      background: var(--primary-dark);
      transform: translateY(-2px);
      opacity: 1;
}
.home-btn:focus-visible {
      outline: 3px solid var(--accent);
      outline-offset: 2px;
}
.checklist-box {
      background: #f0f7fa;
      border: 1px solid #c5dde8;
      border-radius: 12px;
      padding: 1.2rem 1.4rem;
      margin: 1rem 0;
}
.checklist-box label {
      display: block;
      margin-bottom: 0.45rem;
      cursor: default;
      font-size: 0.95rem;
}

@media print {
  .header, .nav-wrap, .nav-group, .btn-print, .footer, .intro, .channels-banner,
  .back-to-top, .home-btn, .top-nav, .calc-box, .calc-reset, .header-brand,
  .header-doctor, .theme-toggle { display: none !important; }

  body { background: white !important; color: #000 !important; font-size: 11pt; }
  a { color: #000; text-decoration: none; }

  .section {
    box-shadow: none !important;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 1rem;
    padding: 0.8rem;
  }
  .print-block {
    border: 1px solid #999;
    background: #fff !important;
    padding: 0.75rem;
  }
  .table-scroll { overflow: visible !important; }
  .scale-table, .diary-table, .print-table {
    min-width: 0 !important;
    font-size: 9.5pt;
    width: 100%;
  }
  h2, h3 { page-break-after: avoid; color: #000 !important; }

  /* When printing only one section / form */
  body.print-section-mode .section:not(.print-only),
  body.print-section-mode .print-block:not(.print-only),
  body.print-section-mode .container > :not(.section.print-only):not(script) {
    display: none !important;
  }
  body.print-section-mode .section.print-only {
    display: block !important;
    border: none;
    box-shadow: none !important;
  }
  body.print-section-mode .print-block.print-only {
    display: block !important;
  }
}


/* FAQ accordion */
.faq-list { margin-top: 0.5rem; }
.faq-item {
      border: 1px solid var(--border);
      border-radius: 12px;
      margin-bottom: 0.65rem;
      background: #f8fbfc;
      overflow: hidden;
}
.faq-item summary {
      list-style: none;
      cursor: pointer;
      padding: 0.95rem 1.15rem;
      font-weight: 600;
      color: var(--primary-dark);
      display: flex;
      align-items: flex-start;
      gap: 0.65rem;
      line-height: 1.4;
      user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
      content: "+";
      flex-shrink: 0;
      width: 24px; height: 24px;
      border-radius: 50%;
      background: var(--primary);
      color: #fff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 1.05rem;
      font-weight: 700;
      margin-top: 1px;
      transition: background 0.2s;
}
.faq-item[open] summary::before {
      content: "−";
      background: var(--accent);
}
.faq-item summary:hover { background: var(--light-blue); }
.faq-answer {
      padding: 0 1.15rem 1.05rem 1.15rem;
      color: var(--text);
      font-size: 0.95rem;
      border-top: 1px solid var(--border);
      margin: 0 0.5rem;
}
.faq-answer p { margin: 0.7rem 0 0.35rem; }
.faq-answer ul { margin: 0.4rem 0 0.5rem; }
@media (max-width: 640px) {
      .faq-item summary { padding: 0.85rem 0.9rem; font-size: 0.92rem; }
      .faq-answer { padding: 0 0.9rem 0.95rem 0.9rem; margin: 0 0.25rem; font-size: 0.9rem; }
}


/* Баннер полезных материалов */
.channels-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      flex-wrap: wrap;
      background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
      color: #fff;
      border-radius: 14px;
      padding: 1.1rem 1.35rem;
      margin: 1.5rem 0 0.5rem;
      box-shadow: 0 4px 16px rgba(15, 52, 96, 0.25);
}
.channels-banner-text { flex: 1; min-width: 200px; }
.channels-banner-text strong {
      display: block;
      font-size: 1.05rem;
      margin-bottom: 0.25rem;
      font-weight: 700;
}
.channels-banner-text span {
      font-size: 0.9rem;
      opacity: 0.9;
      line-height: 1.4;
}
.channel-btns {
      display: flex;
      flex-wrap: wrap;
      gap: 0.55rem;
      align-items: center;
}
.channel-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.45rem;
      background: #ff6633;
      color: #fff !important;
      text-decoration: none;
      font-weight: 700;
      font-size: 0.92rem;
      padding: 0.7rem 1.15rem;
      border-radius: 10px;
      white-space: nowrap;
      transition: background 0.2s, transform 0.2s;
      border: none;
}
.channel-btn:hover {
      background: #e55a2b;
      transform: translateY(-1px);
}
.channel-btn.tg {
      background: #2AABEE;
}
.channel-btn.tg:hover {
      background: #229ED9;
}
@media (max-width: 640px) {
      .channels-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1rem 1.1rem;
        margin: 1.2rem 0 0;
      }
      .channel-btns { flex-direction: column; width: 100%; }
      .channel-btn { justify-content: center; width: 100%; min-height: 44px; }
}

/* Улучшение доступности */
.nav-card:focus-visible,
.btn-print:focus-visible,
.back-to-top:focus-visible {
      outline: 3px solid var(--accent);
      outline-offset: 2px;
}
.section:target {
      box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.35);
}
  
.channel-btn.max { background: #7B68EE; }
.channel-btn.max:hover { background: #6A5ACD; }

.page-nav { margin: 1rem 0; }
.page-nav a { color: var(--primary); font-weight: 600; text-decoration: none; margin-right: 1rem; }

/* ========== NEW: Sticky top navigation ========== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.top-nav-brand {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.top-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
}
.top-nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.top-nav-links a:hover,
.top-nav-links a.active {
  background: var(--light-blue);
  color: var(--primary);
}
.top-nav-search {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
}
.top-nav-search input {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  width: 160px;
  max-width: 40vw;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.top-nav-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,138,0.15);
}
.top-nav-toggle {
  display: none;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-size: 1.1rem;
  cursor: pointer;
}
@media (max-width: 780px) {
  .top-nav-links {
display: none;
width: 100%;
flex-direction: column;
gap: 0.2rem;
padding-top: 0.5rem;
  }
  .top-nav-links.open { display: flex; }
  .top-nav-toggle { display: inline-flex; }
  .top-nav-search { margin-left: 0; order: 3; width: 100%; }
  .top-nav-search input { width: 100%; max-width: none; }
}

/* ========== Interactive calculators ========== */
.calc-box {
  background: linear-gradient(135deg, #f0f9f8 0%, #e8f4f8 100%);
  border: 1px solid #c5e0dc;
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
  margin: 1.2rem 0;
}
.calc-box h4 {
  color: var(--primary-dark);
  margin-bottom: 0.9rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.calc-question {
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #d4e8e5;
}
.calc-question:last-of-type { border-bottom: none; }
.calc-q-text {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.55rem;
  color: var(--text);
}
.calc-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.calc-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.calc-options label:hover {
  border-color: var(--primary);
  background: var(--light-blue);
}
.calc-options input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}
.calc-options input[type="radio"]:checked + span,
.calc-options label:has(input:checked) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.calc-result {
  margin-top: 1.1rem;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: white;
  border: 2px solid var(--accent);
  text-align: center;
}
.calc-result .score {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.calc-result .interp {
  margin-top: 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.calc-result .interp.mild { color: #27ae60; }
.calc-result .interp.moderate { color: #e67e22; }
.calc-result .interp.severe { color: #c0392b; }
.calc-result .hint {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.calc-reset {
  margin-top: 0.8rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}
.calc-reset:hover {
  background: #f8f9fa;
  color: var(--text);
}

/* QoL for IPSS */
.calc-qol {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed #c5e0dc;
}
.calc-qol .calc-options label {
  font-size: 0.78rem;
  padding: 0.35rem 0.55rem;
}

/* Search results overlay */
.search-results {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.12);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1100;
  display: none;
  margin-top: 4px;
}
.search-results.open { display: block; }
.search-results a {
  display: block;
  padding: 0.7rem 1rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}
.search-results a:hover {
  background: var(--light-blue);
  color: var(--primary);
}
.search-results .sr-page {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.4rem;
}

/* After-procedures cards */
.after-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.after-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.after-card h4 {
  color: var(--primary-dark);
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.after-card ul {
  margin: 0.4rem 0 0 1.1rem;
  font-size: 0.93rem;
}
.after-card li { margin-bottom: 0.35rem; }

/* Dark mode support (prefers-color-scheme + class) */
@media (prefers-color-scheme: dark) {
  :root {
--bg: #1a1f24;
--card: #242b33;
--text: #e8ecef;
--muted: #a0aab4;
--border: #3a4450;
--light-blue: #1e3a45;
  }
  .top-nav {
background: rgba(36,43,51,0.97);
  }
  .calc-box { background: linear-gradient(135deg, #1e3a3a 0%, #1e3a45 100%); border-color: #2a5555; }
  .calc-options label { background: #2a333c; }
  .calc-result { background: #2a333c; }
  .search-results { background: #242b33; }
  .after-card { background: #242b33; }
  .nav-card { background: #2a333c; }
  .section { background: var(--card); }
  .faq-item { background: #2a333c; }
  .tip { background: #1e3a45; }
  .warning-box { background: #3d2e1e; border-color: #e67e22; }
}

body.dark-mode {
  --bg: #1a1f24;
  --card: #242b33;
  --text: #e8ecef;
  --muted: #a0aab4;
  --border: #3a4450;
  --light-blue: #1e3a45;
}
body.dark-mode .top-nav { background: rgba(36,43,51,0.97); }
body.dark-mode .calc-box { background: linear-gradient(135deg, #1e3a3a 0%, #1e3a45 100%); border-color: #2a5555; }
body.dark-mode .calc-options label { background: #2a333c; }
body.dark-mode .calc-result { background: #2a333c; }
body.dark-mode .search-results { background: #242b33; }
body.dark-mode .after-card { background: #242b33; }
body.dark-mode .nav-card { background: #2a333c; }
body.dark-mode .section { background: var(--card); }
body.dark-mode .faq-item { background: #2a333c; }
body.dark-mode .tip { background: #1e3a45; }
body.dark-mode .warning-box { background: #3d2e1e; border-color: #e67e22; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}

/* =========================================================
   DESIGN UPGRADE v2 — all 6 points
   ========================================================= */

/* 6. More breathing room */
.container {
  padding: 1rem 1.25rem 4rem;
}
.section {
  margin-bottom: 2rem;
  padding: 1.9rem 1.65rem;
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(26, 107, 138, 0.06);
  border: 1px solid rgba(223, 230, 233, 0.9);
  transition: box-shadow 0.25s ease;
}
.section:hover {
  box-shadow: 0 6px 24px rgba(26, 107, 138, 0.09);
}
.nav-wrap {
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.intro {
  margin-bottom: 2.2rem;
  padding: 1.45rem 1.6rem;
  border-radius: 16px;
}

/* 4. Cards — richer shadow + stronger hover */
.nav-group {
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(26, 107, 138, 0.07);
  border: 1px solid rgba(223, 230, 233, 0.85);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nav-group:hover {
  box-shadow: 0 8px 28px rgba(26, 107, 138, 0.11);
}
.nav-card {
  background: #f7fafc;
  border: 1px solid #e4ecef;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
  min-height: 74px;
}
.nav-card:hover {
  border-color: var(--primary);
  background: linear-gradient(145deg, #e8f4f8 0%, #f0f9f8 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(26, 107, 138, 0.15);
  color: var(--primary-dark);
}
.nav-card span.icon,
.nav-card .icon-svg {
  font-size: 1.55rem;
  line-height: 1;
  transition: transform 0.22s ease;
}
.nav-card:hover span.icon,
.nav-card:hover .icon-svg {
  transform: scale(1.12);
}
.nav-card .icon-svg {
  width: 28px;
  height: 28px;
  display: block;
}

/* 1. Visual variety — accent strips & softer section headers */
.section h2 {
  position: relative;
  padding-left: 0.15rem;
}
.section h2 .num {
  box-shadow: 0 2px 8px rgba(26, 107, 138, 0.25);
}
.nav-group-head {
  border-bottom: 1px solid transparent;
  background: linear-gradient(90deg, var(--light-blue) 0%, transparent 100%);
  margin: -0.35rem -0.4rem 0.85rem;
  padding: 0.55rem 0.7rem 0.6rem;
  border-radius: 10px 10px 0 0;
}
.nav-group-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.15rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Decorative subtle pattern on header */
.header {
  padding: 2.4rem 1.25rem 2.6rem;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(255,255,255,0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 90% 80%, rgba(42,157,143,0.18) 0%, transparent 45%),
    linear-gradient(135deg, #1a6b8a 0%, #0f4c63 100%);
}
.header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M20 20c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10zm-10 0c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.7;
}
.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.95;
  letter-spacing: 0.02em;
}
.header-brand svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.header h1 {
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.header .header-sub {
  opacity: 0.92;
  font-size: 1.05rem;
  max-width: 720px;
  margin: 0.55rem auto 0;
  line-height: 1.55;
}
.header .header-doctor {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.35rem 0.9rem;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* 3. Compact header on mobile */
@media (max-width: 640px) {
  .header {
    padding: 1.35rem 1rem 2.1rem;
  }
  .header::after {
    height: 32px;
    bottom: -16px;
  }
  .header h1 {
    font-size: 1.28rem;
    line-height: 1.3;
  }
  .header .header-sub {
    font-size: 0.9rem !important;
  }
  .header-brand {
    font-size: 0.82rem;
    margin-bottom: 0.45rem;
  }
  .header .header-doctor {
    font-size: 0.8rem;
    margin-top: 0.6rem;
    padding: 0.28rem 0.7rem;
  }
  .section {
    margin-bottom: 1.5rem;
    padding: 1.35rem 1.1rem;
  }
  .nav-wrap {
    gap: 0.9rem;
    margin-bottom: 1.8rem;
  }
  .nav-card {
    min-height: 64px;
  }
}

/* 5. Dark theme — stronger contrast */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151a1f;
    --card: #1e262e;
    --text: #eef1f4;
    --muted: #9aa5b0;
    --border: #2f3a45;
    --light-blue: #1a3340;
  }
  .tip {
    background: #1a3a42 !important;
    border-left-color: var(--accent);
    color: #d0e8ec;
  }
  .warning-box {
    background: #3a2a1a !important;
    border-color: #e67e22;
    color: #f5e6d3;
  }
  .nav-card {
    background: #252e38;
    border-color: #35404c;
  }
  .nav-card:hover {
    background: linear-gradient(145deg, #1e3a45 0%, #1a3a3a 100%);
    border-color: var(--accent);
  }
  .nav-group {
    background: var(--card);
    border-color: #2f3a45;
  }
  .section {
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  }
  .intro {
    background: var(--card);
    border-left-color: var(--accent);
  }
  .calc-result {
    border-color: var(--accent);
    background: #1e2a32;
  }
  .after-card {
    background: #252e38;
    border-color: #35404c;
  }
  .faq-item {
    background: #252e38;
    border-color: #35404c;
  }
  .header::before {
    opacity: 0.4;
  }
}

body.dark-mode {
  --bg: #151a1f;
  --card: #1e262e;
  --text: #eef1f4;
  --muted: #9aa5b0;
  --border: #2f3a45;
  --light-blue: #1a3340;
}
body.dark-mode .tip {
  background: #1a3a42 !important;
  border-left-color: var(--accent);
  color: #d0e8ec;
}
body.dark-mode .warning-box {
  background: #3a2a1a !important;
  border-color: #e67e22;
  color: #f5e6d3;
}
body.dark-mode .nav-card {
  background: #252e38;
  border-color: #35404c;
}
body.dark-mode .nav-card:hover {
  background: linear-gradient(145deg, #1e3a45 0%, #1a3a3a 100%);
  border-color: var(--accent);
}
body.dark-mode .nav-group {
  background: var(--card);
  border-color: #2f3a45;
}
body.dark-mode .section {
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
body.dark-mode .intro {
  background: var(--card);
}
body.dark-mode .calc-result {
  border-color: var(--accent);
  background: #1e2a32;
}
body.dark-mode .after-card {
  background: #252e38;
  border-color: #35404c;
}
body.dark-mode .faq-item {
  background: #252e38;
  border-color: #35404c;
}
body.dark-mode .top-nav {
  background: rgba(30, 38, 46, 0.97);
  border-bottom-color: #2f3a45;
}
body.dark-mode .search-results {
  background: #1e262e;
  border-color: #2f3a45;
}
body.dark-mode .calc-box {
  background: linear-gradient(135deg, #1a3338 0%, #1a3340 100%);
  border-color: #2a4a50;
}
body.dark-mode .calc-options label {
  background: #252e38;
  border-color: #35404c;
  color: var(--text);
}
body.dark-mode .channels-banner {
  background: var(--card);
}

/* SVG icon base */
.icon-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-svg path,
.icon-svg circle,
.icon-svg rect {
  fill: currentColor;
}

/* After-cards polish */
.after-card {
  border-radius: 16px;
  box-shadow: 0 3px 14px rgba(26,107,138,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.after-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,107,138,0.1);
}

/* Calc box polish */
.calc-box {
  border-radius: 16px;
  box-shadow: 0 3px 14px rgba(42,157,143,0.08);
}
.calc-result {
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(42,157,143,0.1);
}

/* Soft focus ring everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}


/* Partners page — softer visual language */
.partners-hero {
  background: linear-gradient(135deg, #e8f4f8 0%, #eef8f6 50%, #f4f7fa 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 3px 14px rgba(26,107,138,0.05);
}
.partners-hero h2 {
  color: var(--primary-dark);
  font-size: 1.2rem;
  margin-bottom: 0.55rem;
  border: none;
  padding: 0;
}
.partners-hero p {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.6;
}
.partners-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin: 1.2rem 0 1.6rem;
}
@media (max-width: 640px) {
  .partners-grid { grid-template-columns: 1fr; }
}
.partners-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 3px 12px rgba(26,107,138,0.05);
}
.partners-card h3 {
  color: var(--primary);
  font-size: 1.05rem;
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.partners-card ul {
  margin: 0.4rem 0 0 1.1rem;
  font-size: 0.95rem;
}
.partners-card li { margin-bottom: 0.4rem; }
.partners-quote {
  margin: 1.4rem 0;
  padding: 1.15rem 1.35rem;
  border-left: 4px solid var(--accent);
  background: #f0faf8;
  border-radius: 0 14px 14px 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--primary-dark);
}
body.dark-mode .partners-hero {
  background: linear-gradient(135deg, #1a3340 0%, #1a3a38 100%);
  border-color: #2f3a45;
}
body.dark-mode .partners-card {
  background: #1e262e;
  border-color: #2f3a45;
}
body.dark-mode .partners-quote {
  background: #1a3a38;
  color: #d0e8ec;
}


/* Exercise YouTube button */
.exercise-card {
  display: flex;
  flex-direction: column;
}
.exercise-card .ex-reps {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
}
.btn-youtube {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.85rem;
  background: #c62828;
  color: #fff !important;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  transition: background 0.2s, transform 0.2s;
  align-self: stretch;
  text-align: center;
}
.btn-youtube:hover {
  background: #a01f1f;
  transform: translateY(-1px);
}
body.dark-mode .btn-youtube {
  background: #b71c1c;
}


/* Channel buttons — original brand colors restored */
.channel-btn {
  background: #ff6633 !important;
  color: #fff !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  border: none !important;
}
.channel-btn:hover {
  background: #e55a2b !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}
.channel-btn.tg {
  background: #2AABEE !important;
}
.channel-btn.tg:hover {
  background: #229ED9 !important;
}
.channel-btn.max {
  background: #7B68EE !important;
}
.channel-btn.max:hover {
  background: #6A5ACD !important;
}

/* Inline schemes */
.scheme {
  margin: 1.2rem 0 1.4rem;
  padding: 1.15rem 1.2rem;
  background: linear-gradient(180deg, #f7fbfc 0%, #eef6f8 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.scheme-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-dark);
  margin-bottom: 0.85rem;
}
.scheme-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  justify-content: space-between;
}
.scheme-step {
  flex: 1 1 100px;
  min-width: 90px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.6rem;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text);
  box-shadow: 0 2px 6px rgba(26,107,138,0.05);
}
.scheme-step strong {
  display: block;
  color: var(--primary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.scheme-step .sch-ico {
  display: block;
  font-size: 1.45rem;
  margin-bottom: 0.3rem;
  line-height: 1;
}
.scheme-arrow {
  display: flex;
  align-items: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0 0.1rem;
}
.stone-types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin: 1rem 0 1.2rem;
}
@media (max-width: 720px) {
  .stone-types { grid-template-columns: 1fr 1fr; }
  .scheme-arrow { display: none; }
}
.stone-type {
  border-radius: 14px;
  padding: 0.9rem 0.7rem;
  text-align: center;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.8rem;
  line-height: 1.35;
}
.stone-type .st-ico { font-size: 1.5rem; display: block; margin-bottom: 0.35rem; }
.stone-type strong { display: block; color: var(--primary-dark); margin-bottom: 0.2rem; font-size: 0.88rem; }
.stone-type.ox { border-top: 3px solid #1a6b8a; }
.stone-type.ur { border-top: 3px solid #2a9d8f; }
.stone-type.ph { border-top: 3px solid #e67e22; }
.stone-type.st { border-top: 3px solid #8e44ad; }
.diet-scheme {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 1rem 0;
}
@media (max-width: 640px) {
  .diet-scheme { grid-template-columns: 1fr; }
}
.diet-scheme-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  font-size: 0.88rem;
}
.diet-scheme-item strong {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
}
body.dark-mode .scheme { background: #1a2a32; }
body.dark-mode .scheme-step,
body.dark-mode .stone-type,
body.dark-mode .diet-scheme-item { background: #1e262e; border-color: #2f3a45; }
