/* ==========================================================================
   One-off pieces for the guides: the active recall experiment, the study
   result bars, the "two ways" comparison and the book notes chooser.
   Built on the tokens in site.css and the .tool shell in tools.css.
   ========================================================================== */

/* ---------- Active recall experiment (/active-recall/) ---------- */

.rt { scroll-margin-top: 90px; }
.rt-steps { display: flex; gap: 8px; margin-bottom: 22px !important; }
.rt-steps li {
    flex: 1; display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3);
}
.rt-steps li::before { content: ''; flex: 1; height: 3px; border-radius: 2px; background: var(--line-strong); order: 2; transition: background 0.5s var(--ease); }
.rt-steps li.is-on { color: var(--text); }
.rt-steps li.is-on::before { background: var(--text); }

.rt-passage { font-size: 18px; line-height: 1.65; color: var(--text); transition: filter 0.4s ease, opacity 0.4s ease; }
.rt-passage-title { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; margin-bottom: 10px; }
.is-returning .rt-passage { filter: blur(7px); opacity: 0.35; user-select: none; pointer-events: none; }
.is-returning .rt-panel[data-rt-step='read'] > .tool-actions { display: none; }

.rt-return {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding: 16px 18px; margin-bottom: 20px; border-radius: 16px;
    background: rgba(123, 108, 246, 0.1); border: 1px solid rgba(123, 108, 246, 0.4);
    font-size: 16px; line-height: 1.45;
}
.rt-return span { flex: 1 1 100%; }
.rt-return .btn { height: 42px; font-size: 15px; padding: 0 18px; }

.rt-label { display: block; font-size: 16px; color: var(--text-2); margin-bottom: 12px; line-height: 1.5; }
.rt-textarea { height: auto; min-height: 170px; padding: 14px; line-height: 1.55; resize: vertical; font-size: 17px; }

.rt-points { display: grid; gap: 8px; }
.rt-points label {
    display: flex; gap: 14px; align-items: flex-start; cursor: pointer;
    padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.rt-points label:hover { border-color: var(--line-strong); }
.rt-points input {
    appearance: none; -webkit-appearance: none; flex: none;
    width: 22px; height: 22px; margin-top: 1px; border-radius: 7px;
    border: 1.5px solid var(--text-3); display: grid; place-items: center; cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.rt-points input::after { content: ''; width: 6px; height: 11px; border: solid #000; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); opacity: 0; }
.rt-points input:checked { background: var(--green); border-color: var(--green); }
.rt-points input:checked::after { opacity: 1; }
.rt-points input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.rt-points label:has(input:checked) { border-color: rgba(127, 210, 124, 0.35); }
.rt-points span { font-size: 16px; line-height: 1.45; color: var(--text); }

.rt-score { display: flex; gap: 18px; align-items: baseline; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.rt-score b { flex: none; font-size: clamp(30px, 4vw, 40px); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rt-score p { font-size: 16px; color: var(--text-2); line-height: 1.5; }

.rt-yours { margin-top: 16px; font-size: 15px; }
.rt-yours summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
.rt-yours p { margin-top: 10px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); white-space: pre-wrap; color: var(--text-2); }

/* ---------- Study result (/active-recall/) ---------- */

.rc-result { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.rc-result-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; font-size: 17px; }
.rc-result-col > span { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.rc-bars { display: grid; gap: 14px; }
.rc-bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.rc-bar i { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--surface-2); position: relative; overflow: hidden; }
.rc-bar i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: 5px; background: var(--text-3); }
.rc-bar.is-recall i::after { background: var(--spectrum); }
.rc-bar b { order: 2; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.rc-bar small { order: 1; font-size: 14px; color: var(--text-2); }
.rc-table td:first-child { color: var(--text-2); width: 45%; }

/* ---------- One passage, two ways (/readwise-alternative/) ---------- */

.twoways { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.twoways-col { display: flex; flex-direction: column; padding: 22px 24px; font-size: 16px; line-height: 1.55; }
.twoways-col.is-us { border-color: rgba(123, 108, 246, 0.45); }
.prose .twoways-quote { border: 0; padding: 0; font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: 19px; line-height: 1.6; color: var(--text); }
.twoways-quote span { background: rgba(240, 211, 92, 0.2); box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 1px 3px; border-radius: 3px; }
.twoways-src { font-size: 14px; color: var(--text-3); margin-top: 10px !important; }
.twoways-note { color: var(--text); }
.twoways-q { margin-top: 14px !important; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.twoways-q p { color: var(--text); }
.twoways-q b { color: #b4acff; font-weight: 600; }
.twoways-hint { font-size: 14px; color: var(--text-3) !important; margin-top: 6px !important; }
.twoways-what { margin-top: auto !important; padding-top: 16px; font-size: 14px; color: var(--text-2); }

/* ---------- Book notes chooser (/book-notes-app/), no JavaScript ---------- */

.nc { position: relative; }
.nc-radio { position: absolute; opacity: 0; pointer-events: none; }
.nc-options { display: flex; flex-wrap: wrap; gap: 8px; }
.nc-options label {
    display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--surface-2);
    font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--text-2); cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nc-options label:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.24); }

#nc-find:checked ~ .nc-options [for='nc-find'],
#nc-write:checked ~ .nc-options [for='nc-write'],
#nc-track:checked ~ .nc-options [for='nc-track'],
#nc-remember:checked ~ .nc-options [for='nc-remember'],
#nc-exam:checked ~ .nc-options [for='nc-exam'] { background: var(--text); color: #000; border-color: transparent; }

#nc-find:focus-visible ~ .nc-options [for='nc-find'],
#nc-write:focus-visible ~ .nc-options [for='nc-write'],
#nc-track:focus-visible ~ .nc-options [for='nc-track'],
#nc-remember:focus-visible ~ .nc-options [for='nc-remember'],
#nc-exam:focus-visible ~ .nc-options [for='nc-exam'] { outline: 2px solid var(--blue); outline-offset: 2px; }

.nc-answers { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.nc-answer { display: none; font-size: 17px; line-height: 1.6; color: var(--text-2); animation: nc-in 0.45s var(--ease); }
.nc-answer > * + * { margin-top: 0.8em; }
.nc-answer strong { color: var(--text); }
.nc-pick { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; color: var(--text); }
.nc-but { font-size: 15px; color: var(--text-3); padding-left: 14px; border-left: 2px solid var(--line-strong); }

#nc-find:checked ~ .nc-answers [data-for='nc-find'],
#nc-write:checked ~ .nc-answers [data-for='nc-write'],
#nc-track:checked ~ .nc-answers [data-for='nc-track'],
#nc-remember:checked ~ .nc-answers [data-for='nc-remember'],
#nc-exam:checked ~ .nc-answers [data-for='nc-exam'] { display: block; }

@keyframes nc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.compare .is-us-row th { color: #b4acff; }

/* ---------- One book in a week (/book-notes-app/) ---------- */

.book-week { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.book-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.book-when { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.book-note { font-size: 15px; line-height: 1.55; color: var(--text); }

.book-result { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px !important; }
.book-topics, .book-quiz { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.book-quiz { border-color: rgba(123, 108, 246, 0.45); }
.book-topics ul { list-style: none; padding: 0; display: grid; gap: 12px; }
.prose .book-topics li + li { margin-top: 0; }
.book-topics b { display: block; font-size: 16px; color: var(--text); font-weight: 600; line-height: 1.35; }
.book-topics small { display: inline-flex; margin-top: 4px; font-size: 13px; color: var(--text-3); }
.book-q { font-size: 16px; line-height: 1.5; color: var(--text); padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.book-q + .book-q { margin-top: 8px !important; }

@media (max-width: 720px) {
    .rc-result, .twoways, .book-week, .book-result { grid-template-columns: 1fr; }
    .rt-score { flex-direction: column; gap: 6px; }
    .rt-passage { font-size: 17px; }
    .nc-options label { font-size: 14px; min-height: 40px; padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .nc-answer { animation: none; }
}
