@layer app {
  .reading-shell { background: white; }
  .summary-masthead { margin: 1.5rem 0 2rem; padding: 1.5rem clamp(1.25rem, 3vw, 2.25rem); background: var(--brand-field); color: var(--ink); }
  .summary-masthead-label { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-size: .75rem; font-weight: 800; }
  .summary-masthead h1 { margin: 1.25rem 0; font: 800 clamp(1.8rem, 4vw, 2.4rem)/1.14 var(--font-sans); letter-spacing: -.04em; overflow-wrap: anywhere; text-wrap: balance; }
  .summary-masthead-course { border-top: 1px solid #1f242c50; padding-top: .75rem; font-size: .8rem; font-weight: 700; overflow-wrap: anywhere; }
  .summary-content > section:first-child .summary-block:first-of-type { margin-top: 0; }
  .summary-content > section { max-width: 68ch; margin-inline: auto; }
  .summary-content h2, .summary-content h3, .summary-masthead { break-after: avoid; }
  .summary-table { max-width: 100%; overflow-x: auto; }
  .summary-page { width: min(772px, calc(100% - 3rem)); margin: auto; padding: 2rem 0 5rem; }
  .summary-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .summary-toolbar .back-link { min-width: 0; overflow-wrap: anywhere; }
  .summary-delete-action { color: var(--danger); }
  .summary-actions { flex-shrink: 0; }
  .summary-actions-menu {
    position: fixed; inset: auto; top: anchor(bottom); right: anchor(right);
    position-try-fallbacks: flip-block; margin: 0.5rem 0 0; width: 12rem; max-width: calc(100vw - 2rem); padding: 0.35rem;
    border: 1px solid var(--line); border-radius: 0.75rem; background: white; color: var(--ink);
  }
  @supports not (top: anchor(bottom)) { .summary-actions-menu { inset: 20% 1rem auto auto; } }
  .summary-actions-menu a, .summary-actions-menu button { display: block; width: 100%; min-height: 44px; border: 0; border-radius: 0.4rem; padding: 0.65rem 0.8rem; background: transparent; color: inherit; text-align: left; font-size: 0.875rem; cursor: pointer; }
  .summary-actions-menu a:hover, .summary-actions-menu button:hover { background: #f3f5f7; }
  .summary-actions-menu .summary-actions-delete { color: var(--danger); border-top: 1px solid var(--line); border-radius: 0; }
  .summary-card > .summary-actions { margin-top: 1rem; }
  .summary-progress-bar { position: fixed; inset: 0 0 auto; z-index: 70; height: 3px; background: var(--primary); transform: scaleX(0); transform-origin: left; }
  .summary-content { min-width: 0; padding: 0 clamp(0rem, 3vw, 2.25rem); color: var(--ink); font: 500 1rem/1.75 var(--font-sans); overflow-wrap: anywhere; }
  .summary-content > section { scroll-margin-top: 2rem; padding: 0; }
  .summary-content > section + section { margin-top: 2rem; }
  .summary-section-head { margin-bottom: 0.85rem; }
  .summary-content h2 { color: var(--ink); font: 800 1.2rem/1.35 var(--font-sans); letter-spacing: -0.04em; text-wrap: pretty; }
  .summary-content h3 { color: var(--ink); font: 800 1rem/1.4 var(--font-sans); letter-spacing: -0.015em; }
  .summary-content p { margin-top: 0.8rem; color: var(--ink); line-height: 1.75; text-wrap: pretty; }
  .summary-prose { max-width: 68ch; }
  .summary-prose > p:first-child { margin-top: 0; }
  .summary-content code { border-radius: 0.25rem; background: #f0f2f5; padding: 0.1em 0.25em; font-size: 0.85em; }
  .summary-block { margin-top: 1.5rem; }
  .summary-block + .summary-block { margin-top: 1.75rem; }
  .summary-highlight { padding-block: .5rem; }
  .summary-highlight p { margin: 0; font-weight: 700; line-height: 1.65; }
  .summary-highlight p + p { margin-top: 0.75rem; }
  .summary-key-points ul { margin-top: .75rem; padding-left: 1.25rem; list-style: disc; }
  .summary-key-points li { padding-left: .25rem; margin-top: .65rem; line-height: 1.7; }
  .summary-key-points li > strong { font-weight: 800; }
  .summary-key-points li p { display: inline; margin: 0; }
  .summary-sequence ol { margin-top: 0.75rem; }
  .summary-sequence li { position: relative; padding: 0 0 1rem 2.5rem; }
  .summary-sequence li:last-child { padding-bottom: 0; }
  .summary-sequence-index { position: absolute; left: 0; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--primary); color: white; font: 800 0.75rem/1 var(--font-sans); }
  .summary-sequence li p { margin-top: 0.2rem; }
  .summary-comparison dl { margin: 0.75rem 0 0; font-family: var(--font-sans); font-size: 0.95rem; line-height: 1.6; }
  .summary-comparison dl > div { display: flex; flex-wrap: wrap; gap: .5rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .summary-comparison dt { flex: 1 1 8rem; font-weight: 800; color: var(--primary-hover); }
  .summary-comparison dd { flex: 2 1 12rem; margin: 0; }
  .summary-table table { font-family: var(--font-sans); width: 100%; margin-top: 0.75rem; border-collapse: collapse; font-size: 0.9rem; line-height: 1.6; }
  .summary-table th, .summary-table td { padding: 0.6rem 0.75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
  .summary-table thead th { background: var(--blue); color: var(--ink); }
  .summary-table tbody tr:nth-child(even) { background: var(--blue); }
  .summary-table tbody th { font-weight: 700; }
  .summary-code pre { margin: 0.75rem 0 0; padding: 1.25rem 1.5rem; border-radius: 0.75rem; background: var(--ink); color: #e6ecf2; overflow-x: auto; font-size: var(--type-caption); line-height: 1.7; }
  .summary-code pre code { padding: 0; background: none; font-size: inherit; }
  .summary-code pre .k, .summary-code pre .kd, .summary-code pre .kn, .summary-code pre .kr, .summary-code pre .ow, .summary-code pre .nb { color: #7db8f0; }
  .summary-code pre .nc, .summary-code pre .nf, .summary-code pre .nn, .summary-code pre .ne { color: #fff; font-weight: 600; }
  .summary-code pre .s, .summary-code pre .s1, .summary-code pre .s2, .summary-code pre .sb { color: #c9e58a; }
  .summary-code pre .mi, .summary-code pre .mf, .summary-code pre .mh { color: #ecc48a; }
  .summary-code pre .c, .summary-code pre .c1, .summary-code pre .cm { color: #8d9aa8; font-style: italic; }
  .summary-code pre .err, .summary-code pre .nt { color: #ff9aa5; }
  .summary-flow-canvas { margin-top: 1rem; font-family: var(--font-sans); font-size: var(--type-caption); }
  .summary-flow-actors { display: grid; grid-template-columns: 1fr 1fr; }
  .summary-flow-actor { justify-self: center; max-width: 90%; padding: 0.55rem 1.25rem; border: 2px solid var(--ink); border-radius: 1rem; background: white; color: var(--ink); font-weight: 700; text-align: center; overflow-wrap: anywhere; }
  .summary-flow-actor:first-child { border-color: #3598fb; background: var(--blue); color: var(--primary-hover); }
  .summary-flow-rows { position: relative; margin-top: 1.5rem; }
  .summary-flow-rows::before, .summary-flow-rows::after { content: ""; position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--line-strong); }
  .summary-flow-rows::before { left: 25%; }
  .summary-flow-rows::after { left: 75%; }
  .summary-flow-rows li { position: relative; display: flex; flex-direction: column; margin-top: 1.15rem; }
  .summary-flow-msg { position: relative; z-index: 1; margin-inline: 25%; padding: 0 0.4rem 0.4rem; border-bottom: 2px solid var(--ink); color: var(--ink); font-weight: 600; font-size: 0.95rem; text-align: center; overflow-wrap: anywhere; }
  .summary-flow-rows .is-forward .summary-flow-msg::after, .summary-flow-rows .is-back .summary-flow-msg::after { content: ""; position: absolute; bottom: -0.25rem; border-block: 0.3rem solid transparent; }
  .summary-flow-rows .is-forward .summary-flow-msg::after { right: -0.1rem; border-left: 0.6rem solid var(--ink); }
  .summary-flow-rows .is-back .summary-flow-msg { border-color: var(--primary-hover); color: var(--primary-hover); }
  .summary-flow-rows .is-back .summary-flow-msg::after { left: -0.1rem; border-right: 0.6rem solid var(--primary-hover); }
  .summary-flow-step { position: absolute; bottom: 0.35rem; font-size: 0.75rem; font-weight: 600; }
  .summary-flow-rows .is-forward .summary-flow-step { left: 0.5rem; }
  .summary-flow-rows .is-back .summary-flow-step { right: 0.5rem; }
  .summary-flow-note { z-index: 1; align-self: center; max-width: 60%; margin-top: 0.6rem; padding: 0.5rem 0.9rem; border: 1px solid #b8c2cc; border-radius: 0.5rem; background: #f6f8fa; font-size: var(--type-caption); text-align: center; overflow-wrap: anywhere; }
  .summary-callout { padding-block: .75rem; border-block: 1px solid var(--line); }
  .summary-callout h3 { font-size: .95rem; }
  .summary-checks { padding-block: 1rem; border-top: 1px solid var(--line); }
  .summary-checks h3 { margin-bottom: .5rem; }
  .summary-checks details { padding: 1rem 0; border-bottom: 1px solid var(--line); }
  .summary-checks details:last-child { padding-bottom: 0; border-bottom: 0; }
  .summary-checks summary { cursor: pointer; font-weight: 700; line-height: 1.5; }
  .summary-checks summary:focus-visible, .study-notes summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
  .summary-checks details p { font-size: .95rem; }
  .summary-chart { margin-inline: 0; }
  .summary-chart meter { width: 100%; height: 1rem; }
  .summary-chart meter::-webkit-meter-bar { border: 0; background: #e5e9ed; }
  .summary-chart meter::-webkit-meter-optimum-value { background: var(--primary); }
  .summary-chart meter::-moz-meter-bar { background: var(--primary); }
  .summary-sources { font-family: var(--font-sans); margin: 2.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line-strong); font-size: 0.8rem; }
  .summary-share-cta { display: flex; justify-content: center; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
  .summary-preparing { width: min(100%, 42rem); margin: 5rem auto 0; }
  .summary-preparing h1 { margin-top: 0.5rem; font-size: 2rem; }
  .summary-preparing-art { width: 7rem; height: 7rem; margin: 2rem 0 0.5rem; object-fit: contain; }
  .summary-request-status { display: flex; align-items: center; gap: 0.5rem; font-size: var(--type-support); }
  .summary-request-status[hidden] { display: none; }
  .summary-request-status img { width: 2.5rem; height: 2.5rem; object-fit: contain; }
  @media (max-width: 800px) {
    .summary-page { width: calc(100% - 2rem); padding-top: 1rem; }
    .summary-table table { display: block; overflow-x: auto; }
  }
  @media (max-width: 480px) {
    .summary-content { padding: 0; }
    .summary-comparison dl > div { flex-direction: column; }
    .summary-comparison dt, .summary-comparison dd { flex: auto; }
    .summary-flow-msg { margin-inline: 15%; font-size: 0.8rem; }
    .summary-flow-rows::before { left: 15%; }
    .summary-flow-rows::after { left: 85%; }
    .summary-flow-note { max-width: 85%; }
  }
  @media print {
    @page { size: A4; margin: 16mm 18mm; }
    .summary-checks, .study-notes details { display: none !important; }
    .summary-masthead { margin: 0 0 6mm; padding: 5mm 6mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .summary-masthead h1 { font-size: 23pt; }
    .summary-masthead-label, .summary-masthead-course { font-size: 9pt; }
    .summary-content > section { max-width: none; }
    .summary-share-cta { display: none; }
    .summary-table { overflow: visible; }
    .summary-table table { display: table; table-layout: fixed; }
    .app-sidebar, .app-mobile-header, .summary-toolbar, .summary-progress-bar, .flash, dialog { display: none !important; }
    .app-layout { display: block; min-height: auto; padding: 0; }
    .app-main, .summary-page { width: 100%; margin: 0; padding: 0; }
    .summary-page { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .summary-content { padding: 0; background: white; font-size: 10.5pt; }
    .summary-content > section { padding: 0; }
    .summary-section-head { margin-bottom: 3mm; }
    .summary-key-points li { break-inside: avoid; }
    .summary-content h2 { font-size: 13pt; }
    .summary-content h3 { font-size: 11pt; }
    .summary-content > section + section { margin-top: 6mm; }
    .summary-block, .summary-block + .summary-block { margin-top: 3mm; }
    .summary-content p, .summary-content li { orphans: 3; widows: 3; }
    .summary-content details, .summary-sequence li { break-inside: avoid; }
    .summary-callout, .summary-highlight, .summary-table, .summary-code, .summary-flow { break-inside: avoid; }
    .summary-code pre { font-size: 8pt; background: white; color: var(--ink); border: 1px solid var(--line); }
    .summary-code pre span { color: var(--ink) !important; font-weight: inherit !important; font-style: inherit !important; }
    .summary-content details::details-content { content-visibility: visible; }
    .summary-content details > * { display: block !important; }
    .summary-content summary { list-style: none; }
    .summary-comparison dl > div { flex-direction: row; break-inside: avoid; }
    * { animation: none !important; transition: none !important; box-shadow: none !important; }
  }

  .summary-visual { margin-inline: 0; padding-block: 1rem; border-block: 1px solid var(--line); }
  .summary-map-core { margin-block: 1rem; font-weight: 700; }
  .summary-map-core p:first-child { margin: 0; }
  .summary-map-nodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; border-top: 2px solid var(--ink); padding-top: 1rem; }
  .summary-map-node { position: relative; padding: 1rem; border: 1px solid var(--ink); border-radius: .75rem; background: var(--blue); }
  .summary-map-node::before { content: ''; position: absolute; height: 1rem; top: -1rem; left: 50%; border-left: 2px solid var(--ink); }
  .summary-map-node > strong { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-weight: 800; }
  .summary-map-nodes p { font-size: .9rem; }
  .summary-map-links { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; font-size: .75rem; }
  .summary-map-links span { width: 100%; color: var(--muted); }
  .summary-map-links strong { border-radius: var(--radius-pill); background: white; padding: .25rem .65rem; }
  .summary-chart-value { border-bottom: 1px solid var(--line); padding: .75rem 0; }
  .summary-chart-value:last-child { border: 0; }
  .summary-chart-measure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; align-items: center; gap: .75rem; }
  .summary-chart-measure > span { font-variant-numeric: tabular-nums; font-weight: 800; }
  .summary-chart-value p { font-size: .9rem; }
  .summary-trend { display: block; width: 100%; margin-top: 1rem; overflow: visible; }
  .summary-trend-grid { stroke: var(--line); stroke-dasharray: 4 6; }
  .summary-trend polyline { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linejoin: round; }
  .summary-trend circle { fill: var(--progress); stroke: var(--ink); stroke-width: 2; }
  .summary-trend text { fill: var(--muted); font-size: 12px; }
  @media (max-width: 480px) { .summary-visual { padding: 1rem; } .summary-map-nodes { grid-template-columns: 1fr; } }
  @media print { .summary-visual { padding: 3mm; } .summary-map-node { break-inside: avoid; } }
}

@layer app {
  .study-notes { max-width: 68ch; margin-inline: auto; }
  .study-notes details { margin-block: 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: .5rem; }
  .study-notes summary { cursor: pointer; font-weight: 700; line-height: 1.5; }
  .study-notes section + section, .study-notes h2 { margin-top: 2.5rem; }
  .study-notes h2 { padding-top: .75rem; border-top: 1px solid var(--line); font-size: 1.35rem; }
  .study-notes article > h2:first-child, .study-notes section:first-child > h2:first-child { margin-top: 0; }
  .study-notes h3 { margin-top: 1.5rem; }
  .study-notes h4 { margin-top: 1rem; font-weight: 800; }
  .study-notes ul, .study-notes ol { padding-left: 1.5rem; margin-block: 1rem; }
  .study-notes ul { list-style: disc; }
  .study-notes ol { list-style: decimal; }
  .study-notes li { margin-top: .5rem; padding-left: .25rem; }
  .study-notes dt { margin-top: 1rem; font-weight: 800; }
  .study-notes dd { margin: .25rem 0 1rem 1.25rem; }
  .study-notes strong, .study-notes b { font-weight: 800; }
  .study-notes aside, .study-notes blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--blue); border-radius: .5rem; }
  .study-notes aside > :first-child, .study-notes blockquote > :first-child { margin-top: 0; }
  .study-notes figure { margin: 1.5rem 0; padding-block: 1rem; border-block: 1px solid var(--line); }
  .study-notes figcaption, .study-notes caption { color: var(--muted); font-size: .85rem; text-align: left; }
  .study-notes table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin-block: 1.25rem; font-size: .9rem; }
  .study-notes th, .study-notes td { padding: .65rem .75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; min-width: 6rem; }
  .study-notes th { background: var(--blue); font-weight: 800; }
  .study-notes caption { padding-bottom: .5rem; font-weight: 700; }
  .study-notes pre { max-width: 100%; overflow-x: auto; padding: 1rem; background: #f0f2f5; border-radius: .5rem; font-size: .85rem; line-height: 1.65; }
  .study-notes pre code { padding: 0; font-size: inherit; background: none; }
  .study-notes sup, .study-notes sub { font-size: .75em; line-height: 0; position: relative; vertical-align: baseline; }
  .study-notes sup { top: -.5em; }
  .study-notes sub { bottom: -.25em; }
  .study-notes hr { margin-block: 2rem; border: 0; border-top: 1px solid var(--line); }
  .study-notes footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line-strong); font-size: .85rem; color: var(--muted); }
  .study-notes footer p { color: inherit; }
  @media print {
    .study-notes { max-width: none; }
    .study-notes section + section, .study-notes h2 { margin-top: 6mm; }
    .study-notes h2 { font-size: 13pt; }
    .study-notes h3 { font-size: 11pt; }
    .study-notes table { display: table; width: 100%; table-layout: fixed; overflow: visible; font-size: 9pt; }
    .study-notes th, .study-notes td { min-width: 0; padding: 2mm; overflow-wrap: anywhere; }
    .study-notes thead { display: table-header-group; }
    .study-notes tr { break-inside: avoid; }
    .study-notes caption, .study-notes h4 { break-after: avoid; }
    .study-notes pre { white-space: pre-wrap; overflow-wrap: anywhere; overflow: visible; font-size: 8pt; }
    .study-notes footer { margin-top: 6mm; font-size: 9pt; }
  }
}

@layer app {
  .summary-reading-controls { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; padding: .5rem 0; background: white; border-block: 1px solid var(--line); }
  .summary-outline { position: relative; flex: 1; min-width: 0; }
  .summary-outline > summary { display: list-item; width: fit-content; min-height: 44px; padding: .6rem .5rem; cursor: pointer; font-size: .9rem; font-weight: 800; }
  .summary-outline nav { position: absolute; top: 100%; left: 0; width: min(30rem, calc(100vw - 2rem)); max-height: min(60vh, 24rem); overflow-y: auto; overscroll-behavior: contain; padding: .5rem; border: 1px solid var(--line); border-radius: .5rem; background: white; }
  .summary-outline a { display: block; min-height: 44px; padding: .65rem .75rem; border-radius: .25rem; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; color: var(--ink); }
  .summary-outline a:hover, .summary-outline a[aria-current="location"] { background: var(--blue); color: var(--primary-hover); }
  .summary-reading-status { display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: var(--muted); white-space: nowrap; }
  .summary-reading-status[hidden] { display: none; }
  .summary-reading-status progress { width: clamp(3rem, 10vw, 6rem); height: .5rem; border: 0; border-radius: 1rem; background: var(--line); accent-color: var(--primary); }
  .summary-reading-status progress::-webkit-progress-bar { background: var(--line); border-radius: 1rem; }
  .summary-reading-status progress::-webkit-progress-value { background: var(--primary); border-radius: 1rem; }
  .summary-reading-status progress::-moz-progress-bar { background: var(--primary); border-radius: 1rem; }
  .summary-content h2[id] { scroll-margin-top: 6rem; }
  .summary-content h2[tabindex]:focus { outline: 2px solid var(--primary); outline-offset: .35rem; }
  @media print {
    .summary-reading-controls { display: none !important; }
    .summary-content h2[tabindex]:focus { outline: none; }
  }
}
