/* KI-Kostenrechner (Unterseite /tokenrechner). Alle Regeln auf #dsgpt-tokenrechner begrenzt.
   Quelle: Desktop/dsgpt/Tokenrechner. Preise pflegen: js/tokenrechner.js, Objekt PRICING. */
#dsgpt-tokenrechner {
  --bg-1: #0f1117; --bg-2: #13151d; --bg-3: #171921;
  --s: #1e2130; --s2: #242738;
  --tx: #e8e8ec; --tm: #9ca3af; --td: #6b7280;
  --ac: #2ecc71; --acd: #27ae60; --acl: #6ee7a8;
  --ag: rgba(46, 204, 113, .12); --ags: rgba(46, 204, 113, .22);
  --bd: rgba(255, 255, 255, .07); --bd2: rgba(255, 255, 255, .12); --ba: rgba(46, 204, 113, .3);
  --warn: #e0a458;
  --r: 16px; --rs: 8px; --mw: 1140px;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--tx);
  -webkit-font-smoothing: antialiased; line-height: 1.5;
  box-sizing: border-box;
}
#dsgpt-tokenrechner *, #dsgpt-tokenrechner *::before, #dsgpt-tokenrechner *::after { box-sizing: border-box; }

/* Grid */
#dsgpt-tokenrechner .tr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
@media (max-width: 960px) { #dsgpt-tokenrechner .tr-grid { grid-template-columns: minmax(0, 1fr); } }

/* Karten / Schritte */
#dsgpt-tokenrechner .tr-card { background: var(--bg-3); border: 1px solid var(--bd); border-radius: var(--r); padding: 24px; }
#dsgpt-tokenrechner .tr-steps { display: flex; flex-direction: column; gap: 16px; }
#dsgpt-tokenrechner .tr-step-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
#dsgpt-tokenrechner .tr-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ag); color: var(--ac); font-size: 14px; font-weight: 700; transform: translateY(4px);
}
#dsgpt-tokenrechner h3 { font-size: 19px; font-weight: 600; margin: 0; }
#dsgpt-tokenrechner .tr-hint { color: var(--tm); font-size: 14px; margin: 0 0 18px 40px; }
#dsgpt-tokenrechner .tr-body { margin-left: 40px; }
@media (max-width: 560px) {
  #dsgpt-tokenrechner .tr-card { padding: 20px 16px; }
  #dsgpt-tokenrechner .tr-hint, #dsgpt-tokenrechner .tr-body { margin-left: 0; }
}

/* Nutzerzahl */
#dsgpt-tokenrechner .tr-users { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
#dsgpt-tokenrechner .tr-users-input {
  display: flex; align-items: center; background: var(--s); border: 1px solid var(--bd2); border-radius: 12px; overflow: hidden;
}
#dsgpt-tokenrechner .tr-users-input button {
  width: 44px; height: 48px; border: 0; background: transparent; color: var(--tx); font-size: 22px; cursor: pointer;
}
#dsgpt-tokenrechner .tr-users-input button:hover { background: var(--s2); color: var(--ac); }
#dsgpt-tokenrechner .tr-users-input input {
  width: 84px; height: 48px; border: 0; background: transparent; color: var(--tx); text-align: center;
  font: 600 22px/1 inherit; font-family: inherit; -moz-appearance: textfield; appearance: textfield;
}
#dsgpt-tokenrechner .tr-users-input input::-webkit-outer-spin-button,
#dsgpt-tokenrechner .tr-users-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#dsgpt-tokenrechner .tr-users-input input:focus { outline: none; }
#dsgpt-tokenrechner .tr-users-input:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ag); }
#dsgpt-tokenrechner .tr-users-label { color: var(--tm); font-size: 15px; }

#dsgpt-tokenrechner input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; margin: 22px 0 6px;
  background: linear-gradient(to right, var(--ac) 0%, var(--ac) var(--p, 0%), var(--s2) var(--p, 0%));
  cursor: pointer;
}
#dsgpt-tokenrechner input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid var(--ac);
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
#dsgpt-tokenrechner input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--ac);
}
#dsgpt-tokenrechner input[type=range]:focus-visible { outline: 2px solid var(--ac); outline-offset: 6px; }
#dsgpt-tokenrechner .tr-scale { display: flex; justify-content: space-between; color: var(--td); font-size: 12px; }

/* Auswahl-Kacheln */
#dsgpt-tokenrechner .tr-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } /* Intensität: 2 × 2 */
#dsgpt-tokenrechner .tr-options.tr-tasks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) {
  #dsgpt-tokenrechner .tr-options, #dsgpt-tokenrechner .tr-options.tr-tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#dsgpt-tokenrechner .tr-opt {
  position: relative; text-align: left; font-family: inherit; color: var(--tx); cursor: pointer;
  background: var(--s); border: 1px solid var(--bd); border-radius: 12px; padding: 14px 14px 12px;
  transition: border-color .15s, background .15s, transform .15s;
}
#dsgpt-tokenrechner .tr-opt:hover { border-color: var(--bd2); background: var(--s2); }
#dsgpt-tokenrechner .tr-opt:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
#dsgpt-tokenrechner .tr-opt[aria-pressed=true], #dsgpt-tokenrechner .tr-opt[aria-checked=true] {
  border-color: var(--ac); background: var(--ag);
}
#dsgpt-tokenrechner .tr-opt-title { display: block; font-weight: 600; font-size: 15px; margin-bottom: 2px; padding-right: 18px; }
#dsgpt-tokenrechner .tr-opt-sub { display: block; color: var(--tm); font-size: 13px; line-height: 1.4; }
#dsgpt-tokenrechner .tr-opt-meta { display: block; color: var(--td); font-size: 12px; margin-top: 8px; font-variant-numeric: tabular-nums; }
#dsgpt-tokenrechner .tr-check {
  position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--bd2);
  display: grid; place-items: center;
}
#dsgpt-tokenrechner .tr-opt[aria-pressed=true] .tr-check { background: var(--ac); border-color: var(--ac); }
#dsgpt-tokenrechner .tr-opt[aria-pressed=true] .tr-check::after {
  content: ""; width: 5px; height: 9px; border: solid #0f1117; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg);
}
#dsgpt-tokenrechner .tr-radio-dot {
  position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--bd2);
}
#dsgpt-tokenrechner .tr-opt[aria-checked=true] .tr-radio-dot { border: 5px solid var(--ac); }

/* Cloud/Lokal-Umschalter */
#dsgpt-tokenrechner .tr-modebar { display: flex; gap: 3px; background: var(--s); border: 1px solid var(--bd); border-radius: 10px; padding: 3px; margin-bottom: 16px; max-width: 420px; }
#dsgpt-tokenrechner .tr-modebar button {
  flex: 1; border: 0; background: transparent; color: var(--tm); font: 500 13.5px/1.2 inherit; font-family: inherit;
  padding: 10px 10px; border-radius: 7px; cursor: pointer;
}
#dsgpt-tokenrechner .tr-modebar button:hover { color: var(--tx); }
#dsgpt-tokenrechner .tr-modebar button[aria-checked=true] { background: var(--s2); color: var(--tx); box-shadow: inset 0 0 0 1px var(--ba); }
#dsgpt-tokenrechner .tr-modebar button:focus-visible { outline: 2px solid var(--ac); }

/* Modellwahl */
#dsgpt-tokenrechner .tr-model-group + .tr-model-group { margin-top: 16px; }
#dsgpt-tokenrechner .tr-model-group-label {
  display: flex; justify-content: space-between; gap: 12px; color: var(--td); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
}
#dsgpt-tokenrechner .tr-model-group-label span:last-child { text-transform: none; letter-spacing: 0; font-weight: 400; }
#dsgpt-tokenrechner .tr-model-group--rec .tr-model-group-label { color: var(--acl); }
#dsgpt-tokenrechner .tr-model-group--rec .tr-models .tr-opt:not([aria-checked=true]) { border-color: var(--ba); }
#dsgpt-tokenrechner .tr-models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { #dsgpt-tokenrechner .tr-models { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#dsgpt-tokenrechner .tr-provider { display: block; color: var(--td); font-size: 12px; margin-bottom: 2px; }
#dsgpt-tokenrechner .tr-opt-vram { display: block; color: var(--td); font-size: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; }
#dsgpt-tokenrechner .tr-fit { display: block; font-size: 12px; font-weight: 600; margin-top: 4px; min-height: 15px; }
#dsgpt-tokenrechner .tr-fit-yes { color: var(--acl); }
#dsgpt-tokenrechner .tr-fit-no { color: var(--warn); }

/* VRAM-Check */
#dsgpt-tokenrechner .tr-vram-check { background: var(--s); border: 1px solid var(--bd); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
#dsgpt-tokenrechner .tr-vram-check label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
#dsgpt-tokenrechner .tr-vram-check input { max-width: 160px; }
#dsgpt-tokenrechner .tr-vram-check small { display: block; color: var(--td); font-size: 12.5px; margin-top: 8px; line-height: 1.45; }
#dsgpt-tokenrechner .tr-vram-rec { margin: 10px 0 0; font-size: 13.5px; color: var(--tx); }
#dsgpt-tokenrechner .tr-vram-rec:empty { margin: 0; }
#dsgpt-tokenrechner .tr-vram-rec b { color: var(--acl); }

/* Erweiterte Annahmen */
#dsgpt-tokenrechner details.tr-adv { border-top: 1px solid var(--bd); margin-top: 4px; }
#dsgpt-tokenrechner details.tr-adv > summary {
  list-style: none; cursor: pointer; padding: 18px 0 2px; color: var(--tm); font-size: 15px; display: flex; align-items: center; gap: 10px;
}
#dsgpt-tokenrechner details.tr-adv > summary::-webkit-details-marker { display: none; }
#dsgpt-tokenrechner details.tr-adv > summary::before {
  content: ""; width: 8px; height: 8px; border: solid var(--tm); border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s;
}
#dsgpt-tokenrechner details.tr-adv[open] > summary::before { transform: rotate(45deg); }
#dsgpt-tokenrechner details.tr-adv > summary:hover { color: var(--tx); }
#dsgpt-tokenrechner .tr-adv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; padding-top: 18px; }
@media (max-width: 640px) { #dsgpt-tokenrechner .tr-adv-grid { grid-template-columns: minmax(0, 1fr); } }
#dsgpt-tokenrechner .tr-field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
#dsgpt-tokenrechner .tr-field small { display: block; color: var(--td); font-size: 12.5px; margin-top: 6px; line-height: 1.45; }
#dsgpt-tokenrechner .tr-seg { display: flex; background: var(--s); border: 1px solid var(--bd); border-radius: 10px; padding: 3px; gap: 3px; }
#dsgpt-tokenrechner .tr-seg button {
  flex: 1; border: 0; background: transparent; color: var(--tm); font: 500 13px/1.2 inherit; font-family: inherit;
  padding: 9px 6px; border-radius: 7px; cursor: pointer;
}
#dsgpt-tokenrechner .tr-seg button:hover { color: var(--tx); }
#dsgpt-tokenrechner .tr-seg button[aria-checked=true] { background: var(--s2); color: var(--tx); box-shadow: inset 0 0 0 1px var(--ba); }
#dsgpt-tokenrechner .tr-seg button:focus-visible { outline: 2px solid var(--ac); }
#dsgpt-tokenrechner .tr-numfield {
  width: 100%; height: 42px; background: var(--s); border: 1px solid var(--bd); border-radius: 10px; color: var(--tx);
  padding: 0 12px; font: 500 15px inherit; font-family: inherit;
}
#dsgpt-tokenrechner .tr-numfield:focus { outline: none; border-color: var(--ac); }

/* Ergebnis */
#dsgpt-tokenrechner .tr-result { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }
#dsgpt-tokenrechner .tr-total {
  background: linear-gradient(160deg, #182a20 0%, var(--bg-3) 55%); border: 1px solid var(--ba); border-radius: var(--r); padding: 26px 24px 22px;
}
#dsgpt-tokenrechner .tr-total-label { color: var(--tm); font-size: 14px; margin: 0; }
#dsgpt-tokenrechner .tr-total-value {
  font-size: clamp(40px, 6vw, 54px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
#dsgpt-tokenrechner .tr-total-value small { font-size: 18px; font-weight: 500; color: var(--tm); letter-spacing: 0; }
#dsgpt-tokenrechner .tr-range { color: var(--tm); font-size: 14px; margin: 0 0 18px; }
#dsgpt-tokenrechner .tr-range b { color: var(--tx); font-weight: 600; font-variant-numeric: tabular-nums; }

#dsgpt-tokenrechner .tr-rangebar { position: relative; height: 8px; border-radius: 999px; background: var(--s2); margin: 0 0 20px; }
#dsgpt-tokenrechner .tr-rangebar-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--acd), var(--ac)); opacity: .55; }
#dsgpt-tokenrechner .tr-rangebar-mark { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: #fff; transform: translateX(-2px); }

#dsgpt-tokenrechner .tr-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--bd); border-radius: 12px; overflow: hidden; }
#dsgpt-tokenrechner .tr-kpi { background: rgba(15, 17, 23, .55); padding: 12px 10px; }
#dsgpt-tokenrechner .tr-kpi span { display: block; color: var(--td); font-size: 12px; }
#dsgpt-tokenrechner .tr-kpi b { display: block; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }

#dsgpt-tokenrechner .tr-volume { color: var(--tm); font-size: 13px; margin: 14px 0 0; line-height: 1.55; }
#dsgpt-tokenrechner .tr-volume b { color: var(--tx); font-weight: 500; }

#dsgpt-tokenrechner .tr-compare h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
#dsgpt-tokenrechner .tr-compare p { margin: 0 0 14px; color: var(--tm); font-size: 13px; }
#dsgpt-tokenrechner .tr-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
#dsgpt-tokenrechner .tr-bar {
  display: grid; grid-template-columns: 138px minmax(0, 1fr) 64px; align-items: center; gap: 10px;
  padding: 5px 6px; border-radius: 8px; cursor: pointer; border: 0; background: transparent; width: 100%;
  color: var(--tx); font-family: inherit; text-align: left;
}
#dsgpt-tokenrechner .tr-bar:hover { background: var(--s); }
#dsgpt-tokenrechner .tr-bar:focus-visible { outline: 2px solid var(--ac); }
#dsgpt-tokenrechner .tr-bar-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tm); }
#dsgpt-tokenrechner .tr-bar-track { height: 8px; border-radius: 999px; background: var(--s2); overflow: hidden; }
#dsgpt-tokenrechner .tr-bar-fill { height: 100%; border-radius: 999px; background: #4b5563; min-width: 3px; transition: width .3s ease; }
#dsgpt-tokenrechner .tr-bar-val { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; color: var(--tm); white-space: nowrap; }
#dsgpt-tokenrechner .tr-bar.is-active .tr-bar-name, #dsgpt-tokenrechner .tr-bar.is-active .tr-bar-val { color: var(--tx); font-weight: 600; }
#dsgpt-tokenrechner .tr-bar.is-active .tr-bar-fill { background: var(--ac); }
#dsgpt-tokenrechner .tr-local { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--s); font-size: 13px; color: var(--tm); }
#dsgpt-tokenrechner .tr-local b { color: var(--tx); font-weight: 600; }

#dsgpt-tokenrechner .tr-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 20px; border-radius: 12px;
  background: var(--ac); color: #0f1117; font-weight: 600; font-size: 16px; text-decoration: none; transition: background .15s, transform .15s;
}
#dsgpt-tokenrechner .tr-cta:hover { background: #36df84; transform: translateY(-1px); }
#dsgpt-tokenrechner .tr-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#dsgpt-tokenrechner .tr-fine { color: var(--td); font-size: 12px; text-align: center; margin: -6px 0 0; }

/* Transparenz-Bereich */
#dsgpt-tokenrechner .tr-method { margin-top: 24px; }
#dsgpt-tokenrechner .tr-method > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
#dsgpt-tokenrechner .tr-method > summary::-webkit-details-marker { display: none; }
#dsgpt-tokenrechner .tr-method > summary h3 { font-size: 18px; }
#dsgpt-tokenrechner .tr-method > summary p { margin: 2px 0 0; color: var(--tm); font-size: 14px; }
#dsgpt-tokenrechner .tr-method > summary::after {
  content: "+"; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--s); color: var(--ac); font-size: 20px;
}
#dsgpt-tokenrechner .tr-method[open] > summary::after { content: "–"; }
#dsgpt-tokenrechner .tr-method-body { margin-top: 22px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 860px) { #dsgpt-tokenrechner .tr-method-body { grid-template-columns: minmax(0, 1fr); } }
#dsgpt-tokenrechner .tr-method h4 { font-size: 15px; margin: 0 0 8px; }
#dsgpt-tokenrechner .tr-method p, #dsgpt-tokenrechner .tr-method li { color: var(--tm); font-size: 14px; }
#dsgpt-tokenrechner .tr-method ul { padding-left: 18px; margin: 0 0 16px; }
#dsgpt-tokenrechner .tr-method li { margin-bottom: 6px; }
#dsgpt-tokenrechner .tr-method a { color: var(--acl); }
#dsgpt-tokenrechner .tr-formula {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; background: var(--bg-1); border: 1px solid var(--bd);
  border-radius: 10px; padding: 14px; color: var(--tx); line-height: 1.7; overflow-x: auto; white-space: pre;
}
#dsgpt-tokenrechner .tr-table-wrap { overflow-x: auto; border: 1px solid var(--bd); border-radius: 10px; }
#dsgpt-tokenrechner table { width: 100%; border-collapse: collapse; font-size: 13px; }
#dsgpt-tokenrechner th, #dsgpt-tokenrechner td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--bd); white-space: nowrap; font-variant-numeric: tabular-nums; }
#dsgpt-tokenrechner th:first-child, #dsgpt-tokenrechner td:first-child { text-align: left; }
#dsgpt-tokenrechner th { color: var(--td); font-weight: 500; background: var(--bg-2); }
#dsgpt-tokenrechner td { color: var(--tm); }
#dsgpt-tokenrechner td:first-child { color: var(--tx); }
#dsgpt-tokenrechner tr:last-child td { border-bottom: 0; }

/* Mobile: fixierte Ergebnisleiste, solange das Ergebnis nicht sichtbar ist */
#dsgpt-tokenrechner .tr-mbar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; display: none;
  align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px;
  background: rgba(23, 25, 33, .96); border: 1px solid var(--ba); box-shadow: 0 12px 32px rgba(0,0,0,.5);
  color: var(--tx); font-family: inherit; text-align: left; cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
#dsgpt-tokenrechner .tr-mbar span { display: block; color: var(--tm); font-size: 12px; }
#dsgpt-tokenrechner .tr-mbar b { font-size: 20px; font-variant-numeric: tabular-nums; }
#dsgpt-tokenrechner .tr-mbar i { font-style: normal; color: var(--ac); font-size: 14px; font-weight: 500; white-space: nowrap; }
@media (max-width: 960px) { #dsgpt-tokenrechner .tr-mbar.is-on { display: flex; } }

#dsgpt-tokenrechner .tr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  #dsgpt-tokenrechner * { transition: none !important; }
}
