/* Shared quiz styles */
* { box-sizing: border-box; }

body.app-page {
  font-family: "Segoe UI", system-ui, sans-serif;
  margin: 0;
  background: var(--theme-bg-page);
  color: var(--theme-text);
  font-size: 1.05rem;
}

.app-page .page-main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}

h1 {
  font-size: 1.35rem;
  font-weight: normal;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.15rem;
  font-weight: bold;
}

/* Language bar */
.lang-bar {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.lang-bar button {
  padding: 3px 10px;
  margin-right: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.lang-bar button.active {
  font-weight: bold;
  background: #ddd;
}

/* Exam badges */
.exam-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.exam-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
}

.exam-badge.ccna { background: #0d6efd; }
.exam-badge.comptia { background: #198754; }
.exam-badge.ihk { background: #fd7e14; }
.exam-badge.general { background: #7c3aed; }

.exam-badge .level {
  opacity: 0.9;
  font-weight: normal;
}

/* Quiz index list */
.quiz-list,
.quiz-index {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.quiz-list li,
.quiz-index li {
  margin-bottom: 1rem;
  list-style: none;
}

.quiz-list .quiz-desc,
.quiz-index .desc {
  font-size: 0.9rem;
  color: #555;
  margin: 0.25rem 0 0 0;
}

.quiz-list a,
.quiz-index a {
  color: #0645ad;
  text-decoration: none;
}

.quiz-index a:hover {
  text-decoration: underline;
}

.quiz-index .desc {
  font-size: 0.9rem;
  color: #555;
  margin-left: 0.25rem;
}

/* Forms */
form.quiz-form,
.quiz-form {
  margin: 1rem 0;
}

.subnet-row,
.form-row {
  margin-bottom: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}

.subnet-row label,
.form-row label {
  min-width: 6.5rem;
}

input.hex {
  width: 4.2rem;
  text-align: center;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid #888;
  padding: 2px 4px;
}

input.prefix {
  width: 2.5rem;
  text-align: center;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid #888;
  padding: 2px 4px;
}

input.answer-short,
input.ipv4 {
  width: 10rem;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid #888;
  padding: 2px 6px;
}

input.correct {
  background: #d4edda;
  border-color: #28a745;
}

input.wrong {
  background: #f8d7da;
  border-color: #dc3545;
}

input.autofilled {
  background: #eef6ff;
  color: #333;
}

/* Buttons & feedback */
.buttons {
  margin-top: 1.25rem;
}

button {
  font-family: inherit;
  font-size: 1rem;
  padding: 4px 14px;
  margin-right: 0.5rem;
  cursor: pointer;
}

#feedback,
.feedback {
  margin-top: 1rem;
  min-height: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.feedback-emoji {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.feedback-text {
  line-height: 1.35;
}

.feedback.ok { color: #166534; }
.feedback.warn { color: #9f1239; }
.feedback.err { color: #c00; }

.hint {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #444;
}

.hidden { display: none !important; }

/* Hilfe section */
.hilfe-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
  max-width: 48rem;
}

.hilfe-section h2 {
  margin: 0 0 0.5rem 0;
}

.hilfe-section p {
  margin: 0.4rem 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.hilfe-section a {
  color: #0645ad;
  cursor: pointer;
}

/* Solution panel */
#loesungsweg,
.loesungsweg {
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #fafafa;
  border: 1px solid #ddd;
  font-size: 0.95rem;
  line-height: 1.5;
}

#loesungsweg.visible,
.loesungsweg.visible {
  display: block;
}

#loesungsweg ol,
.loesungsweg ol {
  margin: 0.5rem 0 0 1.2rem;
  padding: 0;
}

#loesungsweg li,
.loesungsweg li {
  margin-bottom: 0.35rem;
}

/* Tables */
.bit-table,
.subnet-bits-table,
.hextet-breakdown,
.quiz-table,
.hex-mask-table {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  margin: 0.5rem 0;
  border-collapse: collapse;
}

.bit-table td,
.bit-table th,
.subnet-bits-table td,
.subnet-bits-table th,
.hextet-breakdown td,
.hextet-breakdown th,
.quiz-table td,
.quiz-table th,
.hex-mask-table td,
.hex-mask-table th {
  border: 1px solid #bbb;
  padding: 2px 6px;
  text-align: center;
}

.hex-mask-walk li {
  margin-bottom: 0.75rem;
}

.hex-mask-digits {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.92rem;
  color: #475569;
}

.hex-mask-power-example {
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface-2, #f4f6f8);
  border-radius: 6px;
  border-left: 3px solid var(--accent, #2563eb);
}

.hex-mask-power-example p {
  margin: 0 0 0.45rem;
}

.hex-mask-power-example p:last-child {
  margin-bottom: 0;
  font-size: 0.92rem;
  opacity: 0.92;
}

.hex-mask-examples {
  margin: 0.35rem 0 0 1.2rem;
  padding: 0;
}

.hex-mask-examples li {
  margin-bottom: 0.4rem;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
}

.hex-mask-cheat {
  max-width: 12rem;
}

.bit-relevant { background: #fff3cd; }

.hextet-breakdown td,
.hextet-breakdown th {
  border-color: #333;
  padding: 8px 14px;
  min-width: 5.5rem;
}

.hextet-breakdown .hex-title {
  font-size: 1.15rem;
  font-weight: bold;
  background: #f0f0f0;
}

.hextet-breakdown .hex-digit {
  font-size: 1.1rem;
  font-weight: bold;
}

.hextet-breakdown .bit-pos {
  font-size: 0.8rem;
  color: #444;
  line-height: 1.35;
}

.hextet-breakdown .bit-change {
  background: #fff3cd;
  font-weight: bold;
  color: #b45309;
}

.visual-block {
  margin: 1rem 0 1.25rem 0;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #ddd;
}

.hex-explain {
  margin-top: 0.85rem;
  padding: 0.55rem 0.65rem;
  background: #f8f9fa;
  border-left: 3px solid #b45309;
  font-size: 0.95rem;
}

/* Quiz page nav: back + next type */
.quiz-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}

.quiz-nav .back-link {
  margin-bottom: 0;
  flex: 0 1 auto;
}

.quiz-nav-adjacent {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

/* IPv4/IPv6 practice quiz only — keep next-type link on its own row (not cert 200-301) */
.quiz-page-head .quiz-nav-adjacent {
  margin-left: 0;
  justify-content: flex-end;
  flex: 1 1 100%;
  width: 100%;
  padding-top: 0.2rem;
}

.quiz-nav .prev-quiz-link,
.quiz-nav .next-quiz-link,
.quiz-nav .cert-quiz-nav-jump {
  font-size: 0.95rem;
  color: var(--theme-link);
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}

.quiz-nav .prev-quiz-link:hover,
.quiz-nav .next-quiz-link:hover {
  text-decoration: underline;
}

.quiz-nav .cert-quiz-nav-jump:hover {
  text-decoration: none;
  opacity: 0.75;
}

/* Back link */
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--theme-link);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.back-link::before {
  content: "← ";
}

/* PHP app: nav, auth, leaderboard */
.top-nav {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.top-nav a {
  color: #0645ad;
  margin-right: 0.75rem;
}

.user-nick {
  font-weight: bold;
}

.btn-primary,
.exam-btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  margin: 0.25rem 0.35rem 0.25rem 0;
  border: 1px solid #333;
  background: #f5f5f5;
  color: #000;
  text-decoration: none;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.exam-btn.ccna { border-color: #0d6efd; }
.exam-btn.comptia { border-color: #198754; }
.exam-btn.ihk { border-color: #fd7e14; }

.exam-hero {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid #ddd;
  background: #fafafa;
}

.exam-hero h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.hero-note,
.guest-hint,
.auth-hint {
  font-size: 0.92rem;
  color: #444;
}

.auth-optional {
  margin-top: 0.5rem;
}

.exam-section {
  margin: 2rem 0 1.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e5e5e5;
}

.exam-section h2 {
  margin-bottom: 0.75rem;
}

.exam-section h3 {
  font-size: 1rem;
  margin: 1rem 0 0.35rem;
}

.auth-page .auth-links {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.auth-page .auth-links a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.auth-page .auth-links a:hover {
  text-decoration: underline;
}

.auth-dev-link-note {
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 1rem;
}

.auth-dev-link {
  word-break: break-all;
  font-size: 0.88rem;
}

.auth-dev-link a {
  color: #7c3aed;
}

.auth-form input {
  width: 100%;
  max-width: 22rem;
  padding: 0.35rem;
  font-family: inherit;
}

.quiz-table.leaderboard {
  width: 100%;
  max-width: 32rem;
}

.user-score {
  font-size: 1.05rem;
}

.buttons-top {
  margin: 1rem 0 1.25rem;
}

.buttons-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.buttons-actions .btn-subnet-help {
  margin-left: 1.25rem;
}

.subnet-v4-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.65rem;
}

.subnet-v4-row label {
  min-width: 2rem;
  font-weight: 600;
}

.subnet-v4-ip {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
}

.subnet-v4-ip .octet-dot {
  padding: 0 0.05rem;
  line-height: 1;
  user-select: none;
}

#answerArea .subnet-v4-ip input.octet {
  box-sizing: border-box;
  width: 2.15rem;
  min-width: 2.15rem;
  max-width: 2.15rem;
  flex: 0 0 auto;
  text-align: center;
  font-family: inherit;
  font-size: 0.92rem;
  border: 1px solid #888;
  padding: 2px 1px;
}

.subnet-v4-ip input.octet.octet-var:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.subnet-v4-prefix-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.4rem;
  width: auto;
  max-width: 100%;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.subnet-v4-prefix-row label {
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.subnet-v4-prefix-input {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.1rem;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
}

#answerArea input.subnet-prefix-in,
.subnet-v4-prefix-input .subnet-prefix-in {
  box-sizing: border-box;
  width: 1.75rem;
  min-width: 1.75rem;
  max-width: 1.75rem;
  flex: 0 0 auto;
  text-align: center;
  font-family: inherit;
  font-size: 0.92rem;
  border: 1px solid #888;
  padding: 1px 2px;
}

.subnet-v4-tip {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.9rem;
  color: #64748b;
}

.hilfe-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.vlsm-box {
  margin: 1rem 0;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.vlsm-box ul {
  margin: 0.5rem 0 0 1.2rem;
}

.vlsm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.75rem;
}

.vlsm-row-label {
  min-width: 11rem;
  font-weight: 600;
}

.mask-octets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0;
}

.mask-octets-row input.octet {
  width: 2.75rem;
  text-align: center;
  font-family: Consolas, monospace;
}

.vlsm-row input.octet {
  width: 2.75rem;
  text-align: center;
  font-family: Consolas, monospace;
}

.vlsm-row input.prefix {
  width: 2.25rem;
  text-align: center;
  font-family: Consolas, monospace;
}

.vlsm-tip {
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.answer-compare {
  margin: 1rem 0;
  padding: 1rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
}

.answer-compare-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #14532d;
}

.answer-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.answer-compare-table th,
.answer-compare-table td {
  border: 1px solid #bbf7d0;
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.answer-compare-table th {
  background: #dcfce7;
  font-weight: 600;
}

.answer-compare-table .compare-mismatch {
  background: #fee2e2;
}

.answer-compare-table .compare-match {
  background: #ecfdf5;
}

.answer-compare-table .compare-correct {
  background: #fff;
  font-weight: 600;
}

.btn-generate {
  font-weight: 600;
}

.feedback {
  margin-top: 1rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

.feedback.ok {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

.feedback.warn {
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.feedback.err {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

input.correct { background: #d1e7dd; }
input.wrong { background: #f8d7da; }

.weight-badge {
  font-size: 0.8rem;
  font-weight: bold;
  margin-left: 0.35rem;
}

.pts-hint {
  font-size: 0.85rem;
  color: #555;
  margin-left: 0.5rem;
}

.legacy-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid #ccc;
}

.legacy-note {
  font-size: 0.9rem;
  color: #555;
}

.quiz-meta {
  color: #444;
  font-size: 0.95rem;
}

#answerArea .subnet-row,
#answerArea .form-row {
  margin: 0.5rem 0;
}

#answerArea input.hex {
  width: 3.5rem;
  font-family: Consolas, monospace;
}

#answerArea input.prefix {
  width: 2.5rem;
}

#answerArea input.ipv4 {
  width: 10rem;
  font-family: Consolas, monospace;
}

.answer-short {
  width: 6rem;
}

.loesungsweg {
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #fafafa;
  border: 1px solid #ddd;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 48rem;
}

.loesungsweg.visible {
  display: block;
}

.radio-opt {
  display: inline-block;
  margin-right: 1rem;
  margin-bottom: 0.35rem;
}

/* Route summarization diagram */
.acl-hint {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
}

.acl-field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #78350f;
}

.acl-answer-block {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.acl-answer-prompt {
  margin: 0 0 0.75rem;
  font-weight: 600;
  color: #0f172a;
}

.acl-input-hint {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  color: #64748b;
}

.answer-acl-line {
  width: min(100%, 32rem);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.95rem;
}

.route-summary-diagram {
  margin: 1rem 0 1.25rem;
  padding: 1.25rem 1rem 1rem;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
}

.route-summary-diagram .rs-caption {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #166534;
  font-weight: 500;
}

.route-summary-diagram .rs-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.route-summary-diagram .rs-wan-segment {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 6rem;
  min-width: 4rem;
  max-width: 12rem;
}

.route-summary-diagram .rs-wan-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a16207;
  white-space: nowrap;
}

.route-summary-diagram .rs-wan-segment .rs-line-h {
  flex: 1;
  min-width: 2rem;
  height: 3px;
}

.route-summary-diagram .rs-lan-zone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 0;
  padding-top: 0;
  max-width: 100%;
}

.route-summary-diagram .rs-stub {
  width: 3px;
  height: 1rem;
  background: #facc15;
  border-radius: 2px;
  margin-left: 2.75rem;
}

.route-summary-diagram .rs-lan-bar {
  height: 3px;
  background: #facc15;
  border-radius: 2px;
  margin-left: 1.25rem;
  align-self: stretch;
  min-width: 12rem;
}

.route-summary-diagram .rs-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.route-summary-diagram .rs-node {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  text-align: center;
}

.route-summary-diagram .rs-router {
  background: #22c55e;
  color: #fff;
  min-width: 5.5rem;
}

.route-summary-diagram .rs-switch {
  background: #3b82f6;
  color: #fff;
  font-weight: 500;
  font-size: 0.8rem;
}

.route-summary-diagram .rs-switch code {
  color: inherit;
  font-size: 0.78rem;
}

.route-summary-diagram .rs-line-h {
  width: 2.5rem;
  height: 3px;
  background: #facc15;
  border-radius: 2px;
}

.route-summary-diagram .rs-fan {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem 1.25rem;
  padding-top: 0.35rem;
  margin-left: 0.5rem;
  border-top: none;
}

.route-summary-diagram .rs-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 8.5rem;
}

.route-summary-diagram .rs-diagram-acl .rs-router-a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: #dbeafe;
  border-color: #3b82f6;
}

.route-summary-diagram .rs-acl-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1d4ed8;
}

.route-summary-diagram .rs-lan-id {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.15rem;
  letter-spacing: 0.04em;
}

.route-summary-diagram .rs-lan-net {
  background: #eff6ff;
  border-color: #60a5fa;
  min-width: 9.5rem;
}

.route-summary-diagram .rs-lan-net code {
  color: #1e3a8a;
  font-size: 0.82rem;
}

.route-summary-diagram .rs-fan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.85rem 1rem;
  width: 100%;
  max-width: 42rem;
}

.route-summary-diagram .rs-line-v {
  width: 3px;
  height: 1.25rem;
  background: #facc15;
  border-radius: 2px;
}

/* Topology subnet-count diagram */
.topology-diagram {
  margin: 0.75rem 0 1.25rem;
  padding: 1rem 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  max-width: 100%;
  overflow-x: auto;
}

.topology-diagram .topo-inner {
  display: flex;
  justify-content: center;
}

.topology-diagram .topo-svg {
  display: block;
  max-width: 580px;
  min-width: 320px;
  height: auto;
}

/* Network diagram quizzes (D01–D08) */
.network-diagram {
  margin: 0.75rem 0 1rem;
  padding: 1rem;
  background: linear-gradient(165deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.network-diagram .nd-svg {
  max-height: 360px;
  display: block;
  min-width: 300px;
  min-height: 220px;
}

.network-diagram .nd-inner {
  display: flex;
  justify-content: center;
}

.diagram-extras {
  margin: 0.5rem 0 1rem;
}

.diagram-cli {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.45;
}

.diagram-scenario {
  font-size: 0.95rem;
  color: #334155;
  margin-bottom: 0.5rem;
  white-space: pre-line;
}

.ihk-scenario,
.ihk-task-follow {
  font-size: 0.95rem;
  color: #334155;
  margin: 0.5rem 0;
}

.question-context {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.55;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
  border-radius: 0 6px 6px 0;
  white-space: pre-line;
}

.ihk-config-table {
  width: 100%;
  max-width: 640px;
  margin: 0.75rem 0 1rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ihk-config-table th,
.ihk-config-table td {
  border: 1px solid #cbd5e1;
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.ihk-config-table th {
  background: #f1f5f9;
  font-weight: 600;
}

.ihk-config-table code {
  font-size: 0.9em;
}

.ihk-nat-header-table .ihk-nat-wan-cell {
  color: #64748b;
  font-style: italic;
}

.ihk-nat-pat-intro {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  color: #475569;
}

.ihk-nat-pat-table {
  margin: 0 0 1rem;
}

.ihk-nat-header-table-title {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  color: #0f172a;
}

.ihk-nat-header-table {
  margin-top: 0.25rem;
}

.ihk-nat-answer-grid {
  display: grid;
  gap: 0.5rem;
  max-width: 420px;
  margin-top: 0.75rem;
}

.ihk-nat-answer-grid .form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.ihk-nat-answer-grid label {
  min-width: 7rem;
  font-weight: 600;
}

.diagram-lpm-table-wrap {
  margin: 0.5rem 0 1rem;
  overflow-x: auto;
}

.diagram-lpm-table {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.92rem;
  background: #f1f5f9;
  border: 2px solid #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.diagram-lpm-table .lpm-col-prefix {
  width: 46%;
}

.diagram-lpm-table .lpm-col-iface {
  width: 22%;
}

.diagram-lpm-table .lpm-col-nh {
  width: 32%;
}

.diagram-entry-table .lpm-col-entry {
  width: 18%;
}

.diagram-entry-table .lpm-col-network {
  width: 38%;
}

.diagram-entry-table .lpm-col-mask {
  width: 44%;
}

.diagram-lpm-table th,
.diagram-lpm-table td {
  border: 1px solid #64748b;
  padding: 0.45rem 0.6rem;
  text-align: center;
  vertical-align: middle;
  font-family: "Segoe UI", system-ui, sans-serif;
  word-break: break-word;
}

.diagram-lpm-table th:nth-child(1),
.diagram-lpm-table td:nth-child(1) {
  text-align: left;
  padding-left: 0.75rem;
}

.diagram-lpm-table th {
  font-weight: 700;
  background: #e2e8f0;
  color: #0f172a;
  white-space: nowrap;
}

.diagram-lpm-table td {
  font-family: Consolas, "Cascadia Code", ui-monospace, monospace;
  font-size: 0.88rem;
  color: #1e293b;
}

.diagram-lpm-table td:nth-child(1) {
  font-size: 0.86rem;
}

.diagram-hints {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.diagram-hints code {
  background: #e2e8f0;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.diagram-radio .radio-opt {
  display: block;
  margin: 0.35rem 0;
  line-height: 1.45;
  word-break: break-word;
}

.ihk-mcq-stack .radio-opt {
  padding: 0.45rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.ihk-mcq-stack .radio-opt:hover {
  background: #f1f5f9;
}

.ihk-mcq-stack .radio-opt:has(input:checked) {
  border-color: #93c5fd;
  background: #eff6ff;
}

.diagram-pick-hint {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: #334155;
}

.diagram-checkbox .diagram-check {
  padding: 0.45rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.diagram-checkbox .diagram-opt-text {
  font-family: Consolas, ui-monospace, monospace;
  font-size: 0.92rem;
  line-height: 1.45;
}

.diagram-radio-multiline .diagram-opt-text {
  font-family: Consolas, ui-monospace, monospace;
  font-size: 0.92rem;
  line-height: 1.45;
}

input.diagram-answer.answer-wide {
  width: min(100%, 22rem);
}

.quiz-tag-diagram {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #6366f1;
  color: #fff;
  margin-right: 0.35rem;
}

.ap1-struktogram {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-x: auto;
}

.ap1-struktogram-step {
  margin-bottom: 0.85rem;
}

.ap1-struktogram-step label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}

.ap1-struktogram-step select {
  width: 100%;
  max-width: 36rem;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
}

.ap1-erm-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.ap1-erm-entity {
  flex: 1 1 10rem;
  min-width: 9rem;
  font-size: 0.88rem;
}

.ap1-erm-entity ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.ap1-erm-link {
  align-self: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #7c3aed;
}

.ap1-erm-field {
  margin-bottom: 0.75rem;
}

.ap1-erm-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.88rem;
}

.ap1-erm-field select {
  width: 100%;
  max-width: 28rem;
}

.walk-struktogram-solution {
  background: #f0fdf4;
  border-color: #86efac;
}

.ap1-struktogram-select.correct,
.ap1-erm-select.correct {
  outline: 2px solid #22c55e;
}

.ap1-struktogram-select.wrong,
.ap1-erm-select.wrong {
  outline: 2px solid #ef4444;
}

.ihk-netplan-wrap {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
}

.ihk-netplan-diagram {
  position: relative;
  min-width: 38rem;
  min-height: 17rem;
  margin: 0.5rem 0 0.25rem;
}

.ihk-netplan-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ihk-netplan-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--ihk-netplan-cols, 6), minmax(5.25rem, 1fr));
  grid-template-rows: repeat(var(--ihk-netplan-rows, 3), auto);
  gap: 0.65rem 0.35rem;
  justify-items: center;
  align-items: center;
}

.ihk-netplan-slot {
  width: 100%;
  display: flex;
  justify-content: center;
}

.ihk-netplan-node {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.ihk-netplan-node-grid {
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 5.25rem;
}

.ihk-netplan-node-grid td {
  border: 1px solid #94a3b8;
  padding: 0.18rem 0.28rem;
  text-align: center;
  min-width: 1.55rem;
  line-height: 1.2;
}

.ihk-netplan-node-dur {
  font-weight: 700;
  background: #f8fafc;
}

.ihk-netplan-node-id {
  font-weight: 700;
  background: #fff;
}

.ihk-netplan-node-empty {
  background: #f8fafc;
}

.ihk-netplan-node-critical .ihk-netplan-node-grid {
  outline: 2px solid #1d4ed8;
  outline-offset: -1px;
}

.ihk-netplan-node-critical .ihk-netplan-node-id strong {
  color: #1d4ed8;
}

.ihk-netplan-node-target .ihk-netplan-node-grid {
  outline: 2px solid #ef4444;
  outline-offset: -1px;
}

.ihk-netplan-node-target .ihk-netplan-node-id strong {
  color: #b91c1c;
}

.ihk-netplan-missing {
  color: #b91c1c;
  font-weight: 700;
  font-style: italic;
}

.ihk-netplan-node-label {
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: #64748b;
  text-align: center;
  max-width: 5.5rem;
  line-height: 1.15;
}

.ihk-netplan-legend {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
}

.ihk-netplan-caption {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.ihk-netplan-table {
  width: 100%;
  min-width: 28rem;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ihk-netplan-table th,
.ihk-netplan-table td {
  padding: 0.35rem 0.5rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.ihk-netplan-table th {
  background: #f1f5f9;
  font-weight: 600;
}

.ihk-netplan-row-target {
  background: #fef2f2;
}

.ihk-netplan-row-target td:first-child strong {
  color: #b91c1c;
}

.ihk-netplan-bar-track {
  min-width: 8rem;
  height: 0.85rem;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.ihk-netplan-bar-fill {
  height: 100%;
  background: #6366f1;
  border-radius: 3px;
}

.ihk-netplan-row-target .ihk-netplan-bar-fill {
  background: #ef4444;
}

.ihk-netplan-delay-note {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

.ihk-netplan-row-critical {
  background: #eff6ff;
}

.ihk-netplan-row-critical td:first-child strong {
  color: #1d4ed8;
}

.ihk-netplan-answer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ihk-netplan-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ihk-netplan-field label {
  flex: 1 1 12rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.ihk-netplan-select {
  flex: 1 1 16rem;
  max-width: 100%;
}

.ihk-netplan-input.correct,
.ihk-netplan-select.correct {
  outline: 2px solid #22c55e;
}

.ihk-netplan-input.wrong,
.ihk-netplan-select.wrong {
  outline: 2px solid #ef4444;
}

.ihk-netplan-unit {
  font-size: 0.85rem;
  color: #64748b;
}

/* Quiz comments — Reddit-style compact */
.quiz-comments {
  margin: 0.5rem 0 0;
}

.quiz-comments-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.45rem;
  min-height: 1.6rem;
  border: none;
  background: transparent;
  color: #576f76;
  cursor: pointer;
  border-radius: 999px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.quiz-comments-toggle:hover,
.quiz-comments.is-open .quiz-comments-toggle {
  background: #e5ebee;
  color: #1c1c1c;
}

.quiz-comments-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.quiz-comments-count {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.quiz-comments-panel {
  margin-top: 0.45rem;
}

.quiz-comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.quiz-comments-empty {
  margin: 0;
  color: #878a8c;
  font-size: 0.78rem;
}

.quiz-comment {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  padding: 0.15rem 0;
}

.quiz-vote-pill {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  padding: 0.1rem 0.15rem;
  border-radius: 999px;
  background: #e5ebee;
  color: #576f76;
}

.quiz-vote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  border-radius: 999px;
}

.quiz-vote svg {
  width: 0.72rem;
  height: 0.72rem;
}

.quiz-vote:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.06);
}

.quiz-vote-up.is-active {
  color: #d93900;
}

.quiz-vote-down.is-active {
  color: #7193ff;
}

.quiz-vote:disabled {
  cursor: default;
  opacity: 0.5;
}

.quiz-vote-count {
  min-width: 0.85rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1c1c1c;
  padding: 0 0.05rem;
}

.quiz-comment-main {
  flex: 1;
  min-width: 0;
  padding-top: 0.05rem;
}

.quiz-comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  margin-bottom: 0.1rem;
  font-size: 0.72rem;
  line-height: 1.2;
  color: #787c7e;
}

.quiz-comment-author {
  font-weight: 700;
  color: #1c1c1c;
}

.quiz-comment-sep {
  color: #878a8c;
}

.quiz-comment-date {
  color: #787c7e;
}

.quiz-comment-actions {
  display: inline-flex;
  gap: 0.35rem;
  margin-left: auto;
}

.quiz-comment-action {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.72rem;
  color: #0079d3;
  cursor: pointer;
}

.quiz-comment-action:hover {
  text-decoration: underline;
}

.quiz-comment-action--danger {
  color: #d93900;
}

.quiz-comment-action--primary {
  font-weight: 600;
}

.quiz-comment-edit {
  display: none;
  margin-top: 0.2rem;
}

.quiz-comment.is-editing .quiz-comment-edit {
  display: block;
}

.quiz-comment-edit-body,
.quiz-comment-edit-link {
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 0.35rem;
}

.quiz-comment-edit-body {
  resize: vertical;
  min-height: 3rem;
}

.quiz-comment-edit-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.quiz-comment-edit-error {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #d93900;
}

.quiz-comment-body {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1c1c1c;
}

.quiz-comment-link {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
}

.quiz-comments-form textarea {
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #ccc;
  border-radius: 999px;
  resize: vertical;
  min-height: 2.2rem;
}

.quiz-comments-form-row {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  align-items: center;
}

.quiz-comments-form-row input[type="url"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #ccc;
  border-radius: 999px;
}

.quiz-comments-submit {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e5ebee;
  color: #1c1c1c;
  cursor: pointer;
}

.quiz-comments-submit:hover {
  background: #d7dadc;
}

.quiz-comments-form-error {
  margin: 0.35rem 0 0;
  color: #b91c1c;
  font-size: 0.78rem;
}

.quiz-comments-login {
  margin: 0;
  color: #787c7e;
  font-size: 0.78rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.walk-kalk-schema {
  width: 100%;
  max-width: 28rem;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.95rem;
}

.walk-kalk-schema td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.walk-kalk-label {
  text-align: left;
  color: #334155;
}

.walk-kalk-op {
  width: 1.5rem;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}

.walk-kalk-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.walk-kalk-schema tr.walk-kalk-highlight td {
  background: #fef9c3;
  font-weight: 700;
  color: #854d0e;
}

.walk-kalk-schema--overview .walk-kalk-value {
  color: #94a3b8;
}

.walk-kalk-schema--overview tr.walk-kalk-highlight .walk-kalk-value {
  color: #854d0e;
}

.kalk-schema {
  width: 100%;
  max-width: 32rem;
  border-collapse: collapse;
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

.kalk-schema td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.kalk-label {
  text-align: left;
  color: #334155;
}

.kalk-op {
  width: 1.75rem;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}

.kalk-value {
  text-align: right;
  white-space: nowrap;
}

.kalk-fixed {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0f172a;
}

.kalk-input {
  width: 7.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 0.35rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
}

.kalk-schema tr.kalk-highlight td {
  background: #fef9c3;
}

.kalk-schema tr.kalk-highlight .kalk-label {
  font-weight: 700;
  color: #854d0e;
}

.kalk-input.correct {
  border-color: #16a34a;
  background: #f0fdf4;
}

.kalk-input.wrong {
  border-color: #dc2626;
  background: #fef2f2;
}

.kalk-zusatz-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  text-transform: uppercase;
}

.kalk-schema-extra .kalk-extra-label {
  text-align: left;
}

.kalk-pct-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.kalk-pct-suffix {
  color: #64748b;
  font-weight: 600;
}

.kalk-input-pct {
  width: 5rem;
}

.kalk-row-param .kalk-label {
  color: #475569;
}

.kalk-input-param {
  border-style: dashed;
  background: #f8fafc;
}

.kalk-schema tr.kalk-row-param td {
  background: #fafafa;
}
