.td-study-reader { color: #e8e5ef; min-width: 0; container: study-reader / inline-size; }
.td-study-reader > [hidden], .td-study-layout > [hidden] { display: none !important; }
.td-study-view-toggle { margin-bottom: 14px; }
.td-study-toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.td-study-toolbar input { flex: 1 1 220px; min-width: 0; padding: 12px 14px; border: 1px solid #686173; border-radius: 12px; background: #26222c; color: #fff; font: inherit; }
.td-study-link-notice { flex-basis: 100%; margin: 0; font-size: 13px; }
.td-study-tabs, .td-study-examples, .td-study-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.td-study-reader button { cursor: pointer; font: inherit; border: 1px solid #686173; border-radius: 10px; padding: 9px 12px; color: inherit; background: transparent; text-align: left; }
.td-study-reader button:hover, .td-study-reader button[aria-current="page"], .td-study-reader button[aria-pressed="true"] { border-color: #b9a6e7; background: #b9a6e719; }
.td-study-reader button:focus-visible, .td-study-reader input:focus-visible, .td-study-reader summary:focus-visible { outline: 3px solid #b9a6e7; outline-offset: 3px; }
.td-study-layout { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 22px; align-items: start; }
.td-study-reader.is-reading .td-study-layout { grid-template-columns: minmax(0, 1fr); }
.td-study-navigation { display: grid; gap: 8px; max-height: 78vh; overflow: auto; padding: 3px; }
.td-study-navigation h4 { font-size: 12px; line-height: 1.5; letter-spacing: .025em; margin: 12px 0 0; color: #c4bacf; }
.td-study-result { display: grid; gap: 5px; width: 100%; min-width: 0; overflow-wrap: anywhere; }
.td-study-result strong { font-size: 13px; font-weight: 600; line-height: 1.5; }
.td-study-result small { color: #beb4c9; font-size: 11px; }
.td-study-content { min-width: 0; }
.td-study-heading { margin-bottom: 16px; }
.td-study-heading h3 { margin: 7px 0; font-size: 22px; line-height: 1.35; }
.td-study-heading small, .td-study-heading p { font-size: 12px; color: #c4bacf; }
.td-study-example-index { margin: 0 0 14px; }
.td-study-example-index summary { cursor: pointer; font-size: 13px; }
.td-study-examples { margin: 10px 0 0; }
.td-study-examples button { font-size: 12px; }
.td-study-reader .notebook-reading-flow { --flow-muted: #635d64; --flow-line: #ddd7dd; --flow-soft: #f4f1ed; }
.td-study-reader .td-notebook-page { min-height: 0; padding: 24px 28px 34px; }
.td-study-reader .td-notebook-paper-heading { margin-bottom: 15px; }
.td-study-reader .td-study-focused { outline: 2px solid #927539; outline-offset: 6px; border-radius: 4px; }
.td-study-reader .notebook-block-edit-action { justify-self: end; margin-top: 10px; font-size: 12px; color: #514556; border-color: #c8c0cb; }
.td-study-inline-editor { margin-top: 20px; padding: 16px; border: 1px solid #b9a6e7; border-radius: 12px; background: #27232e; }
.td-study-inline-editor h4 { margin-top: 0; }
.td-study-inline-editor [role="status"] { font-size: 13px; }
.td-study-inline-editor .lesson-notebook-block-delete { display: none; }
.td-study-edit-actions { margin-top: 16px; }
.td-study-reference { margin: 18px 0; border: 1px solid #686173; border-radius: 12px; padding: 14px; }
.td-study-reference > summary { cursor: pointer; }
.td-study-reference > p, .td-study-reference-card > p { font-size: 13px; line-height: 1.6; }
.td-study-reference-card { margin-top: 14px; background: #fcfaf5; color: #282332; border-radius: 10px; padding: 14px; }
.td-study-reference-source { font-size: 12px; margin-top: 12px; }
.td-study-reference-source small { display: block; margin-top: 6px; }
.lesson-notebook-reader-actions { display: flex; gap: 10px; margin: 16px 0; }
.lesson-notebook-reader-loading { padding: 20px; }
/* The reader also lives inside a desktop split-screen panel. Its available
   width, rather than the browser width, determines whether a sidebar fits. */
@container study-reader (max-width: 760px) {
  .td-study-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .td-study-reader.is-browsing .td-study-content { display: none; }
  .td-study-navigation { max-height: none; }
  .td-study-toolbar { gap: 10px; }
  .td-study-toolbar input { flex-basis: 100%; }
  .td-study-reader .td-notebook-page { padding: 20px 16px 30px; }
  .td-study-heading h3 { font-size: 19px; }
  .td-study-reader .td-notebook-spread { grid-template-columns: minmax(0, 1fr); }
}
