* { box-sizing: border-box; }

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f7f9fb;
  color: #333;
  margin: 0; padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

.header { text-align: center; padding: 20px 0 10px; }
.logo { height: 48px; display: inline-block; }

.mode-toggle {
  display: flex; justify-content: center; align-items: center; margin: 30px 0;
}

.container {
  max-width: 500px; margin: 20px auto 0; background: #fff;
  padding: 30px 40px; border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: background-color 0.3s;
}

h2 { text-align: center; margin-bottom: 25px; }
h3 { font-size: 1.2rem; margin: 20px 0 10px; font-weight: bold; }

label { font-weight: 600; margin-bottom: 6px; display: block; }
input[type="number"], select {
  width: 100%; padding: 12px; border-radius: 6px; border: 1px solid #ccc;
  font-size: 1rem; margin-bottom: 18px;
}

#result-mileage, #result-pit {
  margin: 20px 0 30px; padding: 20px 20px 30px;
  background: #eef3fa; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-weight: 500; white-space: pre-wrap; line-height: 1.5;
  word-break: break-word; font-size: 1rem;
  transition: background-color 0.3s;
}

#result-mileage p, #result-pit p { margin: 6px 0; }
#result-mileage .value, #result-pit .value { font-weight: bold; }

body.dark-mode { background: #1e1e1e; color: #f0f0f0; }
body.dark-mode .container { background: #2c2c2c; }
body.dark-mode input, body.dark-mode select {
  background: #444; color: #f0f0f0; border: 1px solid #666;
}
body.dark-mode #result-mileage, body.dark-mode #result-pit { background: #303841; }

.toggle-switch {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600;
}

.toggle-switch input[type="checkbox"] {
  width: 40px; height: 20px; appearance: none; background: #ccc;
  border-radius: 20px; position: relative; outline: none; cursor: pointer;
  transition: background-color 0.3s;
}

.toggle-switch input[type="checkbox"]::before {
  content: ""; position: absolute; height: 16px; width: 16px;
  border-radius: 50%; background: #fff; top: 2px; left: 2px;
  transition: transform 0.3s;
}

.toggle-switch input[type="checkbox"]:checked { background: #4285f4; }
.toggle-switch input[type="checkbox"]:checked::before { transform: translateX(20px); }

.required-warning {
  border-color: #e74c3c !important;
  box-shadow: 0 0 4px rgba(231, 76, 60, 0.5);
}
