/**
 * Funnel calculator — ADP-style side-by-side layout, Gleanit tokens.
 */

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.fc-main {
  padding-top: 60px;
  background: var(--paper);
}

.fc {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-12) var(--space-6) var(--space-20);
}

@media (min-width: 768px) {
  .fc {
    padding: var(--space-16) var(--space-8) var(--space-20);
  }
}

/* Hero */
.fc-hero {
  margin-bottom: var(--space-10);
  max-width: 40rem;
}

.fc-h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: var(--font-weight-medium);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 var(--space-3);
}

.fc-lead {
  margin: 0 0 var(--space-5);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--muted);
}

.fc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
}

.fc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--ink2);
}

.fc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 0.25em;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: 0;
}

.fc-badge--marketer {
  background: color-mix(in srgb, var(--score-good) 16%, var(--white));
  color: var(--score-good);
  border: none;
}

.fc-badge--business {
  background: color-mix(in srgb, var(--chart-blue-deep) 14%, var(--white));
  color: var(--chart-blue-deep);
  border: none;
}

.fc-legend-item .fc-badge {
  width: var(--space-3);
  height: var(--space-3);
  min-width: var(--space-3);
  padding: 0;
  font-size: 0;
  border-radius: var(--radius-full);
}

.fc-legend-item .fc-badge--marketer {
  background: var(--score-good);
}

.fc-legend-item .fc-badge--business {
  background: var(--chart-blue-deep);
}

/* Side-by-side workspace */
.fc-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: start;
  margin-bottom: var(--space-12);
}

@media (min-width: 960px) {
  .fc-workspace {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
    gap: var(--space-10);
  }
}

/* Inputs column */
.fc-inputs {
  min-width: 0;
}

.fc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: var(--border-thin) solid var(--border);
  margin-bottom: var(--space-6);
}

.fc-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.fc-tab:hover {
  color: var(--ink);
}

.fc-tab.is-active {
  color: var(--ink);
  font-weight: var(--font-weight-semibold);
  border-bottom-color: var(--ink);
}

.fc-tab:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.fc-form {
  min-height: 280px;
}

.fc-panel[hidden] {
  display: none !important;
}

.fc-panel-heading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-medium);
  margin: 0 0 var(--space-2);
  color: var(--ink);
}

.fc-panel-desc {
  margin: 0 0 var(--space-8);
  font-size: var(--text-sm);
  line-height: var(--lh-normal);
  color: var(--muted);
}

.fc-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.fc-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.fc-field-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.fc-field-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
}

.fc-field-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.fc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--ink-12);
  outline: none;
  cursor: pointer;
  margin: var(--space-1) 0;
}

.fc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--ink);
  border: 3px solid var(--paper);
  box-shadow: var(--shadow-md);
  cursor: grab;
}

.fc-range::-webkit-slider-thumb:active {
  cursor: grabbing;
}

.fc-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--ink);
  border: 3px solid var(--paper);
  box-shadow: var(--shadow-md);
  cursor: grab;
}

.fc-range::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--ink-12);
}

.fc-range:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.fc-field-hint {
  font-size: var(--text-xs);
  color: var(--muted2);
  margin: 0;
}

/* Summary column (sticky on wide) */
.fc-summary {
  min-width: 0;
}

.fc-summary-sticky {
  padding: 0;
}

@media (min-width: 960px) {
  .fc-summary-sticky {
    position: sticky;
    top: 80px;
  }
}

.fc-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.fc-goal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  max-width: 320px;
}

.fc-goal-label {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--ink2);
}

.fc-goal-input-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  border: var(--border-medium) solid var(--border2);
  border-radius: var(--radius-md);
  background: transparent;
  padding: 0 var(--space-3);
  cursor: text;
}

.fc-goal-input-wrap:hover {
  border-color: var(--ink3);
}

.fc-goal-input-wrap:focus-within {
  border-color: var(--ink);
  outline: 2px solid var(--ink-12);
}

.fc-goal-prefix {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
}

.fc-goal-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: var(--space-3) var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  opacity: 1;
  outline: none;
  -moz-appearance: textfield;
}

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

.fc-ring {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0;
}

.fc-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.fc-ring-track {
  fill: none;
  stroke: var(--ink-08);
  stroke-width: 10;
}

.fc-ring-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: butt;
  transition: stroke-dasharray 0.35s ease, stroke-dashoffset 0.35s ease;
}

.fc-ring-fill--mkt {
  stroke: var(--score-good);
}

.fc-ring-fill--biz {
  stroke: var(--chart-blue-deep);
}

.fc-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4);
}

.fc-ring-label {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.fc-ring-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--score-good);
  line-height: var(--lh-tight);
}

.fc-ring-pct {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--muted);
}

.fc-ring-value.fc-explain-value--neg {
  opacity: 0.75;
}

.fc-ring-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  max-width: 320px;
}

.fc-ring-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--ink2);
}

.fc-ring-legend-item strong {
  font-weight: var(--font-weight-bold);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.fc-ring-legend-swatch {
  width: var(--space-3);
  height: var(--space-3);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.fc-ring-legend-item--mkt .fc-ring-legend-swatch {
  background: var(--score-good);
}

.fc-ring-legend-item--biz .fc-ring-legend-swatch {
  background: var(--chart-blue-deep);
}

.fc-summary-list {
  list-style: none;
  margin: 0 auto var(--space-3);
  padding: 0;
  max-width: 320px;
  width: 100%;
}

.fc-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

.fc-summary-row-label {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
}

.fc-summary-row-value {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.fc-summary-row--emphasis .fc-summary-row-label,
.fc-summary-row--emphasis .fc-summary-row-value {
  font-weight: var(--font-weight-bold);
  color: var(--ink);
}

.fc-summary-list--compact {
  margin-bottom: 0;
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: var(--border-thin) solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 320px;
}

.fc-summary-list--compact .fc-summary-row {
  padding: var(--space-2) 0;
}

.fc-summary-list--compact .fc-summary-row:last-child {
  padding-bottom: 0;
}

.fc-summary-list--compact .fc-summary-row:first-child {
  padding-top: 0;
}

.fc-summary-list--compact .fc-summary-row-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--ink2);
}

.fc-summary-list--compact .fc-summary-row-value {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--ink);
}

.fc-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--muted2);
  cursor: help;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.fc-info:hover,
.fc-info:focus-visible {
  color: var(--ink);
}

.fc-info:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.fc-info-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + var(--space-2));
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
  border: var(--border-thin) solid var(--border2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-regular);
  line-height: var(--lh-snug);
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  z-index: 5;
}

.fc-info:hover .fc-info-tip,
.fc-info:focus-visible .fc-info-tip {
  opacity: 1;
  visibility: visible;
}

/* Below workspace */
.fc-below {
  max-width: 100%;
}

.fc-table-wrap {
  overflow-x: auto;
  border: var(--border-thin) solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
}

.fc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.fc-table-caption {
  caption-side: top;
  text-align: left;
  padding: var(--space-4) var(--space-4) var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-medium);
  color: var(--ink);
}

.fc-table th,
.fc-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: var(--border-thin) solid var(--border);
}

.fc-table th {
  font-weight: var(--font-weight-semibold);
  color: var(--muted);
  background: var(--paper2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fc-table td {
  color: var(--ink);
}

.fc-table tr:last-child td {
  border-bottom: none;
}

.fc-table td:not(:first-child),
.fc-table th:not(:first-child) {
  text-align: right;
}

.fc-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
  padding: var(--space-6) 0;
}

.fc-cta-copy {
  min-width: 0;
}

.fc-cta-copy p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--lh-normal);
}

.fc-cta-copy strong {
  color: var(--ink);
  font-weight: var(--font-weight-semibold);
}

.fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border: var(--border-thin) solid transparent;
  cursor: pointer;
}

.fc-btn-yellow {
  background: var(--brand-yellow);
  color: var(--ink);
  border-color: var(--brand-yellow);
}

.fc-btn-yellow:hover {
  filter: brightness(0.96);
}
