/* "Et si j'avais investi ?" calculator card (see calculator.js). Colors come from the
   theme variables defined in index.html. Losses and errors use the app-wide #c0392b in
   light mode; on the dark card it only reaches 2.9:1, so dark mode gets a lighter red. */
.calc-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; margin-bottom: 14px; color-scheme: light; --calc-loss: #c0392b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .calc-card { color-scheme: dark; --calc-loss: #e8766a; }
}
.calc-card h2 { margin-bottom: 4px; }
.calc-intro { margin: 0 0 12px; color: var(--muted); font-size: 0.8rem; }

.calc-form { display: grid; gap: 12px; margin: 0; }
.calc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.calc-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calc-field label { font-size: 0.8rem; color: var(--muted); }
.calc-field select, .calc-field input {
  width: 100%; min-width: 0; max-width: 100%; min-height: 42px; padding: 8px 10px;
  font: inherit; font-size: 16px; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; }
/* Without this iOS Safari sizes the date field from its native widget and overflows narrow cards. */
.calc-field input[type="date"] { -webkit-appearance: none; appearance: none; text-align: left; }
.calc-field [aria-invalid="true"] { border-color: var(--calc-loss); }
.calc-card :is(select, input, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.calc-submit { width: 100%; min-height: 44px; font-size: 1rem; font-weight: 600;
  background: var(--accent); color: var(--bg); }
.calc-submit:disabled { opacity: 0.65; cursor: progress; }

.calc-error { margin: 10px 0 0; font-size: 0.85rem; color: var(--calc-loss); }
.calc-error:empty { margin: 0; }

.calc-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.calc-examples-label { font-size: 0.72rem; color: var(--muted); }
.calc-chip { min-height: 32px; padding: 4px 10px; font-size: 0.75rem; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); }

.calc-results:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.calc-headline { margin: 0 0 8px; font-size: 0.9rem; line-height: 1.45; }
.calc-value { display: block; font-size: 1.6rem; font-weight: 800; color: var(--accent); overflow-wrap: anywhere; }
.calc-rows { margin: 0; }
.calc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--border); font-size: 0.88rem; }
.calc-row dt { flex: none; color: var(--muted); }
.calc-row dd { min-width: 0; margin: 0; text-align: right; font-weight: 600;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calc-note { margin: 8px 0 0; font-size: 0.72rem; line-height: 1.4; color: var(--muted); }
.calc-card .calc-positive { color: var(--positive); }
.calc-card .calc-negative { color: var(--calc-loss); }
