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

.si-dl-lock { overflow: hidden; }

.si-dl-overlay {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 18, 45, .62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.si-dl-overlay.is-open {
  display: flex;
  animation: si-dl-fade .18s ease;
}

@keyframes si-dl-fade { from { opacity: 0; } to { opacity: 1; } }

.si-dl-card {
  display: flex;
  width: min(88vw, 300px);
  flex-direction: column;
  align-items: center;
  padding: 26px 20px 20px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 52px rgba(11, 25, 60, .24);
  text-align: center;
}

.si-dl-ringwrap { position: relative; width: 67px; height: 67px; }
.si-dl-ring { width: 67px; height: 67px; transform: rotate(-90deg); }
.si-dl-ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.si-dl-ring-track { stroke: #eef2f9; }
.si-dl-ring-bar { stroke: #1877f2; transition: stroke-dashoffset .25s ease; }

.si-dl-overlay.is-indeterminate .si-dl-ring { animation: si-dl-spin 2.4s linear infinite; }
.si-dl-overlay.is-indeterminate .si-dl-ring-bar { transition: none; }
@keyframes si-dl-spin { to { transform: rotate(270deg); } }

.si-dl-ringtext {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #12224a;
  font-size: .89rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.si-dl-check {
  position: absolute;
  inset: 0;
  width: 67px;
  height: 67px;
  padding: 19px;
  opacity: 0;
  fill: none;
  stroke: #0a967b;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: scale(.7);
}

.si-dl-check path { stroke-dasharray: 48; stroke-dashoffset: 48; }
.si-dl-overlay.is-done .si-dl-ring-bar { stroke: #0a967b; }
.si-dl-overlay.is-done .si-dl-ringtext { opacity: 0; }
.si-dl-overlay.is-done .si-dl-check {
  opacity: 1;
  transform: scale(1);
  transition: opacity .2s ease, transform .3s cubic-bezier(.2, 1.3, .4, 1);
}
.si-dl-overlay.is-done .si-dl-check path { animation: si-dl-tick .4s .1s ease forwards; }
@keyframes si-dl-tick { to { stroke-dashoffset: 0; } }

.si-dl-label {
  margin: 16px 0 0;
  color: #25324f;
  font-size: .98rem;
  font-weight: 650;
  line-height: 1.35;
}

.si-dl-meta {
  margin: 5px 0 0;
  min-height: 1.2em;
  color: #7a879e;
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.si-dl-actions {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.si-dl-cancel {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #fff;
  color: #7a879e;
  font: inherit;
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
}

.si-dl-cancel:hover,
.si-dl-cancel:focus-visible { border-color: #a9c2e4; color: #25324f; }
.si-dl-overlay.is-done .si-dl-cancel { visibility: hidden; }

.si-dl-save {
  display: none;
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: #1877f2;
  color: #fff;
  font: inherit;
  font-size: .97rem;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
}

.si-dl-overlay.is-ios .si-dl-save { display: block; visibility: hidden; }
.si-dl-save:hover,
.si-dl-save:focus-visible { background: #0d61d0; }
.si-dl-save:disabled { opacity: .6; cursor: default; }
.si-dl-overlay.is-await-save .si-dl-save {
  display: block;
  visibility: visible;
  animation: si-dl-rise .28s cubic-bezier(.2, 1.2, .4, 1) both;
}
@keyframes si-dl-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.si-dl-overlay.is-await-save .si-dl-cancel { visibility: visible; }

.si-dl-overlay.is-nocancel .si-dl-cancel { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .si-dl-overlay.is-open { animation: none; }
  .si-dl-overlay.is-indeterminate .si-dl-ring { animation-duration: 6s; }
  .si-dl-ring-bar { transition: none; }
  .si-dl-overlay.is-done .si-dl-check { transition: none; }
  .si-dl-overlay.is-done .si-dl-check path { animation: none; stroke-dashoffset: 0; }
  .si-dl-overlay.is-await-save .si-dl-save { animation: none; }
}

.save-tool-floating {
  position: fixed;
  z-index: 1060;
  right: max(14px, env(safe-area-inset-right));
  top: auto;
  bottom: max(86px, calc(env(safe-area-inset-bottom) + 86px));
  display: grid;
  gap: 12px;
  pointer-events: none;
}

.save-tool-floating > button {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(142, 187, 226, .8);
  border-radius: 16px;
  background: rgba(240, 248, 255, .94);
  color: #175f96;
  box-shadow: 0 14px 28px rgba(51, 88, 140, .16);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 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 18px 34px rgba(82, 55, 140, .22);
  outline: none;
  transform: translateY(-2px);
}

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

.save-tool-floating svg {
  width: 22px;
  height: 22px;
  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(92vw, 460px);
  max-height: min(680px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d5e0ec;
  border-radius: 17px;
  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 22px 64px rgba(15, 23, 42, .24);
}

.save-tool-dialog::backdrop {
  background: rgba(17, 24, 39, .58);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

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

.save-tool-sheet > header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 13px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #dfe8f1;
  background: rgba(255, 255, 255, .82);
}

.save-tool-mark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(81, 47, 145, .12);
}

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

.save-tool-sheet h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}

.save-tool-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #d6e0eb;
  border-radius: 11px;
  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: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

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

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

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

.save-tool-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding-top: 2px;
  list-style: none;
}

.save-tool-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-tool-option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 62px;
}

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

.save-tool-step-icon {
  display: grid;
  flex: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #eaf8f3;
  color: #07836c;
}

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

.save-tool-step-text {
  color: #283247;
  font-size: 14px;
  line-height: 1.4;
}

.save-tool-step-text b {
  display: inline-grid;
  flex: none;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  place-items: center;
  border-radius: 50%;
  background: #0a967b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.save-tool-option strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

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

.save-tool-option kbd {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  margin-top: 9px;
  padding: 0 9px;
  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: 13px;
}

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

.save-tool-live {
  min-height: 19px;
  margin: 0;
  padding: 0 20px;
  color: #07836c;
  font-size: 13px;
  font-weight: 700;
}

.save-tool-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px calc(14px + 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: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 18px;
  border: 1px solid #c9d7e7;
  border-radius: 10px;
  background: #fff;
  color: #283247;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

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

.save-tool-cta {
  flex: 1 1 100%;
  min-height: 52px;
  font-size: 16px;
  box-shadow: 0 10px 24px rgba(10, 150, 123, .34);
}

.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: 2px solid rgba(10, 150, 123, .28);
  outline-offset: 1px;
}

@media (max-width: 720px) {
  .save-tool-floating {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 78px));
    gap: 9px;
  }

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

  .save-tool-floating svg {
    width: 19px;
    height: 19px;
  }

  .save-tool-dialog {
    width: min(92vw, 380px);
    max-height: min(540px, calc(100dvh - 24px));
    border-radius: 16px;
  }

  .save-tool-sheet > header {
    grid-template-columns: 34px minmax(0, 1fr) 30px;
    gap: 9px;
    padding: 12px 13px 11px;
  }

  .save-tool-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .save-tool-sheet > header small {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .save-tool-sheet h2 {
    font-size: 16px;
    line-height: 1.3;
  }

  .save-tool-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .save-tool-option-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .save-tool-close {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .save-tool-body {
    padding: 14px 13px;
  }

  .save-tool-steps {
    gap: 10px;
  }

  .save-tool-option {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 46px;
  }

  .save-tool-option-action {
    min-height: 30px !important;
    padding: 0 9px !important;
    gap: 5px;
    font-size: 11.5px;
    white-space: nowrap;
  }

  .save-tool-option-action svg {
    width: 13px;
    height: 13px;
  }

  .save-tool-step-text { font-size: 13px; }

  .save-tool-option strong { font-size: 13.5px; }

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

  .save-tool-option kbd {
    min-height: 27px;
    margin-top: 7px;
    font-size: 12px;
  }

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

  .save-tool-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 11px 13px calc(11px + env(safe-area-inset-bottom));
  }

  .save-tool-actions button {
    min-width: 0;
    min-height: 36px;
    padding: 0 8px;
    font-size: 13px;
  }

  .save-tool-actions button:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 440px) {
  .save-tool-dialog {
    width: calc(100vw - 22px);
    max-width: 360px;
    max-height: min(520px, calc(100dvh - 22px));
    margin: auto;
    border-width: 1px;
    border-radius: 16px;
  }
}

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