.home-study-stack {
    position: fixed;
    z-index: 12;
    top: min(22vh, 180px);
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 304px;
    max-height: calc(100dvh - min(22vh, 180px) - 85px);
    pointer-events: none;
}

.home-study-stack > * { pointer-events: auto; }
.home-study-stack .upcoming-study-panel:not(.is-expanded) {
    position: relative;
    inset: auto;
    width: 100%;
    flex: 0 1 auto;
    min-height: 0;
}
.home-study-stack .upcoming-study-compact-list { max-height: min(29dvh, 310px); }
.home-study-stack .upcoming-study-panel.is-expanded { position: fixed; z-index: 14; }
.home-prep-panel {
    --prep-accent: 158, 198, 220;
    min-height: 0;
    flex: 0 0 auto;
    color: #e7edf2;
    border: 1px solid #50616b;
    border-radius: 8px;
    background: rgba(34, 43, 49, .97);
    box-shadow: 0 14px 38px #0003;
    overflow: hidden;
    backdrop-filter: blur(18px);
    transition: border-color 160ms, box-shadow 180ms;
}
.home-prep-panel[hidden] { display: none; }
.home-prep-panel button, .prep-dialog button { margin: 0; }
.home-prep-panel:hover { border-color: #7e9aa9; box-shadow: 0 17px 40px #0004; }
.home-prep-panel svg,
.prep-dialog svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.prep-panel-heading { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-bottom: 1px solid #ffffff12; }
.prep-heading-icon { display: inline-flex; }
.prep-heading-icon > svg { color: #a7c9dc; width: 20px; height: 20px; }
.prep-panel-heading > span { margin-left: auto; color: #a4b1ba; font-size: 10px; }
.prep-compact-list { overflow-y: auto; max-height: 220px; scrollbar-width: thin; }
.prep-compact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    border-left: 3px solid rgba(var(--prep-accent), .65);
    border-bottom: 1px solid #ffffff0a;
    background: transparent;
    color: #e7edf2;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: background 180ms, border-color 180ms;
}
.prep-compact-item:last-child { border-bottom: 0; }
.prep-compact-item:hover,
.prep-compact-item:focus-visible { background: rgba(var(--prep-accent), .1); border-left-color: rgb(var(--prep-accent)); }
.prep-compact-item > svg { width: 17px; height: 17px; color: #a0afba; transition: transform 180ms; }
.prep-compact-item:hover > svg { transform: translate(1px, -1px); color: rgb(var(--prep-accent)); }
.prep-compact-copy { min-width: 0; flex: 1; }
.prep-compact-copy > span { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; color: rgb(var(--prep-accent)); font-size: 11px; font-weight: 600; }
.prep-compact-copy small { font-size: 9px; color: #a9b5bd; font-weight: 400; white-space: nowrap; }
.prep-compact-copy > strong { display: block; margin-top: 3px; font-size: 12px; line-height: 1.4; font-weight: 500; }
.prep-panel-loading { min-height: 66px; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 13px; }

.prep-modal-open { overflow: hidden; }
.prep-dialog {
    --prep-accent: 154, 203, 180;
    box-sizing: border-box;
    width: min(1380px, calc(100vw - 48px));
    height: min(1050px, calc(100dvh - 48px));
    max-width: none;
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid #62716d;
    border-radius: 8px;
    background: #252c31;
    color: #e5ecf1;
    font-family: "Space Grotesk", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    box-shadow: 0 30px 110px #0008;
    letter-spacing: 0;
}
.prep-dialog[open] { display: flex; flex-direction: column; animation: prep-enter 220ms cubic-bezier(.2, .8, .2, 1); }
.prep-dialog::backdrop { background: #0e141bbd; backdrop-filter: blur(8px); }
.prep-dialog *, .home-prep-panel * { box-sizing: border-box; letter-spacing: 0; }
.prep-dialog button, .prep-dialog a, .prep-dialog select, .prep-dialog summary { -webkit-tap-highlight-color: transparent; }
.prep-dialog button:focus-visible, .prep-dialog a:focus-visible, .prep-dialog select:focus-visible, .prep-dialog summary:focus-visible,
.home-prep-panel button:focus-visible { outline: 2px solid #a4c8ec; outline-offset: -3px; }
.prep-toolbar { display: flex; align-items: center; gap: 16px; padding: 12px 20px; flex: 0 0 auto; background: #2c343a; border-bottom: 1px solid #ffffff12; }
.prep-toolbar-title { display: flex; align-items: center; gap: 10px; }
.prep-toolbar-title > svg { color: rgb(var(--prep-accent)); width: 25px; height: 25px; }
.prep-date-control { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; color: #b6c4cc; }
.prep-date-control select { font: inherit; font-size: 13px; background: #2c343a; color: inherit; border: 0; min-height: 38px; max-width: 100%; }
.prep-icon-button { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; flex: 0 0 auto; border: 1px solid #ffffff20; border-radius: 5px; background: #ffffff03; color: #c3d2dd; cursor: pointer; transition: background 160ms, border-color 160ms, transform 160ms; }
.prep-icon-button:hover { background: #ffffff0d; border-color: #a3bfce80; transform: translateY(-1px); }
.prep-icon-button:active { transform: translateY(0); }
.prep-tabs { display: flex; flex: 0 0 auto; gap: 8px; padding: 10px 20px; background: #252d32; border-bottom: 1px solid #ffffff13; }
.prep-tabs button { font: inherit; text-align: left; flex: 1; min-width: 0; padding: 10px 15px; border: 1px solid transparent; border-bottom: 2px solid #ffffff16; border-radius: 5px 5px 0 0; background: transparent; color: #aab7c0; cursor: pointer; transition: border-color 160ms, color 160ms, background 160ms; }
.prep-tabs button:hover { background: #ffffff04; color: #e4edf3; }
.prep-tabs button[aria-selected="true"] { background: rgba(var(--prep-accent), .08); border-bottom-color: rgb(var(--prep-accent)); color: rgb(var(--prep-accent)); }
.prep-tabs span { display: block; font-size: 15px; font-weight: 600; }
.prep-tabs small { display: block; margin-top: 2px; font-size: 11px; color: #adb8c1; }
.prep-body { min-height: 0; flex: 1; display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 34px; padding: 28px 34px 40px 20px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #83968c80 transparent; scroll-behavior: smooth; }
.prep-contents { position: sticky; top: 0; height: fit-content; display: grid; gap: 5px; max-height: calc(100dvh - 245px); overflow-y: auto; scrollbar-width: thin; }
.prep-contents > span { padding: 0 10px 14px; color: #91a2ae; font-size: 11px; }
.prep-contents a { display: flex; align-items: baseline; gap: 10px; padding: 9px 10px; border-left: 2px solid transparent; color: #b3bec6; text-decoration: none; font-size: 12px; line-height: 1.45; transition: background 160ms, color 160ms, border-color 160ms; }
.prep-contents a svg { width: 15px; height: 15px; align-self: center; }
.prep-contents a small { color: #758792; font-size: 10px; font-variant-numeric: tabular-nums; }
.prep-contents a:hover, .prep-contents a[aria-current] { color: #e7eef3; background: #ffffff05; border-left-color: rgb(var(--prep-accent)); }
.prep-contents .prep-review { margin-top: 10px; color: #a5c5e7; border-top: 1px solid #ffffff12; padding-top: 16px; }
.prep-article { min-width: 0; max-width: 960px; width: 100%; margin: 0 auto; animation: prep-content-enter 180ms ease both; }
.prep-session-meta { display: flex; flex-wrap: wrap; gap: 7px 18px; color: rgb(var(--prep-accent)); font-size: 12px; font-weight: 500; }
.prep-session-meta span + span { color: #a7b7c3; font-weight: 400; }
.prep-session-head h2 { margin: 12px 0 10px; color: #edf2f5; font-size: 30px; line-height: 1.2; font-weight: 600; overflow-wrap: break-word; }
.prep-session-head > p { margin: 0 0 20px; font-size: 16px; color: #b7c5cd; line-height: 1.6; }
.prep-scope { border-left: 2px solid #bba579; padding: 3px 0 3px 14px; font-size: 12px; color: #b6b9b7; line-height: 1.65; }
.prep-section { padding: 30px 0; border-bottom: 1px solid #ffffff12; scroll-margin-top: 18px; }
.prep-section:last-child { border: 0; padding-bottom: 12px; }
.prep-section h3 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 18px; font-size: 20px; line-height: 1.3; font-weight: 600; color: #d9e6eb; }
.prep-section h3 > span { color: rgb(var(--prep-accent)); font-size: 12px; font-variant-numeric: tabular-nums; }
.prep-section p { margin: 16px 0; color: #c8d1d7; }
.prep-section strong { font-weight: 600; color: #e4edf2; }
.prep-list { padding-left: 21px; margin: 0; }
.prep-list li { margin: 0 0 13px; padding-left: 5px; color: #c5d1d7; }
.prep-list li::marker { color: rgb(var(--prep-accent)); }
.is-priority .prep-list { columns: 2; column-gap: 28px; }
.is-priority .prep-list li { break-inside: avoid; font-size: 14px; }
.prep-table-wrap { margin: 18px 0; }
.prep-dialog table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; line-height: 1.6; }
.prep-dialog thead { background: rgba(var(--prep-accent), .09); }
.prep-dialog th, .prep-dialog td { text-align: left; vertical-align: top; padding: 13px 15px; border-bottom: 1px solid #ffffff12; overflow-wrap: break-word; }
.prep-dialog th { font-weight: 500; color: #dbe6eb; }
.prep-dialog thead th { color: rgb(var(--prep-accent)); font-size: 12px; font-weight: 600; }
.prep-dialog th:first-child { width: 23%; }
.prep-dialog td { color: #bfcdd5; }
.prep-dialog tbody tr:nth-child(even) { background: #ffffff02; }
.prep-dialog tbody tr { transition: background 160ms; }
.prep-dialog tbody tr:hover { background: #ffffff05; }
.prep-note { margin: 18px 0 4px; border-left: 2px solid #c9b388; padding: 8px 16px; background: #cab38307; color: #cbd0cf; font-size: 13px; }
.prep-steps { list-style: none; counter-reset: prep-step; padding: 0; margin: 0; }
.prep-steps li { position: relative; counter-increment: prep-step; padding: 0 0 22px 44px; border-left: 1px solid rgba(var(--prep-accent), .25); margin-left: 12px; }
.prep-steps li:last-child { padding-bottom: 0; border-left-color: transparent; }
.prep-steps li::before { content: counter(prep-step); position: absolute; left: -13px; top: 0; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #303e3c; border: 1px solid rgba(var(--prep-accent), .5); color: rgb(var(--prep-accent)); font-size: 11px; }
.prep-steps h4 { margin: 0 0 4px; font-size: 15px; font-weight: 500; color: #e4ecf1; }
.prep-steps p { margin: 0; font-size: 14px; }
.prep-term { display: inline; margin: 0; padding: 0 0 1px; border: 0; border-bottom: 1px dashed #96badd90; border-radius: 0; background: none; font: inherit; line-height: inherit; color: #b6d5eb; text-align: inherit; cursor: help; transition: color 150ms, border-color 150ms; }
.prep-term:hover, .prep-term:focus { color: #e2f3ff; border-color: #c6e6ff; transform: none; }
.prep-tooltip { position: fixed; z-index: 2; width: 320px; max-width: calc(100vw - 64px); padding: 14px 17px; border: 1px solid #688591; border-radius: 6px; background: #17252df7; color: #d3e3ec; box-shadow: 0 10px 30px #0006; font: 13px/1.6 "Space Grotesk", sans-serif; animation: prep-content-enter 120ms ease; }
.prep-tooltip[hidden] { display: none; }
.prep-tooltip strong, .prep-tooltip span { display: block; }
.prep-tooltip strong { color: #b0d8ee; margin-bottom: 5px; font-size: 13px; font-weight: 600; }
.prep-questions details { border-bottom: 1px solid #ffffff14; }
.prep-questions summary { display: flex; align-items: center; gap: 13px; padding: 17px 9px; cursor: pointer; list-style: none; font-size: 14px; color: #d2dfe6; transition: background 160ms; }
.prep-questions summary::-webkit-details-marker { display: none; }
.prep-questions summary:hover { background: rgba(var(--prep-accent), .04); }
.prep-question-number { color: rgb(var(--prep-accent)); font-size: 11px; font-variant-numeric: tabular-nums; }
.prep-questions summary > svg { margin-left: auto; width: 17px; height: 17px; color: #93a5b0; transition: transform 180ms; }
.prep-questions details[open] summary > svg { transform: rotate(90deg); }
.prep-questions details[open] summary { color: rgb(var(--prep-accent)); }
.prep-questions details > p { margin: 0 0 17px 37px; padding: 0 12px 0 14px; border-left: 2px solid rgba(var(--prep-accent), .4); font-size: 14px; animation: prep-content-enter 160ms ease; }
.prep-section-sources { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 19px; }
.prep-source { display: flex; align-items: center; gap: 8px; min-width: 0; border: 0; background: transparent; padding: 5px 0; color: #90a9b8; font: inherit; font-size: 11px; text-align: left; text-decoration: none; cursor: pointer; transition: color 150ms; }
.prep-source:hover { color: #cce8f7; }
.prep-source svg { width: 14px; height: 14px; }
.prep-source span { overflow-wrap: anywhere; }
.prep-source small { display: block; font-size: 11px; color: #9cabb4; font-weight: 400; margin-top: 2px; }
.prep-source-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.prep-source-list .prep-source { font-size: 13px; align-items: flex-start; padding-block: 9px; }
.prep-source-list svg { margin-top: 3px; width: 18px; height: 18px; }
.prep-loading { grid-column: 1 / -1; min-height: 300px; align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 16px; color: #b1c4cf; font-size: 14px; }
.prep-spinner { display: inline-block; flex: 0 0 auto; width: 26px; height: 26px; border: 2px solid #e3ecf019; border-top-color: #eef7fc; border-right-color: #b7d0dd; border-radius: 50%; box-shadow: 0 0 12px #eaf5ff15; animation: prep-spin .7s linear infinite; }
.prep-source.is-material-loading svg { animation: prep-spin .8s linear infinite; }
@keyframes prep-spin { to { transform: rotate(360deg); } }
@keyframes prep-enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes prep-content-enter { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 1700px) { .home-study-stack { right: max(22px, calc((100vw - 1350px) / 2 - 292px)); } }
@media (max-width: 1180px) {
    .home-study-stack { top: auto; right: 18px; bottom: 82px; max-height: calc(100dvh - 105px); }
    .home-study-stack .upcoming-study-compact-list { max-height: 22dvh; }
    .prep-body { grid-template-columns: 175px minmax(0, 1fr); gap: 24px; padding-right: 24px; }
    .is-priority .prep-list { columns: 1; }
}
@media (max-width: 760px) {
    .prep-dialog { width: calc(100vw - 20px); height: calc(100dvh - 20px); }
    .prep-toolbar { padding: 9px 12px; gap: 9px; }
    .prep-toolbar-title > svg { width: 20px; height: 20px; }
    .prep-date-control { gap: 5px; }
    .prep-date-control > svg { display: none; }
    .prep-date-control select { font-size: 11px; }
    .prep-tabs { padding: 8px 12px; }
    .prep-tabs button { padding: 8px 10px; }
    .prep-tabs span { font-size: 13px; }
    .prep-tabs small { font-size: 10px; }
    .prep-body { display: block; padding: 18px; }
    .prep-contents { position: static; display: flex; flex-wrap: wrap; gap: 5px 13px; margin-bottom: 26px; max-height: none; overflow: visible; }
    .prep-contents > span { flex-basis: 100%; padding: 0 0 6px; }
    .prep-contents a { padding: 3px 0; border: 0; font-size: 10px; gap: 4px; }
    .prep-contents a small { display: none; }
    .prep-contents .prep-review { margin: 0; padding: 3px 0; border: 0; }
    .prep-session-head h2 { font-size: 25px; }
    .prep-session-head > p { font-size: 14px; }
    .prep-session-meta { font-size: 11px; }
    .prep-section h3 { font-size: 18px; }
    .prep-source-list { grid-template-columns: 1fr; gap: 9px; }
}
@media (max-width: 560px) {
    .home-study-stack { width: min(290px, calc(100vw - 24px)); right: 12px; bottom: 78px; gap: 8px; }
    .home-study-stack .upcoming-study-panel:not(.is-expanded) { width: 100%; max-height: none; }
    .home-study-stack .upcoming-study-compact-list { max-height: min(18dvh, 150px); }
    .prep-compact-list { max-height: 185px; }
    .prep-compact-item { padding: 10px 12px; }
    .prep-panel-heading { padding: 8px 12px; }
    .prep-dialog th:first-child { width: auto; }
    .prep-dialog thead { display: none; }
    .prep-dialog table, .prep-dialog tbody, .prep-dialog tr, .prep-dialog th, .prep-dialog td { display: block; width: 100%; }
    .prep-dialog tbody tr { padding: 13px 12px; border-bottom: 1px solid #ffffff19; }
    .prep-dialog tbody th { border: 0; padding: 0 0 4px; color: rgb(var(--prep-accent)); font-size: 14px; }
    .prep-dialog td { border: 0; padding: 7px 0 0; font-size: 13px; }
    .prep-dialog td::before { content: attr(data-label); display: block; font-size: 10px; color: #94a3ad; margin-bottom: 3px; }
    .prep-section p, .prep-list li { font-size: 14px; }
    .prep-dialog { line-height: 1.6; }
    .prep-section { padding-block: 25px; }
}
@media (prefers-reduced-motion: reduce) {
    .home-prep-panel *, .prep-dialog, .prep-dialog *, .home-prep-panel { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
