/* New tab, menus, notices, graph extras, canvas polish, book library and flashcards. Loaded after app.css and neural.css. */
:root, body { --fc-accent: #34D399; --fc-violet: #8B9CFF; --fc-gold: #FBBF24; --fc-red: #FB7185; --fc-card: rgba(255,255,255,.035); --fc-line: rgba(140,155,255,.16); }
.theme-light { --fc-card: rgba(20,30,80,.035); --fc-line: rgba(60,70,130,.16); }
.spacer { flex: 1; }
.mod-cta, button.mod-cta, a.mod-cta { background: var(--fc-accent); color: #04140D; border: none; border-radius: 10px; padding: 9px 16px; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: transform .12s ease, filter .12s ease, box-shadow .2s ease; box-shadow: 0 6px 24px -10px rgba(52,211,153,.8); }
.mod-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.mod-cta:disabled, .mod-cta[disabled] { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.mod-muted { background: var(--background-modifier-hover); color: var(--text-normal); border: 1px solid var(--background-modifier-border); border-radius: 10px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
kbd { font-family: var(--font-monospace-theme, ui-monospace, monospace); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .55; margin-left: 6px; }

/* ---------- new tab */
.view-content.is-newtab { display: flex; align-items: center; justify-content: center; }
.empty-state-container { text-align: center; padding: 40px 20px; max-width: 420px; width: 100%; }
.empty-state-title { font-size: 22px; font-weight: 600; color: var(--text-muted); margin-bottom: 18px; }
.empty-state-action { color: var(--interactive-accent); cursor: pointer; padding: 7px 12px; border-radius: 8px; display: flex; justify-content: space-between; gap: 20px; }
.empty-state-action span { color: var(--text-faint); font-size: 12px; }
.empty-state-action:hover { background: var(--background-modifier-hover); }
.empty-state-recent { margin-top: 26px; text-align: left; }
.empty-state-recent .tree-item { display: flex; align-items: center; gap: 8px; }
.empty-state-recent .svg-icon { width: 15px; height: 15px; opacity: .7; }

/* ---------- menu and notices */
.menu { position: fixed; z-index: 80; min-width: 210px; padding: 5px; border-radius: 12px; background: var(--background-primary); border: 1px solid var(--background-modifier-border-hover, rgba(140,155,255,.3)); box-shadow: 0 20px 50px -14px rgba(0,0,0,.85); animation: pop-in .12s ease; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--text-normal); font-size: 13.5px; }
.menu-item:hover { background: var(--background-modifier-hover); }
.menu-item .svg-icon { width: 16px; height: 16px; color: var(--text-muted); }
.menu-separator { height: 1px; margin: 4px 6px; background: var(--background-modifier-border); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.notice-container { position: fixed; top: 14px; right: 14px; z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.notice { padding: 10px 16px; border-radius: 10px; background: var(--background-primary); border: 1px solid var(--background-modifier-border-hover, rgba(140,155,255,.3)); box-shadow: 0 14px 40px -12px rgba(0,0,0,.8); color: var(--text-normal); animation: pop-in .18s ease; transition: opacity .3s, transform .3s; }
.notice.is-hiding { opacity: 0; transform: translateY(-6px); }
.hover-popover { animation: pop-in .14s ease; }
.hover-popover.is-closing { opacity: 0; transition: opacity .12s; }

/* ---------- graph extras */
.segmented { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--background-modifier-hover); margin-bottom: 8px; }
.segmented button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; background: none; color: var(--text-muted); padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px; transition: background .15s, color .15s; }
.segmented button .svg-icon { width: 15px; height: 15px; }
.segmented button.is-active { background: var(--background-primary); color: var(--text-normal); box-shadow: 0 2px 8px -3px rgba(0,0,0,.6); }
.segmented.small button { padding: 4px 12px; }
.graph-controls:not(.is-free) .free-only { display: none; }
.graph-fit { position: absolute; left: 12px; bottom: 12px; z-index: 3; background: rgba(13,17,32,.8); border: 1px solid var(--background-modifier-border); backdrop-filter: blur(8px); }
.theme-light .graph-fit { background: rgba(250,250,253,.9); }
.workspace-leaf-content[data-type="graph"] canvas, .workspace-leaf-content[data-type="localgraph"] canvas { filter: none !important; }

/* ---------- canvas polish */
.canvas-wrapper { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.canvas-wrapper .canvas { will-change: transform; }
.canvas-wrapper:not(.is-moving) .canvas { will-change: auto; }
.canvas-node-container { border-radius: 12px; }
.canvas-node:not(.canvas-node-group) .canvas-node-container { border: 2px solid rgba(140,155,255,.38); background: color-mix(in srgb, var(--background-primary) 94%, #8B9CFF); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px -18px rgba(0,0,0,.95); }
.canvas-node.is-themed:not(.canvas-node-group) .canvas-node-container { border-color: color-mix(in srgb, var(--canvas-color) 85%, transparent); background: color-mix(in srgb, var(--canvas-color) 11%, var(--background-primary)); }
.canvas-node-content { overflow: hidden; scrollbar-width: none; padding: 10px 16px; line-height: 1.5; }
.canvas-node-content::-webkit-scrollbar { display: none; }
.canvas-node-content .markdown-preview-sizer > div:first-child > :first-child { margin-top: 0; }
.canvas-node-content p:last-child { margin-bottom: 0; }
.canvas-edges .canvas-edge { stroke-width: 3; stroke-linecap: round; }
.canvas-wrapper.is-dragging .canvas-node a { pointer-events: none; }
.canvas-wrapper.is-far .canvas-node-text .canvas-node-content > * { visibility: hidden; }

/* ---------- quote sources */
.callout.has-book-source[data-callout="quote"] { cursor: pointer; transition: border-color .15s, background .15s; }
.callout.has-book-source[data-callout="quote"]:hover { border-color: rgba(var(--callout-color), .5); }
.callout-source-btn { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(var(--callout-color), .35); background: rgba(var(--callout-color), .08); color: rgb(var(--callout-color)); border-radius: 999px; padding: 1px 9px 1px 7px; font-size: 11.5px; cursor: pointer; opacity: .75; transition: opacity .15s, background .15s; }
.callout-source-btn .svg-icon { width: 13px; height: 13px; }
.callout:hover .callout-source-btn, .callout-source-btn:focus { opacity: 1; }
.callout-source-btn:hover { background: rgba(var(--callout-color), .18); }
@media (hover: none) { .callout-source-btn { opacity: 1; } }

/* ---------- book library */
.view-content.books-host { background: var(--background-primary); }
.books-view { max-width: 860px; margin: 0 auto; padding: 34px 28px 120px; }
.books-kicker { display: flex; align-items: center; gap: 8px; color: var(--text-faint); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; margin-bottom: 14px; }
.books-kicker .svg-icon { width: 16px; height: 16px; }
.books-search { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; border: 1px solid var(--background-modifier-border-hover, rgba(140,155,255,.3)); background: var(--fc-card); box-shadow: 0 14px 40px -24px rgba(0,0,0,.9); }
.books-search:focus-within { border-color: var(--interactive-accent); box-shadow: 0 0 0 3px rgba(52,211,153,.14); }
.books-search-icon { color: var(--text-faint); display: flex; }
.books-search input { flex: 1; min-width: 0; border: none; background: none; outline: none; color: var(--text-normal); font: inherit; font-size: 17px; padding: 8px 0; }
.books-filters { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.books-filters .segmented { margin: 0; }
.books-filters select { background: var(--background-modifier-hover); color: var(--text-normal); border: 1px solid var(--background-modifier-border); border-radius: 8px; padding: 5px 8px; font: inherit; }
.books-open-reader { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; text-decoration: none; }
.books-open-reader .svg-icon { width: 14px; height: 14px; }
.books-status { color: var(--text-faint); font-size: 12.5px; margin: 18px 2px 8px; min-height: 18px; display: flex; align-items: center; gap: 8px; }
.books-results.is-loading { opacity: .5; transition: opacity .2s; }
.books-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--background-modifier-border); border-top-color: var(--interactive-accent); display: inline-block; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.book-hit { padding: 16px 18px; margin: 10px 0; border-radius: 14px; border: 1px solid var(--fc-line); background: var(--fc-card); transition: border-color .15s; }
.book-hit:hover { border-color: rgba(140,155,255,.35); }
.book-hit-cite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--interactive-accent); font-weight: 650; }
.book-hit-cite .svg-icon { width: 15px; height: 15px; }
.book-hit-ch { color: var(--text-faint); font-weight: 400; }
.book-hit-text { margin-top: 8px; line-height: 1.6; color: var(--text-normal); font-size: 15px; }
.book-hit-text mark, .book-page-text mark { background: rgba(250,204,21,.26); color: inherit; border-radius: 3px; padding: 0 2px; }
.book-hit-figs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; }
.book-hit-figs figure { margin: 0; flex: none; width: 150px; cursor: zoom-in; }
.book-hit-figs img { width: 150px; height: 110px; object-fit: contain; background: #fff; border-radius: 8px; }
.book-hit-figs figcaption { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.book-hit-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.book-hit-actions button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--background-modifier-border); background: none; color: var(--text-muted); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.book-hit-actions button:hover { color: var(--text-normal); background: var(--background-modifier-hover); }
.book-hit-actions .svg-icon { width: 14px; height: 14px; }
.books-auth { text-align: center; padding: 46px 20px; border: 1px dashed var(--fc-line); border-radius: 16px; margin-top: 10px; }
.books-auth-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--background-modifier-hover); color: var(--interactive-accent); }
.books-auth-icon .svg-icon { width: 24px; height: 24px; }
.books-auth-title { font-weight: 650; font-size: 17px; }
.books-auth-text { color: var(--text-muted); margin: 6px 0 16px; }
.books-auth-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.book-page-view { max-width: 980px; margin: 0 auto; padding: 18px 22px 120px; }
.book-page-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 8px 6px; background: var(--background-primary); border-bottom: 1px solid var(--background-modifier-border); margin-bottom: 14px; }
.book-page-title { font-weight: 650; padding: 0 6px; }
.book-page-title span { color: var(--interactive-accent); margin-left: 6px; }
.book-page-quote { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: rgba(250,204,21,.07); border: 1px solid rgba(250,204,21,.25); color: var(--text-normal); line-height: 1.55; margin-bottom: 16px; }
.book-page-quote .svg-icon { flex: none; color: var(--fc-gold); margin-top: 2px; }
.book-page-image img { width: 100%; height: auto; border-radius: 10px; background: #fff; box-shadow: 0 20px 60px -30px rgba(0,0,0,.9); cursor: zoom-in; }
.book-page-text { margin-top: 18px; line-height: 1.65; color: var(--text-muted); }
.book-page-text p.is-match { color: var(--text-normal); }
.book-page-loading { padding: 40px; text-align: center; color: var(--text-faint); }

/* ---------- flashcards */
.view-content.fc-host { background: radial-gradient(70% 50% at 50% 0%, rgba(124,140,248,.08), transparent 70%), var(--background-primary); }
.fc-loading { padding: 60px; text-align: center; color: var(--text-faint); }
.fc-view { max-width: 980px; margin: 0 auto; padding: 28px 24px 120px; }
.fc-hero { display: grid; grid-template-columns: 220px 1fr auto; gap: 26px; align-items: center; padding: 22px 26px; border-radius: 22px; border: 1px solid var(--fc-line); background: linear-gradient(135deg, rgba(52,211,153,.07), rgba(139,156,255,.06) 60%, transparent), var(--fc-card); box-shadow: 0 30px 80px -50px rgba(0,0,0,.9); }
.fc-spec { width: 220px; height: 220px; border-radius: 50%; position: relative; background: radial-gradient(circle at 50% 50%, rgba(10,14,30,.6), rgba(10,14,30,0) 70%); }
.theme-light .fc-spec { background: radial-gradient(circle at 50% 50%, rgba(20,30,80,.1), transparent 70%); }
.fc-spec canvas, .fc-sum-spec canvas, .fc-mini-spec canvas, .fc-evo canvas { width: 100%; height: 100%; display: block; }
.fc-kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.fc-name { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; }
.fc-name-text { font-family: var(--serif, Georgia, serif); font-size: 34px; font-weight: 650; letter-spacing: -.01em; line-height: 1.1; }
.fc-name-input { font-family: var(--serif, Georgia, serif); font-size: 30px; background: none; border: none; border-bottom: 2px solid var(--interactive-accent); color: var(--text-normal); outline: none; width: 100%; max-width: 420px; }
.fc-rename { opacity: .5; } .fc-rename:hover { opacity: 1; }
.fc-stage { color: var(--text-muted); margin-bottom: 14px; }
.fc-level { display: flex; align-items: center; gap: 12px; }
.fc-lv { font-weight: 750; color: var(--fc-violet); white-space: nowrap; }
.fc-xpbar { flex: 1; height: 10px; border-radius: 99px; background: rgba(130,140,190,.16); overflow: hidden; min-width: 80px; }
.fc-xpbar div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--fc-violet), var(--fc-accent)); box-shadow: 0 0 14px rgba(52,211,153,.6); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.fc-xpnum { font-size: 12px; color: var(--text-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fc-next { font-size: 12.5px; color: var(--text-faint); margin-top: 8px; }
.fc-hero-side { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fc-ring { position: relative; width: 104px; height: 104px; }
.fc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.fc-ring circle { fill: none; stroke-width: 8; }
.fc-ring .track { stroke: rgba(130,140,190,.18); }
.fc-ring .fill { stroke: var(--fc-accent); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.fc-ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.fc-ring-label b { font-size: 24px; line-height: 1; }
.fc-ring-label span { font-size: 11px; color: var(--text-faint); }
.fc-streak { display: flex; align-items: center; gap: 6px; color: var(--text-faint); font-size: 12.5px; }
.fc-streak b { font-size: 17px; color: var(--text-muted); }
.fc-streak.is-on { color: var(--fc-gold); } .fc-streak.is-on b { color: var(--fc-gold); }
.fc-streak.is-on .svg-icon { filter: drop-shadow(0 0 6px rgba(251,191,36,.8)); }
.fc-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 14px; margin: 18px 0 8px; }
.fc-big { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--fc-line); background: var(--fc-card); color: var(--text-normal); cursor: pointer; text-align: left; transition: transform .15s ease, border-color .15s, box-shadow .2s; }
.fc-big:hover:not([disabled]) { transform: translateY(-2px); border-color: rgba(140,155,255,.4); box-shadow: 0 16px 40px -24px rgba(0,0,0,.9); }
.fc-big .svg-icon { width: 22px; height: 22px; }
.fc-big b { display: block; font-size: 16px; } .fc-big small { color: inherit; opacity: .7; font-size: 12.5px; }
.fc-big.mod-cta { border: none; }
.fc-big[disabled] { opacity: .45; cursor: default; }
.fc-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: 16px; border: 1px solid var(--fc-line); background: var(--fc-card); }
.fc-stats div { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 4px; }
.fc-stats div + div { border-left: 1px solid var(--fc-line); }
.fc-stats b { font-size: 19px; font-variant-numeric: tabular-nums; } .fc-stats span { font-size: 11px; color: var(--text-faint); }
.fc-decks { margin-top: 22px; }
.fc-subject { margin-bottom: 18px; }
.fc-subject-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 8px; font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.fc-mini { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--background-modifier-border); background: none; color: var(--text-muted); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 500; }
.fc-mini:hover:not([disabled]) { color: var(--text-normal); background: var(--background-modifier-hover); }
.fc-mini[disabled] { opacity: .4; cursor: default; }
.fc-mini .svg-icon { width: 14px; height: 14px; }
.fc-deck { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr auto; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; transition: background .12s, border-color .12s; }
.fc-deck:hover { background: var(--fc-card); border-color: var(--fc-line); }
.fc-deck-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-deck-name span { display: block; font-weight: 400; font-size: 12px; color: var(--text-faint); }
.fc-deck-bar { position: relative; height: 7px; border-radius: 99px; background: rgba(130,140,190,.14); overflow: hidden; }
.fc-deck-bar i, .fc-deck-bar b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.fc-deck-bar i { background: rgba(139,156,255,.45); }
.fc-deck-bar b { background: var(--fc-accent); box-shadow: 0 0 10px rgba(52,211,153,.6); }
.fc-deck-due { display: flex; gap: 8px; font-size: 12.5px; min-width: 110px; justify-content: flex-end; }
.fc-deck-due .due { color: var(--fc-red); font-weight: 650; } .fc-deck-due .new { color: var(--fc-violet); } .fc-deck-due .done { color: var(--fc-accent); display: flex; }
.fc-deck-due .svg-icon { width: 16px; height: 16px; }
.fc-section-title { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin: 26px 4px 12px; }
.fc-section-title span { font-weight: 500; letter-spacing: 0; text-transform: none; }
.fc-evo { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.fc-evo-item { display: flex; flex-direction: column; align-items: center; padding: 10px 6px 12px; border-radius: 14px; border: 1px solid var(--fc-line); background: var(--fc-card); text-align: center; }
.fc-evo-item canvas { width: 92px; height: 92px; }
.fc-evo-item b { font-size: 12.5px; margin-top: 4px; color: var(--text-faint); }
.fc-evo-item span { font-size: 11px; color: var(--text-faint); }
.fc-evo-item.is-unlocked b { color: var(--text-normal); }
.fc-evo-item.is-current { border-color: rgba(52,211,153,.5); box-shadow: 0 0 0 1px rgba(52,211,153,.25), 0 14px 40px -24px rgba(52,211,153,.6); }
.fc-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.fc-badge { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--fc-line); background: var(--fc-card); opacity: .5; }
.fc-badge .svg-icon { grid-row: span 2; width: 20px; height: 20px; color: var(--text-faint); }
.fc-badge b { font-size: 13px; } .fc-badge span { font-size: 11.5px; color: var(--text-faint); }
.fc-badge.is-earned { opacity: 1; border-color: rgba(251,191,36,.35); }
.fc-badge.is-earned .svg-icon { color: var(--fc-gold); filter: drop-shadow(0 0 6px rgba(251,191,36,.6)); }
.fc-footer { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--fc-line); font-size: 12.5px; color: var(--text-muted); }
.fc-footer input[type="number"] { width: 64px; margin-left: 6px; background: var(--background-modifier-hover); border: 1px solid var(--background-modifier-border); color: var(--text-normal); border-radius: 7px; padding: 4px 6px; font: inherit; }
.fc-import { cursor: pointer; }
.fc-danger:hover { color: var(--fc-red) !important; border-color: rgba(251,113,133,.5) !important; }
.fc-note { font-size: 11.5px; color: var(--text-faint); margin-top: 10px; }

/* session */
.fc-session { max-width: 760px; margin: 0 auto; padding: 16px 20px 40px; min-height: 100%; display: flex; flex-direction: column; }
.fc-session-top { display: flex; align-items: center; gap: 14px; }
.fc-progress, .fc-timer { flex: 1; height: 8px; border-radius: 99px; background: rgba(130,140,190,.16); overflow: hidden; }
.fc-progress div, .fc-timer div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--fc-violet), var(--fc-accent)); transition: width .35s ease; }
.fc-timer div { transition: width .1s linear; }
.fc-timer.is-low div { background: linear-gradient(90deg, var(--fc-red), var(--fc-gold)); }
.fc-combo, .fc-sprint-score { display: flex; flex-direction: column; align-items: center; line-height: 1; min-width: 46px; color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.fc-combo-n, .fc-sprint-score b { font-size: 20px; font-weight: 750; color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: 0; transition: color .2s, transform .2s; }
.fc-combo.is-hot .fc-combo-n { color: var(--fc-gold); text-shadow: 0 0 12px rgba(251,191,36,.7); }
.fc-mini-spec { width: 56px; height: 56px; flex: none; }
.fc-stage-area { position: relative; display: flex; align-items: center; justify-content: center; padding: 6vh 0 22px; perspective: 1600px; }
.fc-card { width: 100%; border-radius: 22px; border: 1px solid var(--fc-line); background: linear-gradient(160deg, rgba(139,156,255,.07), transparent 50%), var(--background-primary); box-shadow: 0 40px 90px -50px rgba(0,0,0,.95), 0 0 0 1px rgba(255,255,255,.02) inset; padding: 26px 30px; animation: card-in .32s cubic-bezier(.2,.8,.2,1); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.fc-flip { position: relative; display: grid; padding: 0; background: none; border: none; box-shadow: none; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.8,.2,1); cursor: pointer; min-height: 300px; }
.fc-flip.is-flipped { transform: rotateY(180deg); cursor: default; }
.fc-face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; border: 1px solid var(--fc-line); background: linear-gradient(160deg, rgba(139,156,255,.07), transparent 50%), var(--background-primary); box-shadow: 0 40px 90px -50px rgba(0,0,0,.95); padding: 26px 30px; display: flex; flex-direction: column; }
.fc-face-back { transform: rotateY(180deg); }
.fc-card-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--text-faint); letter-spacing: .04em; margin-bottom: 18px; }
.fc-tag-new { color: var(--fc-violet); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.fc-front { font-size: 21px; line-height: 1.45; font-weight: 550; color: var(--text-normal); }
.fc-front.small, .fc-term.small { font-size: 14px; color: var(--text-muted); font-weight: 500; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--fc-line); }
.fc-term { font-family: var(--serif, Georgia, serif); font-size: 38px; font-weight: 650; text-align: center; margin: auto 0 6px; }
.fc-prompt { text-align: center; color: var(--text-faint); margin-bottom: auto; }
.fc-tap { margin-top: auto; padding-top: 22px; text-align: center; font-size: 12px; color: var(--text-faint); letter-spacing: .08em; text-transform: uppercase; }
.fc-back { font-size: 16.5px; line-height: 1.6; color: var(--text-normal); }
.fc-back img { max-width: 100%; border-radius: 10px; background: #fff; }
.fc-back p:first-child { margin-top: 0; }
.fc-source { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 12.5px; color: var(--text-faint); cursor: pointer; text-decoration: none; }
.fc-source:hover { color: var(--interactive-accent); }
.fc-source .svg-icon { width: 14px; height: 14px; }
.fc-options { display: grid; gap: 10px; margin-top: 20px; }
.fc-opt { display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--fc-line); background: var(--fc-card); color: var(--text-normal); cursor: pointer; font: inherit; font-size: 15.5px; transition: border-color .12s, background .12s, transform .12s; }
.fc-opt:hover:not(:disabled) { border-color: rgba(139,156,255,.5); transform: translateX(2px); }
.fc-opt b { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--background-modifier-hover); font-size: 12.5px; color: var(--text-muted); }
.fc-opt.is-right { border-color: var(--fc-accent); background: rgba(52,211,153,.12); }
.fc-opt.is-right b { background: var(--fc-accent); color: #04140D; }
.fc-opt.is-wrong { border-color: var(--fc-red); background: rgba(251,113,133,.1); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.fc-mcq-back { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--fc-line); }
.fc-sprint-def { font-size: 18px; line-height: 1.55; font-weight: 500; }
.fc-controls { display: flex; justify-content: center; min-height: 64px; align-items: flex-start; }
.fc-continue { min-width: 220px; justify-content: center; padding: 12px 22px; font-size: 15px; }
.fc-hint { color: var(--text-faint); font-size: 12.5px; }
.fc-grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.fc-grade { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 8px; border-radius: 14px; border: 1px solid var(--fc-line); background: var(--fc-card); color: var(--text-normal); cursor: pointer; font: inherit; transition: transform .12s, border-color .12s, background .12s; }
.fc-grade:hover { transform: translateY(-2px); }
.fc-grade b { font-size: 15px; } .fc-grade span { font-size: 12px; color: var(--text-faint); } .fc-grade kbd { margin: 2px 0 0; }
.fc-grade.g0:hover { border-color: var(--fc-red); background: rgba(251,113,133,.1); }
.fc-grade.g1:hover { border-color: var(--fc-gold); background: rgba(251,191,36,.08); }
.fc-grade.g2:hover { border-color: var(--fc-accent); background: rgba(52,211,153,.1); }
.fc-grade.g3:hover { border-color: var(--fc-violet); background: rgba(139,156,255,.12); }
.fc-float { position: absolute; top: 8px; right: 12px; font-weight: 750; font-size: 18px; color: var(--fc-accent); pointer-events: none; animation: float-up 1.1s ease forwards; text-shadow: 0 0 14px rgba(52,211,153,.7); }
.fc-float.bad { color: var(--fc-red); text-shadow: 0 0 14px rgba(251,113,133,.6); }
@keyframes float-up { from { opacity: 0; transform: translateY(10px); } 15% { opacity: 1; } to { opacity: 0; transform: translateY(-30px); } }

/* summary */
.fc-summary { max-width: 560px; margin: 0 auto; padding: 40px 20px 80px; text-align: center; }
.fc-sum-spec { width: 200px; height: 200px; margin: 0 auto; }
.fc-sum-spec.is-evolving { animation: evolve 1.8s ease; }
@keyframes evolve { 0% { filter: brightness(1); } 45% { filter: brightness(3) blur(2px); transform: scale(.9); } 55% { filter: brightness(3) blur(2px); transform: scale(1.1); } 100% { filter: none; transform: none; } }
.fc-evolved { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 14px; border-radius: 99px; background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.35); color: var(--fc-gold); font-weight: 650; }
.fc-summary h2 { font-family: var(--serif, Georgia, serif); font-size: 30px; margin: 14px 0 18px; }
.fc-sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: 16px; border: 1px solid var(--fc-line); background: var(--fc-card); margin-bottom: 18px; }
.fc-sum-grid div { padding: 14px 4px; display: flex; flex-direction: column; }
.fc-sum-grid div + div { border-left: 1px solid var(--fc-line); }
.fc-sum-grid b { font-size: 22px; } .fc-sum-grid span { font-size: 11.5px; color: var(--text-faint); }
.fc-sum-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.fc-sum-badges span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1px solid rgba(251,191,36,.35); color: var(--fc-gold); font-size: 13px; }
.fc-sum-badges .svg-icon { width: 15px; height: 15px; }
.fc-sum-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }
.fc-sum-actions button:not(.mod-cta) { border: 1px solid var(--background-modifier-border); background: none; color: var(--text-normal); border-radius: 10px; padding: 9px 16px; cursor: pointer; }

@media (max-width: 900px) {
  .fc-view { padding: 16px 14px 100px; }
  .fc-hero { grid-template-columns: 1fr; text-align: center; padding: 18px; gap: 12px; }
  .fc-spec { width: 170px; height: 170px; margin: 0 auto; }
  .fc-name { justify-content: center; } .fc-name-text { font-size: 28px; }
  .fc-hero-side { flex-direction: row; justify-content: center; gap: 22px; }
  .fc-actions { grid-template-columns: 1fr 1fr; }
  .fc-stats { grid-column: span 2; }
  .fc-deck { grid-template-columns: 1fr auto; } .fc-deck-bar { grid-column: span 2; order: 3; }
  .fc-evo { grid-template-columns: repeat(4, 1fr); }
  .fc-evo-item canvas { width: 64px; height: 64px; }
  .fc-front { font-size: 18px; } .fc-term { font-size: 30px; }
  .fc-face, .fc-card { padding: 20px 18px; }
  .fc-grades { gap: 6px; } .fc-grade kbd { display: none; }
  .books-view { padding: 20px 14px 100px; }
  .books-open-reader { margin-left: 0; }
}

/* ---------- Ask about highlighted text */
.ask-fab { position: fixed; z-index: 60; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 9px; border-radius: 999px; border: 1px solid rgba(139,156,255,.45); background: linear-gradient(180deg, rgba(40,46,92,.96), rgba(22,26,58,.96)); color: #E7EAFF; font-size: .82rem; font-weight: 600; cursor: pointer; box-shadow: 0 10px 28px -10px rgba(0,0,0,.8), 0 0 0 4px rgba(139,156,255,.08); animation: askIn .14s ease-out; }
.ask-fab .svg-icon { width: 15px; height: 15px; color: var(--fc-violet); }
.ask-fab:hover { border-color: rgba(139,156,255,.8); }
.theme-light .ask-fab { background: #fff; color: #1d2340; border-color: rgba(80,90,180,.35); }
@keyframes askIn { from { opacity: 0; transform: translateY(4px) scale(.96); } to { opacity: 1; transform: none; } }

.ask-panel { position: fixed; z-index: 55; width: 440px; max-width: calc(100vw - 20px); max-height: 70vh; display: flex; flex-direction: column; background: var(--background-primary); border: 1px solid var(--background-modifier-border-hover); border-radius: 14px; box-shadow: 0 30px 70px -24px rgba(0,0,0,.9); overflow: hidden; animation: askIn .16s ease-out; font-size: .9rem; }
.ask-panel.is-sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-width: none; max-height: 78vh; border-radius: 16px 16px 0 0; }
.ask-panel.is-dragging { animation: none; user-select: none; }
.ask-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px 14px; }
.ask-panel.is-draggable .ask-head { cursor: grab; touch-action: none; }
.ask-panel.is-draggable.is-dragging .ask-head { cursor: grabbing; }
.ask-badge { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(139,156,255,.14); color: var(--fc-violet); flex: none; }
.ask-badge .svg-icon { width: 16px; height: 16px; }
.ask-head-text { flex: 1; min-width: 0; }
.ask-title { font-weight: 650; color: var(--text-normal); }
.ask-where { font-size: .76rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-sel { margin: 0 14px 6px; padding: 7px 10px; border-left: 3px solid var(--fc-violet); background: rgba(139,156,255,.07); border-radius: 0 8px 8px 0; color: var(--text-muted); font-size: .84rem; max-height: 84px; overflow: auto; }
.ask-thread { overflow-y: auto; padding: 2px 14px; flex: 1; min-height: 0; }
.ask-turn { padding: 10px 0; border-top: 1px solid var(--background-modifier-border); }
.ask-turn:first-child { border-top: none; }
.ask-q { font-weight: 600; color: var(--text-normal); margin-bottom: 6px; }
.ask-a { color: var(--text-normal); line-height: 1.55; }
.ask-a p { margin: 0 0 8px; }
.ask-a ul, .ask-a ol { margin: 4px 0 8px; padding-left: 20px; }
.ask-a li { margin: 2px 0; }
.ask-a code { font-size: .85em; }
.ask-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ask-source { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--fc-line); background: var(--fc-card); color: var(--text-muted); font-size: .76rem; cursor: pointer; }
.ask-source:hover { color: var(--text-normal); border-color: rgba(139,156,255,.5); }
.ask-source .svg-icon { width: 13px; height: 13px; }
.ask-tools { display: flex; justify-content: flex-end; margin-top: 2px; }
.ask-tools .clickable-icon .svg-icon { width: 14px; height: 14px; }
.ask-error { display: flex; align-items: center; gap: 8px; color: var(--fc-red); font-size: .85rem; }
.ask-error .svg-icon { width: 15px; height: 15px; flex: none; }
.ask-error a { color: var(--fc-violet); }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px 4px; }
.ask-chips[hidden] { display: none; }
.ask-chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--fc-line); background: var(--fc-card); color: var(--text-muted); font-size: .8rem; cursor: pointer; text-align: left; }
.ask-chip:hover { color: var(--text-normal); border-color: rgba(139,156,255,.5); }
.ask-form { display: flex; gap: 6px; padding: 10px 12px 6px; }
.ask-input { flex: 1; min-width: 0; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--background-modifier-border-hover); background: var(--background-secondary); color: var(--text-normal); font-size: .88rem; outline: none; }
.ask-input:focus { border-color: rgba(139,156,255,.65); box-shadow: 0 0 0 3px rgba(139,156,255,.12); }
.ask-send { width: 36px; border-radius: 10px; border: none; background: var(--fc-violet); color: #0B0E24; display: grid; place-items: center; cursor: pointer; }
.ask-send .svg-icon { width: 16px; height: 16px; }
.ask-foot { padding: 0 14px 10px; font-size: .7rem; color: var(--text-faint); }

/* ---------- annotation layer ---------- */
.ann-layer { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 3; }
.ann-layer.is-editing { pointer-events: auto; cursor: crosshair; }
.ann-layer.is-editing .ann-shape { cursor: move; pointer-events: all; }
.ann-shape.is-selected { filter: drop-shadow(0 0 0 2px var(--fc-violet)); }
.ann-handle { fill: var(--background-primary); stroke: var(--fc-violet); stroke-width: 1.5; pointer-events: all; }
.ann-handle:hover { fill: var(--fc-violet); }
.ann-text-box { padding: 6px 8px; outline: none; white-space: pre-wrap; word-break: break-word; font-family: inherit; line-height: 1.35; height: 100%; box-sizing: border-box; }
.ann-edit-box { position: absolute; z-index: 4; resize: none; padding: 6px 8px; border-radius: 6px; border: none; background: var(--background-secondary); box-shadow: 0 0 0 2px var(--fc-violet); font-family: inherit; line-height: 1.35; outline: none; }

.ann-toolbar { position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 20px); display: flex; flex-direction: column; gap: 8px; background: var(--background-primary); border: 1px solid var(--background-modifier-border-hover); border-radius: 14px; box-shadow: 0 30px 70px -24px rgba(0,0,0,.9); padding: 10px; font-size: .9rem; cursor: grab; }
.ann-toolbar.ann-locked { cursor: default; width: 320px; }
.ann-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ann-tools { padding-bottom: 8px; border-bottom: 1px solid var(--background-modifier-border); }
.ann-tool { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-muted); display: grid; place-items: center; cursor: pointer; }
.ann-tool:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.ann-tool.is-active { background: rgba(139,156,255,.16); border-color: rgba(139,156,255,.5); color: var(--fc-violet); }
.ann-tool .svg-icon, .ann-tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ann-opts { padding-bottom: 8px; border-bottom: 1px solid var(--background-modifier-border); }
.ann-colors { display: flex; gap: 5px; }
.ann-color { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.ann-color.is-active { border-color: var(--text-normal); }
.ann-width { flex: 1; min-width: 60px; accent-color: var(--fc-violet); }
.ann-fontsize { width: 52px; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--background-modifier-border-hover); background: var(--background-secondary); color: var(--text-normal); font-size: .8rem; }
.ann-fontsize[hidden] { display: none; }
.ann-draw { gap: 6px; }
.ann-draw-input { flex: 1; min-width: 0; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--background-modifier-border-hover); background: var(--background-secondary); color: var(--text-normal); font-size: .85rem; outline: none; }
.ann-draw-input:focus { border-color: rgba(139,156,255,.65); box-shadow: 0 0 0 3px rgba(139,156,255,.12); }
.ann-draw-go { width: 36px; padding: 0; justify-content: center; }
.ann-draw-go .svg-icon { width: 15px; height: 15px; }
.ann-done { justify-content: flex-end; }
.ann-done .mod-cta .svg-icon { width: 14px; height: 14px; }

/* ---------- 3D free-shape neural map */
.graph-surface { position: absolute; inset: 0; overflow: hidden; }
.graph-dimension-hint { font-size: 11px; color: var(--text-faint); line-height: 1.5; margin: 4px 0 12px; }
.graph-3d-canvas:focus-visible { outline: 2px solid var(--interactive-accent); outline-offset: -3px; }
.graph-3d-hud { position: absolute; left: 20px; top: 20px; z-index: 2; pointer-events: none; }
.graph-3d-kicker { display: flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 650; letter-spacing: .13em; color: var(--text-muted); }
.graph-3d-kicker .svg-icon { width: 20px; height: 20px; color: var(--interactive-accent); }
.graph-3d-kicker b { margin-left: 5px; padding: 2px 5px; color: var(--interactive-accent); border: 1px solid color-mix(in srgb, var(--interactive-accent) 40%, transparent); border-radius: 4px; font-size: 10px; }
.graph-3d-status { margin: 7px 0 14px; font-size: 11px; color: var(--text-faint); }
.graph-3d-actions { display: flex; gap: 6px; pointer-events: auto; }
.graph-3d-actions button, .graph-3d-selection-title button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--background-modifier-border); background: color-mix(in srgb, var(--background-primary) 85%, transparent); backdrop-filter: blur(10px); color: var(--text-muted); border-radius: 8px; padding: 6px 9px; cursor: pointer; font: inherit; font-size: 11px; }
.graph-3d-actions button:hover, .graph-3d-selection-title button:hover { color: var(--text-normal); border-color: var(--interactive-accent); }
.graph-3d-actions .svg-icon, .graph-3d-selection-title .svg-icon { width: 14px; height: 14px; }
.graph-3d-help, .graph-3d-selection { position: absolute; z-index: 4; border: 1px solid var(--background-modifier-border-hover); background: color-mix(in srgb, var(--background-primary) 94%, transparent); backdrop-filter: blur(12px); border-radius: 12px; box-shadow: 0 16px 40px -22px rgba(0,0,0,.8); color: var(--text-muted); padding: 14px 16px; font-size: 12px; }
.graph-3d-help { top: 124px; left: 20px; width: min(345px, calc(100% - 40px)); max-height: calc(100% - 150px); overflow: auto; box-sizing: border-box; }
.graph-3d-help strong { color: var(--text-normal); font-weight: 600; }
.graph-3d-help dl { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 9px; margin: 14px 0; line-height: 1.4; }
.graph-3d-help dt { color: var(--text-faint); }
.graph-3d-help dd { margin: 0; }
.graph-3d-help p { color: var(--interactive-accent); margin: 8px 0 0; font-size: 11px; }
.graph-3d-selection { left: 50%; bottom: 18px; transform: translateX(-50%); width: min(360px, calc(100% - 140px)); box-sizing: border-box; }
.graph-3d-selection-title { display: flex; align-items: center; gap: 9px; }
.graph-3d-selection-title strong { flex: 1; min-width: 0; color: var(--text-normal); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.graph-3d-selection-title button { flex: none; padding: 4px; background: none; border: none; }
.graph-3d-selection p { margin: 6px 0 11px 19px; font-size: 11px; color: var(--text-faint); }
.graph-3d-selection .graph-3d-actions button:last-child { color: var(--interactive-accent); }
.graph-3d-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; color: var(--text-muted); pointer-events: none; font-size: 13px; }
.graph-3d-help[hidden], .graph-3d-selection[hidden], .graph-3d-empty[hidden] { display: none; }
@media (max-width: 600px) {
  .graph-3d-hud { top: 58px; left: 14px; }
  .graph-3d-help { top: 158px; left: 14px; max-height: calc(100% - 180px); width: calc(100% - 28px); }
  .graph-3d-status { display: none; }
  .graph-3d-hud .graph-3d-actions { margin-top: 10px; }
  .graph-3d-selection { bottom: 12px; width: calc(100% - 116px); padding: 12px; }
}

/* ---------------------------------------------------------------- diagram cards (numbered gaps) */
.occl { position: relative; width: 100%; max-width: 640px; margin: 0 auto 10px; border-radius: 10px; overflow: hidden; background: #fff; }
.occl img { display: block; width: 100%; height: auto; }
.occl-box { position: absolute; min-width: 20px; min-height: 18px; display: grid; place-items: center; background: #1e2440; border: 2px solid var(--interactive-accent); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.occl-box b { font-size: 12px; font-weight: 800; color: #fff; line-height: 1; }
.occl-box.is-right { background: #065f46; border-color: #34D399; }
.occl-box.is-wrong { background: #7f1d1d; border-color: #f87171; }
.occl-prompt { font-size: 16px; text-align: center; color: var(--text-normal); }
.fc-front.small .occl { max-width: 420px; }
.fc-front.small .occl-prompt { font-size: 13px; }
.occl-answers { margin: 6px 0 0; padding-left: 28px; font-size: 16px; line-height: 1.6; text-align: left; }
.occl-answers li::marker { color: var(--interactive-accent); font-weight: 800; }

/* ---------------------------------------------------------------- exam practice */
.view-content.exam-host { background: var(--background-primary); }
.exam-wrap { max-width: 860px; margin: 0 auto; padding: 22px 18px 80px; color: var(--text-normal); }
.exam-head h1, .exam-result h1 { font-size: 26px; margin: 4px 0 6px; }
.exam-head p, .exam-result p { color: var(--text-muted); line-height: 1.5; margin: 0 0 8px; }
.exam-subject h2 { font-size: 17px; margin: 26px 0 12px; display: flex; gap: 10px; align-items: baseline; }
.exam-subject h2 span { font-size: 12px; color: var(--text-faint); letter-spacing: .06em; }
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.exam-paper-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--background-modifier-border); background: var(--background-secondary); color: var(--text-normal); text-decoration: none; transition: border-color .12s, transform .12s; }
.exam-paper-card:hover { border-color: var(--interactive-accent); transform: translateY(-1px); }
.exam-paper-lec { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--interactive-accent); font-weight: 700; }
.exam-paper-title { font-size: 15.5px; font-weight: 650; }
.exam-paper-meta { font-size: 12.5px; color: var(--text-muted); }
.exam-paper-score { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.exam-pill { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: rgba(124,140,248,.16); color: var(--text-normal); }
.exam-pill.ok { background: rgba(52,211,153,.18); }
.exam-pill.dim { background: var(--background-modifier-hover); color: var(--text-muted); }
.exam-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.exam-bar .spacer { flex: 1; }
.exam-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); text-decoration: none; font-size: 13px; }
.exam-back:hover { color: var(--text-normal); }
.exam-back .svg-icon { width: 15px; height: 15px; }
.exam-q { display: flex; gap: 14px; padding: 18px 0; border-top: 1px solid var(--background-modifier-border); }
.exam-qn { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); }
.exam-qbody { flex: 1; min-width: 0; }
.exam-stem { font-size: 15.5px; line-height: 1.55; margin-bottom: 10px; }
.exam-img { display: block; max-width: 100%; max-height: 520px; margin: 8px auto 12px; border-radius: 8px; background: #fff; }
.exam-fig { max-width: 600px; margin: 8px 0 10px; }
.exam-table-wrap { overflow-x: auto; margin: 6px 0 12px; }
.exam-table { border-collapse: collapse; font-size: 14px; }
.exam-table th, .exam-table td { border: 1px solid var(--background-modifier-border); padding: 5px 12px; text-align: center; }
.exam-table th { background: var(--background-secondary); font-weight: 650; }
.exam-part { margin: 12px 0 16px; }
.exam-part-stem { display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; margin-bottom: 8px; font-size: 15px; }
.exam-part-stem > div { flex: 1; }
.exam-letter { flex: none; font-weight: 700; color: var(--text-muted); }
.exam-marks { flex: none; color: var(--text-muted); font-weight: 650; font-size: 13px; }
.exam-ans { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; line-height: 1.5; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--background-modifier-border); background: var(--background-secondary); color: var(--text-normal); outline: none; resize: vertical; }
.exam-ans:focus { border-color: var(--interactive-accent); box-shadow: 0 0 0 3px rgba(52,211,153,.14); }
.exam-seq { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .04em; }
.exam-num { display: flex; align-items: center; gap: 8px; max-width: 320px; }
.exam-num span { color: var(--text-muted); white-space: nowrap; }
.exam-mcq { display: grid; gap: 6px; }
.exam-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--background-modifier-border); background: var(--background-secondary); cursor: pointer; }
.exam-opt:hover { border-color: var(--text-faint); }
.exam-opt input { accent-color: var(--interactive-accent); }
.exam-opt b { color: var(--text-muted); }
.exam-labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.exam-labels label { display: flex; align-items: center; gap: 8px; }
.exam-labels label b { flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: #1e2440; color: #fff; border: 2px solid var(--interactive-accent); font-size: 12px; }
.exam-labels .exam-ans { padding: 6px 9px; }
.exam-submit { display: flex; align-items: center; gap: 14px; justify-content: flex-end; flex-wrap: wrap; padding: 18px 0; border-top: 1px solid var(--background-modifier-border); }
.exam-left { color: var(--text-muted); font-size: 13px; }
.exam-left.warn { color: #fbbf24; }
.exam-btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 650; padding: 10px 18px; border-radius: 10px; border: none; background: var(--interactive-accent); color: #06281d; cursor: pointer; }
.exam-btn .svg-icon { width: 16px; height: 16px; }
.exam-btn.ghost { background: var(--background-secondary); color: var(--text-normal); border: 1px solid var(--background-modifier-border); padding: 7px 12px; }
.exam-result { display: flex; gap: 20px; align-items: center; padding: 6px 0 18px; }
.exam-score { flex: none; width: 104px; height: 104px; border-radius: 50%; display: grid; place-content: center; text-align: center; border: 3px solid var(--interactive-accent); }
.exam-score b { font-size: 30px; line-height: 1; } .exam-score span { color: var(--text-muted); font-size: 13px; }
.exam-meter { height: 8px; border-radius: 99px; background: var(--background-modifier-hover); overflow: hidden; margin: 6px 0 10px; }
.exam-meter i { display: block; height: 100%; background: var(--interactive-accent); }
.exam-part.is-review { padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--background-modifier-border); background: var(--background-secondary); }
.exam-part.is-review.full { border-left-color: #34D399; }
.exam-part.is-review.part { border-left-color: #fbbf24; }
.exam-part.is-review.zero { border-left-color: #f87171; }
.exam-award { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.exam-award b { min-width: 44px; text-align: center; font-size: 13.5px; }
.exam-award button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--background-modifier-border); background: var(--background-primary); color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1; }
.exam-award button:hover { color: var(--text-normal); border-color: var(--text-faint); }
.exam-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.exam-ms-h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; margin: 4px 0 4px; }
.exam-mine { white-space: pre-wrap; line-height: 1.5; font-size: 14.5px; }
.exam-none { color: var(--text-faint); }
.exam-ms { font-size: 14px; line-height: 1.5; }
.exam-ms p { margin: 4px 0 8px; color: var(--text-muted); }
.exam-ms-note { font-size: 12px; color: var(--text-faint); margin: 2px 0 6px; }
.exam-points { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.exam-points li { display: flex; gap: 6px; align-items: flex-start; }
.exam-points .svg-icon { flex: none; width: 15px; height: 15px; margin-top: 3px; }
.exam-points li.ok .svg-icon { color: #34D399; } .exam-points li.no .svg-icon { color: #f87171; }
.exam-points li.no span { color: var(--text-muted); }
.exam-label-review { margin: 0; padding-left: 26px; display: grid; gap: 3px; font-size: 14px; }
.exam-label-review li { display: flex; gap: 10px; flex-wrap: wrap; }
.exam-label-review .mine { min-width: 120px; }
.exam-label-review li.ok .mine { color: #34D399; } .exam-label-review li.no .mine { color: #f87171; text-decoration: line-through; }
.exam-label-review li.ok .right { display: none; }
.exam-label-review .right::before { content: '→ '; color: var(--text-faint); }
.exam-links .exam-meta { color: var(--text-faint); font-size: .85em; }
@media (max-width: 700px) {
  .exam-review-grid { grid-template-columns: 1fr; }
  .exam-q { gap: 8px; } .exam-qn { width: 24px; height: 24px; font-size: 12px; }
  .exam-result { flex-direction: column; align-items: flex-start; }
  .exam-head h1, .exam-result h1 { font-size: 22px; }
}

/* ---------------------------------------------------------------- flashcard exam plans */
.fc-plans .fc-section-title { justify-content: space-between; align-items: center; }
.fc-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.fc-plan { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--fc-line, var(--background-modifier-border)); background: var(--background-secondary); cursor: pointer; display: grid; gap: 9px; }
.fc-plan:hover { border-color: var(--interactive-accent); }
.fc-plan-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.fc-plan-name { font-weight: 700; font-size: 15.5px; color: var(--text-normal); }
.fc-plan-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.fc-plan-status { flex: none; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.fc-plan-status.ok { background: rgba(52,211,153,.18); color: #6EE7B7; }
.fc-plan-status.warn { background: rgba(251,191,36,.18); color: #FCD34D; }
.fc-plan-status.dim { background: var(--background-modifier-hover); color: var(--text-muted); }
.theme-light .fc-plan-status.ok { color: #047857; } .theme-light .fc-plan-status.warn { color: #92400e; }
.fc-plan-nums { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-muted); }
.fc-plan-nums b { color: var(--text-normal); }
.fc-plan-verdict { font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.fc-plan-verdict.big { font-size: 15px; color: var(--text-normal); margin: 10px 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); }
.fc-plan-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-plan-actions .fc-mini.mod-cta { background: var(--interactive-accent); color: #06281d; border-color: transparent; font-weight: 650; }
.fc-plan-empty { color: var(--text-muted); font-size: 13.5px; padding: 4px 4px 8px; }
.fc-plan-bar { margin-bottom: 10px; }
.fc-plan-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fc-plan-title h2, .fc-planform h2 { margin: 4px 0; font-size: 24px; }
.fc-plan-when { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--text-muted); font-size: 13.5px; margin-top: 6px; }
.fc-plan-when input, .fc-field input, .fc-field select { font: inherit; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--background-modifier-border); background: var(--background-secondary); color: var(--text-normal); color-scheme: dark; }
.theme-light .fc-plan-when input, .theme-light .fc-field input, .theme-light .fc-field select { color-scheme: light; }
.fc-plan-when label { display: flex; align-items: center; gap: 8px; }
.fc-plan-stats { margin: 0 0 14px; }
.fc-plan-days { display: grid; gap: 6px; }
.fc-plan-day { display: flex; gap: 14px; align-items: baseline; padding: 10px 14px; border-radius: 10px; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); }
.fc-plan-day.is-today { border-color: var(--interactive-accent); }
.fc-plan-day.is-review { background: rgba(124,140,248,.08); }
.fc-plan-day.is-exam { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.35); }
.fc-plan-date { flex: none; width: 92px; font-weight: 700; font-size: 13px; }
.fc-plan-work { flex: 1; font-size: 13.5px; color: var(--text-muted); line-height: 1.45; }
.fc-plan-work b { color: var(--text-normal); }
.fc-plan-rev { margin-left: 10px; font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.fc-plan-covers, .fc-plan-hist { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-plan-covers span, .fc-plan-hist span, .fc-paper { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); color: var(--text-muted); }
.fc-plan-covers em, .fc-paper em { font-style: normal; color: var(--text-faint); margin-left: 4px; }
.fc-paper { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-normal); }
.fc-paper:hover { border-color: var(--interactive-accent); }
.fc-paper .svg-icon { width: 14px; height: 14px; }
.fc-planform { max-width: 720px; }
.fc-field { display: grid; gap: 6px; margin: 12px 0; font-size: 13px; color: var(--text-muted); }
.fc-field > span { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.fc-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.fc-pick-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--background-modifier-border); background: var(--background-secondary); cursor: pointer; color: var(--text-normal); font-size: 13.5px; }
.fc-pick-item span { flex: 1; } .fc-pick-item em { font-style: normal; color: var(--text-faint); font-size: 12px; }
.fc-pick-item input, .fc-check input { accent-color: var(--interactive-accent); }
.fc-check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text-normal); margin: 8px 0 14px; }
.fc-plan-preview { font-size: 14px; line-height: 1.5; color: var(--text-muted); padding: 12px 14px; border-radius: 12px; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); margin-bottom: 14px; }
.fc-plan-preview b { color: var(--text-normal); }
.fc-plan-preview .warn, .fc-planform .warn { color: #FBBF24; }
@media (max-width: 700px) { .fc-plan-date { width: 70px; } .fc-plan-day { gap: 10px; } }
