/* Honorar-Rechner nach JVEG (templates/tool-jveg.php). Karte, Schritte, Felder,
   Auswahlflächen und Weiche kommen aus dem gemeinsamen Unterbau der Rechner
   (tailwind/input.css, css/rechner-weiche.css); hier stehen nur die Teile,
   die dieser Rechner zusätzlich hat.

   Das wiederkehrende Motiv ist die Abrechnung: die Aufstellung als Beleg mit
   Kopfleiste, gestrichelten Zeilen und doppelt unterstrichener Summe, darüber
   die letzte begonnene Stunde als Leiste mit der 30-Minuten-Marke, darunter
   die Vorschussleiste mit der Grenze von 20 %. */

/* ---------- Kopf der Karte ---------- */
.jv-card-head {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid color-mix(in oklch, var(--color-primary-900) 10%, transparent);
}
.jv-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 1.1rem + 0.45vw, 1.4rem);
  line-height: 1.2;
  color: var(--color-primary-900);
}
.jv-usps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-primary-700);
}
.jv-usps li { display: inline-flex; align-items: center; gap: 0.3rem; }
.jv-usps svg { width: 0.95rem; height: 0.95rem; flex: none; color: var(--color-primary-600); }
.jv-privacy { font-size: 0.84rem; line-height: 1.5; color: var(--color-primary-700); }

/* ---------- Felder ---------- */
.jv-sub { margin-top: 1.25rem; }
.jv-sub[hidden], .jv-check[hidden], .jv-block[hidden], .jv-copy-fallback[hidden], .jv-actions .btn[hidden] { display: none; }
.jv-form .field-optional { font-weight: 500; color: var(--color-primary-700); }
.jv-form .field-hint a { color: var(--color-primary-800); text-decoration: underline; text-underline-offset: 2px; }
.jv-select { max-width: 40rem; }
.jv-num { max-width: 11rem; font-variant-numeric: tabular-nums; }
.jv-unit-row { justify-content: start; grid-template-columns: minmax(0, 11rem) auto; }
.jv-date { max-width: 13rem; font-variant-numeric: tabular-nums; }
.jv-rate-hint { font-weight: 600; color: var(--color-primary-800); }
.jv-alt-note { margin-top: 0.75rem; }
.jv-group-title { margin-bottom: 0.25rem; }
.jv-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem 1.5rem; }
@media (min-width: 640px) { .jv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.jv-field { min-width: 0; }

.jv-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.45rem 0;
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-primary-900);
  cursor: pointer;
}
.jv-check input { flex: none; width: 1.25rem; height: 1.25rem; margin-top: 0.12rem; accent-color: var(--color-primary-600); }
.jv-check input:focus-visible { outline: 3px solid var(--color-accent-500); outline-offset: 2px; }
.jv-check-hint { margin-top: 0; padding-left: 1.85rem; }

/* Zeit: je Zeile Stunden und Minuten. */
.jv-zeit-hint { margin: 0.1rem 0 0.6rem; }
.jv-times { display: grid; gap: 0.55rem; }
.jv-time { min-width: 0; margin: 0; padding: 0; border: 0; }
.jv-time-label { padding: 0; font-size: 0.92rem; font-weight: 600; color: var(--color-primary-900); }
.jv-time-fields { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin-top: 0.3rem; }
.jv-time-part { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; font-weight: 600; color: var(--color-primary-700); }
.jv-time-input { width: 4.8rem; text-align: right; font-variant-numeric: tabular-nums; }
@media (min-width: 640px) {
  .jv-time { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 1rem; }
  .jv-time-label { float: left; }
  .jv-time-fields { margin-top: 0; }
  .jv-time .field-error { grid-column: 1 / -1; }
}
.jv-sum {
  margin-top: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.65rem;
  background: var(--color-primary-50);
  border: 1px dashed color-mix(in oklch, var(--color-primary-600) 40%, transparent);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary-900);
}

/* Weitere Auslagen zum Aufklappen. */
.jv-more { margin-top: 1.25rem; border-top: 1px solid color-mix(in oklch, var(--color-primary-900) 10%, transparent); }
.jv-more > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 0;
  font-weight: 600;
  color: var(--color-primary-800);
  cursor: pointer;
  list-style: none;
}
.jv-more > summary::-webkit-details-marker { display: none; }
.jv-more > summary svg { width: 1.1rem; height: 1.1rem; flex: none; transition: transform 0.2s ease; }
.jv-more[open] > summary svg { transform: rotate(180deg); }
.jv-more > summary:focus-visible { outline: 3px solid var(--color-accent-500); outline-offset: 2px; border-radius: 0.4rem; }
.jv-more > .jv-grid { padding: 0.4rem 0 0.2rem; }

/* ---------- Ergebnis: Kernsatz ---------- */
.jv-verdict { margin-top: 0.6rem; }
.jv-badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  border: 1.5px solid currentColor;
}
.jv-title {
  margin-top: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary-950);
}
.jv-lead { overflow-wrap: break-word; margin-top: 0.55rem; font-size: 0.98rem; line-height: 1.6; font-variant-numeric: tabular-nums; color: var(--color-primary-900); }

.jv-block {
  margin-top: 1.5rem;
  padding: 1rem 0.95rem;
  border-radius: 0.9rem;
  background: #fff;
  border: 1px solid color-mix(in oklch, var(--color-primary-600) 20%, transparent);
}
.jv-block-title { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.3; color: var(--color-primary-950); }
.jv-block-text { overflow-wrap: break-word; margin-top: 0.6rem; font-size: 0.92rem; line-height: 1.6; font-variant-numeric: tabular-nums; color: var(--color-primary-900); }
@media (min-width: 640px) { .jv-block { padding: 1.1rem 1.25rem; } }

/* Die letzte begonnene Stunde: Leiste von 0 bis 60 Minuten, Marke bei 30. */
.jv-hour { margin-top: 0.9rem; max-width: 26rem; }
.jv-hour-track {
  position: relative;
  height: 0.9rem;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, color-mix(in oklch, var(--color-primary-600) 16%, transparent) 0 calc(100% / 12 - 2px), transparent calc(100% / 12 - 2px) calc(100% / 12));
  overflow: hidden;
}
.jv-hour-fill { position: absolute; inset-block: 0; left: 0; border-radius: 999px; background: var(--color-accent-500); }
.jv-hour.is-full .jv-hour-fill { background: var(--color-primary-600); }
.jv-hour-mid { position: absolute; inset-block: -2px; left: 50%; width: 2px; margin-left: -1px; background: var(--color-primary-950); }
.jv-hour-scale { display: flex; justify-content: space-between; margin-top: 0.3rem; font-size: 0.75rem; font-variant-numeric: tabular-nums; color: var(--color-primary-700); }

/* ---------- Die Aufstellung als Beleg ---------- */
.jv-bill { border-top: 5px solid var(--color-primary-600); }
.jv-table-wrap { margin-top: 0.8rem; }
.jv-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.jv-table th, .jv-table td { padding: 0.5rem 0.55rem; text-align: left; vertical-align: top; }
.jv-table tbody tr + tr th, .jv-table tbody tr + tr td { border-top: 1px dashed color-mix(in oklch, var(--color-primary-900) 18%, transparent); }
.jv-table thead th { font-size: 0.78rem; font-weight: 700; color: var(--color-primary-700); border-bottom: 1px solid color-mix(in oklch, var(--color-primary-900) 14%, transparent); }
.jv-table tbody th { font-weight: 600; color: var(--color-primary-950); }
.jv-table .jv-num-col { text-align: right; white-space: nowrap; }
.jv-table .jv-para-col { font-size: 0.82rem; color: var(--color-primary-700); }
.jv-table tfoot th, .jv-table tfoot td { font-weight: 600; color: var(--color-primary-900); }
.jv-table tfoot tr:first-child th, .jv-table tfoot tr:first-child td { border-top: 1px solid color-mix(in oklch, var(--color-primary-900) 30%, transparent); }
.jv-table tfoot th { text-align: right; }
.jv-table .jv-total th, .jv-table .jv-total td { font-size: 1.02rem; font-weight: 800; color: var(--color-primary-950); }
.jv-table .jv-total td { border-bottom: 3px double var(--color-primary-950); }
@media (max-width: 639px) {
  .jv-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .jv-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 0.75rem; padding: 0.55rem 0; }
  .jv-table tbody tr + tr { border-top: 1px dashed color-mix(in oklch, var(--color-primary-900) 18%, transparent); }
  .jv-table tbody th, .jv-table tbody td { display: block; padding: 0; border: 0 !important; overflow-wrap: anywhere; }
  .jv-table tbody th { grid-column: 1; grid-row: 1; }
  .jv-table tbody .jv-num-col { grid-column: 2; grid-row: 1; font-weight: 700; }
  .jv-table tbody td:not(.jv-num-col) { grid-column: 1 / -1; font-size: 0.84rem; color: var(--color-primary-800); }
  .jv-table tfoot tr { display: flex; justify-content: space-between; gap: 0.75rem; }
  .jv-table tfoot th, .jv-table tfoot td { display: block; padding: 0.4rem 0; }
  .jv-table tfoot tr:first-child { border-top: 1px solid color-mix(in oklch, var(--color-primary-900) 30%, transparent); }
  .jv-table tfoot tr:first-child th, .jv-table tfoot tr:first-child td { border-top: 0; }
  .jv-table tfoot th { text-align: left; }
}

.jv-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.1rem; }
.jv-actions .btn { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; }
.jv-actions .btn svg { width: 1.15rem; height: 1.15rem; flex: none; }
.jv-copy-note { margin-top: 0.55rem; font-size: 0.86rem; line-height: 1.5; color: var(--color-primary-700); }
.jv-copy-note:empty { display: none; }
.jv-copy-fallback { display: block; margin-top: 0.8rem; }
.jv-copy-fallback textarea { font-size: 0.85rem; line-height: 1.5; font-variant-numeric: tabular-nums; }

/* ---------- Vorschuss ---------- */
.jv-vs { margin: 2.2rem 0 1.9rem; }
.jv-vs-track { position: relative; height: 0.85rem; border-radius: 999px; background: color-mix(in oklch, var(--color-primary-600) 14%, transparent); }
.jv-vs-fill { position: absolute; inset-block: 0; left: 0; border-radius: 999px; }
.jv-vs-fill--ok { background: oklch(0.66 0.16 148); }
.jv-vs-fill--ueber { background: oklch(0.78 0.15 82); }
.jv-vs-fill--erheblich { background: oklch(0.6 0.19 30); }
.jv-vs-mark { position: absolute; top: -0.45rem; bottom: -0.45rem; width: 2px; margin-left: -1px; background: var(--color-primary-950); }
.jv-vs-mark--limit { background: repeating-linear-gradient(180deg, var(--color-primary-950) 0 3px, transparent 3px 6px); }
.jv-vs-mark-label {
  position: absolute;
  bottom: calc(100% + 0.15rem);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--color-primary-900);
}
.jv-vs-mark--limit .jv-vs-mark-label { bottom: auto; top: calc(100% + 0.15rem); }

/* ---------- Frist ---------- */
.jv-frist-date {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.35rem 0.8rem;
  border: 2px solid var(--color-primary-900);
  border-radius: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.25rem);
  font-variant-numeric: tabular-nums;
  color: var(--color-primary-950);
}

/* ---------- Hinweise ---------- */
.jv-items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.8rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.jv-item {
  padding: 1rem 1.05rem;
  border-radius: 0.9rem;
  background: color-mix(in oklch, var(--color-primary-50) 55%, #fff);
  border: 1px solid color-mix(in oklch, var(--color-primary-600) 18%, transparent);
  border-inline-start: 5px solid var(--color-primary-600);
}
.jv-item--check { border-inline-start-color: oklch(0.7 0.12 60); }
.jv-item-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.35rem 0.85rem; }
.jv-item-title { font-family: var(--font-display); font-weight: 600; font-size: 1.04rem; line-height: 1.3; color: var(--color-primary-950); }
.jv-status { flex: none; max-width: 100%; padding: 0.14rem 0.65rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; line-height: 1.4; }
.jv-status--check { background: oklch(0.95 0.04 65); color: oklch(0.42 0.1 55); }
.jv-status--info { background: var(--color-primary-50); color: var(--color-primary-800); }
.jv-item-para { margin-top: 0.3rem; font-size: 0.82rem; font-weight: 600; }
.jv-item-para a { color: var(--color-primary-800); text-decoration: underline; text-underline-offset: 2px; }
.jv-item-para a:hover { color: var(--color-primary-950); }
.jv-item-text { overflow-wrap: break-word; margin-top: 0.55rem; font-size: 0.9rem; line-height: 1.6; color: color-mix(in oklch, var(--color-primary-950) 86%, #000); }

/* Rechenweg: nummerierte Schritte. */
.jv-steps { margin: 0.6rem 0 0; padding: 0; list-style: none; counter-reset: jv-step; font-size: 0.88rem; line-height: 1.55; font-variant-numeric: tabular-nums; color: var(--color-primary-900); }
.jv-steps li { position: relative; padding: 0.45rem 0 0.45rem 1.8rem; border-top: 1px dotted color-mix(in oklch, var(--color-primary-900) 22%, transparent); overflow-wrap: anywhere; }
.jv-steps li::before {
  counter-increment: jv-step;
  content: counter(jv-step);
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--color-primary-100);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
  color: var(--color-primary-800);
}

.jv-disclaimer {
  margin-top: 1rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--color-accent-500);
  font-size: 0.88rem;
  line-height: 1.55;
  color: color-mix(in oklch, var(--color-primary-950) 86%, #000);
}

/* ---------- Stundensätze im Text ---------- */
.jv-rt-wrap { margin: 1.25rem 0 0.5rem; }
.jv-rt { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; box-shadow: none; }
.jv-rt caption { padding-bottom: 0.6rem; text-align: left; font-size: 0.86rem; font-weight: 600; color: var(--color-primary-700); }
.jv-rt th, .jv-rt td { padding: 0.45rem 0.55rem; text-align: left; vertical-align: top; border-bottom: 1px solid color-mix(in oklch, var(--color-primary-900) 10%, transparent); }
.jv-rt thead th { font-size: 0.78rem; font-weight: 700; color: var(--color-primary-700); background: var(--color-primary-50); }
.jv-rt .jv-rt-rate { text-align: right; white-space: nowrap; }
.jv-rt .jv-rt-nr { white-space: nowrap; font-weight: 600; color: var(--color-primary-800); }
.jv-rt td.jv-rt-rate:nth-child(3) { font-weight: 700; color: var(--color-primary-950); }
.jv-rt td.jv-rt-rate:nth-child(4) { color: var(--color-primary-700); }
.jv-rt tbody tr.jv-rt-part th { padding-top: 1rem; font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--color-primary-950); background: var(--color-primary-100); border-bottom: 2px solid var(--color-primary-600); }
.jv-rt tbody tr.jv-rt-group th { font-weight: 600; font-size: 0.88rem; color: var(--color-primary-900); background: color-mix(in oklch, var(--color-primary-50) 60%, #fff); }
.jv-rt-note { display: block; font-size: 0.78rem; font-weight: 500; color: var(--color-primary-700); }
.jv-rt-source { margin-top: 0.75rem; font-size: 0.86rem; line-height: 1.55; color: var(--color-primary-800); }
@media (max-width: 559px) {
  .jv-rt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .jv-rt tbody tr:not(.jv-rt-part):not(.jv-rt-group) { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: 0.15rem 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid color-mix(in oklch, var(--color-primary-900) 10%, transparent); }
  .jv-rt tbody tr:not(.jv-rt-part):not(.jv-rt-group) td { padding: 0; border: 0; }
  .jv-rt tbody td.jv-rt-rate { grid-column: 2; display: flex; justify-content: space-between; gap: 0.5rem; text-align: right; }
  .jv-rt tbody td.jv-rt-rate::before { content: attr(data-label); font-size: 0.78rem; font-weight: 600; color: var(--color-primary-700); }
  .jv-rt tbody td.jv-rt-rate .jv-rt-note { display: inline; margin-left: 0.3rem; }
  .jv-rt-part th, .jv-rt-group th { display: block; }
}

/* Auf dem Telefon nimmt die Schrittnummer keine eigene Spalte: Die Felder
   bekommen die volle Breite der Karte, ab 320 px ohne Überlauf. */
@media (max-width: 479px) {
  .jv-form.tool-card { padding: 1.15rem 0.85rem; }
  .jv-form .calc-step { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .jv-form .calc-step + .calc-step { margin-top: 1.5rem; padding-top: 1.5rem; }
  .jv-form .calc-step-no { margin-bottom: 0; }
  .jv-result { padding: 1.1rem 0.7rem; }
  .jv-block { padding: 0.9rem 0.7rem; }
  .jv-item { padding-inline: 0.75rem; }
  .jv-actions .btn { flex: 1 1 100%; justify-content: center; }
  .jv-unit-row { grid-template-columns: minmax(0, 1fr) auto; }
  .jv-weiche .calc-weiche-options { grid-template-columns: minmax(0, 1fr); }
  .jv-weiche .calc-weiche-option { min-width: 0; }
}
