/* Edelmetall-Sparplan-Rechner V2 – V10, F-WEB-33.
   Farben nur aus fg-site.v5.css (--brand, --brand-deep, --brand-soft, --paper*, --ink*, --line, --plus, --minus) und Gold #b8860b. */
.em-v2{--gold:#b8860b;display:grid;gap:18px;margin-top:22px}
@media(min-width:980px){.em-v2{grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr);align-items:start}}
.em-v2 .card{min-width:0}

/* Eingaben */
.em-felder{display:grid;gap:18px}
.em-feld label{display:block;font-size:.95rem;font-weight:600;margin-bottom:2px;color:var(--ink)}
.em-feld .em-zeile{display:flex;align-items:center;gap:12px}
.em-feld .em-zeile input[inputmode]{width:118px;flex:none}
.em-feld .em-einheit{flex:none;color:var(--ink-3);font-size:.9rem;width:1.6em;margin-left:-6px}
.em-feld .hinweis{margin:2px 0 0}
.em-feld .feldfehler{margin:6px 0 0;color:var(--minus);font-size:.9rem;font-weight:600}
.em-feld input[aria-invalid=true]{border-color:var(--minus);outline-color:var(--minus)}
.em-feld input[type=range]{flex:1;min-width:0;width:auto;height:44px;min-height:44px;margin:0;padding:0;border:0;background:transparent;
  -webkit-appearance:none;appearance:none;cursor:pointer;accent-color:var(--brand)}
.em-feld input[type=range]::-webkit-slider-runnable-track{height:6px;border-radius:99px;background:var(--paper-3)}
.em-feld input[type=range]::-moz-range-track{height:6px;border-radius:99px;background:var(--paper-3)}
.em-feld input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:24px;height:24px;margin-top:-9px;border-radius:50%;
  background:var(--brand);border:3px solid var(--paper);box-shadow:0 0 0 1px var(--brand-deep)}
.em-feld input[type=range]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--brand);border:3px solid var(--paper);box-shadow:0 0 0 1px var(--brand-deep)}
.em-feld input[type=range]:focus{outline:none}
.em-feld input[type=range]:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:8px}
.em-gruppe{margin:4px 0 -4px;font-variant-caps:all-small-caps;letter-spacing:.06em;color:var(--brand);font-weight:600}

/* Ergebnis */
.em-annahme{margin:0 0 6px;font-size:.92rem;color:var(--ink-3)}
.em-reiter{display:flex;flex-wrap:wrap;gap:4px;padding:5px;border-radius:24px;background:var(--paper-3);border:1px solid var(--line);margin:4px 0 6px}
/* A10 (Audit V13): oben die eigene Annahme, darunter die drei Annahmen zum Vergleich */
.em-reiter button[data-szenario=eigen]{flex-basis:100%}
.em-reiter .em-vgl-titel{flex-basis:100%;margin:4px 0 0;padding:0 10px;font-size:.82rem;color:var(--ink-2)}
.em-reiter button{appearance:none;flex:1;border:0;background:transparent;color:var(--ink-2);font:600 .95rem var(--sans);padding:6px 10px;border-radius:999px;
  min-height:48px;cursor:pointer;line-height:1.15;display:flex;flex-direction:column;align-items:center;justify-content:center}
.em-reiter button small{font-weight:500;font-size:.78rem;color:var(--ink-2)}
.em-reiter button[aria-pressed=true]{background:var(--paper);color:var(--ink);box-shadow:0 1px 0 var(--line)}
.em-reiter button[aria-pressed=true] small{color:var(--brand-deep)}
.em-reiter button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.em-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 4px}
@media(min-width:620px){.em-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}}
.em-kpis div{padding:12px 14px;border-radius:14px;background:var(--paper);border:1px solid var(--line);min-width:0}
.em-kpis span{display:block;font-size:.82rem;color:var(--ink-3);line-height:1.25}
.em-kpis b{display:block;font-family:var(--serif);font-weight:500;font-size:1.35rem;line-height:1.2;margin-top:4px;color:var(--ink);overflow-wrap:anywhere}
.em-kpis b.negativ,.em-v2 .negativ{color:var(--minus)}
.em-kpis b.positiv{color:var(--plus)}
.em-grafik{margin-top:22px}
.em-grafik h3{margin:0 0 2px;font-size:1.15rem}
.em-modellhinweis{display:inline-block;margin:2px 0 10px;padding:2px 10px;border-radius:999px;background:var(--brand-soft);color:var(--brand-deep);font-size:.8rem;font-weight:600}
.em-svg{width:100%;overflow:hidden}
.em-svg svg{display:block;max-width:100%}
#em-verlauf-ziel{display:block;border-radius:12px;cursor:crosshair;touch-action:pan-y}
#em-verlauf-ziel:focus-visible{outline:2px solid var(--brand);outline-offset:4px}
.em-legende{display:flex;flex-wrap:wrap;gap:6px 16px;margin:10px 0 0;padding:0;list-style:none;font-size:.85rem;color:var(--ink-2)}
.em-legende li{display:flex;align-items:center;gap:6px}
.em-legende i{display:inline-block;width:14px;height:10px;border-radius:3px}
.em-legende i.linie{height:3px;border-radius:2px}
.em-ablesung{margin-top:10px;padding:10px 14px;border-radius:12px;background:var(--paper);border:1px solid var(--line)}
.em-ablesung p{margin:0 0 6px;font-weight:600}
.em-ablesung dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:4px 18px;margin:0}
.em-ablesung dl div{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:8px;font-size:.9rem;border-bottom:1px dotted var(--line);padding:3px 0}
.em-ablesung dt{color:var(--ink-2);text-align:left}.em-ablesung dd{margin:0;font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap;text-align:right}
.em-ablesung dl div::before{content:"";width:10px;height:10px;border-radius:3px}
.em-s-einz::before{background:var(--ink-2)}.em-s-erloes::before{background:var(--gold)}.em-s-auf::before{background:var(--brand)}
.em-s-lager::before{background:var(--brand-deep)}.em-s-rueck::before{background:var(--brand-soft);box-shadow:inset 0 0 0 1px var(--brand)}.em-s-verlust::before{background:var(--minus)}
.em-schalter{display:flex;align-items:center;gap:12px;min-height:44px;margin:4px 0 0;cursor:pointer;font-size:.95rem}
.em-schalter input{width:24px;height:24px;min-height:24px;flex:none;margin:0;accent-color:var(--minus)}
.em-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
#rechner details summary{min-height:44px;display:flex;align-items:center;cursor:pointer}

/* SVG-Elemente */
.em-raster{stroke:var(--line);stroke-width:1}
.em-achse{fill:var(--ink-3);font:12px var(--sans)}
.em-f-erloes{fill:var(--gold);fill-opacity:.16}
.em-f-auf{fill:var(--brand);fill-opacity:.55}
.em-f-lager{fill:var(--brand-deep);fill-opacity:.45}
.em-f-rueck{fill:var(--brand-soft);stroke:var(--brand);stroke-width:.6;stroke-opacity:.6}
.em-l-einz{fill:none;stroke:var(--ink-2);stroke-width:2;stroke-dasharray:6 4}
.em-l-erloes{fill:none;stroke:var(--gold);stroke-width:3;stroke-linejoin:round}
.em-l-verlust{fill:none;stroke:var(--minus);stroke-width:2.2;stroke-dasharray:3 4;stroke-linecap:round}
.em-mark{stroke:var(--ink-3);stroke-width:1;stroke-dasharray:2 3}
.em-punkt-erloes{fill:var(--gold);stroke:var(--paper);stroke-width:2}
.em-punkt-einz{fill:var(--ink-2);stroke:var(--paper);stroke-width:2}
.em-punkt-verlust{fill:var(--minus);stroke:var(--paper);stroke-width:2}
.em-wf-label{fill:var(--ink-2);font:13px var(--sans)}
.em-wf-wert{fill:var(--ink);font:600 13px var(--sans);font-variant-numeric:tabular-nums}
.em-wf-label.fett,.em-wf-wert.fett{fill:var(--ink);font-weight:700}
.em-wf-wert.neg{fill:var(--minus)}
.em-w-einz{fill:var(--ink-3)}
.em-w-preis{fill:var(--plus);fill-opacity:.75}
.em-w-minus{fill:var(--minus);fill-opacity:.75}
.em-w-auf{fill:var(--brand)}
.em-w-lager{fill:var(--brand-deep)}
.em-w-rueck{fill:var(--brand-soft);stroke:var(--brand);stroke-width:1}
.em-w-erloes{fill:var(--gold)}
.em-w-erloes.blass{fill-opacity:.45}
.em-w-verlust{fill:var(--minus);fill-opacity:.22;stroke:var(--minus);stroke-width:1;stroke-dasharray:3 3}
.em-bezug{stroke:var(--ink-2);stroke-width:1.2;stroke-dasharray:4 3}
.em-verbinder{stroke:var(--ink-3);stroke-width:1}

/* sanftes Einblenden nur ohne „Bewegung reduzieren“ */
/* A8 (Audit V13): nur beim ersten Zeichnen einblenden; .em-ruhig setzt edelmetall-rechner-v2.js ab dem zweiten Zeichnen */
.em-bewegt .em-svg:not(.em-ruhig) svg{animation:em-ein .35s ease-out}
@keyframes em-ein{from{opacity:.55}to{opacity:1}}
@media (prefers-reduced-motion:reduce){.em-bewegt .em-svg svg{animation:none}}

/* Tabelle wie bisher, auf dem Handy als Karten */
.em-tabelle{width:100%;border-collapse:collapse;font-size:.95rem}
.em-tabelle th,.em-tabelle td{border-bottom:1px solid var(--line);padding:8px 6px;text-align:right;font-variant-numeric:tabular-nums}
.em-tabelle td{white-space:nowrap}
.em-tabelle th[scope=row],.em-tabelle thead th:first-child{text-align:left}
@media(max-width:640px){
  .em-karten thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .em-karten tr{display:block;border:1px solid var(--line);border-radius:12px;padding:6px 12px;margin:0 0 10px;background:var(--paper)}
  .em-karten th[scope=row]{display:block;border:0;padding:6px 0;font-weight:700}
  .em-karten td{display:flex;justify-content:space-between;gap:12px;padding:6px 0}
  .em-karten td::before{content:attr(data-label);color:var(--ink-3);text-align:left}
  .em-karten tr td:last-child{border-bottom:0}
  .em-karten caption{display:block}
  .em-feld .em-zeile input[inputmode]{width:104px}
  .em-reiter{border-radius:16px}
  .em-reiter button{font-size:.84rem;padding:6px 4px}
  .em-jahre-box .em-karten tr{padding:2px 10px;margin-bottom:8px}
  .em-jahre-box .em-karten td,.em-jahre-box .em-karten th[scope=row]{padding:3px 0}
}
.em-jahre-box{max-height:320px;overflow:auto}
.em-jahre-box .em-tabelle{font-size:.88rem}
