.study-root { min-width: 0; width: 100%; height: 100%; overflow: auto; overscroll-behavior: contain; }
.study-view { width: min(1100px, 100%); min-height: 100%; box-sizing: border-box; padding: clamp(16px, 3vw, 36px); margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.study-header, .study-subject > header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.study-header > div:first-child { flex: 1 1 260px; min-width: 0; }
.study-view h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 8px; line-height: 1.15; }
.study-view h2, .study-dialog h2 { margin: 0 0 10px; font-size: 1.2rem; }
.study-view h3 { margin: 0 0 7px; font-size: 1rem; }
.study-view :is(h1,h2,h3,p,span,small), .study-dialog :is(h2,h3,p,code) { overflow-wrap: anywhere; }
.study-eyebrow { letter-spacing: .12em; font-size: .68rem; font-weight: 700; color: var(--accent, #b4bcff); margin: 0 0 12px; }
.study-help { color: var(--muted, #a5aabd); line-height: 1.6; font-size: .9rem; margin: 0; }
.study-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.study-root button, .study-dialog button { color: inherit; font: inherit; padding: 10px 13px; border: 1px solid var(--border, #343848); border-radius: 10px; background: var(--panel, #1a1e2b); cursor: pointer; min-height: 42px; max-width: 100%; white-space: normal; }
.study-root button:hover, .study-dialog button:hover { filter: brightness(1.15); }
.study-root button:focus-visible, .study-dialog :is(button,input,textarea,select):focus-visible, .study-opt-in:focus-within { outline: 2px solid var(--accent, #b4bcff); outline-offset: 3px; }
.study-root .study-primary, .study-dialog .study-primary { background: var(--accent, #b4bcff); color: var(--bg, #111326); font-weight: 650; }
.study-root .study-danger, .study-dialog .study-danger { color: #ffb5bc; }
.study-dialog button:disabled { opacity: .5; cursor: default; }
.study-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.study-root .study-class-card { display: flex; align-items: flex-start; flex-direction: column; text-align: left; padding: 22px; gap: 12px; }
.study-class-icon, .study-empty-icon { display: inline-grid; place-content: center; width: 46px; height: 46px; border-radius: 14px; font-size: 1.6rem; color: var(--accent, #b4bcff); background: #b4bcff17; }
.study-role { width: fit-content; border-radius: 8px; padding: 7px 10px; color: var(--muted, #afb5cd); background: #858caa15; font-size: .8rem; line-height: 1.5; margin: 0; }
.study-empty { display: grid; justify-items: center; text-align: center; padding: 35px 18px; gap: 15px; border: 1px dashed var(--border, #343848); border-radius: 18px; }
.study-empty p { max-width: 490px; }
.study-subject { padding: 20px; border: 1px solid var(--border, #343848); border-radius: 16px; background: var(--panel, #141824); display: grid; gap: 18px; }
.study-subject > header h2 { flex: 1 1 200px; }
.study-order-list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.study-order-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--border, #343848); border-radius: 12px; background: #858caa0a; }
.study-order-row[data-drop-target="true"] { border-color: var(--accent, #b4bcff); background: #858caa20; }
.study-order-name { flex: 1; min-width: 0; line-height: 1.5; }
.study-order-controls { display: flex; flex-wrap: wrap; flex: 0 0 auto; gap: 6px; }
.study-order-dialog .study-drag-handle { flex: 0 0 auto; font-size: 1.3rem; cursor: grab; }
.study-order-dialog button { min-width: 44px; min-height: 44px; }
.study-order-dialog button:disabled { cursor: default; }
.study-order-dialog .study-drag-handle:active { cursor: grabbing; }
.study-order-status { margin: 0; min-height: 1.5em; color: var(--muted, #a5aabd); font-size: .85rem; line-height: 1.5; }
@media (max-width: 430px) { .study-order-row { gap: 8px; padding: 8px; } .study-order-controls { flex-direction: column; } }
.study-topic { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 16px 0 0; border-top: 1px solid var(--border, #343848); }
.study-topic > div:first-child { flex: 1 1 220px; min-width: 0; }
.study-opt-in { display: flex; gap: 14px; align-items: flex-start; padding: 15px; border: 1px solid var(--border, #343848); border-radius: 12px; }
.study-opt-in input { margin-top: 4px; accent-color: var(--accent, #b4bcff); }
.study-opt-in span { display: grid; gap: 7px; }
.study-opt-in small { color: var(--muted, #a5aabd); line-height: 1.5; }
.study-dialog { width: min(650px, calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: calc(100dvh - 32px); box-sizing: border-box; margin: auto; padding: clamp(16px, 3vw, 26px); border-radius: 18px; border: 1px solid var(--border, #343848); background: var(--panel, #171c29); color: var(--text, #eef0ff); overflow: auto; overscroll-behavior: contain; }
.study-dialog::backdrop { background: #07090ec9; }
.study-dialog form { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.study-dialog .study-close { align-self: flex-end; }
.study-field { display: grid; gap: 8px; font-size: .87rem; min-width: 0; }
.study-field :is(input,textarea), .study-member select, .study-field select { width: 100%; min-width: 0; box-sizing: border-box; color: inherit; background: #080b1455; border: 1px solid var(--border, #454b60); padding: 12px; border-radius: 9px; font: inherit; font-size: 16px; }
.study-field textarea { min-height: 85px; resize: vertical; }
.study-error { color: #ffb5bc; line-height: 1.5; }
.study-member { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border, #343848); }
.study-member > div { display: grid; gap: 6px; min-width: 0; flex: 1 1 130px; }
.study-member small { color: var(--muted, #a5aabd); }
.study-member select { width: auto; max-width: 180px; }
.study-card-editor, .study-card-rows, .study-pdf-editor { display: grid; gap: 16px; }
.study-edit-card { padding: 15px; border: 1px solid var(--border, #343848); border-radius: 10px; display: grid; gap: 12px; }
.study-review { padding: 20px; border: 1px solid var(--border, #343848); border-radius: 12px; display: grid; gap: 20px; text-align: center; }
.study-review h3 { white-space: pre-wrap; font-size: 1.4rem; margin: 0; }
.study-review progress { width: 100%; height: 8px; accent-color: var(--accent, #b4bcff); }
.study-review .study-answer { white-space: pre-wrap; padding: 20px 0; font-size: 1.1rem; line-height: 1.7; }
.study-feedback { line-height: 1.7; white-space: pre-wrap; }
:root:is([data-theme="ivory"],[data-theme="windows-xp"]) :is(.study-danger,.study-error) { color: #a31836; }
.study-root [hidden], .study-dialog [hidden] { display: none !important; }
@media (max-width: 430px) { .study-view { gap: 18px; } .study-subject { padding: 14px; } .study-topic .study-actions { width: 100%; } .study-root button, .study-dialog button { padding: 10px; } .study-review { padding: 14px; } }
.rail-button[data-tab="study"][hidden], [data-tab="study"][hidden] { display: none !important; }
.study-topic-disclosure { display:block; }
.study-topic-disclosure > summary { cursor:pointer; padding:12px 0; font-weight:700; overflow-wrap:anywhere; }
.study-topic-disclosure[open] > .study-actions { margin-top:12px; }
