body {
  min-height: 100vh;
  background: #f4f6f8;
  color: #212529;
  display: flex;
  flex-direction: column;
}

html {
  scroll-behavior: smooth;
}

.site-header {
  width: 100%;
  background: linear-gradient(135deg, #181a1f, #22252c);
  color: #fff;
}

.brand-link {
  min-width: 0;
}

.site-title {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -1px;
  margin: 0;
  line-height: 1.2;
  color: #ffffffc7;
  white-space: nowrap;
}

.navbar-toggler {
  border-color: #ffffff40;
  box-shadow: none !important;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.header-menu {
  gap: .5rem;
}

.header-menu .nav-link {
  color: #ffffffc7;
  font-weight: 500;
  padding-left: .85rem;
  padding-right: .85rem;
  border-radius: .65rem;
}

.header-menu .nav-link:hover,
.header-menu .nav-link:focus {
  color: #fff;
  background: #ffffff14;
}

.install-app-link {
  border: 1px solid #ffffff26;
  background: #ffffff12;
  color: #ffffffd9 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.install-app-link:hover,
.install-app-link:focus {
  color: #ffffff !important;
  background: #ffffff1f;
  border-color: #ffffff3d;
}

.install-app-link[disabled] {
  cursor: default;
  opacity: .68;
}

.install-app-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.install-app-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

.percentage-calculator {
  width: 100%;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 0;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
}

.percentage-screen {
  padding: 20px;
  background: #1e2026;
  color: #ffffff;
  border-bottom: 1px solid #cbd5e1;
}

.percentage-screen-top {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.share-buttons {
  gap: 8px;
}

.share-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}

.share-btn:hover,
.share-btn:focus {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(148, 163, 184, 0.42);
}

.share-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.share-btn .share-icon {
  display:flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
}

.share-btn .share-icon-check {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  visibility:hidden;
  transition:opacity .2s ease, visibility .2s ease;
}

.share-btn .share-icon-copy {
  opacity:1;
  visibility:visible;
  transition:opacity .2s ease, visibility .2s ease;
}

.share-btn.copied .share-icon-copy {
  opacity:0;
  visibility:hidden;
}

.share-btn.copied .share-icon-check {
  opacity:1;
  visibility:visible;
}

.share-btn.copied {
  background:#dcfce7;
  border-color:#86efac;
  color:#166534;
}

.percentage-result-box {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255,255,255,0.06);
  padding: 16px;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.percentage-result-title {
  min-height: 22px;
  font-size: 14px;
  color: #94a3b8;
  text-align: left;
  margin: 0 0 6px;
  font-weight: 800;
}

.percentage-result-text {
  min-height: 40px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.035em;
  font-weight: 900;
  color: #ffffff;
  text-align: left;
  word-break: break-word;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.percentage-form-panel {
  background: #ffffff;
}

#percentageForm {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid #cbd5e1;
}

.field-row {
  padding: 16px;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  background: #ffffff;
}

.field-row:nth-child(2n + 1) {
  border-right: 0;
}

.field-row.full {
  grid-column: 1 / -1;
  border-right: 0;
}

.field-row label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 850;
  color: #111827;
}

.required {
  color: #1d4ed8;
  font-weight: 900;
}

.field-row input,
.field-row select {
  width: 100%;
  height: 52px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
  background: #f8fafc;
  padding: 0 14px;
  font-size: 16px;
  color: #111827;
  outline: none;
}

.field-row input:focus,
.field-row select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px #dbeafe;
  background: #ffffff;
}

.hint {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: #64748b;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.btn-primary,
.btn-secondary {
  min-height: 64px;
  border: 0;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  border-radius: 0;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: background .12s ease, transform .08s ease;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #1d4ed8;
}

.btn-secondary {
  background: #f8fafc;
  color: #111827;
  border-right: 0;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #eef2f7;
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(.992);
}

.content-card,
.about-card,
.legal-page-card {
  border: 1px solid #e6e8ec;
  border-radius: 1.25rem;
}

.calc-content h1,
.calc-content h2,
.calc-content h3,
.perc-title-h2,
.perc-title-h3,
.page-title {
  color: #111827;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.calc-content h1,
.page-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 1rem;
}

.calc-content h2,
.perc-title-h2 {
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  margin: 0 0 1rem;
}

.calc-content h3,
.perc-title-h3 {
  font-size: 1.2rem;
  margin: 1.35rem 0 .75rem;
}

.calc-content p,
.calc-content li {
  color: #6c757d;
  line-height: 1.75;
}

.calc-content p:last-child,
.calc-content ul:last-child,
.calc-content ol:last-child {
  margin-bottom: 0;
}

.calc-content a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}

.calc-content a:hover,
.calc-content a:focus {
  text-decoration: underline;
}

.faq-list {
  margin: 0;
}

.faq-list > .perc-title-h2,
.faq-list > h2,
.faq-list > h3 {
  margin-bottom: 1rem;
}

.faq-item {
  border: 1px solid #e6e8ec;
  border-radius: .85rem;
  background: #ffffff;
  overflow: hidden;
  margin-bottom: .75rem;
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item h3 {
  margin: 0;
}

.faq-trigger {
  width: 100%;
  background: #f8fafc;
  border: 0;
  padding: 1rem 1.125rem;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  cursor: pointer;
}

.faq-trigger:hover,
.faq-trigger:focus {
  background: #eef2f7;
}

.faq-trigger svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform .2s ease;
}

.faq-item.is-open .faq-trigger svg {
  transform: rotate(180deg);
}

.faq-panel {
  padding: 0 1.125rem 1rem;
  color: #6c757d;
  font-size: .96rem;
  line-height: 1.7;
}

.site-footer {
  width: 100%;
  background: #181a1f;
  color: #ffffffb8;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: #ffffffc7;
  text-decoration: none;
  font-size: .925rem;
}

.footer-links a:hover,
.footer-links a:focus {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 991.98px) {
  .header-navbar-row {
    flex-wrap: wrap;
  }

  .site-logo {
    flex: 0 0 auto;
  }

  .site-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .navbar-toggler {
    flex: 0 0 auto;
  }

  .navbar-collapse {
    flex: 0 0 100%;
    width: 100%;
    margin-top: 1rem;
    padding: .75rem;
    background: #ffffff0f;
    border: 1px solid #ffffff1a;
    border-radius: 1rem;
  }

  .header-menu {
    width: 100%;
  }

  .header-menu .nav-link {
    padding: .75rem .85rem;
  }
}

@media (max-width: 640px) {
  main.py-5 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  .percentage-screen {
    padding: 16px;
  }

  .percentage-screen-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .share-buttons {
    width: 100%;
    justify-content: flex-end !important;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-row,
  .field-row:nth-child(2n + 1) {
    border-right: 0;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .btn-primary,
  .btn-secondary {
    border-right: 0;
  }

  

  .percentage-result-text {
    font-size: 1.45rem;
  }
}

.brand-link h1.site-title {
  margin: 0;
}
