.calculator-result-share,
.calculator-result-share *,
.calculator-share-dialog,
.calculator-share-dialog * {
  box-sizing: border-box;
}

.calculator-result-share {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #d9e0e4;
  border-radius: 16px;
  background: #f8faf8;
}

.calculator-result-share__cta {
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  border: 1px solid #35523d;
  border-radius: 10px;
  background: #35523d;
  color: #fff;
  font: inherit;
  font-weight: 800;
  line-height: 1.35;
  cursor: pointer;
}

.calculator-result-share__cta:hover:not(:disabled) {
  background: #294331;
}

.calculator-result-share__cta:disabled {
  border-color: #cbd3cf;
  background: #e4e9e6;
  color: #68756e;
  cursor: not-allowed;
}

.calculator-result-share__cta:focus-visible,
.calculator-share-dialog button:focus-visible,
.calculator-share-dialog input:focus-visible {
  outline: 3px solid rgba(143, 165, 99, 0.42);
  outline-offset: 2px;
}

.calculator-result-share__status {
  margin: 10px 0 0;
  color: #59675f;
  font-size: 14px;
  line-height: 1.6;
}

.calculator-share-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(880px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: #1a2b3b;
  box-shadow: 0 24px 80px rgba(19, 36, 27, 0.24);
}

.calculator-share-dialog::backdrop {
  background: rgba(17, 31, 24, 0.58);
  backdrop-filter: blur(3px);
}

.calculator-share-dialog:not([open]) {
  display: none;
}

.calculator-share-dialog-open {
  overflow: hidden;
}

.calculator-share-dialog__panel {
  padding: 28px;
}

.calculator-share-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.calculator-share-dialog__header h2,
.calculator-share-dialog__eyebrow,
.calculator-share-dialog__description,
.calculator-share-dialog__privacy-note,
.calculator-share-dialog__status,
.calculator-share-dialog__fallback-status p {
  margin: 0;
}

.calculator-share-dialog__eyebrow {
  margin-bottom: 6px;
  color: #597152;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.calculator-share-dialog__header h2 {
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.25;
}

.calculator-share-dialog__close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #d6ded9;
  border-radius: 50%;
  background: #fff;
  color: #32453a;
  font: inherit;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.calculator-share-dialog__description {
  margin-top: 14px;
  color: #59675f;
  line-height: 1.65;
}

.calculator-share-dialog__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.calculator-share-dialog fieldset {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid #d9e0dc;
  border-radius: 14px;
}

.calculator-share-dialog legend {
  padding: 0 5px;
  color: #30483a;
  font-weight: 800;
}

.calculator-share-dialog fieldset label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  padding: 9px 8px;
  border-radius: 9px;
  color: #34463c;
  cursor: pointer;
}

.calculator-share-dialog fieldset label:hover {
  background: #f4f7f4;
}

.calculator-share-dialog fieldset input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: #52704e;
}

.calculator-share-dialog__privacy-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f2f6f1;
  color: #45584c;
  font-size: 14px;
  line-height: 1.6;
}

.calculator-share-dialog__create,
.calculator-share-dialog__actions button {
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid #35523d;
  border-radius: 10px;
  background: #35523d;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.calculator-share-dialog__create {
  width: 100%;
  margin-top: 16px;
}

.calculator-share-dialog__create:disabled {
  opacity: 0.65;
  cursor: wait;
}

.calculator-share-dialog__status {
  min-height: 24px;
  margin-top: 12px;
  color: #4a5b51;
  font-size: 14px;
  line-height: 1.55;
}

.calculator-share-dialog__preview {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #d8e0dc;
  border-radius: 14px;
  background: #edf0f2;
}

.calculator-share-dialog__preview img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
}

.calculator-share-dialog__actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.calculator-share-dialog__actions button:not(:first-child) {
  border-color: #aebdb3;
  background: #fff;
  color: #30473b;
}

.calculator-share-dialog__fallback-status {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.calculator-share-dialog__fallback-status .is-success {
  color: #286039;
}

.calculator-share-dialog__fallback-status .is-error {
  color: #a13d32;
}

@media (max-width: 680px) {
  .calculator-result-share {
    padding: 16px;
  }

  .calculator-share-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }

  .calculator-share-dialog__panel {
    padding: 20px 16px;
  }

  .calculator-share-dialog__options,
  .calculator-share-dialog__actions {
    grid-template-columns: 1fr;
  }

  .calculator-share-dialog__actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calculator-share-dialog,
  .calculator-result-share__cta {
    scroll-behavior: auto;
    transition: none;
  }
}
