:root {
  --bg: #F3E9D2;
  --card-bg: #FAF3E4;
  --ink: #1A1A1A;
  --mustard: #E8AE1A;
  --teal: #2A9D8F;
  --coral: #E8604C;
  --border-w: 3px;
  --shadow-off: 5px;
  --radius: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.4;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

header.app-header {
  text-align: center;
  margin-bottom: 20px;
}

header.app-header h1 {
  font-size: 1.5rem;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

header.app-header p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.75;
}

.card {
  background: var(--card-bg);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--ink);
  padding: 16px;
  margin-bottom: 20px;
}

.field {
  margin-bottom: 14px;
}

.field:last-child { margin-bottom: 0; }

label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

select, input[type="number"], input[type="url"], input[type="text"] {
  width: 100%;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  appearance: none;
}

select:disabled, input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select:focus, input:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--ink);
}

.help-text {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 5px;
}

.soc-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.soc-row input[type="number"] {
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.nudge-btn {
  flex: 0 0 42px;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  background: var(--mustard);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}

.nudge-btn:active {
  transform: translate(2px, 2px);
}

.vehicle-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--teal);
  color: #fff;
}

.vehicle-badge.conflict {
  background: var(--coral);
}

.btn {
  display: block;
  width: 100%;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  padding: 13px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: var(--mustard);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn.secondary {
  background: #fff;
}

.btn.teal {
  background: var(--teal);
  color: #fff;
}

.btn.coral {
  background: var(--coral);
  color: #fff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.results {
  display: flex;
  gap: 12px;
}

.result-card {
  flex: 1;
  background: var(--mustard);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--ink);
  padding: 14px 12px;
  text-align: center;
}

.result-card.cost {
  background: var(--teal);
  color: #fff;
}

.result-card .value {
  font-size: 1.6rem;
  font-weight: 800;
  display: block;
  margin-top: 2px;
}

.result-card .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.disclaimer {
  margin-top: 14px;
  padding: 10px 12px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  font-size: 0.8rem;
  background: #fff;
}

.link-btn {
  background: none;
  border: none;
  text-decoration: underline;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
  padding: 6px 0;
}

.hidden { display: none !important; }

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px solid #d8cba8;
}

.detail-row:last-child { border-bottom: none; }

.history-item {
  font-size: 0.78rem;
  padding: 8px 0;
  border-bottom: 1px solid #d8cba8;
}

.history-item:last-child { border-bottom: none; }

.history-item .meta {
  opacity: 0.65;
  font-size: 0.72rem;
}

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.action-row .btn {
  flex: 1;
}

.form-msg {
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
}

.form-msg.ok { background: var(--teal); color: #fff; }
.form-msg.err { background: var(--coral); color: #fff; }

.section-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin: 0 0 10px;
}

footer {
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 24px;
}
