/* ════════════════════════════════════════════════════════════════════════
   flashcards.css — EKGLab Flashcards
   A calm, focused surface inspired by Apple's product pages: generous space,
   big confident type, soft layered depth, one restrained brand accent.
   Everything is scoped under .fc-page / .fc-* so it never leaks into the
   global stylesheet.
   ════════════════════════════════════════════════════════════════════════ */

.fc-page {
    --fc-ink:     #14181d;
    --fc-ink-2:   #5b6573;
    --fc-ink-3:   #9aa3b0;
    --fc-line:    #e7ebf1;
    --fc-bg:      #f4f7fc;
    --fc-card:    #ffffff;
    --fc-brand:   #26408b;
    --fc-brand-2: #3a6fd0;
    --fc-teal:    #5fb3c9;
    --fc-mint:    #c2e7d9;
    --fc-navy:    #0d0221;
    --fc-radius:  24px;
    --fc-shadow:       0 1px 2px rgba(20,30,50,.04), 0 18px 50px -20px rgba(20,30,50,.22);
    --fc-shadow-hover: 0 1px 2px rgba(20,30,50,.05), 0 32px 64px -24px rgba(20,30,50,.34);
    --fc-ease: cubic-bezier(.22,.61,.36,1);

    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--fc-ink);
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(1100px 560px at 82% -12%, rgba(95,179,201,.12), transparent 60%),
        radial-gradient(820px 480px at -5% -5%, rgba(38,64,139,.08), transparent 55%),
        var(--fc-bg);
}
.fc-page *, .fc-page *::before, .fc-page *::after { box-sizing: border-box; }

.fc-wrap { max-width: 1080px; margin: 0 auto; padding: 54px 32px 84px; }

/* Soft staged entrance */
@keyframes fc-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.fc-hero, .fc-today, .fc-decks, .fc-how { animation: fc-rise .62s var(--fc-ease) both; }
.fc-today { animation-delay: .07s; }
.fc-decks { animation-delay: .14s; }
.fc-how   { animation-delay: .21s; }
@media (prefers-reduced-motion: reduce) {
    .fc-hero, .fc-today, .fc-decks, .fc-how { animation: none; }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.fc-eyebrow {
    font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
    color: var(--fc-brand); margin: 0 0 14px;
}
.fc-title {
    font-size: clamp(38px, 5vw, 56px); font-weight: 800; letter-spacing: -.032em;
    line-height: 1.02; margin: 0; color: var(--fc-ink);
}
.fc-lede {
    font-size: 18px; line-height: 1.6; color: var(--fc-ink-2);
    max-width: 56ch; margin: 18px 0 0;
}

/* ── Today panel (focal element) ──────────────────────────────────────── */
.fc-today {
    margin-top: 40px;
    display: flex; align-items: center; gap: 42px;
    background: var(--fc-card);
    border: 1px solid var(--fc-line);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    padding: 36px 40px;
}
.fc-today-ring { position: relative; flex: none; width: 168px; height: 168px; }
.fc-today-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fc-ring-track { fill: none; stroke: #eef1f6; stroke-width: 13; }
.fc-ring-prog  { fill: none; stroke: url(#fcRingGrad); stroke-width: 13; stroke-linecap: round;
                 transition: stroke-dashoffset 1s var(--fc-ease); }
.fc-ring-center {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1px;
}
.fc-ring-num   { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1;
                 color: var(--fc-ink); font-variant-numeric: tabular-nums; }
.fc-ring-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fc-ink-3); }

.fc-today-main { flex: 1; min-width: 0; }
.fc-today-h   { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.fc-today-sub { font-size: 15px; color: var(--fc-ink-2); margin: 6px 0 0; line-height: 1.5; }
.fc-today-stats { display: flex; gap: 32px; margin: 22px 0 26px; flex-wrap: wrap; }
.fc-stat { display: flex; flex-direction: column; gap: 3px; }
.fc-stat-num   { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fc-stat-label { font-size: 12px; font-weight: 600; color: var(--fc-ink-3); letter-spacing: .02em; }

.fc-cta {
    display: inline-flex; align-items: center; gap: 9px;
    background: var(--fc-brand); color: #fff; border: 0;
    border-radius: 999px; padding: 14px 28px;
    font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -.01em;
    cursor: pointer; box-shadow: 0 12px 24px -10px rgba(38,64,139,.62);
    transition: transform .22s var(--fc-ease), box-shadow .22s var(--fc-ease), background .2s;
}
.fc-cta:hover  { transform: translateY(-2px); box-shadow: 0 18px 32px -12px rgba(38,64,139,.68); background: #2c4aa0; }
.fc-cta:active { transform: translateY(0); }
.fc-cta .material-symbols-outlined { font-size: 20px; }

/* ── Accuracy-over-time charts (split by deck) ────────────────────────── */
.fc-trend {
    margin-top: 22px;
    background: var(--fc-card);
    border: 1px solid var(--fc-line);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    padding: 26px 30px 20px;
    animation: fc-rise .62s var(--fc-ease) both; animation-delay: .105s;
}
@media (prefers-reduced-motion: reduce) { .fc-trend { animation: none; } }
.fc-trend-defs { position: absolute; width: 0; height: 0; }

.fc-trend-head { margin-bottom: 4px; }
.fc-trend-title { font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin: 0; color: var(--fc-ink); }
.fc-trend-sub { font-size: 13.5px; color: var(--fc-ink-2); margin: 4px 0 0; line-height: 1.45; max-width: 66ch; }

.fc-trend-split { display: grid; grid-template-columns: 1fr 1px 1fr; align-items: stretch; margin-top: 12px; }
.fc-trend-divider { background: var(--fc-line); margin: 10px 0; }
.fc-trend-panel { min-width: 0; padding: 8px 18px 0; }
.fc-trend-panel:first-of-type { padding-left: 2px; }
.fc-trend-panel:last-of-type  { padding-right: 2px; }

.fc-trend-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.fc-trend-panel-l { display: flex; align-items: center; gap: 7px; min-width: 0; }
.fc-trend-panel-ic { font-size: 17px; color: var(--fc-brand); flex: none; }
.fc-trend-panel-name { font-size: 13px; font-weight: 700; color: var(--fc-ink); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-trend-panel-r { display: flex; align-items: baseline; gap: 7px; flex: none; }
.fc-trend-panel-now { font-size: 21px; font-weight: 800; letter-spacing: -.025em; color: var(--fc-ink); font-variant-numeric: tabular-nums; line-height: 1; }

.fc-trend-delta { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-trend-delta.up   { color: #15724c; background: rgba(31,157,87,.12); }
.fc-trend-delta.down { color: #b06800; background: rgba(176,104,0,.12); }
.fc-trend-delta.flat { color: var(--fc-ink-3); background: rgba(154,163,176,.16); }

.fc-trend-chart { position: relative; width: 100%; margin-top: 8px; }
.fc-trend-svg { width: 100%; }
.fc-trend-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.fc-trend-grid-line { stroke: var(--fc-line); stroke-width: 1; }
.fc-trend-grid-lbl { fill: var(--fc-ink-3); font-size: 9.5px; font-weight: 500; font-family: 'IBM Plex Mono','ui-monospace',monospace; }
.fc-trend-x-lbl { fill: var(--fc-ink-3); font-size: 10.5px; font-weight: 600; }
.fc-trend-area { stroke: none; }
.fc-trend-line { fill: none; stroke: url(#fcTrendStroke); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fc-trend-dot { fill: #fff; stroke: var(--fc-brand-2); stroke-width: 2; }
.fc-trend-dot-last { fill: var(--fc-brand); stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 2px 5px rgba(38,64,139,.45)); }
.fc-trend-guide { stroke: var(--fc-brand-2); stroke-width: 1; stroke-dasharray: 3 4; opacity: .5; pointer-events: none; }
.fc-trend-focus { fill: var(--fc-brand); stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 2px 6px rgba(38,64,139,.5)); pointer-events: none; }
.fc-trend-hit { cursor: crosshair; }

.fc-trend-tip {
    position: absolute; z-index: 5; pointer-events: none;
    background: #14181d; color: #fff; border-radius: 11px; padding: 7px 10px;
    box-shadow: 0 12px 30px -10px rgba(15,20,35,.55);
    display: flex; flex-direction: column; gap: 1px; min-width: 86px;
}
.fc-trend-tip-d   { font-size: 10.5px; font-weight: 600; color: #aab4c4; letter-spacing: .02em; }
.fc-trend-tip-pct { font-size: 17px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.fc-trend-tip-sub { font-size: 10.5px; font-weight: 500; color: var(--fc-mint); font-variant-numeric: tabular-nums; }

.fc-trend-foot { margin-top: 10px; display: flex; justify-content: flex-end; }
.fc-trend-unit { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--fc-ink-3); }

.fc-trend-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    gap: 9px; min-height: 150px; padding: 16px;
    border: 1px dashed var(--fc-line); border-radius: 14px; background: rgba(244,247,252,.55);
}
.fc-trend-empty .material-symbols-outlined { font-size: 26px; color: var(--fc-ink-3); }
.fc-trend-empty p { font-size: 12.5px; color: var(--fc-ink-2); margin: 0; max-width: 30ch; line-height: 1.5; }

/* ── Deck section ─────────────────────────────────────────────────────── */
.fc-section-title {
    font-size: 13px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
    color: var(--fc-ink-3); margin: 58px 0 18px;
}
/* ── Focus on a topic ── */
.fc-topics { animation: fc-rise .62s var(--fc-ease) both; animation-delay: .18s; }
@media (prefers-reduced-motion: reduce) { .fc-topics { animation: none; } }
.fc-topics .fc-section-title { margin-bottom: 6px; }
.fc-topics-sub { font-size: 14.5px; color: var(--fc-ink-2); margin: 0 0 18px; max-width: 62ch; }
.fc-topic-group { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.fc-topic-group-lbl { flex: none; width: 64px; padding-top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fc-ink-3); }
.fc-topic-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.fc-topic-chip {
    display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600;
    color: var(--fc-ink); background: var(--fc-card); border: 1px solid var(--fc-line); border-radius: 999px;
    padding: 8px 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .12s;
}
.fc-topic-chip:hover { border-color: var(--tc); box-shadow: 0 4px 14px -6px var(--tc); transform: translateY(-1px); }
.fc-topic-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); flex: none; }
.fc-topic-chip b { font-weight: 700; color: var(--fc-ink-3); font-variant-numeric: tabular-nums; font-size: 12.5px; }

.fc-deck-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.fc-deck {
    display: flex; flex-direction: column; text-align: left;
    background: var(--fc-card); border: 1px solid var(--fc-line);
    border-radius: var(--fc-radius); overflow: hidden; padding: 0;
    box-shadow: var(--fc-shadow); cursor: pointer; font: inherit; color: inherit;
    transition: transform .3s var(--fc-ease), box-shadow .3s var(--fc-ease), border-color .3s;
}
.fc-deck:hover  { transform: translateY(-6px); box-shadow: var(--fc-shadow-hover); border-color: #d6deea; }
.fc-deck:focus-visible { outline: 2.5px solid var(--fc-brand); outline-offset: 3px; }

/* ECG preview area (dark navy panel, mint trace) */
.fc-deck-canvas-wrap {
    height: 154px; background:
        radial-gradient(120% 140% at 50% -20%, #16093a 0%, var(--fc-navy) 70%);
    position: relative; overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.fc-deck-strip { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fc-montage {
    position: absolute; inset: 0; padding: 12px 14px;
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr);
    gap: 8px;
}
.fc-mini { width: 100%; height: 100%; display: block; border-radius: 4px; }

.fc-deck-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.fc-deck-head { display: flex; align-items: center; gap: 10px; }
.fc-deck-icon { font-size: 22px; color: var(--fc-brand); }
.fc-deck-name { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.fc-deck-sub  { font-size: 14.5px; line-height: 1.55; color: var(--fc-ink-2); margin: 11px 0 0; }
.fc-deck-badge {
    display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
    margin-top: 14px; font-size: 12px; font-weight: 600; color: #15724c;
    background: rgba(31,157,87,.10); padding: 5px 11px; border-radius: 999px;
}
.fc-deck-badge .material-symbols-outlined { font-size: 15px; }
.fc-deck-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: auto; padding-top: 20px;
}
.fc-deck-count { font-size: 13px; font-weight: 600; color: var(--fc-ink-3); font-variant-numeric: tabular-nums; }
.fc-deck-go { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; color: var(--fc-brand); }
.fc-deck-go .material-symbols-outlined { font-size: 18px; transition: transform .25s var(--fc-ease); }
.fc-deck:hover .fc-deck-go .material-symbols-outlined { transform: translateX(4px); }

/* ── How it works ─────────────────────────────────────────────────────── */
.fc-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 60px; }
.fc-how-item { padding: 2px 4px; }
.fc-how-n {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 12px;
    background: rgba(38,64,139,.08); color: var(--fc-brand); margin-bottom: 15px;
}
.fc-how-n .material-symbols-outlined { font-size: 21px; }
.fc-how-h { font-size: 15.5px; font-weight: 700; margin: 0 0 5px; letter-spacing: -.01em; }
.fc-how-p { font-size: 14px; line-height: 1.55; color: var(--fc-ink-2); margin: 0; }

/* ── "Coming next" toast ──────────────────────────────────────────────── */
.fc-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 18px);
    background: #14181d; color: #fff; font-size: 13.5px; font-weight: 500;
    padding: 13px 20px; border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.45);
    display: flex; align-items: center; gap: 9px; z-index: 80;
    opacity: 0; pointer-events: none;
    transition: opacity .3s cubic-bezier(.22,.61,.36,1), transform .3s cubic-bezier(.22,.61,.36,1);
    max-width: min(92vw, 460px);
}
.fc-toast.show { opacity: 1; transform: translate(-50%, 0); }
.fc-toast .material-symbols-outlined { font-size: 19px; color: #c2e7d9; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .fc-deck-grid { grid-template-columns: 1fr; }
    .fc-how { grid-template-columns: 1fr; gap: 18px; }
    .fc-today { flex-direction: column; align-items: flex-start; gap: 28px; }
}
@media (max-width: 720px) {
    .fc-trend-split { grid-template-columns: 1fr; }
    .fc-trend-divider { height: 1px; margin: 6px 0; }
    .fc-trend-panel { padding: 8px 2px 0; }
}
@media (max-width: 600px) {
    .fc-wrap { padding: 34px 20px 64px; }
    .fc-today { padding: 28px 24px; }
    .fc-trend { padding: 22px 20px 16px; }
}

/* ════════════════════════════════════════════════════════════════════════
   Review screen
   ════════════════════════════════════════════════════════════════════════ */
/* Author display:grid/flex on toggled elements would beat the UA [hidden]
   rule — force hidden to win everywhere inside the page. */
.fc-page [hidden] { display: none !important; }

.fc-review { max-width: 820px; margin: 0 auto; padding: 22px 28px 84px; }

/* progress chrome */
.fc-rv-top { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.fc-rv-close {
    flex: none; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--fc-line); background: var(--fc-card); border-radius: 50%; cursor: pointer;
    color: var(--fc-ink-2); box-shadow: 0 1px 2px rgba(20,30,50,.05);
    transition: background .15s, color .15s, transform .15s;
}
.fc-rv-close:hover { background: #eef1f6; color: var(--fc-ink); transform: scale(1.06); }
.fc-rv-close .material-symbols-outlined { font-size: 20px; }
.fc-rv-progress { flex: 1; height: 7px; background: #e4e9f1; border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(20,30,50,.07); }
.fc-rv-progress-bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--fc-brand), var(--fc-teal)); box-shadow: 0 0 12px rgba(95,179,201,.55); transition: width .45s var(--fc-ease); }
.fc-rv-count { flex: none; font-size: 13px; font-weight: 700; color: var(--fc-ink-3); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; letter-spacing: .02em; }

.fc-rv-deck-label { text-align: center; font-size: 11.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--fc-brand); margin: 0 0 18px; }

/* per-card entrance */
@keyframes fc-card-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.fc-rv-stage { animation: fc-card-in .44s var(--fc-ease) both; }

/* ECG readout card (hero) */
.fc-rv-card {
    background: var(--fc-card); border: 1px solid rgba(20,30,50,.07); border-radius: 26px; padding: 8px;
    box-shadow: 0 1px 2px rgba(20,30,50,.04), 0 28px 60px -30px rgba(20,30,50,.32), 0 10px 26px -18px rgba(38,64,139,.20);
}
.fc-rv-card-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; }
.fc-rv-card-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fc-ink-3); }
.fc-rv-card-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fc-teal); box-shadow: 0 0 0 3px rgba(95,179,201,.18); }
.fc-rv-card-cal { font-size: 11px; font-weight: 600; color: var(--fc-ink-3); font-variant-numeric: tabular-nums; }
/* 12SL interval-measurement footer (12-lead only) — like a real ECG readout strip */
.fc-rv-card-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 9px 24px; padding: 14px 14px 10px; border-top: 1px solid rgba(20,30,50,.06); }
.fc-rv-foot-item { font-size: 13px; color: var(--fc-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-rv-foot-k { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--fc-ink-3); margin-right: 5px; }
.fc-rv-foot-item b { font-size: 15.5px; font-weight: 700; color: var(--fc-ink); }
.fc-rv-foot-na { color: var(--fc-ink-3); font-style: italic; }
/* PTB-XL record link in the rhythm card footer (shown on reveal) */
.fc-rv-foot-recid { font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .03em; color: var(--fc-brand); background: none; border: none; padding: 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.fc-rv-foot-recid::after { content: ' \2197'; font-weight: 700; }
.fc-rv-foot-recid:hover { text-decoration: underline; text-underline-offset: 2px; color: #1b2f6b; }

/* PTB-XL record id in the card head — plain until reveal, then a link to the record */
.fc-rv-card-head-r { display: inline-flex; align-items: center; gap: 12px; }
.fc-rv-recid { font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--fc-ink-3); background: none; border: none; padding: 0; font-variant-numeric: tabular-nums; cursor: default; }
.fc-rv-recid.is-open { color: var(--fc-brand); cursor: pointer; }
.fc-rv-recid.is-open::after { content: ' \2197'; font-weight: 700; }
.fc-rv-recid.is-open:hover { color: #1b2f6b; text-decoration: underline; text-underline-offset: 2px; }

/* full-length (10 s) Lead II rhythm strip beneath the 12-lead grid */
.fc-rv-rhythm { position: relative; margin-top: 6px; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgba(20,30,50,.05); }
.fc-rv-rhythm-lbl { position: absolute; top: 7px; left: 11px; z-index: 1; font-size: 11px; font-weight: 700; color: var(--fc-ink-3); letter-spacing: .04em; }
#fcRvRhythmCanvas { display: block; width: 100%; height: 112px; }

.fc-rv-canvas-wrap { position: relative; border-radius: 19px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgba(20,30,50,.05); }
#fcRvCanvas { display: block; width: 100%; height: 300px; transition: opacity .2s; }
.fc-rv-spinner {
    position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
    border: 3px solid #e3e8f0; border-top-color: var(--fc-brand); border-radius: 50%;
    animation: fc-spin .8s linear infinite; opacity: 0; transition: opacity .2s; pointer-events: none;
}
@keyframes fc-spin { to { transform: rotate(360deg); } }
.fc-rv-canvas-wrap.is-loading .fc-rv-spinner { opacity: 1; }
.fc-rv-canvas-wrap.is-loading #fcRvCanvas { opacity: .2; }
.fc-rv-errnote { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 14px; color: var(--fc-ink-3); background: #fff; padding: 0 24px; text-align: center; }
.fc-rv-canvas-wrap.is-error .fc-rv-errnote { display: flex; }

/* 12-lead grid (4 cols x 3 rows: I aVR V1 V4 / II aVL V2 V5 / III aVF V3 V6) */
.fc-rv-grid-wrap { position: relative; border-radius: 19px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgba(20,30,50,.05); }
.fc-rv-grid-wrap.is-loading .fc-rv-spinner { opacity: 1; }
.fc-rv-grid-wrap.is-loading .fc-rv-grid12 { opacity: .2; }
.fc-rv-grid-wrap.is-error .fc-rv-errnote { display: flex; }
.fc-rv-grid12 { display: grid; grid-template-columns: repeat(4, 1fr); }
.fc12-cell { position: relative; aspect-ratio: 3 / 2; border-right: 1px solid rgba(20,30,50,.07); border-bottom: 1px solid rgba(20,30,50,.07); }
.fc12-cell:nth-child(4n) { border-right: none; }
.fc12-cell:nth-child(n+9) { border-bottom: none; }
.fc12-lead { position: absolute; top: 4px; left: 6px; z-index: 1; font-size: 10.5px; font-weight: 700; color: #1d2a3d; background: rgba(255,255,255,.72); padding: 0 4px; border-radius: 3px; }
.fc12-canvas { display: block; width: 100%; height: 100%; }

/* prompt */
.fc-rv-prompt { text-align: center; font-size: 20px; font-weight: 650; letter-spacing: -.015em; color: var(--fc-ink); margin: 26px 0 0; }

/* answer — colour-coded by rhythm family via --cat / --cat-soft (set in JS) */
@keyframes fc-answer-in { from { opacity: 0; transform: translateY(10px) scale(.95); } to { opacity: 1; transform: none; } }
.fc-rv-answer { text-align: center; margin: 20px 0 0; --cat: var(--fc-brand); --cat-soft: rgba(38,64,139,.10);
    animation: fc-answer-in .42s cubic-bezier(.34,1.42,.5,1) both; }
.fc-rv-answer-cat { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cat); background: var(--cat-soft); padding: 5px 13px; border-radius: 999px; }
.fc-rv-cat-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cat); }
.fc-rv-answer-label { font-size: 35px; font-weight: 800; letter-spacing: -.025em; color: var(--cat); margin-top: 12px; line-height: 1.06; }
.fc-rv-answer-teach { font-size: 14.5px; line-height: 1.55; color: var(--fc-ink-2); margin: 12px auto 0; max-width: 52ch; }
.fc-rv-answer-cite { font-size: 11.5px; font-style: italic; color: var(--fc-ink-3); margin: 7px auto 0; max-width: 52ch; }
.fc-rv-answer-cite::before { content: 'Diagnostic criteria · '; font-style: normal; font-weight: 600; }

/* 12-lead clinical details (all SCP/12SL codes + cardiologist report), shown on reveal */
.fc-rv-details { max-width: 660px; margin: 22px auto 0; text-align: left; animation: fc-answer-in .42s cubic-bezier(.34,1.42,.5,1) both; }
.fc-rv-det-block { margin-top: 18px; }
.fc-rv-det-block:first-child { margin-top: 0; }
.fc-rv-det-head { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fc-ink-3); margin-bottom: 9px; }
.fc-rv-det-report { font-size: 14.5px; line-height: 1.6; color: var(--fc-ink); background: var(--fc-card); border: 1px solid var(--fc-line); border-radius: 14px; padding: 14px 16px; margin: 0; box-shadow: var(--fc-shadow); white-space: pre-line; }
.fc-rv-det-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-rv-det-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fc-ink-2); background: var(--fc-card); border: 1px solid var(--fc-line); border-radius: 999px; padding: 5px 12px; }
.fc-rv-det-chip b { color: var(--fc-ink); font-weight: 700; }
.fc-rv-det-lik { font-size: 10.5px; font-weight: 700; color: var(--fc-brand); background: rgba(38,64,139,.09); padding: 1px 6px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.fc-rv-det-loading { font-size: 13.5px; color: var(--fc-ink-3); text-align: center; padding: 10px; }

/* wider review for 12-lead so the grid + details have room (~20% larger grid) */
.fc-review.is-12lead { max-width: 985px; }
/* Wider review for long (10 s PTB-XL) rhythm strips so they aren't compressed
   — renderStrip fits the whole signal to width, so more width = larger px/mm. */
.fc-review.is-wide-strip { max-width: 1320px; }

/* actions */
.fc-rv-actions { margin-top: 30px; display: flex; flex-direction: column; align-items: center; }
.fc-rv-show {
    display: inline-flex; align-items: center; gap: 9px;
    background: linear-gradient(180deg, #222838, #14181d); color: #fff; border: 0; border-radius: 999px;
    padding: 15px 30px; font: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
    box-shadow: 0 16px 30px -12px rgba(20,24,29,.55), inset 0 1px 0 rgba(255,255,255,.08);
    transition: transform .2s var(--fc-ease), box-shadow .2s;
}
.fc-rv-show:hover { transform: translateY(-2px); box-shadow: 0 22px 36px -14px rgba(20,24,29,.6), inset 0 1px 0 rgba(255,255,255,.08); }
.fc-rv-show:active { transform: translateY(0) scale(.985); }
.fc-rv-show .material-symbols-outlined { font-size: 20px; opacity: .82; }
.fc-rv-show kbd { font: inherit; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.15); padding: 2px 7px; border-radius: 6px; margin-left: 2px; }

/* grade buttons (tactile) */
.fc-rv-grades { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 440px; margin: 0 auto;
    animation: fc-answer-in .42s cubic-bezier(.34,1.42,.5,1) .05s both; }
.fc-grade {
    display: flex; flex-direction: column; align-items: center; gap: 9px;
    border: 1px solid var(--fc-line); background: var(--fc-card); border-radius: 18px; padding: 17px 10px 14px;
    font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(20,30,50,.04), 0 16px 30px -24px rgba(20,30,50,.45);
    transition: transform .16s var(--fc-ease), box-shadow .16s, background .16s, border-color .16s;
}
.fc-grade:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(20,30,50,.05), 0 24px 40px -22px rgba(20,30,50,.42); }
.fc-grade:active { transform: translateY(-1px) scale(.985); }
.fc-grade-ic { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.fc-grade-ic .material-symbols-outlined { font-size: 23px; }
.fc-grade-name { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.fc-grade-int { font-size: 11.5px; font-weight: 600; color: var(--fc-ink-3); font-variant-numeric: tabular-nums; }
.fc-grade-missed .fc-grade-ic { background: #fdecea; color: #c0392b; } .fc-grade-missed .fc-grade-name { color: #c0392b; }
.fc-grade-missed:hover { border-color: #ecc4bd; background: #fffafa; }
.fc-grade-got .fc-grade-ic { background: #e6f6ed; color: #15724c; } .fc-grade-got .fc-grade-name { color: #15724c; }
.fc-grade-got:hover { border-color: #aedcc6; background: #fbfffc; }
.fc-grade:focus-visible { outline: 2.5px solid currentColor; outline-offset: 2px; }

/* done */
.fc-rv-done { text-align: center; padding: 44px 0 0; animation: fc-answer-in .44s cubic-bezier(.34,1.42,.5,1) both; }
.fc-rv-done-check { width: 78px; height: 78px; margin: 0 auto 22px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #e8f7ef, #d6f0e1); display: flex; align-items: center; justify-content: center; box-shadow: 0 14px 30px -14px rgba(31,157,87,.5); }
.fc-rv-done-check .material-symbols-outlined { font-size: 42px; color: #1f9d57; }
.fc-rv-done-h { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.fc-rv-done-sub { font-size: 15px; color: var(--fc-ink-2); margin: 8px 0 26px; }
.fc-rv-done-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.fc-rv-done-back {
    background: none; border: 0; font: inherit; font-size: 14px; font-weight: 600;
    color: var(--fc-ink-3); cursor: pointer; padding: 6px 12px; border-radius: 8px; transition: color .15s;
}
.fc-rv-done-back:hover { color: var(--fc-ink); }

@media (max-width: 560px) {
    .fc-review { padding: 18px 16px 60px; }
    .fc-rv-card { border-radius: 22px; }
    .fc-rv-grades { gap: 10px; }
    .fc-grade { padding: 15px 6px 12px; }
    .fc-grade-name { font-size: 14.5px; }
    .fc-rv-answer-label { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    .fc-rv-stage, .fc-rv-answer, .fc-rv-grades, .fc-rv-done { animation: none; }
}

/* ════════════════════════════════════════════════════════════════════════
   Rhythm deck — dark cardiac-monitor FLIP card
   (ported from the Claude-Design "EKG Flash Cards" mock-up; rhythm deck only.
   The 12-lead deck keeps its diagnostic card above. Card width follows the
   review container, so .fc-review.is-wide-strip 10 s PTB-XL cards stay wide.
   Accent teal = the app's Broadcast-button hover (#a6cfd5, text #0d0221) per
   user — replaces the mock's cyan so the card matches the rest of EKGLab.)
   ════════════════════════════════════════════════════════════════════════ */
.fc-flip {
    --c-ink:    #eef3f8;
    --c-ink-2:  #9db0c2;
    --c-ink-3:  #6a7c8e;
    --c-line:   rgba(255,255,255,.10);
    --c-surface:rgba(255,255,255,.05);
    --c-accent: #a6cfd5;          /* Broadcast-button hover teal */
    --c-accent-hi: #bbdde2;       /* lighter, for hover */
    --c-on-accent: #0d0221;       /* dark text on the teal */
    --c-glow:   rgba(166,207,213,.26);
    --c-trace:  #F3BD5C;          /* amber trace — reveal button + HR dot */
    --c-trace-hi: #f8cf83;        /* lighter amber, for hover */
    --c-trace-glow: rgba(243,189,92,.30);
    --c-miss:   #cf4140;
    --c-miss-hi:#db4a44;
    --c-got:    #5ccb8e;          /* green — "Got it" grade button */
    --c-got-hi: #6fd49d;
    --c-got-glow: rgba(92,203,142,.30);
    --c-ease:   cubic-bezier(.2,.7,.2,1);
    margin: 0 auto;
    /* perspective lives per-face below (Safari flattens preserve-3d on a grid parent). */
}
/* Stack both faces in one grid cell so the card auto-sizes to the taller face.
   NOTE: deliberately NO transform-style:preserve-3d here. WebKit/Safari FLATTENS
   preserve-3d when it sits on a grid (or flex) container, which collapsed the flip
   to a 2D mirror and let the front face bleed through the answer, reversed (the
   reported Safari bug). Instead each face owns its rotation + perspective() below
   — a flip that needs no preserve-3d ancestor and renders identically in Chrome. */
.fc-flip-inner {
    display: grid;
}
.fc-face {
    grid-area: 1 / 1;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    transition: transform .6s var(--c-ease);
    background: radial-gradient(135% 125% at 50% -10%, #232e3a 40%, #131a22 100%);
    border: 1px solid rgba(255,255,255,.09); border-radius: 20px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        inset 0 0 60px rgba(0,0,0,.30),
        0 1px 1px rgba(15,22,33,.30),
        0 12px 26px -12px rgba(15,22,33,.45),
        0 38px 64px -34px rgba(15,22,33,.55);
    display: flex; flex-direction: column; overflow: hidden;
    color: var(--c-ink);
}
/* Independent two-face flip — each face carries its own perspective() so the 3D
   read survives without a preserve-3d parent. Both faces rotate the same
   direction (−180°) so it reads as one coherent flip; backface-visibility hides
   whichever face is turned away. */
.fc-face-front { transform: perspective(2200px) rotateY(0deg); }
.fc-face-back  { transform: perspective(2200px) rotateY(180deg); }
.fc-flip-inner.flipped .fc-face-front { transform: perspective(2200px) rotateY(-180deg); }
.fc-flip-inner.flipped .fc-face-back  { transform: perspective(2200px) rotateY(0deg); }

/* small outlined diamond bullet */
.fc-dia { width: 8px; height: 8px; flex: none; border: 1.6px solid currentColor; transform: rotate(45deg); display: inline-block; }

/* ── front ── */
.fc-face-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px 12px; }
.fc-lead-tag { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; letter-spacing: .04em;
    color: var(--c-ink); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 7px; padding: 4px 10px; }
.fc-scale { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--c-ink-3); font-weight: 500; }

/* ── Header left cluster: caliper toggle · lead selector · heart rate ─────
   Caliper pill + lead-select buttons match the Rhythm Foundations EKG widget
   (.cal-btn / .rf-lead-seg) — amber pill on the dark monitor face. */
.fc-hd-left { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.fc-caliper-btn {
    position: relative;
    display: inline-flex; align-items: center; gap: 5px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: rgba(243,189,92,.85);
    background: rgba(243,189,92,.08); border: 1px solid rgba(243,189,92,.3);
    border-radius: 999px; padding: 4px 10px; cursor: pointer;
    transition: color .15s, background .15s, border-color .15s, transform .12s;
}
.fc-caliper-btn:hover { color: #fff; background: rgba(243,189,92,.16); }
.fc-caliper-btn:active { transform: scale(.96); }
.fc-caliper-btn.is-on { color: #3a2a00; background: var(--c-trace); border-color: var(--c-trace); }
.fc-caliper-btn:focus-visible { outline: 2px solid var(--c-trace); outline-offset: 2px; }

/* Lead selector — one pill per lead the source record actually carries
   (12 for PTB-XL, 2 for MIT-BIH / VFDB). Built per card in flashcards.js. */
.fc-lead-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.fc-lead-opt { font-family: 'Inter', system-ui, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .02em;
    color: rgba(207,233,255,.6); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
    border-radius: 7px; padding: 3px 7px; min-width: 26px; text-align: center; cursor: pointer;
    transition: background .14s, color .14s, border-color .14s; }
.fc-lead-opt:hover { color: #fff; background: rgba(255,255,255,.13); }
.fc-lead-opt.is-on { background: rgba(255,255,255,.92); color: #10141b; border-color: transparent; }
.fc-lead-opt:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
/* Caliper how-to tooltip — same look as the Segment Lab .chipTip; anchored
   below-left (the button is top-left) with an up-pointing arrow. */
.fc-cal-tip {
    position: absolute; top: calc(100% + 11px); left: 0; transform: translateY(-5px);
    width: max-content; max-width: 250px; background: #171c28; color: #eef1f6; text-align: left;
    font-family: 'Inter', system-ui, sans-serif; font-weight: 400; font-size: 12.5px; line-height: 1.5;
    letter-spacing: normal; text-transform: none; padding: 10px 13px; border-radius: 12px;
    box-shadow: 0 14px 34px -10px rgba(15,20,35,.5);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility .16s; z-index: 50;
}
.fc-cal-tip b { font-weight: 700; color: #fff; }
.fc-cal-tip::after { content: ""; position: absolute; bottom: 100%; left: 11px;
    border: 6px solid transparent; border-bottom-color: #171c28; }
.fc-caliper-btn:hover .fc-cal-tip, .fc-caliper-btn:focus-visible .fc-cal-tip {
    opacity: 1; visibility: visible; transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) { .fc-cal-tip { transition: none; } }
.fc-hr { display: inline-flex; align-items: center; gap: 6px;
    font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; letter-spacing: .02em; color: var(--c-ink-2); }
.fc-hr b { color: var(--c-ink); font-weight: 700; font-size: 13px; }
.fc-hr-unit { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--c-ink-3); }
.fc-hr-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-trace);
    box-shadow: 0 0 0 0 rgba(243,189,92,.55); animation: fcHrPulse 1.4s ease-out infinite; }
@keyframes fcHrPulse {
    0%   { box-shadow: 0 0 0 0 rgba(243,189,92,.5); }
    70%  { box-shadow: 0 0 0 6px rgba(243,189,92,0); }
    100% { box-shadow: 0 0 0 0 rgba(243,189,92,0); }
}
@media (prefers-reduced-motion: reduce) { .fc-hr-dot { animation: none; } }

/* caliper overlay canvas sits transparently above the static strip */
.fc-caliper-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.fc-rv-canvas-wrap.caliper-on { box-shadow: inset 0 0 0 1.5px rgba(166,207,213,.5); }

/* the live strip canvas frame — a dark monitor screen (the canvas draws the teal grid + trace) */
.fc-flip .fc-rv-canvas-wrap { margin: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.10);
    box-shadow: inset 0 0 30px rgba(0,0,0,.45); background: radial-gradient(120% 140% at 50% 30%, #0f1820 0%, #0a1118 100%); }
.fc-flip #fcRvCanvas { height: 270px; }
.fc-flip .fc-rv-errnote { background: #0c141c; color: var(--c-ink-3); }

.fc-ask { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 22px 26px; text-align: center; }
.fc-ask-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--c-ink-3); display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.fc-ask-q { font-size: 27px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 16px; color: var(--c-ink); }
.fc-reveal { font: inherit; font-size: 14px; font-weight: 700; letter-spacing: -.01em; color: var(--c-on-accent); white-space: nowrap;
    background: var(--c-trace); border: 1px solid var(--c-trace); border-radius: 11px; padding: 12px 22px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 10px; transition: .16s var(--c-ease); box-shadow: 0 0 18px var(--c-trace-glow); }
.fc-reveal:hover { background: var(--c-trace-hi); border-color: var(--c-trace-hi); transform: translateY(-1px); }
.fc-kbd { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; letter-spacing: .04em;
    background: rgba(13,2,33,.14); border: 1px solid rgba(13,2,33,.24); border-radius: 6px; padding: 3px 7px;
    color: rgba(13,2,33,.72); }

/* ── back ── */
.fc-back-inner { flex: 1; display: flex; flex-direction: column; padding: 24px 28px 22px; width: 100%; max-width: 680px; margin: 0 auto; }
.fc-back-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.fc-cat { align-self: flex-start; font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; letter-spacing: .16em;
    text-transform: uppercase; color: var(--c-ink-2); background: var(--c-surface); border-radius: 980px; padding: 5px 12px; }
.fc-flipback { font: inherit; font-size: 12px; font-weight: 600; letter-spacing: -.01em; color: var(--c-ink-2);
    background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 9px; padding: 6px 10px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px; transition: .16s var(--c-ease); white-space: nowrap; }
.fc-flipback:hover { color: var(--c-ink); border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.09); }
.fc-flipback svg { display: block; }
.fc-flipback .fc-kbd { color: var(--c-ink-3); background: rgba(0,0,0,.22); border: 1px solid var(--c-line); }

.fc-dx { font-size: 30px; font-weight: 800; letter-spacing: -.035em; margin: 0; line-height: 1.05; color: var(--c-ink); }
.fc-def { font-size: 14.5px; line-height: 1.5; color: var(--c-ink-2); margin: 9px 0 0; max-width: 54ch; }

.fc-findings { margin-top: 18px; border-top: 1px solid var(--c-line); display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }
.fc-findings:empty { display: none; }
.fc-find { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--c-line); }
.fc-find .fc-find-k { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--c-ink-3); white-space: nowrap; }
.fc-find .fc-find-v { font-size: 13px; font-weight: 600; letter-spacing: -.01em; text-align: right; color: var(--c-ink); }

.fc-tip { display: flex; gap: 10px; margin-top: 15px; font-size: 12.5px; line-height: 1.45; color: var(--c-ink-2); }
.fc-tip .fc-dia { margin-top: 3px; color: var(--c-accent); }
.fc-tip b { color: var(--c-ink); font-weight: 600; }
.fc-cite { font-size: 11.5px; font-style: italic; color: var(--c-ink-3); margin: 11px 0 0; }
.fc-cite::before { content: 'Diagnostic criteria · '; font-style: normal; font-weight: 600; }
.fc-back-foot { margin-top: 12px; }
.fc-back-foot .fc-rv-foot-recid { font-size: 12.5px; color: var(--c-accent); }
.fc-back-foot .fc-rv-foot-recid:hover { color: var(--c-accent-hi); }

.fc-grade2 { display: flex; gap: 12px; margin-top: auto; padding-top: 18px; }
.fc-g2 { flex: 1; font: inherit; font-size: 15px; font-weight: 700; letter-spacing: -.01em; border-radius: 12px; padding: 14px; cursor: pointer;
    border: 1.5px solid; transition: .16s var(--c-ease); white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 9px; }
.fc-kbd2 { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 5px;
    font-family: 'IBM Plex Mono', monospace; font-size: 15px; font-weight: 600; line-height: 1; border-radius: 7px; border: 1px solid; }
.fc-g2-miss { color: #fff; background: var(--c-miss); border-color: var(--c-miss); box-shadow: 0 0 18px rgba(207,65,64,.28); }
.fc-g2-miss:hover { background: var(--c-miss-hi); border-color: var(--c-miss-hi); transform: translateY(-1px); }
.fc-g2-miss .fc-kbd2 { color: #fff; background: rgba(0,0,0,.20); border-color: rgba(255,255,255,.45); }
.fc-g2-got { color: var(--c-on-accent); background: var(--c-got); border-color: var(--c-got); box-shadow: 0 0 18px var(--c-got-glow); }
.fc-g2-got:hover { background: var(--c-got-hi); border-color: var(--c-got-hi); transform: translateY(-1px); }
.fc-g2-got .fc-kbd2 { color: rgba(13,2,33,.8); background: rgba(13,2,33,.16); border-color: rgba(13,2,33,.3); }

/* ── 12-lead inside the flip card (dark monitor) — all scoped to .fc-flip so the
      admin review tool keeps the clinical pink/white grid + report. ── */
.fc-front-twelve, .fc-back-twelve { display: flex; flex-direction: column; }
.fc-flip .fc-rv-grid-wrap { margin: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.10);
    box-shadow: inset 0 0 30px rgba(0,0,0,.45); background: #0b1219; }
.fc-flip .fc12-cell { border-right-color: rgba(255,255,255,.08); border-bottom-color: rgba(255,255,255,.08); }
.fc-flip .fc12-lead { color: var(--c-ink); background: rgba(11,18,25,.62); }
.fc-flip .fc-rv-rhythm { margin: 9px 14px 0; border-radius: 10px; background: #0b1219; box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); }
.fc-flip .fc-rv-rhythm-lbl { color: var(--c-ink-3); }
.fc-flip #fcRvRhythmCanvas { height: 78px; }
/* interval readout — moved INTO the 12-lead card header (compact inline, no footer block) */
.fc-flip .fc-face-hd-12 { flex-wrap: wrap; gap: 4px 14px; }
.fc-flip .fc-rv-card-foot { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center;
    gap: 2px 14px; margin: 0; padding: 0; border: none; }
.fc-flip .fc-rv-foot-item { font-size: 11px; color: var(--c-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fc-flip .fc-rv-foot-k { font-size: 8.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--c-ink-3); margin-right: 4px; }
.fc-flip .fc-rv-foot-item b { font-size: 12.5px; font-weight: 700; color: var(--c-ink); }
.fc-flip .fc-rv-foot-na { color: var(--c-ink-3); font-style: italic; }
/* cardiologist report + coded statements (back) */
.fc-flip .fc-rv-details { max-width: none; margin: 2px 0 0; text-align: left; }
.fc-flip .fc-rv-det-head { color: var(--c-ink-3); }
.fc-flip .fc-rv-det-report { color: var(--c-ink); background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: none; }
.fc-flip .fc-rv-det-chip { color: var(--c-ink-2); background: var(--c-surface); border: 1px solid var(--c-line); }
.fc-flip .fc-rv-det-chip b { color: var(--c-ink); }
.fc-flip .fc-rv-det-lik { color: var(--c-on-accent); background: var(--c-accent); }
.fc-flip .fc-rv-det-loading { color: var(--c-ink-3); }

/* ── footer keyboard hint (replaces fc-rv-actions for the rhythm deck) ── */
.fc-flip-hint { display: flex; align-items: center; justify-content: center; gap: 30px; margin-top: 18px; min-height: 24px; }
.fc-flip-hint-front { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fc-ink-3); }
.fc-flip-hint-front b { color: var(--fc-ink-2); font-weight: 600; }
.fc-flip-hint-back { display: inline-flex; align-items: center; gap: 26px; }
.fc-kh { display: inline-flex; align-items: center; gap: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fc-ink-3); }
.fc-kh-k { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 26px; padding: 0 6px;
    font-size: 15px; color: var(--fc-ink-2); background: #fff; border: 1px solid #d7dce4; border-radius: 7px; box-shadow: 0 2px 0 rgba(29,42,61,.1); }

@media (prefers-reduced-motion: reduce) { .fc-face { transition: none; } }
@media (max-width: 560px) {
    .fc-ask-q { font-size: 23px; }
    .fc-dx { font-size: 25px; }
    .fc-findings { grid-template-columns: 1fr; }
    .fc-back-inner { padding: 20px 18px 18px; }
}
