/* Swiss Clean Minimalist Design System */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #FFFFFF;
  color: #09090B;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Layout Utilities */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
.header-bar {
  border-bottom: 1px solid #E4E4E7;
  background: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #09090B;
}

.brand-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: #71717A;
  border: 1px solid #E4E4E7;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-secondary-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #71717A;
  transition: color 0.15s ease;
}

.btn-secondary-link:hover {
  color: #09090B;
}

.btn-primary-action {
  background-color: #000000;
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid #000000;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-primary-action:hover {
  opacity: 0.9;
}

/* Hero Section */
.hero-section {
  padding: 48px 0 32px 0;
  border-bottom: 1px solid #E4E4E7;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #09090B;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1rem;
  color: #71717A;
  max-width: 780px;
}

/* Ad Placement Zone */
.ad-slot-wrapper {
  margin: 32px 0;
  padding: 24px;
  background-color: #FAFAFA;
  border: 1px solid #E4E4E7;
  border-radius: 4px;
  text-align: center;
}

.ad-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #71717A;
  margin-bottom: 8px;
  font-weight: 600;
}

.ad-placeholder {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #71717A;
  font-size: 0.875rem;
  border: 1px dashed #E4E4E7;
  border-radius: 4px;
  background: #FFFFFF;
}

/* Main Calculator Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  margin-top: 32px;
  width: 100%;
}

@media (min-width: 992px) {
  .calculator-grid {
    grid-template-columns: 460px minmax(0, 1fr);
    align-items: start;
  }
}

/* Controls Panel */
.controls-card {
  background-color: #FAFAFA;
  border: 1px solid #E4E4E7;
  border-radius: 6px;
  padding: 28px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #71717A;
  margin-bottom: 20px;
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #09090B;
}

.form-sublabel {
  font-size: 0.75rem;
  color: #71717A;
  margin-bottom: 6px;
  display: block;
}

.input-with-symbol {
  position: relative;
  display: flex;
  align-items: center;
}

.input-symbol {
  position: absolute;
  left: 12px;
  font-size: 0.875rem;
  color: #71717A;
  pointer-events: none;
}

.input-symbol-right {
  position: absolute;
  right: 12px;
  font-size: 0.875rem;
  color: #71717A;
  pointer-events: none;
}

.text-input {
  width: 100%;
  padding: 8px 12px 8px 28px;
  background: #FFFFFF;
  border: 1px solid #E4E4E7;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #09090B;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.text-input.input-pct {
  padding-left: 12px;
  padding-right: 28px;
}

.text-input:focus {
  border-color: #09090B;
}

.range-slider {
  width: 100%;
  margin-top: 8px;
  accent-color: #000000;
  cursor: pointer;
}

/* Preset Buttons */
.preset-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn-preset {
  background: #FFFFFF;
  border: 1px solid #E4E4E7;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #09090B;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  background: #F4F4F5;
  border-color: #D4D4D8;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid #E4E4E7;
  margin-top: 8px;
}

.toggle-info {
  flex: 1;
  padding-right: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 22px;
  opacity: 0.01;
  cursor: pointer;
  z-index: 2;
  margin: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #E4E4E7;
  transition: 0.2s;
  border-radius: 22px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: #000000;
}

input:checked + .slider-round:before {
  transform: translateX(18px);
}

/* Results Display Area */
.results-card {
  background: #FFFFFF;
  border: 1px solid #E4E4E7;
  border-radius: 6px;
  padding: 28px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.results-header {
  border-bottom: 1px solid #E4E4E7;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.break-even-pill {
  display: inline-block;
  background: #FAFAFA;
  border: 1px solid #E4E4E7;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #09090B;
}

.recommendation-banner {
  padding: 16px;
  border-radius: 4px;
  margin-top: 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid #E4E4E7;
  background-color: #FAFAFA;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recommendation-banner.booth-winner {
  border-left: 4px solid #000000;
}

.recommendation-banner.commission-winner {
  border-left: 4px solid #71717A;
}

/* Comparison Cards */
.side-by-side-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 24px;
}

@media (min-width: 640px) {
  .side-by-side-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.comparison-card {
  background-color: #FAFAFA;
  border: 1px solid #E4E4E7;
  border-radius: 4px;
  padding: 20px;
}

.comparison-card.card-highlight {
  border-color: #09090B;
  background-color: #FFFFFF;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #71717A;
  margin-bottom: 8px;
}

.card-net-profit {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #09090B;
  margin-bottom: 4px;
}

.card-subtext {
  font-size: 0.75rem;
  color: #71717A;
  margin-bottom: 20px;
}

.metric-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  padding: 8px 0;
  border-top: 1px solid #E4E4E7;
}

.metric-line:last-child {
  border-bottom: 1px solid #E4E4E7;
}

.metric-name {
  color: #71717A;
}

.metric-val {
  font-weight: 600;
  color: #09090B;
}

/* Annual Projections */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 28px;
}

.annual-summary-table {
  width: 100%;
  min-width: 380px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.annual-summary-table th, 
.annual-summary-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #E4E4E7;
}

.annual-summary-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #71717A;
  font-weight: 600;
}

.annual-summary-table td.numeric {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.annual-summary-table th.numeric {
  text-align: right;
}

/* Contextual Micro-Affiliate Section */
.affiliate-endorsement-banner {
  margin-top: 32px;
  padding: 16px 20px;
  background-color: #FAFAFA;
  border: 1px solid #E4E4E7;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.affiliate-meta {
  font-size: 0.8125rem;
}

.affiliate-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #71717A;
  display: block;
  margin-bottom: 2px;
}

.affiliate-desc {
  font-weight: 500;
  color: #09090B;
}

.btn-affiliate {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #09090B;
  background: #FFFFFF;
  border: 1px solid #09090B;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-affiliate:hover {
  background: #09090B;
  color: #FFFFFF;
}

/* Algorithmic Methodology Section */
.methodology-container {
  margin: 64px 0 32px 0;
  padding-top: 48px;
  border-top: 1px solid #E4E4E7;
}

.methodology-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.methodology-text {
  font-size: 0.9375rem;
  color: #71717A;
  margin-bottom: 24px;
  line-height: 1.6;
}

.formula-card {
  background-color: #FAFAFA;
  border: 1px solid #E4E4E7;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 24px;
}

.formula-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #09090B;
  margin-bottom: 8px;
}

.formula-body {
  font-size: 0.875rem;
  color: #09090B;
  line-height: 1.6;
}

.tax-disclaimer-box {
  background-color: #FFFFFF;
  border-left: 3px solid #71717A;
  padding: 16px;
  font-size: 0.8125rem;
  color: #71717A;
  line-height: 1.5;
  margin-top: 24px;
}

/* Modal Windows */
.modal-scrim {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(9, 9, 11, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s ease-in-out;
}

.modal-scrim.hidden, .hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.modal-scrim.modal-open {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.modal-container {
  background-color: #FFFFFF;
  border: 1px solid #E4E4E7;
  border-radius: 6px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #71717A;
  padding: 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #09090B;
}

/* Modal Form Tabs */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid #E4E4E7;
  margin-bottom: 24px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #71717A;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab-btn.tab-active {
  color: #09090B;
  border-bottom: 2px solid #000000;
}

.portal-form-group {
  margin-bottom: 16px;
}

.portal-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #09090B;
}

.portal-input, .portal-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #E4E4E7;
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
}

.portal-input:focus, .portal-textarea:focus {
  border-color: #09090B;
}

.portal-textarea {
  resize: vertical;
  min-height: 90px;
}

.portal-submit-btn {
  width: 100%;
  padding: 10px;
  background: #000000;
  color: #FFFFFF;
  border: 1px solid #000000;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: opacity 0.15s ease;
}

.portal-submit-btn:hover {
  opacity: 0.9;
}

.modal-status {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: #71717A;
  text-align: center;
}

/* Footer Section */
.site-footer {
  background-color: #FAFAFA;
  border-top: 1px solid #E4E4E7;
  padding: 48px 0;
  margin-top: 64px;
  font-size: 0.8125rem;
  color: #71717A;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-brand-meta {
  max-width: 400px;
}

.footer-brand-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #09090B;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  color: #71717A;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: #09090B;
}

.legal-copy {
  margin-top: 16px;
  font-size: 0.75rem;
  color: #A1A1AA;
}

/* Floating Coffee Widget */
.support-widget-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #000000;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #000000;
  z-index: 99;
  transition: opacity 0.15s ease;
}

.support-widget-float:hover {
  opacity: 0.85;
}

/* Mobile Responsiveness Overrides */
@media (max-width: 640px) {
  .app-container {
    padding: 0 16px;
  }
  .controls-card, .results-card {
    padding: 16px;
  }
  .preset-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .btn-preset {
    width: 100%;
    text-align: center;
  }
  .hero-title {
    font-size: 1.75rem;
    word-break: break-word;
  }
  .annual-summary-table th, 
  .annual-summary-table td {
    padding: 8px 6px;
    font-size: 0.8125rem;
  }
}