/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== Custom select arrow ===== */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px !important;
  cursor: pointer;
}

/* ===== Field helpers (used in JS-generated cards) ===== */
.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #111827;
}
.field-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.field-input::placeholder { color: #d1d5db; }

.field-select {
  width: 100%;
  padding: 8px 30px 8px 10px;
  font-size: 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #111827;
}
.field-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ===== Toggle (Present switch) ===== */
.toggle-track .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.toggle-track { display: inline-block; }

/* ===== Job card animation ===== */
.job-card {
  animation: cardIn 0.18s ease-out;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Result number pulse on update ===== */
.res-flash {
  animation: flashPulse 0.3s ease-out;
}
@keyframes flashPulse {
  0%   { opacity: 0.5; transform: scale(0.97); }
  100% { opacity: 1;   transform: scale(1); }
}

/* ===== FAQ details/summary ===== */
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary .chevron { transition: transform 0.2s ease; }
details[open] summary .chevron { transform: rotate(180deg); }

/* ===== Prose table ===== */
.prose-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.prose-table th,
.prose-table td {
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  text-align: left;
}
.prose-table th { background: #f9fafb; font-weight: 600; }
.prose-table tr:nth-child(even) td { background: #f9fafb; }

/* ===== Code block ===== */
.formula-block {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.82rem;
  color: #1e293b;
  overflow-x: auto;
}

/* ===== Scrollbar (webkit) ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ===== Focus visible ===== */
:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
