/* Probetest – start screen (exam route + pass rule), stage frame (transit-line stepper, stage heads, nav bar),
   self-assessment layout and the result (verdict, score bars with thresholds, history).
   Lesen items, the Schreiben editor and the Sprechen oral exam are styled by their own views. */

/* ---------- start screen */
.mock-start { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; margin: 0 0 20px; }
.mock-start > .card { margin: 0; }
@media (max-width: 959px) { .mock-start { grid-template-columns: 1fr; } .pass-panel { order: -1; } }

.exam-route { padding: 22px 24px 18px; }
.exam-route-head h2 { margin: 0 0 2px; }
.exam-route-head .sub { margin: 0 0 18px; }
.exam-route-head .mono { color: var(--ink); font-weight: 600; }
.exam-line { position: relative; list-style: none; margin: 0; padding: 0; }
.exam-line::before { content: ""; position: absolute; left: 12px; top: 14px; bottom: 30px; width: 3px; border-radius: 3px; background: var(--line); }
.exam-group { position: relative; padding: 0 0 14px; }
.exam-group + .exam-group { padding-top: 8px; }
.exam-group-head { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 28px; padding-left: 40px; margin: 0 0 4px; }
.exam-group-head::before { content: ""; position: absolute; left: 3px; top: 50%; width: 21px; height: 21px; transform: translateY(-50%); border-radius: 50%; background: var(--lc); border: 4px solid var(--surface); box-shadow: 0 0 0 1.5px var(--lc); }
.exam-group-note { font-size: var(--fs-caption); color: var(--ink-3); }
.exam-group-facts { display: inline-flex; gap: 12px; margin-left: auto; font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.exam-stops { list-style: none; margin: 0; padding: 0; }
.exam-stop { display: grid; grid-template-columns: 27px 58px minmax(0, 1fr) auto; align-items: center; gap: 0 12px; min-height: 48px; padding: 6px 0; }
.exam-stop + .exam-stop { border-top: 1px solid var(--line); }
.stop-dot { justify-self: center; position: relative; z-index: 1; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 3px solid var(--lc); }
.stop-key { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; }
.stop-key .icon { width: 17px; height: 17px; color: var(--ink-3); }
.stop-name { display: flex; flex-direction: column; font-weight: 560; line-height: 1.35; min-width: 0; }
.stop-en { font-size: var(--fs-caption); font-weight: 400; color: var(--ink-3); }
.stop-pts { font-size: 0.82rem; color: var(--ink-2); white-space: nowrap; }
.exam-group.after .stop-dot { border-color: var(--line-strong); }
.exam-group.after .exam-group-head::before { background: var(--surface); border-color: var(--surface); box-shadow: 0 0 0 2px var(--line-strong); }

.pass-panel { padding: 22px 22px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
.pass-panel .eyebrow .icon { color: var(--accent-strong); }
.pass-panel h2 { margin: 0 0 14px; font-size: 1.3rem; letter-spacing: -0.02em; }
.rule-list { list-style: none; margin: 0 0 10px; padding: 0; }
.rule-list li { display: grid; grid-template-columns: 8.2rem minmax(0, 1fr); align-items: baseline; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rule-figure { white-space: nowrap; }
.rule-list li:first-child { border-top: 0; padding-top: 2px; }
.rule-num { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.04em; color: var(--ink); white-space: nowrap; }
.rule-of { font-size: 0.9rem; color: var(--ink-3); white-space: nowrap; }
.rule-text { display: flex; flex-direction: column; line-height: 1.35; }
.rule-text strong { font-weight: 600; }
.rule-text span { font-size: var(--fs-caption); color: var(--ink-3); }
.rule-note { display: flex; align-items: center; gap: 6px; margin: 0 0 16px; font-size: var(--fs-small); color: var(--ink-2); }
.rule-note .icon { width: 15px; height: 15px; color: var(--ink-3); }
.pass-panel #mock-start .icon { width: 16px; height: 16px; }
.pass-hint { margin: 12px 0 0; }
.booking-rule { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: var(--fs-small); line-height: 1.5; color: var(--ink-2); }
.booking-rule > .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--l-pruefung); }
.booking-rule strong { color: var(--ink); }
.booking-rule.met > .icon { color: var(--good); }

/* ---------- history */
.mock-history { padding: 22px 24px 14px; }
.mock-history-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 0 0 8px; }
.mock-history-head h2 { margin: 0; }
.mock-history-head .sub { margin: 0; }
.mock-history-head .mono { color: var(--ink); font-weight: 600; }
.mock-table th.num { text-align: right; }
.mock-table td { vertical-align: middle; }
.mock-date { white-space: nowrap; color: var(--ink-2); }
.mock-table td.below { color: var(--bad); font-weight: 600; }
.mock-total { white-space: nowrap; font-weight: 600; }
.mini-bar { position: relative; display: inline-block; width: 52px; height: 6px; margin-right: 10px; vertical-align: 2px; border-radius: 999px; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--line); }
.mini-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--ink); transform-origin: left center; transform: scaleX(var(--p, 0)); }
.mini-need { position: absolute; top: -3px; bottom: -3px; left: calc(var(--n) * 100%); width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink-3); }
.mock-table tr.current td { background: var(--accent-soft); }
@media (max-width: 767px) {
  .mock-history { padding: 18px 16px 10px; }
  .mock-table .hide-sm, .mock-year { display: none; }
  .mock-table .badge-text, .mock-table .th-result span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .mock-table .badge { padding: 3px 6px; }
  .mock-table th, .mock-table td { padding: 10px 6px; }
  .mini-bar { display: none; }
}

/* ---------- stage frame: the transit-line stepper */
.mock-line { margin: 0 0 var(--s-5); padding: 18px 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.stepper { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; padding: 0; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.stepper li + li::before { content: ""; position: absolute; top: 10px; left: calc(-50% + 16px); right: calc(50% + 16px); height: 4px; border-radius: 4px; background: var(--line-strong); }
.stepper li.done + li::before { background: var(--ink); }
.st-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; margin: 0 0 8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line-strong); color: var(--surface); }
.st-dot .icon { width: 12px; height: 12px; stroke-width: 3.2; }
.stepper li.done .st-dot { background: var(--ink); border-color: var(--ink); }
.stepper li.current .st-dot { background: var(--accent); border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
.stepper li.current .st-dot::after { content: ""; position: absolute; inset: -3px; z-index: -1; border-radius: 50%; background: var(--accent); animation: pulse-ring 2.4s var(--ease-out) infinite; }
.st-name { font-size: 0.86rem; font-weight: 600; line-height: 1.25; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-meta { font-size: var(--fs-caption); line-height: 1.3; color: var(--ink-3); }
.stepper li.current .st-name { color: var(--ink); }
.stepper li.next .st-name { color: var(--ink-3); font-weight: 560; }
.stepper-caption { display: none; margin: 10px 0 0; text-align: center; font-size: var(--fs-small); color: var(--ink-2); }
.stepper-caption .mono { color: var(--ink); font-weight: 600; }
@media (max-width: 599px) {
  .mock-line { padding: 14px 8px 12px; }
  .st-name, .st-meta { display: none; }
  .st-dot { width: 22px; height: 22px; margin: 0; }
  .stepper li + li::before { top: 9px; left: calc(-50% + 14px); right: calc(50% + 14px); }
  .stepper-caption { display: block; }
}

/* ---------- stage head + nav */
.stage-head { margin: 0 0 var(--s-4); max-width: 68ch; }
.stage-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; }
.stage-facts { font-size: 0.8rem; font-weight: 500; color: var(--ink-3); }
.stage-head h2 { font-size: 1.55rem; letter-spacing: -0.02em; margin: 0 0 4px; }
.stage-head .sub { margin: 0; }
@media (min-width: 900px) { .view-probetest .stage-head + .sticky-timer { margin-top: -62px; margin-bottom: 26px; } }
.mock-nav { margin-top: var(--s-4); }
.mock-nav-note { margin: 0; font-size: var(--fs-small); color: var(--ink-2); min-width: 0; }
.mock-nav-note strong { color: var(--ink); }
.view-probetest .submit-bar .btn .icon { transition: transform var(--t-mid) var(--ease-out); }
.view-probetest .submit-bar .btn:hover .icon { transform: translateX(2px); }
.view-probetest .lesen-items .lesen-item { margin-bottom: var(--s-4); }

/* ---------- self-assessment */
.bew-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
.bew-grid > .card { margin: 0; }
@media (max-width: 959px) { .bew-grid { grid-template-columns: 1fr; } }
.bew-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 14px; }
.card .bew-card-head h3 { margin: 0; font-size: 1.08rem; }
.bew-card-head .badge .mono { font-weight: 650; }
.bew-text .attempt-text { margin: 0 0 4px; max-height: 420px; overflow: auto; }
.bew-text details.reveal { margin-top: 10px; }
.ai-score { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.ai-score .field { margin: 0; }
.ai-score input { max-width: 160px; font-family: var(--mono); }
.bew-sprechen { max-width: 820px; }

/* ---------- result */
@keyframes mock-bar-grow { from { transform: scaleX(0); } }
.card.result-card { padding: 0; overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow-2); animation: rise-in var(--t-slow) var(--ease-out); }
.result-card.pass { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.result-card.fail { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.verdict-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 22px; padding: 26px 28px; border-bottom: 1px solid var(--line); }
.result-card.pass .verdict-head { background: var(--good-soft); border-bottom-color: color-mix(in srgb, var(--good) 25%, transparent); }
.result-card.fail .verdict-head { background: var(--bad-soft); border-bottom-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.verdict-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: var(--surface); animation: verdict-pop 520ms var(--ease-out) both 120ms; }
.verdict-mark .icon { width: 34px; height: 34px; stroke-width: 2; }
.result-card.pass .verdict-mark { background: var(--good); }
.result-card.fail .verdict-mark { background: var(--bad); }
@keyframes verdict-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
.verdict-text .eyebrow { margin: 0 0 2px; }
.card.result-card .verdict-text h2 { margin: 0; font-size: var(--fs-display); font-weight: 650; letter-spacing: -0.035em; line-height: 1.05; }
.result-card.pass .verdict-text h2 { color: var(--good); }
.result-card.fail .verdict-text h2 { color: var(--bad); }
.verdict-text .sub { margin: 6px 0 0; color: var(--ink); }
.verdict-total { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 6px; text-align: right; }
.verdict-num { font-size: 3rem; font-weight: 600; letter-spacing: -0.05em; line-height: 1; color: var(--ink); }
.verdict-of { font-size: 1.15rem; color: var(--ink-2); }
.verdict-label { grid-column: 1 / -1; font-size: var(--fs-caption); color: var(--ink-2); }

.score-block { padding: 12px 28px 4px; }
.score-block-title { margin: 14px 0 0; font-size: var(--fs-eyebrow); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.score-rows { list-style: none; margin: 0 0 8px; padding: 0; }
.score-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 118px; align-items: center; gap: 8px 22px; padding: 22px 0 12px; border-top: 1px solid var(--line); }
.score-row:first-child { border-top: 0; }
.score-row.small { padding: 12px 0; }
.score-name { display: block; font-weight: 600; line-height: 1.3; }
.score-sub { display: block; font-size: var(--fs-caption); color: var(--ink-3); }
.score-track { position: relative; height: 12px; border-radius: 999px; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--line); }
.score-row.small .score-track { height: 8px; }
.score-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--ink); transform-origin: left center; transform: scaleX(var(--p, 0)); animation: mock-bar-grow 900ms var(--ease-out) both 200ms; }
.score-row.met .score-fill { background: var(--good); }
.score-row.missed .score-fill { background: var(--bad); }
.score-need { position: absolute; top: -5px; bottom: -5px; left: calc(var(--n) * 100%); width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); }
.score-need-label { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); padding: 0 4px; border-radius: 4px; background: var(--ink); color: var(--surface); font-size: 0.66rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.score-value { display: flex; align-items: center; justify-content: flex-end; gap: 2px; white-space: nowrap; }
.score-value .mono:first-child { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.03em; }
.score-value .of { color: var(--ink-3); font-size: 0.9rem; }
.score-flag { display: inline-grid; place-items: center; width: 22px; margin-left: 6px; }
.score-flag .icon { width: 18px; height: 18px; }
.score-row.met .score-flag { color: var(--good); }
.score-row.missed .score-flag { color: var(--bad); }

.reasons { list-style: none; margin: 0 28px 16px; padding: 12px 16px; border-radius: 12px; background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }
.reasons li { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; font-size: 0.93rem; }
.reasons li .icon { flex: none; margin-top: 3px; width: 16px; height: 16px; color: var(--bad); }
.result-card .booking-rule { margin: 0 28px 10px; padding: 0; border: 0; }
.result-card > .hint { margin: 0 28px 16px; }
.result-actions { margin: 0; padding: 16px 28px 20px; border-top: 1px solid var(--line); }
.mock-review { margin-top: var(--s-2); }

@media (max-width: 767px) {
  .exam-route { padding: 18px 16px 12px; }
  .exam-stop { grid-template-columns: 27px 48px minmax(0, 1fr) auto; gap: 0 8px; }
  .pass-panel { padding: 18px 16px 16px; border-radius: var(--r-lg); }
  .verdict-head { grid-template-columns: auto minmax(0, 1fr); padding: 20px 16px; gap: 12px 16px; }
  .verdict-mark { width: 52px; height: 52px; }
  .verdict-mark .icon { width: 28px; height: 28px; }
  .verdict-total { grid-column: 1 / -1; justify-content: start; text-align: left; grid-template-columns: auto auto 1fr; }
  .verdict-label { grid-column: auto; padding-left: 6px; }
  .verdict-num { font-size: 2.4rem; }
  .score-block { padding: 8px 16px 4px; }
  .score-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 14px 0 12px; }
  .score-track { grid-column: 1 / -1; grid-row: 2; margin-top: 18px; }
  .score-row.small .score-track { margin-top: 4px; }
  .reasons { margin: 0 16px 14px; }
  .result-card .booking-rule, .result-card > .hint { margin-left: 16px; margin-right: 16px; }
  .result-actions { padding: 14px 16px 18px; }
}
