.idea-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  background: var(--sheet);
}
.idea-operation, .idea-theorem { min-width: 0; padding: clamp(16px, 2vw, 25px); }
.idea-board[hidden] { display: none; }
.idea-theorem { border-left: 1px solid var(--rule); background: #1b191e; }
.idea-board h2 { font-size: clamp(1.38rem, 2.15vw, 1.8rem); line-height: 1.12; letter-spacing: -.04em; }
.idea-board p { font-size: .94rem; line-height: 1.55; color: #d7d6d1; }
.idea-operation > p, .idea-theorem > p { margin-top: 9px; }
.math-area { margin: 14px 0 10px; }
.math-area dt { font-weight: 700; font-size: 1.01rem; }
.math-area dd { margin: 4px 0 0; color: #d7d6d1; font-size: .94rem; line-height: 1.5; }
.math-illustration { width: min(100%, 380px); margin: 12px auto 18px; }
.math-drawing { display: block; width: 100%; height: auto; }
.math-illustration figcaption { margin-top: 6px; color: var(--muted); font-size: .83rem; line-height: 1.4; }
.idea-theorem .idea-property-name {
  margin: 11px 0 0;
  color: var(--violet);
  font: 680 1.04rem/1.3 Archivo, Arial, sans-serif;
}
.idea-property-name + p { margin-top: 5px; }
.idea-board var { font-family: Georgia, serif; }
.idea-operations { display: flex; flex-wrap: wrap; gap: .55rem 1.5rem; margin-block: 16px; }
.idea-operations > div { display: inline-flex; gap: .5rem; align-items: baseline; }
.idea-operations > div > span:first-child { font-size: .8rem; font-weight: 650; }
.idea-example { margin: 0 0 10px; }
.idea-example figcaption { margin-bottom: 7px; color: var(--muted); font: 500 .78rem/1.5 var(--mono); }
.idea-example ol {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
  padding: 0; margin: 0; list-style: none;
}
.idea-example ol[hidden] { display: none; }
.idea-example li {
  position: relative; display: grid; align-content: center; gap: 2px; padding: 8px; text-align: center;
  border: 1px solid #554b65; border-radius: 5px; background: #242128; color: var(--violet);
}
.idea-example li:nth-child(2),
body[data-lab="ml-kem"] #lesson-idea-values li:nth-child(-n+2) {
  background: #282418; border-color: #605538; color: var(--yellow);
}
.idea-example li:last-child,
body[data-lab="ml-kem"] #lesson-idea-values li:nth-child(n+3) {
  background: #192720; border-color: #425e50; color: var(--mint);
}
.idea-example li + li::before {
  content: "→"; position: absolute; right: 100%; width: 18px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); color: var(--muted);
}
.idea-example li span { color: var(--ink); font-size: .77rem; font-weight: 600; }
.idea-example li strong { font: 650 clamp(.96rem, 1.4vw, 1.18rem)/1.3 var(--mono); overflow-wrap: anywhere; }
#lesson-idea-values { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr)); gap: 6px; }
#lesson-idea-values li::before { content: none; }
body[data-lab="ml-kem"] #lesson-idea-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-lab="ml-kem"] #lesson-idea-values strong { font-size: .9rem; }
#lesson-idea-check { margin: 0 0 8px; }
.idea-link { color: var(--violet); font-size: .85rem; font-weight: 600; text-underline-offset: 3px; }
.idea-equation { margin: 15px 0; padding: 10px 12px; border-left: 3px solid var(--violet); background: #25212c; color: var(--ink); font-size: clamp(1.09rem, 1.5vw, 1.35rem); }
.idea-proof {
  grid-column: 1 / -1; padding: 0 clamp(16px, 2vw, 25px);
  background: var(--sheet); border-top: 1px solid var(--rule);
}
.idea-proof summary { padding: 12px 0; width: fit-content; }
.idea-proof[open] { padding-bottom: 16px; }
.idea-proof-body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.idea-proof h4 { margin: 1px 0 5px; font-size: .94rem; }
.idea-proof p { margin: 6px 0; }
.idea-derivation { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .3em; padding-block: 7px; }
.idea-proof .idea-proof-check { margin-block: 12px; padding: 10px 12px; border-left: 3px solid var(--mint); background: #192720; color: var(--ink); }
.idea-board :is(h2, summary, .idea-link):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
@container lesson-panel (max-width: 680px) {
  .idea-board, .idea-proof-body { grid-template-columns: 1fr; }
  .idea-theorem { border-left: none; border-top: 1px solid var(--rule); }
  .idea-proof-body { gap: 9px; }
}
@media (max-width: 360px) {
  .idea-example ol { gap: 10px; }
  .idea-example li { padding: 6px 2px; }
  .idea-example li span { font-size: .71rem; }
  .idea-example li + li::before { width: 10px; font-size: .72rem; }
}
