.save-tool-installed .save-tool-floating { display: none !important; }

.save-tool-floating {
  position: fixed;
  z-index: 1060;
  right: max(16px, env(safe-area-inset-right));
  top: 50%;
  display: grid;
  gap: 14px;
  pointer-events: none;
  transform: translateY(-50%);
}

.save-tool-floating > button {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(142, 187, 226, .8);
  border-radius: 18px;
  background: rgba(240, 248, 255, .94);
  color: #175f96;
  box-shadow: 0 18px 36px rgba(51, 88, 140, .18);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.save-tool-floating > button:nth-child(2) {
  border-color: rgba(126, 204, 178, .82);
  background: rgba(235, 249, 243, .96);
  color: #07836c;
}

.save-tool-floating > button:hover,
.save-tool-floating > button:focus-visible {
  border-color: rgba(226, 48, 108, .42);
  box-shadow: 0 22px 44px rgba(82, 55, 140, .24);
  outline: none;
  transform: translateY(-2px);
}

.save-tool-floating > button:active { transform: translateY(1px); }

.save-tool-floating svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.save-tool-floating span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.save-tool-toast {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: max-content;
  max-width: min(280px, calc(100vw - 32px));
  margin: 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: #101827;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  font-size: 13px;
  line-height: 1.35;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.save-tool-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.save-tool-dialog {
  width: min(94vw, 640px);
  max-height: min(760px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d5e0ec;
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 18%, rgba(239, 246, 255, .95), transparent 34%),
    linear-gradient(140deg, #fff 0%, #fbfffd 56%, #edf9f4 100%);
  color: #111827;
  box-shadow: 0 28px 76px rgba(15, 23, 42, .28);
}

.save-tool-dialog::backdrop { background: rgba(17, 24, 39, .52); }

.save-tool-sheet {
  display: flex;
  max-height: inherit;
  flex-direction: column;
}

.save-tool-sheet > header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 16px;
  padding: 24px 26px 22px;
  border-bottom: 1px solid #dfe8f1;
  background: rgba(255, 255, 255, .82);
}

.save-tool-mark {
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  box-shadow: 0 12px 30px rgba(81, 47, 145, .13);
}

.save-tool-sheet > header small {
  display: block;
  margin-bottom: 4px;
  color: #07836c;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
}

.save-tool-sheet h2 {
  margin: 0;
  font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.16;
}

.save-tool-close {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid #d6e0eb;
  border-radius: 16px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.save-tool-close svg,
.save-tool-option-action svg,
.save-tool-actions button svg,
.save-tool-step-icon svg,
.save-tool-option-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.save-tool-body {
  min-height: 0;
  overflow-y: auto;
  padding: 28px 30px;
}

.save-tool-lead,
.save-tool-note {
  margin: 0;
  color: #62708a;
  font-size: 18px;
  line-height: 1.55;
}

.save-tool-note {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-left: 3px solid #0a967b;
  border-radius: 12px;
  background: rgba(235, 249, 243, .78);
  font-size: 15px;
}

.save-tool-steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.save-tool-steps li,
.save-tool-option {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 78px;
}

.save-tool-steps li + li,
.save-tool-option + .save-tool-option { border-top: 1px solid #dce6f0; }

.save-tool-step-icon,
.save-tool-option-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 17px;
  background: #eaf8f3;
  color: #07836c;
}

.save-tool-steps small {
  display: block;
  margin-bottom: 4px;
  color: #748198;
  font-size: 12px;
  font-weight: 700;
}

.save-tool-steps strong,
.save-tool-option strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
}

.save-tool-option p {
  margin: 7px 0 0;
  color: #62708a;
  font-size: 17px;
  line-height: 1.45;
}

.save-tool-option kbd {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid #c6d3e2;
  border-bottom-width: 3px;
  border-radius: 10px;
  background: #f7fbff;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
}

.save-tool-option-action {
  display: inline-flex;
  min-height: 48px !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px !important;
  border: 1px solid #0a967b;
  border-radius: 13px !important;
  background: #0a967b;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.save-tool-live {
  min-height: 24px;
  margin: 0;
  padding: 0 30px;
  color: #07836c;
  font-size: 14px;
  font-weight: 700;
}

.save-tool-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 26px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid #dfe8f1;
  background: rgba(255, 255, 255, .82);
}

.save-tool-actions button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 1px solid #c9d7e7;
  border-radius: 14px;
  background: #fff;
  color: #283247;
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
}

.save-tool-primary {
  border-color: #0a967b !important;
  background: #0a967b !important;
  color: #fff !important;
}

.save-tool-secondary { background: #fff; }

.save-tool-share-action {
  border-color: #b9d5ee !important;
  background: #edf6ff !important;
  color: #175f96 !important;
}

.save-tool-close:hover,
.save-tool-close:focus-visible,
.save-tool-actions button:hover,
.save-tool-actions button:focus-visible,
.save-tool-option-action:hover,
.save-tool-option-action:focus-visible {
  outline: 3px solid rgba(10, 150, 123, .16);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .save-tool-floating {
    right: max(10px, env(safe-area-inset-right));
    gap: 10px;
  }

  .save-tool-floating > button {
    width: 52px;
    height: 52px;
    border-radius: 15px;
  }

  .save-tool-dialog {
    width: min(94vw, 520px);
    border-radius: 18px;
  }

  .save-tool-sheet > header {
    grid-template-columns: 50px minmax(0, 1fr) 48px;
    gap: 12px;
    padding: 18px 16px;
  }

  .save-tool-mark,
  .save-tool-step-icon,
  .save-tool-option-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .save-tool-close {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .save-tool-body {
    padding: 22px 16px;
  }

  .save-tool-steps li,
  .save-tool-option {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 13px;
    min-height: 68px;
  }

  .save-tool-option-action {
    grid-column: 2;
    width: fit-content;
    min-height: 44px !important;
  }

  .save-tool-steps strong,
  .save-tool-option strong { font-size: 17px; }

  .save-tool-option p,
  .save-tool-lead { font-size: 15px; }

  .save-tool-live { padding: 0 16px; }

  .save-tool-actions {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .save-tool-actions button {
    flex: 1 1 auto;
    min-height: 50px;
    padding: 0 14px;
    font-size: 15px;
  }
}

@media (max-width: 440px) {
  .save-tool-dialog {
    width: 100%;
    max-width: none;
    max-height: min(84dvh, 720px);
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .save-tool-floating > button,
  .save-tool-toast {
    transition: none;
  }
}
