* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #222;
  line-height: 1.4;
}

.app {
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
  padding: 20px;
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo-icon {
  font-size: 28px;
}

.header h1 {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.tab {
  flex: 1;
  padding: 14px;
  border: none;
  background: transparent;
  color: #666;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}

.tab.active {
  color: #d32f2f;
  border-bottom-color: #d32f2f;
}

.tab:hover:not(.active) {
  color: #333;
  background: #fafafa;
}

/* Calculator */
.calculator {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.inputs {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.input-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.input-group {
  flex: 1;
  min-width: 0;
}

.input-group label,
.slider-group label,
.yeast-selector > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

/* Stepper */
.stepper {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.stepper-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: #f5f5f5;
  color: #333;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.stepper-btn:hover {
  background: #e0e0e0;
}

.stepper-btn:active {
  background: #d32f2f;
  color: #fff;
}

.stepper input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  background: #fff;
  color: #222;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.stepper input:focus {
  outline: none;
  background: #fff8e1;
}

.unit {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* Sliders */
.slider-group {
  margin-bottom: 20px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.slider-value {
  font-size: 15px;
  font-weight: 700;
  color: #2e7d32;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e0e0e0;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d32f2f;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d32f2f;
  border: none;
  cursor: pointer;
}

/* Yeast Selector */
.yeast-selector {
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.yeast-buttons {
  display: flex;
  gap: 8px;
}

.yeast-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s;
}

.yeast-btn:hover {
  border-color: #d32f2f;
  color: #d32f2f;
}

.yeast-btn.active {
  background: #d32f2f;
  border-color: #d32f2f;
  color: #fff;
}

/* Results */
.results {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.results h2 {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  text-align: center;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.result-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 14px 8px;
  text-align: center;
}

.result-card.flour { background: #fffde7; }
.result-card.water { background: #e3f2fd; }
.result-card.salt-result { background: #fafafa; }
.result-card.yeast { background: #e8f5e9; }

.result-label {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.result-value {
  font-size: 22px;
  font-weight: 700;
  color: #222;
}

.result-unit {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

/* Footer */
.footer {
  padding: 20px;
  text-align: center;
}

.footer p {
  font-size: 13px;
  color: #999;
}

/* Animation */
.result-value.updating {
  color: #d32f2f;
}

/* Tablet+ */
@media (min-width: 600px) {
  .calculator {
    padding: 24px;
  }

  .inputs, .results {
    padding: 24px;
  }

  .result-value {
    font-size: 26px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-card {
    padding: 12px;
  }

  .result-value {
    font-size: 24px;
  }
}

@media (max-width: 360px) {
  .input-row {
    flex-direction: column;
    gap: 16px;
  }

  .calculator {
    padding: 12px;
  }

  .inputs, .results {
    padding: 16px;
    border-radius: 10px;
  }
}
