/* Worth-it break-even tool. Scoped so it does not restyle the site header or footer. */

.worth-tool {
  --wt-brand-50: #eef2ff;
  --wt-brand-300: #a5b4fc;
  --wt-brand-400: #818cf8;
  --wt-brand-500: #6366f1;
  --wt-brand-600: #4f46e5;
  --wt-brand-700: #4338ca;
  --wt-success-50: #ecfdf5;
  --wt-success-100: #d1fae5;
  --wt-success-600: #059669;
  --wt-success-700: #047857;
  --wt-warn-50: #fffbeb;
  --wt-warn-100: #fef3c7;
  --wt-warn-600: #d97706;
  --wt-warn-700: #b45309;
  --wt-danger-50: #fef2f2;
  --wt-danger-100: #fee2e2;
  --wt-danger-600: #dc2626;
  --wt-danger-700: #b91c1c;
  --wt-ink-950: #0f172a;
  --wt-ink-900: #1e293b;
  --wt-ink-700: #334155;
  --wt-ink-500: #64748b;
  --wt-ink-400: #94a3b8;
  --wt-ink-50: #f8fafc;
  --wt-border: #e2e8f0;
  --wt-border-strong: #cbd5e1;
  --wt-white: #fff;
  --wt-radius: 10px;
  --wt-radius-lg: 14px;
  --wt-radius-xl: 20px;
}

.worth-tool .worth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.worth-tool .panel {
  background: var(--wt-white);
  border: 1px solid var(--wt-border);
  border-radius: var(--wt-radius-xl);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  padding: 1.5rem 1.5rem 1.75rem;
}

.worth-tool .verdict-panel {
  position: sticky;
  top: 5.5rem;
}

.worth-tool .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.worth-tool .panel-head h3,
.worth-tool .section-divider h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--wt-ink-950);
  letter-spacing: -0.02em;
  margin: 0;
}

.worth-tool .preset-row { display: flex; gap: 0.5rem; }

.worth-tool .spend-fields {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.worth-tool .field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.worth-tool .field-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.375rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--wt-ink-900);
}

.worth-tool .field-hint {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--wt-ink-500);
  width: 100%;
  margin-left: 1.5rem;
}

.worth-tool .input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--wt-border-strong);
  border-radius: var(--wt-radius);
  background: var(--wt-ink-50);
  overflow: hidden;
}

.worth-tool .input-wrap:focus-within {
  border-color: var(--wt-brand-500);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background: var(--wt-white);
}

.worth-tool .input-wrap .prefix {
  padding: 0 0 0 0.875rem;
  font-weight: 600;
  color: var(--wt-ink-500);
  font-size: 0.875rem;
}

.worth-tool .input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.7rem 0.875rem 0.7rem 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--wt-ink-950);
  outline: none;
  min-width: 0;
  width: 100%;
  margin: 0;
}

.worth-tool .input-wrap input::-webkit-outer-spin-button,
.worth-tool .input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.worth-tool .panel-note {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--wt-ink-500);
}

.worth-tool .section-divider {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--wt-border);
  margin-bottom: 1rem;
}

.worth-tool .section-lede {
  font-size: 0.875rem;
  color: var(--wt-ink-500);
  margin-top: 0.35rem;
  line-height: 1.5;
}

.worth-tool .credit-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.worth-tool .credit-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--wt-border);
  border-radius: var(--wt-radius);
  cursor: pointer;
  background: var(--wt-white);
}

.worth-tool .credit-item:hover {
  border-color: var(--wt-brand-300);
  background: var(--wt-brand-50);
}

.worth-tool .credit-item:has(input:checked) {
  border-color: var(--wt-brand-400);
  background: var(--wt-brand-50);
}

.worth-tool .credit-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--wt-brand-600);
  cursor: pointer;
  margin: 0;
}

.worth-tool .credit-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.worth-tool .credit-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--wt-ink-900);
}

.worth-tool .credit-desc,
.worth-tool .credit-use {
  font-size: 0.75rem;
  color: var(--wt-ink-500);
}

.worth-tool .credit-use { font-weight: 600; color: var(--wt-brand-700); }

.worth-tool .credit-amount {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--wt-brand-700);
  font-variant-numeric: tabular-nums;
}

.worth-tool .credits-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.875rem;
  padding: 0.75rem 1rem;
  background: var(--wt-ink-50);
  border-radius: var(--wt-radius);
  font-size: 0.875rem;
  color: var(--wt-ink-700);
}

.worth-tool .credits-subtotal strong {
  font-size: 1.125rem;
  color: var(--wt-brand-700);
}

.worth-tool .bonus-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.875rem;
  align-items: start;
  padding: 1rem;
  border: 1.5px solid var(--wt-border);
  border-radius: var(--wt-radius-lg);
  cursor: pointer;
  background: var(--wt-white);
}

.worth-tool .bonus-toggle:hover,
.worth-tool .bonus-toggle:has(input:checked) {
  border-color: #f59e0b;
  background: var(--wt-warn-50);
}

.worth-tool .bonus-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  accent-color: #d97706;
}

.worth-tool .bonus-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--wt-ink-950);
  margin-bottom: 0.25rem;
}

.worth-tool .bonus-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--wt-ink-500);
  line-height: 1.45;
}

.worth-tool .verdict-banner {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  padding: 1.125rem 1.25rem;
  border-radius: var(--wt-radius-lg);
  margin-bottom: 1.25rem;
}

.worth-tool .verdict-banner[data-verdict="worth"] {
  background: var(--wt-success-50);
  border: 1.5px solid var(--wt-success-100);
}
.worth-tool .verdict-banner[data-verdict="borderline"] {
  background: var(--wt-warn-50);
  border: 1.5px solid var(--wt-warn-100);
}
.worth-tool .verdict-banner[data-verdict="not"] {
  background: var(--wt-danger-50);
  border: 1.5px solid var(--wt-danger-100);
}

.worth-tool .verdict-emoji {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
  color: white;
}
.worth-tool .verdict-banner[data-verdict="worth"] .verdict-emoji { background: var(--wt-success-600); }
.worth-tool .verdict-banner[data-verdict="borderline"] .verdict-emoji { background: var(--wt-warn-600); }
.worth-tool .verdict-banner[data-verdict="not"] .verdict-emoji { background: var(--wt-danger-600); }

.worth-tool .verdict-label {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.worth-tool .verdict-banner[data-verdict="worth"] .verdict-label { color: var(--wt-success-700); }
.worth-tool .verdict-banner[data-verdict="borderline"] .verdict-label { color: var(--wt-warn-700); }
.worth-tool .verdict-banner[data-verdict="not"] .verdict-label { color: var(--wt-danger-700); }

.worth-tool .verdict-sub {
  font-size: 0.875rem;
  color: var(--wt-ink-700);
  margin: 0.15rem 0 0;
}

.worth-tool .math-strip {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem 0 1rem;
}

.worth-tool .math-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.875rem;
  color: var(--wt-ink-700);
  font-variant-numeric: tabular-nums;
}

.worth-tool .math-row span:last-child {
  font-weight: 600;
  color: var(--wt-ink-900);
}

.worth-tool .math-row.muted span:last-child { color: var(--wt-danger-600); }

.worth-tool .math-row.net {
  font-size: 1rem;
  font-weight: 700;
  color: var(--wt-ink-950);
}

.worth-tool .math-row.net span:last-child {
  font-size: 1.25rem;
  font-weight: 800;
}

.worth-tool .math-row.net.positive span:last-child { color: var(--wt-success-700); }
.worth-tool .math-row.net.negative span:last-child { color: var(--wt-danger-700); }
.worth-tool .math-row.net-secondary { font-size: 0.875rem; color: var(--wt-ink-500); }
.worth-tool .math-row.is-hidden { display: none; }

.worth-tool .math-divider {
  height: 1px;
  background: var(--wt-border);
  margin: 0.35rem 0;
}

.worth-tool .breakeven-sentence {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--wt-ink-700);
  background: var(--wt-brand-50);
  border-left: 3px solid var(--wt-brand-500);
  padding: 0.875rem 1rem;
  border-radius: 0 var(--wt-radius) var(--wt-radius) 0;
  margin: 0 0 1.25rem;
}

.worth-tool .assumptions { margin-bottom: 1rem; }

.worth-tool .assumptions h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wt-ink-500);
  margin: 0 0 0.5rem;
}

.worth-tool .assumptions ul {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.worth-tool .assumptions li {
  font-size: 0.75rem;
  color: var(--wt-ink-500);
  padding-left: 0.875rem;
  position: relative;
}

.worth-tool .assumptions li::before {
  content: "·";
  position: absolute;
  left: 0.25rem;
  color: var(--wt-brand-500);
  font-weight: 700;
}

.worth-tool .caveat {
  font-size: 0.75rem;
  color: var(--wt-ink-400);
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.worth-tool .cta-stack {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.worth-tool .wt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--wt-ink-700);
}

.worth-tool .wt-btn-ghost {
  border-color: var(--wt-border-strong);
  background: var(--wt-white);
}

.worth-tool .wt-btn-ghost:hover { background: var(--wt-ink-50); }

.worth-tool .wt-btn-primary {
  background: var(--wt-brand-600);
  color: white;
  padding: 0.8rem 1rem;
  font-size: 1rem;
}

.worth-tool .wt-btn-primary:hover { background: var(--wt-brand-700); }

.worth-tool .cta-stack .wt-btn { width: 100%; }

@media (max-width: 860px) {
  .worth-tool .worth-layout { grid-template-columns: 1fr; }
  .worth-tool .verdict-panel { position: static; }
}
