.apastigmcalc {
  --apcalc-accent: #49a5b8;
  --apcalc-text: #244249;
  --apcalc-paper: #f7f8f6;
  color: var(--apcalc-text);
  border-radius: 28px;
  padding: 32px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

.apastigmcalc * {
  box-sizing: border-box;
}

.apastigmcalc__inner {
  position: relative;
  z-index: 2;
}

.apastigmcalc__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.apastigmcalc__header h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3vw, 56px);
  line-height: 1.05;
  color: var(--apcalc-accent);
  font-weight: 800;
}

.apastigmcalc__subtitle {
  max-width: 760px;
  font-size: 16px;
  line-height: 1.65;
}

.apastigmcalc__help {
  border: 0;
  background: rgba(255, 255, 255, 0.78);
  color: var(--apcalc-text);
  border-radius: 999px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.apastigmcalc__help svg,
.apastigmcalc__share-buttons svg,
.apastigmcalc__share-trigger svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.apastigmcalc__grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(280px, 0.95fr);
  gap: 28px;
  align-items: start;
}

.apastigmcalc__form,
.apastigmcalc__receipt {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(3px);
  border-radius: 24px;
  padding: 24px;
}

.apastigmcalc__eye + .apastigmcalc__eye {
  margin-top: 24px;
}

.apastigmcalc__eye-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
}

.apastigmcalc__fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.apastigmcalc__fields label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left !important;
}

.apastigmcalc__fields label > span {
  display: block;
  width: 100%;
  text-align: left !important;
}

.apastigmcalc__input {
  width: 100%;
  border: 1px solid rgba(73, 165, 184, 0.35);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
  font-size: 16px;
  color: var(--apcalc-text);
  text-align: left !important;
  text-align-last: left;
}

.apastigmcalc__select {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, rgba(36, 66, 73, 0.7) 50%), linear-gradient(135deg, rgba(36, 66, 73, 0.7) 50%, transparent 50%);
  background-position: calc(100% - 22px) calc(50% - 3px), calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

.apastigmcalc__select::-ms-expand {
  display: none;
}

.apastigmcalc__input::placeholder {
  color: rgba(36, 66, 73, 0.45);
}

.apastigmcalc__input:focus {
  outline: 0;
  border-color: var(--apcalc-accent);
  box-shadow: 0 0 0 3px rgba(73, 165, 184, 0.12);
}

.apastigmcalc__hint {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(36, 66, 73, 0.72);
}

.apastigmcalc__actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.apastigmcalc__calculate,
.apastigmcalc__share-trigger {
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(73, 165, 184, 0.25);
}

.apastigmcalc__calculate {
  background: linear-gradient(135deg, var(--apcalc-accent), #8dd6aa);
}

.apastigmcalc__share-trigger {
  background: linear-gradient(135deg, #5a97b5, var(--apcalc-accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
  align-self: auto;
}

.apastigmcalc__message {
  font-size: 14px;
  font-weight: 600;
}

.apastigmcalc__message.is-error {
  color: #b42318;
}

.apastigmcalc__after-result {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.apastigmcalc__receipt-strip {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(247,248,246,0.98));
  border: 1px dashed rgba(36, 66, 73, 0.22);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.apastigmcalc__receipt-strip::before,
.apastigmcalc__receipt-strip::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 10px;
  background-image: radial-gradient(circle, rgba(36, 66, 73, 0.12) 2px, transparent 2px);
  background-size: 12px 10px;
  background-repeat: repeat-x;
  opacity: 0.65;
}

.apastigmcalc__receipt-strip::before {
  top: -6px;
}

.apastigmcalc__receipt-strip::after {
  bottom: -6px;
}

.apastigmcalc__receipt-strip-title,
.apastigmcalc__receipt-strip-date,
.apastigmcalc__receipt-strip-row {
  position: relative;
  z-index: 1;
}

.apastigmcalc__receipt-strip-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 10px;
}

.apastigmcalc__receipt-strip-date {
  font-size: 12px;
  opacity: 0.72;
  margin-bottom: 12px;
}

.apastigmcalc__receipt-strip-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dotted rgba(36, 66, 73, 0.18);
  align-items: start;
}

.apastigmcalc__receipt-strip-row span,
.apastigmcalc__receipt-strip-row strong {
  font-size: 13px;
  line-height: 1.55;
}

.apastigmcalc__receipt-strip-row strong {
  font-weight: 700;
}

.apastigmcalc__receipt {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,248,246,0.92));
  border: 1px solid rgba(36, 66, 73, 0.06);
}

.apastigmcalc__receipt::before,
.apastigmcalc__receipt::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 12px;
  background-image: radial-gradient(circle, rgba(36, 66, 73, 0.12) 2px, transparent 2px);
  background-size: 14px 12px;
  background-repeat: repeat-x;
  opacity: 0.55;
  pointer-events: none;
}

.apastigmcalc__receipt::before {
  top: -7px;
}

.apastigmcalc__receipt::after {
  bottom: -7px;
}

.apastigmcalc__receipt-header,
.apastigmcalc__receipt-body,
.apastigmcalc__share,
.apastigmcalc__receipt-brand,
.apastigmcalc__receipt-meta {
  position: relative;
  z-index: 1;
}

.apastigmcalc__receipt-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px dashed rgba(36, 66, 73, 0.18);
  padding-bottom: 16px;
}

.apastigmcalc__receipt-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.apastigmcalc__receipt-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.apastigmcalc__receipt-brand strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.apastigmcalc__receipt-brand small,
.apastigmcalc__receipt-meta span {
  opacity: 0.75;
}

.apastigmcalc__receipt-meta {
  font-size: 13px;
  text-align: right;
  line-height: 1.7;
}

.apastigmcalc__receipt-title {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 2px;
}

.apastigmcalc__receipt-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dotted rgba(36, 66, 73, 0.18);
}

.apastigmcalc__receipt-row:last-child {
  border-bottom: 0;
}

.apastigmcalc__receipt-row-title {
  font-size: 18px;
  font-weight: 900;
}

.apastigmcalc__receipt-values {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.apastigmcalc__share {
  margin-top: auto;
  border-top: 1px dashed rgba(36, 66, 73, 0.18);
  padding-top: 16px;
}

.apastigmcalc__share-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  font-weight: 800;
}

.apastigmcalc__share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.apastigmcalc__share-buttons a,
.apastigmcalc__share-buttons button {
  border: 0;
  text-decoration: none;
  color: #fff;
  background: var(--apcalc-accent);
  border-radius: 999px;
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.apastigmcalc__share-buttons a:hover,
.apastigmcalc__share-buttons button:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.apastigmcalc__copy-status {
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
  min-height: 18px;
}

.apastigmcalc__footer-note {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.7;
}

.apastigmcalc__modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.apastigmcalc__modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 15, 18, 0.55);
}

.apastigmcalc__modal-dialog {
  position: relative;
  max-width: 820px;
  margin: 4vh auto;
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  color: #1f3135;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.25);
}

.apastigmcalc__modal-dialog--share {
  max-width: 980px;
}

.apastigmcalc__modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(31, 49, 53, 0.08);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.apastigmcalc__modal-content {
  line-height: 1.75;
  font-size: 16px;
}

.apastigmcalc__modal-content ul,
.apastigmcalc__modal-content ol {
  padding-left: 18px;
}

.apastigmcalc__share-modal-box {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.apastigmcalc__receipt--modal {
  background: linear-gradient(180deg, #fff, #fafaf7);
}

.apastigmcalc__share--modal-actions {
  margin-top: 0;
}

body.apastigmcalc-modal-open,
body.apastigmcalc-share-open {
  overflow: hidden;
}

@media (max-width: 991px) {
  .apastigmcalc {
    padding: 24px 18px;
    border-radius: 22px;
  }

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

  .apastigmcalc__receipt-header {
    flex-direction: column;
  }

  .apastigmcalc__receipt-meta {
    text-align: left;
  }

  .apastigmcalc__after-result {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .apastigmcalc__header {
    flex-direction: column;
    align-items: stretch;
  }

  .apastigmcalc__help {
    width: 100%;
    justify-content: center;
  }

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

  .apastigmcalc__share-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .apastigmcalc__share-buttons a,
  .apastigmcalc__share-buttons button,
  .apastigmcalc__share-trigger {
    justify-content: center;
  }

  .apastigmcalc__modal-dialog {
    margin: 2vh 10px;
    max-height: 96vh;
    border-radius: 18px;
    padding: 24px 18px;
  }

  .apastigmcalc__receipt-row,
  .apastigmcalc__receipt-strip-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media print {
  body * {
    visibility: hidden !important;
  }

  .apastigmcalc,
  .apastigmcalc * {
    visibility: visible !important;
  }

  .apastigmcalc {
    position: static;
    box-shadow: none;
    padding: 0;
    margin: 0;
    background: #fff !important;
  }

  .apastigmcalc__form,
  .apastigmcalc__help,
  .apastigmcalc__share,
  .apastigmcalc__footer-note,
  .apastigmcalc__modal,
  .apastigmcalc__after-result {
    display: none !important;
  }

  .apastigmcalc__receipt {
    padding: 0;
    background: #fff;
    box-shadow: none;
    border: 0;
  }

  .apastigmcalc__receipt::before,
  .apastigmcalc__receipt::after {
    display: none;
  }
}


.apastigmcalc__result-area {
  display: none;
}

.apastigmcalc__hint {
  display: none !important;
}

.apastigmcalc-shortcode-loader {
  width: 100%;
}

.apastigmcalc-shortcode-loader__inner {
  padding: 18px 20px;
  border: 1px dashed rgba(73, 165, 184, 0.35);
  border-radius: 16px;
  color: #244249;
  background: rgba(255, 255, 255, 0.75);
  text-align: center;
  font-weight: 600;
}

.apastigmcalc-shortcode-loader__inner--error {
  color: #9b2c2c;
  border-color: rgba(155, 44, 44, 0.3);
}
