/* Academy: How encryption gets broken (/academy/how-encryption-gets-broken/), seit 03.12.2026. Ergänzt site.css
   (cm-* stammt von /academy/block-cipher-modes/). Ruhig: weiße Flächen, eine Akzentfarbe, keine bunten Schriften. */

/* Knackzeit-Rechner */
.bk-calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-areas: "sel out" "att out"; grid-template-rows: auto 1fr; }
.bk-calc__in { padding: 20px; display: flex; flex-direction: column; gap: 16px; border-right: 1px solid var(--line); }
.bk-calc__sel { grid-area: sel; padding-bottom: 0; }
.bk-calc__att { grid-area: att; }
.bk-calc__out { grid-area: out; }
.bk-calc__in select { width: 100%; font-family: var(--text); font-size: 15px; }
.bk-att { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bk-att legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.bk-att label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #DCDCE8; border-radius: 10px; font-size: 14.5px; color: var(--ink); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.bk-att label:hover { border-color: var(--accent); }
.bk-att label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.bk-att input, .bk-switch input { accent-color: var(--accent); margin: 0; flex: none; }
.bk-switch { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.bk-calc__out { grid-area: out; padding: 24px; display: flex; flex-direction: column; gap: 10px; background: #FCFCFF; border-radius: 0 18px 18px 0; min-width: 0; }
.bk-calc__k { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bk-calc__time { margin: 0; font-family: var(--head); font-weight: 700; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; letter-spacing: -.03em; color: var(--ink); overflow-wrap: anywhere; }
.bk-calc__sub, .bk-calc__uni { margin: 0; font-size: 15px; color: var(--body); }
.bk-calc__sub b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.bk-calc__uni { font-weight: 600; color: var(--ink); }
.bk-calc__note { margin: 4px 0 0; font-size: 14px; color: var(--muted); line-height: 1.55; }
.bk-scale { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.bk-scale li { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.bk-scale i { display: block; height: 8px; border-radius: 4px; background: #E9E9F3; }
.bk-scale li.is-on i { background: var(--accent); }
.bk-scale li.is-on span { color: var(--ink); font-weight: 700; }
.bk-q { margin-top: 4px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: #FFFFFF; font-size: 14.5px; line-height: 1.6; }
.bk-q b { color: var(--ink); }
.bk-q a { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* Übersicht */
.answer { font-size: 18px !important; color: var(--ink); }
.bk-map { margin: 4px 0 0; padding: 18px 18px 10px; border: 1px solid var(--line-2); border-radius: 16px; background: #FFFFFF; }
.bk-map svg { width: 100%; height: auto; }
.bk-map figcaption { font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 4px; }
.bk-map__label { font-family: var(--text); font-size: 14px; font-weight: 600; fill: var(--ink); }
.bk-map__num { fill: #FFFFFF; stroke: var(--accent); stroke-width: 2; transition: fill .15s ease; }
.bk-map__numtext { font-family: var(--head); font-size: 13px; font-weight: 700; fill: var(--accent); pointer-events: none; }
.bk-map a:hover .bk-map__num, .bk-map a:focus .bk-map__num { fill: var(--accent-soft); }
.bk-ov td, .bk-qt td, .bk-est td, .bk-dl td { white-space: normal !important; width: auto !important; text-align: left !important; color: var(--ink) !important; }
.bk-ov td:first-child { width: 1% !important; color: var(--muted) !important; font-weight: 700; }
.bk-ov a, .bk-est a { font-family: var(--text) !important; }
.bk-est small { display: block; color: var(--muted); font-size: 12.5px; }
.bk-est td:first-child, .bk-est td:nth-child(4), .bk-est td:nth-child(5), .bk-dl td:last-child { white-space: nowrap !important; }
.bk-qt td:last-child { width: 1% !important; white-space: nowrap !important; }

/* Abschnitte */
.bk-s { scroll-margin-top: 90px; }
.bk-s > p, .bk-honest { max-width: 760px; }
.bk-s > p a, .bk-list a { color: var(--accent); }
.bk-h3 { margin: 12px 0 0; font-family: var(--head); font-weight: 600; font-size: 20px; color: var(--ink); scroll-margin-top: 90px; }
.bk-cases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-left: 2px solid var(--line-2); }
.bk-cases li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding: 6px 0 6px 16px; position: relative; font-size: 15px; line-height: 1.55; }
.bk-cases li::before { content: ''; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: #FFFFFF; border: 2px solid var(--accent); }
.bk-cases b { font-family: var(--head); font-weight: 600; font-size: 14px; color: var(--ink); }
.bk-ws .pitfall:first-child b::before { content: '⚠ '; color: var(--muted); }
.bk-ws .pitfall:last-child b::before { content: '✓ '; color: var(--muted); }
.bk-honest { margin: 0; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px; font-size: 15px; }
.bk-honest b { color: var(--ink); }
.bk-honest a { color: var(--accent); font-weight: 600; }
.block > .bk-try { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.bk-try span { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.bk-page .bk-try a { padding: 5px 11px; border: 1px solid #DCDCE8; border-radius: 8px; color: var(--ink); font-weight: 500; }
.bk-page .bk-try a:hover { border-color: var(--accent); color: var(--accent); }
.bk-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; font-size: 16px; max-width: 760px; }
.bk-list b { color: var(--ink); }
.bk-small { font-size: 14px !important; color: var(--muted); }
.bk-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bk-side .cm-toc a { display: flex; gap: 10px; align-items: baseline; }
.bk-side .cm-toc span { flex: none; width: 20px; font-family: var(--head); font-weight: 700; font-size: 13px; color: var(--accent); }

/* Moscas Ungleichung */
.mo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); box-shadow: none; }
.mo-in { padding: 20px; display: flex; flex-direction: column; gap: 18px; border-right: 1px solid var(--line); }
.mo-field { display: flex; flex-direction: column; gap: 6px; }
.mo-field label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.mo-field label b { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 4px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); font-size: 13px; }
.mo-input { display: flex; align-items: center; gap: 10px; }
.mo-input input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }
.mo-input input[type=number] { width: 64px; padding: 6px 8px; border: 1px solid #DCDCE8; border-radius: 8px; font-family: var(--head); font-weight: 700; font-size: 16px; text-align: center; color: var(--ink); }
.mo-input span { font-size: 13.5px; color: var(--muted); }
.mo-field small { font-size: 13px; color: var(--muted); line-height: 1.6; }
.mo-field .chip { min-height: 26px; padding: 2px 8px; font-size: 12.5px; margin: 2px 0; }
.mo-field .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.mo-out { padding: 20px; display: flex; flex-direction: column; gap: 12px; background: #FCFCFF; border-radius: 0 18px 18px 0; min-width: 0; }
.mo-chart svg { width: 100%; height: auto; overflow: visible; }
.mo-grid { stroke: #EDEDF4; stroke-width: 1; }
.mo-tick { font-family: var(--text); font-size: 11.5px; fill: var(--muted); text-anchor: middle; }
.mo-label { font-family: var(--text); font-size: 13px; font-weight: 600; fill: var(--ink); }
.mo-val { font-family: var(--text); font-size: 11.5px; fill: var(--muted); }
.mo-bar--y { fill: #C9C8FF; }
.mo-bar--x { fill: var(--accent); }
.mo-risk { fill: none; stroke: var(--red); stroke-width: 2; stroke-dasharray: 5 4; }
.mo-q { stroke: var(--ink); stroke-width: 2; }
.mo-qlabel { font-family: var(--text); font-size: 12.5px; font-weight: 700; fill: var(--ink); }
.mo-verdict { margin: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #FFFFFF; font-size: 15px; line-height: 1.55; }
.mo-verdict b { color: var(--ink); }
.mo-verdict[data-state="risk"] { border-left: 4px solid var(--red); }
.mo-verdict[data-state="ok"] { border-left: 4px solid var(--green); }
.mo-rule { margin: 0; font-size: 13.5px; color: var(--muted); }

@media (max-width: 900px) {
  .bk-calc, .mo { grid-template-columns: minmax(0, 1fr); }
  .bk-calc { grid-template-areas: "sel" "out" "att"; grid-template-rows: auto; }
  .bk-calc__sel { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
  .bk-calc__in, .mo-in { border-right: 0; }
  .mo-in { border-bottom: 1px solid var(--line); }
  .bk-calc__out { border-radius: 0; border-bottom: 1px solid var(--line); }
  .mo-out { border-radius: 0 0 18px 18px; }
  .bk-att label { padding: 6px 10px; font-size: 14px; }
  .bk-scale { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 10px; }
  .bk-notes { grid-template-columns: minmax(0, 1fr); }
  .bk-cases li { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
