/* Caravel Pay: the monthly-sales slider. Used by the home page (compact) and /pricing/ (full).
   Needs base.css. Behaviour: assets/js/calc.js. Without JS it shows the default figures. */
.calc {
  padding: 22px 24px 20px;
  border-radius: 18px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  box-shadow: 0 1px 2px rgba(20, 24, 33, 0.04), 0 20px 40px -30px rgba(20, 24, 33, 0.35);
}
.calc .label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.calc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.calc-value { display: flex; align-items: baseline; gap: 6px; }
.calc-value output {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.calc-value > span { font-size: 14px; color: var(--ink-3); }
.calc-slider {
  --p: 0.482;
  position: relative;
  height: 44px;
  margin: 8px 12px 0;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 12px;
}
.calc-slider:focus { outline: none; }
.calc-slider:focus-visible .calc-thumb { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.calc-rail {
  position: absolute;
  left: -12px;
  right: -12px;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  border-radius: 99px;
  background: var(--cream-2);
}
.calc-rail::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  top: 12px;
  height: 5px;
  background: repeating-linear-gradient(90deg, rgba(20, 24, 33, 0.18) 0 1px, transparent 1px calc(100% / 20));
  opacity: 0.8;
}
.calc-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: calc(12px + var(--p) * (100% - 24px));
  border-radius: inherit;
  background: var(--ink);
}
.calc-thumb {
  position: absolute;
  top: 50%;
  left: calc(var(--p) * 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 0 4px 10px -4px rgba(20, 24, 33, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.calc-thumb span { width: 1.5px; height: 9px; border-radius: 2px; background: var(--ink-3); }
.calc-slider:hover .calc-thumb { transform: scale(1.06); }
.calc-slider.is-held .calc-thumb { transform: scale(1.14); box-shadow: 0 10px 22px -8px rgba(20, 24, 33, 0.5); }
.calc-scale {
  position: relative;
  height: 18px;
  margin: 2px 12px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.calc-scale span { position: absolute; left: calc(var(--p) * 100%); transform: translateX(-50%); }
.calc-keep {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 14px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.calc-keep-label { font-weight: 600; }
.calc-keep-value {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--ink-2);
}
.calc-keep-value .usdc-mark { width: 28px; height: 28px; }
.calc-keep-value b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.03em;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
/* the unit next to the fee stays on one line on narrow screens */
.calc-per { white-space: nowrap; }
.calc-keep-fee { grid-column: 1 / -1; justify-self: end; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.calc-keep-fee b { font-weight: 600; color: var(--ink-2); }
.calc-compare { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.cc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 14px;
  font-size: 13.5px;
}
.cc-name { color: var(--ink-2); }
.cc-row.is-us .cc-name { color: var(--ink); font-weight: 600; }
.cc-val { grid-row: 1; grid-column: 2; font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.cc-val b { font-weight: 650; color: var(--ink); }
.cc-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 6px; }
.cc-bar i { border-radius: 99px; }
.cc-bar .k { flex: var(--k); background: var(--ink); opacity: 0.85; }
.cc-row:not(.is-us) .cc-bar .k { background: var(--ink-3); opacity: 0.5; }
.cc-bar .f { flex: var(--f); background: var(--amber); }
.cc-name em { font-style: normal; color: var(--ink-3); }
.cc-row.is-est .cc-bar .k { background: var(--ink-3); opacity: 0.35; }
.cc-row.is-est .cc-bar .f { opacity: 0.7; }
.cc-diff { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.calc .fine a { color: var(--ink-2); text-underline-offset: 3px; }
.cc-diff b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.calc .fine { margin-top: 12px; font-size: 12.5px; line-height: 1.55; color: var(--ink-3); }

/* compact form on the home page: the two fee rows and one line, no totals block */
.calc.is-compact .calc-compare { margin-top: 18px; }
.calc.is-compact .cc-row { font-size: 14.5px; }
.calc.is-compact .cc-diff { font-size: 14.5px; }

/* inside an article (the pricing page) */
.g-body .calc { margin-block: 1.4em; }
.g-body .calc p { margin: 0; max-width: none; }
.g-body .calc .fine { margin-top: 12px; }
.g-body .calc .cc-diff { margin-top: 4px; }

@media (max-width: 640px) {
  .calc { padding: 18px 16px 16px; }
  .calc-value output { font-size: 26px; }
  .calc-keep-value b { font-size: 26px; }
  .cc-row { grid-template-columns: minmax(0, 1fr); }
  .cc-val { grid-row: auto; grid-column: 1; }
  /* the compact form has short labels: keep the amount beside the name */
  .calc.is-compact .cc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .calc.is-compact .cc-val { grid-row: 1; grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .calc * { transition: none !important; animation: none !important; }
}
