/* Page-scoped styles for /tableau-to-power-bi-migration-cost-calculator/.
   styles.css is a pre-compiled, purged Tailwind bundle — utilities not already
   used elsewhere on the site are not in it — so everything the calculator
   needs beyond the shared classes is a small hand-rolled component here.
   Loaded after styles.css and assets/site.css; shared tokens (var(--brand),
   .roi-range, .faq-chevron, .price-usd/.price-eur) come from those. */

/* Fixed header (~82px): in-page anchors need an offset. */
#how-it-works,
#sensitivity,
#left-out,
#real-numbers,
#faq,
#calc-estimate {
  scroll-margin-top: 96px;
}

/* Visually hidden, still read by assistive tech (the bundle ships no sr-only). */
.calc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Inputs ─────────────────────────────────────────────────────── */

.calc-num {
  width: 110px;
  flex-shrink: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.calc-num-sm {
  width: 72px;
}
.calc-num::-webkit-outer-spin-button,
.calc-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Same focus signal as every other control on the page: a 2px brand outline
   (the utility ring stays for :focus in browsers without :focus-visible). */
.calc-num:focus-visible {
  outline: 2px solid var(--brand, #2563eb);
  outline-offset: 2px;
  box-shadow: none;
}
/* 16px on touch widths so iOS Safari does not zoom the page on focus. */
@media (max-width: 1023px) {
  .calc-num {
    font-size: 16px;
  }
}

/* The negative margin grows the tap target to ~44px without moving the
   text; hidden when the page runs without JS, since it would do nothing. */
.calc-reset {
  background: none;
  border: 0;
  padding: 12px 4px;
  margin: -12px -4px;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
}
.calc:not([data-enhanced]) .calc-reset {
  display: none;
}
.calc-reset:focus-visible {
  outline: 2px solid var(--brand, #2563eb);
  outline-offset: 2px;
  border-radius: 2px;
}

/* A number field with its unit beside it (%, h, mo) or a currency symbol
   before it. */
.calc-field {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.calc-unit {
  font-size: 0.8rem;
  color: #525252;
  white-space: nowrap;
}
.calc-unit-lead {
  font-weight: 600;
  color: #171717;
}

/* Complexity mix: one stacked bar, then three small fields in a row, each with
   its band name above. The ramp runs light to dark with complexity, so the
   bar reads as data, not as three unrelated colours. */
.calc-bar {
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e5e5;
  margin: 0.25rem 0 0.875rem;
}
.calc-bar > span {
  display: block;
  height: 100%;
}
.calc-bar-simple { background: #bfdbfe; }
.calc-bar-moderate { background: #60a5fa; }
.calc-bar-complex { background: #2563eb; }

.calc-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.calc-mix,
.calc-two,
.calc-three {
  display: grid;
  gap: 1rem 1.5rem;
}
.calc-mix { grid-template-columns: repeat(3, minmax(0, auto)); justify-content: start; column-gap: 2rem; }
.calc-two { grid-template-columns: 1fr; }
.calc-three { grid-template-columns: repeat(3, minmax(0, auto)); justify-content: start; column-gap: 2rem; }
@media (min-width: 640px) {
  .calc-two { grid-template-columns: 1fr 1fr; }
}
/* Phones: the three mix fields stay on one row (the inputs shrink to fit);
   the three licence fields, which carry a wider amount, go two-up. */
@media (max-width: 479px) {
  .calc-mix {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 0.75rem;
  }
  .calc-mix .calc-field {
    display: flex;
    gap: 0.375rem;
  }
  .calc-mix .calc-num-sm {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 72px;
    padding-left: 0.625rem;
    padding-right: 0.5rem;
  }
  .calc-three {
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
  }
}
.calc-mix-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.calc-mix-name {
  display: inline-flex;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 600;
  color: #171717;
  white-space: nowrap;
}

/* Advanced assumptions: a native details/summary styled like the FAQ, with
   the live values echoed in the summary line. */
.calc-more {
  border-top: 1px solid #f5f5f5;
  padding-top: 1.25rem;
}
.calc-more-summary,
.calc-lines-summary {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  list-style: none;
  cursor: pointer;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #171717;
}
.calc-more-summary .faq-chevron,
.calc-lines-summary .faq-chevron {
  margin-top: 0.2em;
}
.calc-more-summary::-webkit-details-marker,
.calc-lines-summary::-webkit-details-marker {
  display: none;
}
.calc-more[open] > .calc-more-summary .faq-chevron,
.calc-lines[open] > .calc-lines-summary .faq-chevron {
  transform: rotate(180deg);
}
.calc-more-summary:focus-visible,
.calc-lines-summary:focus-visible {
  outline: 2px solid var(--brand, #2563eb);
  outline-offset: 4px;
  border-radius: 2px;
}
.calc-more-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 1.5rem;
}

/* ── Phone summary bar ──────────────────────────────────────────── */

.calc-mobile-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.25rem -2rem -2rem;
  padding: 0.75rem 2rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e5e5e5;
}
@media (min-width: 1024px) {
  .calc-mobile-bar {
    display: none;
  }
}

/* ── Results ───────────────────────────────────────────────────── */

/* The card has no overflow clipping (it would kill position: sticky), so the
   tinted panel rounds its own outer corners. Sticky on desktop so the figures
   stay in view when the advanced group is opened and the column grows. */
.calc-results {
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
}
@media (min-width: 1024px) {
  .calc-results {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    border-radius: 0 1rem 1rem 0;
  }
}

/* The one visual in the panel: two bars, manual against Antares, so the ratio
   reads before the digits do. Widths are set by the script. */
.calc-cmp {
  height: 6px;
  border-radius: 999px;
  background: #e5e5e5;
  margin-top: 0.5rem;
  overflow: hidden;
}
.calc-cmp > span {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.calc-cmp-manual { background: #a3a3a3; }
.calc-cmp-antares { background: var(--brand, #2563eb); }

/* Figures the script rewrites: tabular widths so a longer number never
   reflows its row. */
.calc [data-out] {
  font-variant-numeric: tabular-nums;
}

.calc-table th,
.calc-table td {
  vertical-align: top;
}
.calc-table td + td,
.calc-table th + th {
  padding-left: 1rem;
}

/* Phones and narrow tablets: the prose tables stack into label / value pairs
   (each cell carries its column header in data-label), so no column is cut
   off behind a horizontal scroll. The three-column band table stays a table. */
@media (max-width: 767px) {
  .calc-stack thead {
    display: none;
  }
  .calc-stack,
  .calc-stack tbody,
  .calc-stack tr,
  .calc-stack td {
    display: block;
    width: 100%;
  }
  .calc-stack tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e5e5;
  }
  .calc-stack tr:last-child {
    border-bottom: 0;
  }
  .calc-stack td {
    border: 0 !important;
    padding: 0.125rem 0 !important;
    text-align: left !important;
    white-space: normal !important;
  }
  .calc-stack td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #525252;
    margin-top: 0.5rem;
  }
  .calc-stack td:first-child::before {
    display: none;
  }
  .calc-stack td:first-child {
    font-weight: 600;
    color: #171717;
  }
}

/* Inline formulas in the prose tables (the pseo prose variant classes are
   compiled only for that container). */
.calc-prose code {
  background: #f5f5f5;
  color: #262626;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .calc-prose code {
    white-space: normal;
  }
}

/* Selection and slider thumb carry the brand rather than browser defaults. */
.calc ::selection {
  background: rgba(37, 99, 235, 0.18);
}
/* A thumb a finger can find: 20px, brand-coloured. */
.calc .roi-range::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
}
.calc .roi-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
}
.calc .roi-range:focus-visible {
  outline: 2px solid var(--brand, #2563eb);
  outline-offset: 4px;
  border-radius: 999px;
}
