.ans-mode { --ans-mint: #a9d6bb; --ans-amber: #e1ba86; }
.ans-mode .card-hover-meta { margin-right: 176px; }
.ans-mode #ans-explain { color: var(--ans-amber); }
.ans-mode .card-frame:focus-within .card-hover-meta { opacity: 1; }
.ans-mode .ans-term { color: inherit; font: inherit; text-decoration: none; border: 0; background: none; cursor: help; }
.ans-mode .ans-term:focus-visible { outline: 1px solid #c5d7df; outline-offset: 3px; border-radius: 2px; }
.ans-tooltip {
    position: fixed; z-index: 50000; width: max-content; max-width: min(350px, calc(100vw - 24px));
    box-sizing: border-box; padding: 13px 16px; border: 1px solid #697a7c; border-radius: 7px;
    background: #1c292d; color: #edf3f3; box-shadow: 0 10px 36px #0006;
    font: 400 14px/1.55 Inter, system-ui, sans-serif; letter-spacing: 0; text-align: left; overflow-wrap: break-word;
}
.ans-tooltip[hidden] { display: none; }
.ans-dialog {
    width: min(940px, calc(100vw - 32px)); max-width: none; height: auto; max-height: calc(100dvh - 36px);
    padding: 0; border: 1px solid #627379; border-radius: 8px; background: #252d32; color: #eaf0f3;
    box-shadow: 0 24px 100px #0008; letter-spacing: 0;
}
.ans-dialog[open] { display: flex; flex-direction: column; animation: ans-appear 170ms ease-out; }
.ans-dialog::backdrop { background: #050c12ba; backdrop-filter: blur(5px); }
.ans-dialog-head {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex: 0 0 auto;
    padding: 12px 22px; border-bottom: 1px solid #c0d6e12b;
}
.ans-dialog-head > span { color: var(--ans-amber); font-size: 13px; line-height: 1.5; }
.ans-dialog-head button { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border-radius: 6px; border: 1px solid #d3e4e333; background: #ffffff05; color: #cfdbdf; cursor: pointer; transition: background 150ms, color 150ms; }
.ans-dialog-head button:hover { background: #ffffff12; color: white; }
.ans-dialog-head button svg { width: 22px; height: 22px; }
.ans-dialog-body { overflow: auto; padding: 26px 36px 30px; overscroll-behavior: contain; }
.ans-dialog h2 { font-size: 23px; line-height: 1.4; margin: 0 0 24px; letter-spacing: 0; overflow-wrap: break-word; }
.ans-dialog h3 { font-size: 15px; line-height: 1.4; font-weight: 650; margin: 0 0 12px; color: var(--ans-mint); letter-spacing: 0; }
.ans-dialog section { margin: 0 0 26px; }
.ans-dialog section + section h3 { color: var(--ans-amber); }
.ans-dialog p, .ans-dialog li { font-size: 16px; line-height: 1.7; }
.ans-dialog p { margin: 0; }
.ans-dialog ul { padding-left: 22px; margin: 0; }
.ans-dialog li + li { margin-top: 10px; }
.ans-dialog figure { margin: 18px 0 26px; }
.ans-dialog figure img { display: block; width: 100%; height: auto; object-fit: contain; background: white; border-radius: 4px; }
.ans-dialog figcaption { margin-top: 9px; font-size: 12px; color: #b0c0c7; }
.ans-dialog footer { padding-top: 20px; border-top: 1px solid #c0d6e12b; }
.ans-dialog footer h3 { color: #adc7de; }
.ans-dialog footer a { display: block; color: #afcbe2; font-size: 13px; line-height: 1.5; padding: 7px 0; text-decoration: none; }
.ans-dialog footer a:hover { color: white; }
.ans-dialog footer a span { color: #b0bdc4; margin-left: 8px; }
@keyframes ans-appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
    body.ans-mode .exam-topbar { gap: 12px; flex-wrap: wrap; }
    body.ans-mode .blood-title { font-size: 20px; }
    body.ans-mode .card-hover-meta { margin: 66px 14px 0; }
    body.ans-mode .card-frame { min-height: 400px; }
    body.ans-mode .card-surface { min-height: 290px; padding: 25px 20px 34px; }
    body.ans-mode .anki-imported-html { font-size: 21px; }
    body.ans-mode .card-content.is-answer-side .anki-imported-html { font-size: 17px; }
    .ans-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 18px); }
    .ans-dialog-head { padding: 10px 16px; }
    .ans-dialog-body { padding: 20px 18px 24px; }
    .ans-dialog h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .ans-dialog[open] { animation: none; } }
