.saved-keys-dialog {
  width: min(750px, calc(100% - 24px)); max-height: min(88vh, 940px); padding: 0;
  border: 1px solid var(--line); border-radius: 15px; background: white; color: var(--ink);
  box-shadow: 0 20px 75px #24131e3b;
}
.saved-keys-dialog[open] { display: flex; flex-direction: column; }
.saved-keys-dialog::backdrop { background: #211c24a8; }
.saved-keys-header { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; gap:12px; padding:14px 20px; border-bottom:1px solid var(--line); }
.saved-keys-header h2 { font-size:1.25rem; margin:0; letter-spacing:-.025em; }
.saved-keys-body { overflow:auto; min-height:0; padding:18px 20px 22px; }
.saved-keys-search { display:grid; gap:6px; font-size:.9rem; font-weight:700; }
.saved-keys-search input, .saved-key-link { width:100%; min-height:44px; padding:8px 10px; border:1px solid #d6cdd2; border-radius:7px; background:white; font:inherit; font-weight:500; }
.saved-keys-list, .saved-key-questions { list-style:none; margin:0; padding:0; }
.saved-keys-list { margin-top:14px; }
.saved-keys-list > li+li { margin-top:8px; }
.saved-key-row { width:100%; display:grid; gap:5px; padding:12px 14px; background:white; color:var(--ink); border:1px solid var(--line); border-radius:8px; text-align:left; }
.saved-key-row:hover, .saved-key-row:focus-visible { border-color:var(--red); background:#fdf8f8; }
.saved-key-row strong, .saved-key-first { font-size:.95rem; line-height:1.45; overflow-wrap:anywhere; }
.saved-key-first { white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.saved-key-meta, .saved-key-reference { color:var(--sub); font-size:.84rem; line-height:1.45; }
.saved-keys-empty, .saved-key-status { color:var(--sub); line-height:1.6; font-size:.95rem; }
.saved-key-status:empty { display:none; }
.saved-key-status:not(:empty) { margin:10px 0; }
.saved-key-actions { display:flex; gap:7px; flex-wrap:wrap; }
.saved-key-actions a { color:var(--ink); display:inline-flex; align-items:center; text-decoration:none; }
.saved-key-heading { padding:20px 0 12px; border-bottom:2px solid var(--red); }
.saved-key-heading h3 { font-size:1.3rem; margin:4px 0 5px; }
.saved-key-school { color:var(--red); font-weight:750; font-size:.9rem; }
.saved-key-question { padding:16px 0; border-bottom:1px solid var(--line); }
.saved-key-question h4 { margin:0 0 3px; font-size:1rem; }
.saved-key-prompt, .saved-key-answer, .saved-key-example { font-size:1rem; line-height:1.55; overflow-wrap:anywhere; }
.saved-key-prompt, .saved-key-answer { margin-top:6px; }
.saved-key-answer { padding:8px 10px; background:#faf4f5; border-inline-start:3px solid var(--red); }
.saved-key-example { margin:10px 0; padding:8px 12px; border:1px solid var(--line); border-radius:7px; }
.saved-key-example ol { margin:6px 0 0; padding-inline-start:1.5em; }
.saved-key-art { margin:6px 0; }
.saved-key-art .diagram { width:100%; max-width:280px; height:auto; max-height:112px; }
.saved-key-art .diagram.grid { max-height:145px; }
.saved-key-art img.diagram.coin { width:64px; height:64px; }
@media (max-width:550px) {
  .saved-keys-dialog { max-height:92vh; }
  .saved-keys-body { padding:14px 13px 18px; }
  .saved-keys-header { padding:10px 13px; }
}
@media print {
  dialog.saved-keys-dialog, dialog.saved-keys-dialog::backdrop { display:none!important; }
  #print .saved-key-sheet { background:white; color:#171317; }
  #print .saved-key-heading { padding:0 0 8pt; break-after:avoid; }
  #print .saved-key-question { break-inside:avoid; padding:10pt 0; }
  #print .saved-key-prompt, #print .saved-key-answer, #print .saved-key-example { font-size:11pt; line-height:1.4; }
  #print .saved-key-meta, #print .saved-key-reference { font-size:9pt; }
}
