.fw-app {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.5rem;
}

.fw-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  overflow: clip;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  color: #1e293b;
}

.theme-dark .fw-card {
  background: #0f172a;
  border-color: #1e293b;
  color: #f1f5f9;
}

.fw-intention {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #7f1d1d08, #78181808);
}

.theme-dark .fw-intention {
  border-color: #1e293b;
  background: linear-gradient(135deg, #7f1d1d18, #78181818);
}

.fw-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7f1d1d;
  margin: 0 0 0.75rem;
}

.theme-dark .fw-section-label { color: #fca5a5; }

.fw-intention-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.fw-intention-btn {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  border: 1.5px solid #e2e8f0;
  background: transparent;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.theme-dark .fw-intention-btn {
  border-color: #334155;
  color: #94a3b8;
}

.fw-intention-btn:hover {
  border-color: #7f1d1d;
  color: #7f1d1d;
}

.theme-dark .fw-intention-btn:hover {
  border-color: #fca5a5;
  color: #fca5a5;
}

.fw-intention-btn.active {
  background: #7f1d1d;
  border-color: #7f1d1d;
  color: #fff;
}

.theme-dark .fw-intention-btn.active {
  background: #991b1b;
  border-color: #991b1b;
}

.fw-mode {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
}

.theme-dark .fw-mode { border-color: #1e293b; }

.fw-mode-btn {
  flex: 1;
  padding: 0.875rem 1rem;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2.5px solid transparent;
}

.theme-dark .fw-mode-btn { color: #64748b; }

.fw-mode-btn.active {
  color: #7f1d1d;
  border-bottom-color: #7f1d1d;
  background: #7f1d1d08;
}

.theme-dark .fw-mode-btn.active {
  color: #fca5a5;
  border-bottom-color: #fca5a5;
  background: #fca5a518;
}

.fw-grid { display: grid; }

@media (min-width: 1024px) {
  .fw-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.fw-left {
  display: flex;
  flex-direction: column;
  border-right: 0;
}

@media (min-width: 1024px) {
  .fw-left { border-right: 1px solid #e2e8f0; }

  .theme-dark .fw-left { border-right-color: #1e293b; }
}

.fw-sec {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.theme-dark .fw-sec { border-color: #1e293b; }

.fw-sec:last-child { border-bottom: none; }

.fw-sec-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-dark .fw-sec-title { color: #f1f5f9; }

.fw-sec-title::before {
  content: '';
  width: 3px;
  height: 1em;
  background: #7f1d1d;
  border-radius: 2px;
}

.theme-dark .fw-sec-title::before { background: #fca5a5; }

.fw-input-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.fw-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.theme-dark .fw-label { color: #94a3b8; }

.fw-slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fw-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #7f1d1d var(--val, 50%), #e2e8f0 var(--val, 50%));
  outline: none;
  cursor: pointer;
}

.theme-dark .fw-slider {
  background: linear-gradient(to right, #991b1b var(--val, 50%), #1e293b var(--val, 50%));
}

.fw-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7f1d1d;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.theme-dark .fw-slider::-webkit-slider-thumb { background: #fca5a5; }

.fw-num-input {
  width: 4.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.5rem;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

.theme-dark .fw-num-input {
  border-color: #334155;
  background: #1e293b;
  color: #f1f5f9;
}

.fw-num-input:focus {
  outline: none;
  border-color: #7f1d1d;
}

.theme-dark .fw-num-input:focus { border-color: #fca5a5; }

.fw-presets {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.fw-preset-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 0.375rem;
  border: 1.5px solid #e2e8f0;
  background: transparent;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.theme-dark .fw-preset-btn {
  border-color: #334155;
  color: #94a3b8;
}

.fw-preset-btn:hover {
  border-color: #b45309;
  color: #b45309;
}

.theme-dark .fw-preset-btn:hover {
  border-color: #fcd34d;
  color: #fcd34d;
}

.fw-right {
  display: flex;
  flex-direction: column;
}

.fw-pearson-wrap {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.theme-dark .fw-pearson-wrap { border-color: #1e293b; }

.fw-pearson-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7f1d1d;
  margin: 0 0 1rem;
}

.theme-dark .fw-pearson-title { color: #fca5a5; }

.fw-pearson-svg {
  width: 100%;
  max-width: 340px;
  display: block;
  margin: 0 auto;
}

.fw-empty-state {
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
  padding: 2rem 0;
}

.fw-error {
  color: #dc2626;
  font-size: 0.8rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

.theme-dark .fw-error {
  background: #7f1d1d30;
  color: #fca5a5;
}

.fw-results {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.theme-dark .fw-results { border-color: #1e293b; }

.fw-results-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-dark .fw-results-title { color: #f1f5f9; }

.fw-results-title::before {
  content: '';
  width: 3px;
  height: 1em;
  background: #7f1d1d;
  border-radius: 2px;
}

.theme-dark .fw-results-title::before { background: #fca5a5; }

.fw-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.fw-result-card {
  background: #f8fafc;
  border-radius: 0.75rem;
  padding: 0.875rem;
  border: 1px solid #e2e8f0;
}

.theme-dark .fw-result-card {
  background: #1e293b;
  border-color: #334155;
}

.fw-result-card.accent {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  border-color: transparent;
  color: #fff;
}

.fw-result-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.theme-dark .fw-result-label { color: #94a3b8; }

.fw-result-card.accent .fw-result-label { color: #fecaca; }

.fw-result-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}

.theme-dark .fw-result-value { color: #f1f5f9; }

.fw-result-card.accent .fw-result-value { color: #fff; }

.fw-result-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  margin-left: 0.2rem;
}

.theme-dark .fw-result-unit { color: #94a3b8; }

.fw-result-card.accent .fw-result-unit { color: #fecaca; }

.fw-bottles {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.theme-dark .fw-bottles { border-color: #1e293b; }

.fw-bottles-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  flex-shrink: 0;
}

.theme-dark .fw-bottles-label { color: #94a3b8; }

.fw-bottle-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #f1f5f9;
  border-radius: 0.5rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

.theme-dark .fw-bottle-badge {
  background: #1e293b;
  color: #cbd5e1;
}

.fw-bottle-icon {
  width: 1rem;
  height: 1rem;
  opacity: 0.5;
}

.fw-copy-wrap { padding: 1rem 1.5rem; }

.fw-copy-btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: none;
  background: #7f1d1d;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.fw-copy-btn:hover { background: #991b1b; }

.fw-copy-btn.copied { background: #15803d; }

.fw-prop-bar {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #e2e8f0;
  margin-top: 0.75rem;
  display: flex;
}

.theme-dark .fw-prop-bar { background: #1e293b; }

.fw-prop-wine {
  background: #7f1d1d;
  transition: width 0.3s;
}

.fw-prop-spirit {
  background: #b45309;
  transition: width 0.3s;
}

.fw-prop-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: #64748b;
}

.theme-dark .fw-prop-labels { color: #94a3b8; }

.fw-prop-wine-pct {
  color: #7f1d1d;
  font-weight: 700;
}

.theme-dark .fw-prop-wine-pct { color: #fca5a5; }

.fw-prop-spirit-pct {
  color: #b45309;
  font-weight: 700;
}

.theme-dark .fw-prop-spirit-pct { color: #fcd34d; }
