/* Vigily savings calculator — compact collapsible widget */
.vsc {
  --vsc-bg: #0C1018;
  --vsc-surface: rgba(255, 255, 255, 0.03);
  --vsc-line: rgba(255, 255, 255, 0.06);
  --vsc-line-2: rgba(255, 255, 255, 0.1);
  --vsc-text: #F2F5FA;
  --vsc-muted: #94A0B2;
  --vsc-muted-2: #5E6A7C;
  --vsc-mint: #00E5A0;
  --vsc-mint-dim: rgba(0, 229, 160, 0.14);
  --vsc-danger: #FF7070;
  --vsc-radius: 16px;
  --vsc-ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--vsc-text);
  line-height: 1.35;
  max-width: 480px;
  -webkit-font-smoothing: antialiased;
}

/* Landing page embed */
.vsc-wrap {
  margin: 8px auto 26px;
  max-width: 520px;
}

.vsc-wrap .vsc {
  max-width: none;
  width: 100%;
}

.vsc *, .vsc *::before, .vsc *::after { box-sizing: border-box; }

.vsc-shell {
  position: relative;
  border-radius: var(--vsc-radius);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.045) 0%, transparent 42%),
    var(--vsc-bg);
  border: 1px solid var(--vsc-line);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 16px 40px -28px rgba(0, 0, 0, 0.75),
    0 0 48px -24px rgba(0, 229, 160, 0.12);
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s var(--vsc-ease), box-shadow 0.2s var(--vsc-ease), transform 0.2s var(--vsc-ease);
}

.vsc:not(.is-open):has(.vsc-toggle:hover) .vsc-shell {
  border-color: rgba(0, 229, 160, 0.28);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 20px 44px -28px rgba(0, 0, 0, 0.75),
    0 0 56px -20px rgba(0, 229, 160, 0.22);
  transform: translateY(-1px);
}

.vsc:not(.is-open):has(.vsc-toggle:active) .vsc-shell {
  transform: translateY(0) scale(0.995);
}

.vsc-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg, rgba(0, 229, 160, 0.22), transparent 38%, rgba(255, 255, 255, 0.06));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.vsc-toggle {
  display: block;
  width: 100%;
  padding: 12px 14px 10px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s var(--vsc-ease);
  -webkit-tap-highlight-color: transparent;
}

.vsc:not(.is-open) .vsc-toggle:hover {
  background: rgba(0, 229, 160, 0.035);
}

.vsc.is-open .vsc-toggle:hover {
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.vsc-toggle:focus-visible {
  outline: 2px solid rgba(0, 229, 160, 0.45);
  outline-offset: -2px;
}

.vsc-toggle-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.vsc-title {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--vsc-text);
}

.vsc-chevron {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  height: auto;
  padding: 5px 9px 5px 7px;
  box-sizing: border-box;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--vsc-mint);
  background: rgba(0, 229, 160, 0.08);
  border: 1px solid rgba(0, 229, 160, 0.28);
  box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.35);
  transition: transform 0.25s var(--vsc-ease), border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
}

.vsc:not(.is-open) .vsc-chevron {
  animation: vsc-adjust-ring 2.4s ease-in-out infinite;
}

.vsc-chevron-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--vsc-mint);
  box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.55);
  animation: vsc-dot-pulse 2.2s ease-out infinite;
  flex-shrink: 0;
}

.vsc.is-open .vsc-chevron-dot {
  display: none;
}

@keyframes vsc-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(0, 229, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0); }
}

@keyframes vsc-adjust-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.28); }
  50% { box-shadow: 0 0 0 5px rgba(0, 229, 160, 0); }
}

.vsc-chevron::after {
  content: 'Adjust';
}

.vsc-chevron::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.25s var(--vsc-ease);
}

.vsc:not(.is-open) .vsc-toggle:hover .vsc-chevron {
  color: #2CF2B5;
  border-color: rgba(0, 229, 160, 0.5);
  background: rgba(0, 229, 160, 0.14);
  animation: none;
  box-shadow: 0 0 18px -2px rgba(0, 229, 160, 0.45);
}

.vsc.is-open .vsc-chevron {
  color: var(--vsc-mint);
  border-color: rgba(0, 229, 160, 0.25);
  background: var(--vsc-mint-dim);
  animation: none;
  box-shadow: none;
}

.vsc.is-open .vsc-chevron::before {
  transform: rotate(180deg);
}

.vsc.is-open .vsc-chevron::after {
  content: 'Close';
}

.vsc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vsc-loss-box,
.vsc-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 11px;
}

.vsc-loss-box {
  background: linear-gradient(135deg, rgba(255, 112, 112, 0.14) 0%, rgba(255, 112, 112, 0.04) 100%);
  border: 1px solid rgba(255, 112, 112, 0.22);
  box-shadow: 0 8px 28px -16px rgba(255, 80, 80, 0.45);
}

.vsc-loss-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--vsc-muted);
}

.vsc-loss-num {
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--vsc-danger);
  text-shadow: 0 0 28px rgba(255, 112, 112, 0.35);
}

.vsc-result {
  background: linear-gradient(135deg, rgba(0, 229, 160, 0.1) 0%, rgba(0, 229, 160, 0.03) 100%);
  border: 1px solid rgba(0, 229, 160, 0.16);
  box-shadow: 0 8px 24px -18px rgba(0, 229, 160, 0.55);
}

.vsc-result-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--vsc-muted);
}

.vsc-result-num {
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: linear-gradient(90deg, #00E5A0 0%, #7AF0CF 40%, #6EC8FF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vsc-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--vsc-mint);
}

.vsc-hint::after {
  content: '→';
  font-size: 0.8rem;
  transition: transform 0.2s var(--vsc-ease);
}

.vsc-cta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(0, 229, 160, 0.35);
  background: rgba(0, 229, 160, 0.06);
  transition: background 0.2s var(--vsc-ease), border-color 0.2s, box-shadow 0.2s;
}

.vsc:not(.is-open) .vsc-toggle:hover .vsc-cta-bar {
  background: rgba(0, 229, 160, 0.1);
  border-color: rgba(0, 229, 160, 0.55);
  border-style: solid;
  box-shadow: 0 0 20px -6px rgba(0, 229, 160, 0.35);
}

.vsc:not(.is-open) .vsc-toggle:hover .vsc-hint::after {
  transform: translateX(3px);
}

.vsc.is-open .vsc-cta-bar { display: none; }

.vsc-sliders {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--vsc-line);
  background: rgba(0, 0, 0, 0.12);
}

.vsc.is-open .vsc-sliders {
  display: grid;
  animation: vsc-in 0.28s var(--vsc-ease);
}

@keyframes vsc-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.vsc-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 10px;
  background: var(--vsc-surface);
  border: 1px solid var(--vsc-line);
  transition: border-color 0.2s, background 0.2s;
}

.vsc-field:focus-within {
  border-color: rgba(0, 229, 160, 0.28);
  background: rgba(0, 229, 160, 0.04);
}

.vsc-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.vsc-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vsc-muted-2);
}

.vsc-val {
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--vsc-text);
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--vsc-line);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vsc-val:hover {
  border-color: rgba(0, 229, 160, 0.35);
  background: rgba(0, 229, 160, 0.08);
}

.vsc-val:focus-visible {
  outline: 2px solid rgba(0, 229, 160, 0.45);
  outline-offset: 1px;
}

.vsc-val-input {
  width: 3.5rem;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.vsc-val-input::-webkit-outer-spin-button,
.vsc-val-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.vsc input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 2px 0 1px;
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  accent-color: var(--vsc-mint);
}

.vsc input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--vsc-mint);
  box-shadow: 0 0 0 3px rgba(0, 229, 160, 0.18), 0 2px 8px rgba(0, 229, 160, 0.35);
  transition: transform 0.15s var(--vsc-ease);
}

.vsc input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

.vsc input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--vsc-mint);
  box-shadow: 0 0 0 3px rgba(0, 229, 160, 0.18), 0 2px 8px rgba(0, 229, 160, 0.35);
}

.vsc-foot {
  padding: 8px 14px 11px;
  border-top: 1px solid var(--vsc-line);
  background: rgba(0, 0, 0, 0.1);
}

.vsc-note {
  font-size: 0.6875rem;
  color: var(--vsc-muted-2);
  line-height: 1.5;
  padding-left: 9px;
  border-left: 2px solid rgba(0, 229, 160, 0.45);
}

.vsc-note b {
  color: var(--vsc-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .vsc-sliders { animation: none; }
  .vsc input[type="range"]::-webkit-slider-thumb { transition: none; }
  .vsc-chevron { transition: none; animation: none; }
  .vsc-chevron-dot { animation: none; }
}
