:root {
  color-scheme: light;
  --jy-bg: #fff;
  --jy-surface: #fff;
  --jy-ink: #161616;
  --jy-muted: #666;
  --jy-line: #a0a0a0;
  --jy-border: #e4e4e4;
  --jy-soft: #f5f5f5;
  --jy-page-gutter: clamp(20px, 4.1vw, 72px);
  --jy-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-family: var(--jy-font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Theme: an explicit data-theme wins; without one (no JS yet, or JS disabled) the system preference applies. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --jy-bg: #111;
  --jy-surface: #171717;
  --jy-ink: #f2f2f2;
  --jy-muted: #aaa;
  --jy-line: #777;
  --jy-border: #333;
  --jy-soft: #222;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --jy-bg: #111;
    --jy-surface: #171717;
    --jy-ink: #f2f2f2;
    --jy-muted: #aaa;
    --jy-line: #777;
    --jy-border: #333;
    --jy-soft: #222;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 280px; background: var(--jy-bg); }
/* D012 L1 floor (UX §0): body 16px/1.75; prototype had .9375rem/1.6. */
body { margin: 0; background: var(--jy-bg); color: var(--jy-ink); font-size: 1rem; line-height: 1.75; }
button, input, select, textarea { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 3px; background: transparent; color: inherit; cursor: pointer; text-align: inherit; }
button:hover { background: var(--jy-soft); }
button:disabled { color: var(--jy-muted); opacity: .45; cursor: default; background: transparent; }
a { color: inherit; text-underline-offset: 4px; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--jy-ink); outline-offset: 4px; }
::selection { background: var(--jy-ink); color: var(--jy-bg); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 550; }
#jy-app { min-height: 100vh; min-height: 100dvh; background: var(--jy-bg); color: var(--jy-ink); }
body[data-view="home"] { overflow: hidden; }
#jy-app[data-view="home"] { height: 100vh; height: 100dvh; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.jy-main { min-width: 0; min-height: 0; }
.jy-header { display: flex; align-items: center; gap: clamp(24px, 5vw, 84px); min-height: 84px; padding: max(14px, env(safe-area-inset-top)) var(--jy-page-gutter) 14px; border-bottom: 1px solid var(--jy-border); }
.jy-brand { flex: 0 0 auto; padding: 0; font-size: 1.625rem; font-weight: 650; letter-spacing: -.07em; line-height: 1; }
.jy-brand:hover { background: transparent; }
.jy-brand-dot { padding-left: 3px; }
.jy-navigation { display: flex; align-items: center; gap: clamp(2px, 1.1vw, 20px); }
.jy-navigation button { white-space: nowrap; color: var(--jy-muted); font-size: 0.875rem; padding-inline: 7px; }
.jy-navigation button:hover, .jy-navigation button[aria-current="page"], .jy-navigation button[aria-pressed="true"] { color: var(--jy-ink); }
.jy-header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.jy-header-tools button { font-size: 0.8125rem; white-space: nowrap; }
.jy-header-tools [data-action="appearance"] { font-size: 1rem; letter-spacing: -.04em; }
.jy-key-hint { padding-left: 14px; color: var(--jy-muted); }

#jy-app[data-view="home"] .jy-header { border-bottom-color: transparent; }
#jy-home { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 7.4fr); grid-template-rows: minmax(0, .5fr) minmax(0, .5fr) auto auto; column-gap: clamp(18px, 2.4vw, 44px); padding: 4px var(--jy-page-gutter) max(12px, env(safe-area-inset-bottom)); }
.jy-eyebrow { color: var(--jy-muted); font-size: 0.6875rem; line-height: 1.5; letter-spacing: .08em; }
.jy-home-intro { display: block; grid-column: 1; grid-row: 1; min-width: 0; align-self: end; padding-bottom: 18px; }
#jy-app[data-space-level="global"] .jy-home-intro { grid-row: 1 / 3; align-self: center; padding-bottom: 8%; }
.jy-home-intro h1 { margin-top: 18px; font-size: clamp(1.875rem, 3.7vw, 3.75rem); line-height: 1.35; letter-spacing: -.055em; font-weight: 480; }
.jy-home-intro h1:focus, #jy-context-title:focus { outline: none; }
.jy-home-intro .jy-eyebrow { font-size: 0.75rem; letter-spacing: .12em; }
.jy-slogan-line { display: block; white-space: nowrap; }
.jy-home-description { margin-top: 18px; color: var(--jy-muted); font-size: 0.875rem; line-height: 1.8; text-wrap: pretty; }
.jy-discovery-start { display: block; margin-top: 18px; padding: 6px 0; font-size: 0.75rem; line-height: 1.6; text-decoration: underline; text-underline-offset: 5px; }
.jy-exploration-bar { grid-column: 2; grid-row: 1; align-self: start; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; min-height: 40px; }
.jy-exploration-tools { display: flex; gap: 6px; flex-shrink: 0; }
.jy-exploration-tools button { min-height: 36px; padding: 4px 7px; color: var(--jy-muted); font-size: 0.75rem; white-space: nowrap; }
.jy-breadcrumbs { display: flex; align-items: center; flex: 1 1 auto; gap: 2px 9px; min-width: 0; min-height: 36px; overflow: hidden; white-space: nowrap; color: var(--jy-muted); font-size: 0.75rem; }
.jy-breadcrumbs button { flex: 0 1 auto; min-width: 0; min-height: 36px; padding: 4px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jy-breadcrumbs > span { flex: 0 0 auto; }
.jy-breadcrumbs [aria-current] { color: var(--jy-ink); }
.jy-space-stage { display: contents; }
.jy-main-space { position: relative; grid-column: 2; grid-row: 1 / 3; align-self: end; width: 100%; height: calc(100% - 40px); min-width: 0; min-height: 0; isolation: isolate; }
.jy-main-space canvas, .jy-local-space canvas { display: block; max-width: 100%; }
.jy-space-placeholder { position: absolute; inset: 6% 0; margin: auto; aspect-ratio: 1; max-height: 86%; max-width: 75%; border: 1px solid var(--jy-border); border-radius: 50%; display: grid; align-content: center; justify-content: center; text-align: center; color: var(--jy-muted); pointer-events: none; }
.jy-space-placeholder span:first-child { color: var(--jy-ink); font-size: 1.125rem; }
.jy-space-placeholder span + span { margin-top: 9px; font-size: 0.6875rem; }
#jy-app[data-space-ready] .jy-space-placeholder { display: none; }
.jy-context { grid-column: 1; grid-row: 2; align-self: start; min-width: 0; padding-top: 12px; }
.jy-context h1 { margin: 0 0 9px; font-size: clamp(1.375rem, 2.05vw, 1.9375rem); line-height: 1.35; letter-spacing: -.04em; overflow-wrap: anywhere; }
#jy-context-description { margin-bottom: 10px; color: var(--jy-muted); font-size: 0.8125rem; line-height: 1.75; }
#jy-context-links { display: grid; gap: 0; }
#jy-context-links > button, #jy-context-links > a { display: block; width: 100%; min-height: 38px; padding: 6px 0; border-radius: 0; font-size: 0.8125rem; text-decoration: none; }
#jy-context-links > .jy-context-all { color: var(--jy-muted); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.jy-person-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.jy-person-actions button, .jy-person-actions a { min-height: 38px; padding: 6px 0; color: var(--jy-muted); font-size: 0.8125rem; }
.jy-space-toolbar { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 48px; padding-top: 4px; }
#jy-space-caption { margin-right: auto; max-width: 45%; color: var(--jy-muted); font-size: 0.75rem; }
.jy-depth-controls { display: flex; align-items: center; flex-shrink: 0; gap: 2px; }
.jy-depth-controls button { display: inline-flex; justify-content: center; align-items: center; min-width: 38px; min-height: 38px; padding: 6px 8px; font-size: 0.875rem; color: var(--jy-muted); }
.jy-depth-controls button[aria-pressed="true"] { color: var(--jy-ink); background: var(--jy-soft); }
.jy-space-actions { display: flex; flex-shrink: 0; gap: 14px; }
.jy-space-actions button { padding-inline: 4px; font-size: 0.75rem; white-space: nowrap; }
.jy-action-compact { display: none; }
.jy-preview-note { grid-column: 1 / -1; grid-row: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; color: var(--jy-muted); font-size: 0.6875rem; line-height: 1.4; letter-spacing: .035em; }
.jy-presentation-switch { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.jy-spatial-comparison { margin-top: 22px; border-top: 1px solid var(--jy-border); padding-top: 12px; }
.jy-spatial-comparison summary { min-height: 44px; padding: 10px 0; color: var(--jy-muted); font-size: 0.75rem; cursor: pointer; }
.jy-spatial-comparison summary:focus-visible { outline: 2px solid var(--jy-ink); outline-offset: 4px; }
.jy-presentation-switch button { min-height: 44px; padding: 8px 13px; font-size: 0.75rem; white-space: nowrap; color: var(--jy-muted); }
.jy-presentation-switch button[aria-pressed="true"] { color: var(--jy-ink); box-shadow: inset 0 -1px currentColor; border-radius: 0; }
.jy-preview-evidence { flex: 0 0 auto; min-height: 36px; padding: 4px 0; font-size: 0.75rem; text-decoration: underline; text-underline-offset: 4px; }
.jy-relation-preview { display: flex; flex-direction: column; gap: 4px; max-height: 190px; min-height: 0; margin-top: 24px; padding: 0 0 0 14px; border: 0; border-left: 1px solid var(--jy-border); border-radius: 0; background: var(--jy-surface); }
.jy-relation-heading { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: 12px; }
.jy-relation-heading strong { font-size: 0.9375rem; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.jy-relation-heading button { flex: 0 0 32px; min-height: 32px; padding: 0 6px; font-size: 1.25rem; text-align: center; color: var(--jy-muted); }
#jy-relation-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 0 0 auto; color: var(--jy-muted); font-size: 0.75rem; line-height: 1.5; }
.jy-relation-list { flex: 1 1 auto; min-height: 32px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.jy-preview-link { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; min-height: 32px; padding: 5px 2px; border-radius: 0; text-align: left; font-size: 0.8125rem; line-height: 1.6; }
.jy-preview-link span { min-width: 0; overflow-wrap: anywhere; }
.jy-preview-link small { max-width: 48%; color: var(--jy-muted); font-size: 0.6875rem; text-align: right; }
.jy-preview-link[data-trace-target] { font-weight: 600; background: var(--jy-soft); }
.jy-preview-link[data-trace-target] small { color: var(--jy-ink); }
.jy-relation-preview > [data-action="explore-preview"] { flex: 0 0 auto; min-height: 32px; padding: 5px 0; font-size: 0.75rem; line-height: 1.5; }
/* Local explanations and relationship previews occupy stable sidebar slots. */
@media (min-width: 641px) {
  #jy-app:not([data-space-level="global"]) #jy-home { grid-template-columns: minmax(0, 2.25fr) minmax(0, 7.75fr); }
  #jy-app:not([data-space-level="global"]) .jy-context { grid-row: 1; align-self: end; padding: 0 0 24px; }
  #jy-app:not([data-space-level="global"]) .jy-home-intro { grid-row: 2; align-self: start; padding: 0; }
  #jy-app:not([data-space-level="global"]) .jy-relation-preview { margin-top: 0; max-height: min(240px, 30vh); max-height: min(240px, 30dvh); }
}

.jy-library, .jy-reader { width: min(100%, 1080px); margin: 0 auto; padding: 30px var(--jy-page-gutter) max(40px, env(safe-area-inset-bottom)); }
.jy-branch-links { display: flex; flex-wrap: wrap; gap: 2px 16px; grid-column: 1 / -1; }
.jy-branch-links button { min-height: 44px; padding: 5px 0; font-size: 0.875rem; }
.jy-content-filters { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 0 0 12px; }
.jy-content-filters button { min-height: 44px; padding: 6px 0; font-size: 0.875rem; color: var(--jy-muted); border-radius: 0; }
.jy-content-filters button[aria-pressed="true"] { color: var(--jy-ink); box-shadow: inset 0 -1px currentColor; }
.jy-back-link { margin-left: -8px; padding-inline: 8px; color: var(--jy-muted); font-size: 0.75rem; }
.jy-page-heading { padding: 46px 0 40px; max-width: 720px; }
.jy-page-heading h1 { margin-top: 12px; font-size: clamp(1.875rem, 4vw, 3rem); line-height: 1.25; letter-spacing: -.05em; }
.jy-page-heading > p:last-child { margin-top: 16px; color: var(--jy-muted); font-size: 0.875rem; line-height: 1.8; }
.jy-library .jy-page-heading { padding: 26px 0 22px; }
.jy-library-list > .jy-section-guide { margin-bottom: 8px; }
.jy-library-list > .jy-sample-note { margin-block: 8px 16px; }
.jy-library-list { border-top: 1px solid var(--jy-ink); }
.jy-content-row { display: block; padding: 26px 0; width: 100%; border-bottom: 1px solid var(--jy-border); border-radius: 0; text-decoration: none; }
button.jy-content-row { text-align: left; }
.jy-content-row:hover { background: transparent; }
.jy-content-row h2, .jy-content-row h3 { margin: 7px 0 9px; font-size: clamp(1.125rem, 2vw, 1.4375rem); line-height: 1.5; letter-spacing: -.025em; }
.jy-content-row p { max-width: 720px; color: var(--jy-muted); line-height: 1.85; font-size: 0.875rem; }
.jy-content-row:hover h2, .jy-content-row:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.jy-content-title { display: inline; min-height: 0; padding: 3px 0; border-radius: 0; font: inherit; line-height: inherit; }
.jy-content-title:hover { background: transparent; }
.jy-content-keywords { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; }
.jy-content-row .jy-meta { font-size: 0.8125rem; }
.jy-content-row .jy-keyword, .jy-article-footer .jy-keyword { min-height: 44px; font-size: 0.875rem; }
.jy-context-content > span { display: block; }
.jy-context-content > span + span { margin-top: 3px; }
.jy-context-content .jy-meta { font-size: 0.75rem; }
.jy-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--jy-muted); font-size: 0.6875rem; line-height: 1.7; }
.jy-keyword { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 8px; margin: 8px 7px 0 -3px; font-size: 0.75rem; color: var(--jy-muted); }
.jy-keyword::before { content: "#"; margin-right: 3px; color: var(--jy-line); }
.jy-keywords { display: flex; flex-wrap: wrap; gap: 0 6px; }
.jy-page-footer { border-top: 1px solid var(--jy-border); margin-top: 72px; padding-top: 16px; color: var(--jy-muted); font-size: 0.6875rem; }
.jy-reader { max-width: 960px; }
.jy-article { max-width: 720px; margin: 42px auto 0; overflow-wrap: anywhere; }
.jy-article > header { margin-bottom: 35px; }
.jy-article h1 { font-size: clamp(1.8125rem, 4.2vw, 2.75rem); line-height: 1.45; font-weight: 550; letter-spacing: -.035em; margin: 10px 0 20px; }
.jy-article h2 { margin: 44px 0 14px; font-size: 1.4375rem; line-height: 1.5; }
.jy-article h3 { margin: 30px 0 12px; font-size: 1.125rem; }
.jy-article p { margin: 0 0 24px; font-size: 1rem; line-height: 2; }
.jy-article .jy-meta { font-size: 0.875rem; line-height: 1.7; }
.jy-article .jy-eyebrow { font-size: 0.6875rem; line-height: 1.5; margin-bottom: 8px; }
.jy-article .jy-lead, .jy-article .jy-article-lead { font-size: 1.1875rem; line-height: 1.9; color: var(--jy-muted); }
.jy-article-footer { margin-top: 42px; padding-top: 24px; border-top: 1px solid var(--jy-border); }
.jy-article-footer .jy-meta { margin-bottom: 4px; }
.jy-article blockquote { margin: 32px 0; padding: 4px 0 4px 24px; border-left: 1px solid var(--jy-ink); color: var(--jy-muted); }
.jy-article blockquote p:last-child { margin-bottom: 0; }
.jy-article ul, .jy-article ol { padding-left: 24px; line-height: 2; margin-bottom: 24px; }
.jy-article li + li { margin-top: 8px; }
.jy-article hr { border: 0; border-top: 1px solid var(--jy-border); margin: 36px 0; }
.jy-article table { border-collapse: collapse; width: 100%; margin: 24px 0; font-size: 0.8125rem; }
.jy-article td, .jy-article th { border-bottom: 1px solid var(--jy-border); padding: 12px 8px; text-align: left; }
.jy-article code { background: var(--jy-soft); padding: 2px 4px; font-size: .9em; }
.jy-inline-keyword { display: inline; min-height: 0; padding: 0 1px; border-radius: 0; border-bottom: 1px dotted var(--jy-line); font: inherit; line-height: inherit; }
.jy-inline-keyword:hover { border-bottom-color: var(--jy-ink); background: var(--jy-soft); }
.jy-reader-graph { position: fixed; top: 104px; right: 20px; bottom: 20px; z-index: 20; width: min(380px, calc(100vw - 40px)); padding: 23px; border: 1px solid var(--jy-border); border-radius: 4px; background: var(--jy-surface); box-shadow: 0 16px 64px #00000012; display: flex; flex-direction: column; min-height: 0; }
#jy-app[data-local-open] .jy-reader, #jy-app[data-local-open] .jy-experience-page { width: calc(100% - 420px); max-width: none; margin-left: 0; margin-right: 420px; }
.jy-graph-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.jy-graph-heading h2 { margin-top: 7px; font-size: 1.4375rem; line-height: 1.4; }
.jy-graph-heading > button { flex-shrink: 0; margin-top: -7px; padding-right: 0; color: var(--jy-muted); font-size: 0.75rem; }
.jy-local-space { position: relative; min-height: 130px; flex: 1 1 260px; width: 100%; margin-block: 12px; }
.jy-reader-relations { flex: 0 1 auto; max-height: 33%; overflow-y: auto; overscroll-behavior: contain; }
.jy-relation-row { display: block; width: 100%; border-top: 1px solid var(--jy-border); border-radius: 0; padding: 12px 0; font-size: 0.8125rem; line-height: 1.6; text-decoration: none; }
.jy-relation-row small { display: block; color: var(--jy-muted); font-size: 0.6875rem; margin-top: 3px; }
.jy-relation-row > .jy-keyword { margin-top: 0; margin-bottom: 2px; padding-left: 0; min-height: 36px; font-size: 0.9375rem; color: var(--jy-ink); }
.jy-relation-row > .jy-meta { font-size: 0.75rem; }
.jy-relation-row > p { margin: 8px 0 4px; color: var(--jy-muted); font-size: 0.875rem; line-height: 1.75; }
.jy-relation-source { display: block; width: 100%; padding: 7px 0; border-radius: 0; min-height: 44px; font-size: 0.8125rem; line-height: 1.7; text-align: left; }
.jy-reader-definition { flex: 0 0 auto; margin-top: 12px; color: var(--jy-muted); font-size: 0.8125rem; line-height: 1.8; }
.jy-journey-steps { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 8px; }
.jy-journey-steps button { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 5px 0; color: var(--jy-muted); font-size: 0.75rem; text-align: center; white-space: nowrap; border-radius: 0; border-bottom: 1px solid var(--jy-border); }
.jy-journey-steps [aria-current="step"] { color: var(--jy-ink); border-bottom-color: var(--jy-ink); font-weight: 550; }
#jy-context-links > .jy-journey-read { text-decoration: underline; text-underline-offset: 5px; }
#jy-context-links > .jy-journey-next { margin-top: 6px; color: var(--jy-muted); }
.jy-reader-journey { max-width: 720px; margin: 24px auto 0; }
.jy-reader-journey .jy-journey-steps { max-width: 360px; margin-top: 8px; }
.jy-journey-continuation { margin-top: 36px; padding-block: 20px; border-block: 1px solid var(--jy-border); }
.jy-journey-continuation p { margin-bottom: 8px; font-size: 0.875rem; color: var(--jy-muted); }
.jy-journey-continuation button { min-height: 44px; padding-inline: 0; font-size: 0.9375rem; text-decoration: underline; text-underline-offset: 5px; }
.jy-article [data-focus-key^="block-"]:focus { outline: none; }
.jy-article [data-focus-key^="block-"]:focus-visible { outline: 1px solid var(--jy-line); outline-offset: 8px; }

.jy-dialog { width: min(620px, calc(100% - 32px)); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); padding: 0; border: 0; background: transparent; color: var(--jy-ink); overflow: visible; }
.jy-dialog::backdrop { background: #00000032; backdrop-filter: blur(3px); }
.jy-dialog-panel { max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; padding: 28px 32px 32px; background: var(--jy-surface); border: 1px solid var(--jy-border); border-radius: 5px; box-shadow: 0 24px 80px #0000001f; }
.jy-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.jy-dialog-heading h2 { font-size: 1.375rem; }
.jy-dialog-heading button { margin-right: -8px; color: var(--jy-muted); padding-inline: 8px; font-size: 0.75rem; }
.jy-word-dialog { width: min(500px, calc(100% - 32px)); }
.jy-word-dialog h2 { font-size: 1.6875rem; line-height: 1.4; letter-spacing: -.03em; }
#jy-word-definition { margin-block: 16px 24px; font-size: 1rem; line-height: 1.9; }
#jy-word-context { margin: 8px 0 20px; padding-left: 16px; border-left: 1px solid var(--jy-border); color: var(--jy-muted); font-size: 0.8125rem; line-height: 1.85; }
.jy-word-expand { min-height: 44px; padding: 8px 0; font-size: 0.875rem; text-decoration: underline; text-underline-offset: 5px; }
.jy-search-form label { display: block; margin-bottom: 18px; font-size: 1.625rem; line-height: 1.4; letter-spacing: -.04em; }
.jy-search-input-row { display: flex; gap: 10px; border-bottom: 1px solid var(--jy-ink); padding-bottom: 8px; }
.jy-search-input-row input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 4px; border: 0; border-radius: 0; background: var(--jy-surface); color: var(--jy-ink); font-size: 1rem; }
.jy-search-input-row input::placeholder { color: var(--jy-muted); opacity: 1; }
.jy-search-input-row button { flex-shrink: 0; font-size: 0.8125rem; }
.jy-search-results { padding-top: 20px; }
.jy-index-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 24px; }
.jy-index-list > button, .jy-index-list > a { padding: 12px 0; border-top: 1px solid var(--jy-border); border-radius: 0; font-size: 0.8125rem; text-decoration: none; }
.jy-index-list > .jy-index-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px; font-size: 0.9375rem; }
.jy-index-item > .jy-meta { flex-shrink: 0; font-size: 0.75rem; }
.jy-search-result { display: grid; gap: 8px; width: 100%; padding: 20px 4px; border-bottom: 1px solid var(--jy-border); border-radius: 0; text-align: left; }
.jy-search-result > strong { font-size: 1.0625rem; line-height: 1.5; font-weight: 550; }
.jy-search-result > span { font-size: 0.875rem; color: var(--jy-muted); line-height: 1.8; }
.jy-empty { padding: 24px 0; font-size: 0.875rem; color: var(--jy-muted); line-height: 1.9; }
.jy-search-results .jy-content-row { padding-block: 18px; }
.jy-search-results .jy-content-row h2, .jy-search-results .jy-content-row h3 { font-size: 1.0625rem; }
.jy-empty-state { padding-block: 20px; color: var(--jy-muted); font-size: 0.8125rem; }
.jy-appearance-dialog { width: min(450px, calc(100% - 32px)); }
.jy-muted { color: var(--jy-muted); font-size: 0.8125rem; }
.jy-theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0 30px; }
.jy-theme-options button { text-align: center; border: 1px solid var(--jy-border); min-height: 52px; font-size: 0.8125rem; }
.jy-theme-options button[aria-pressed="true"] { color: var(--jy-bg); background: var(--jy-ink); border-color: var(--jy-ink); }
.jy-motion-option { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; border-top: 1px solid var(--jy-border); font-size: 0.875rem; cursor: pointer; }
.jy-motion-option small { display: block; margin-top: 6px; font-size: 0.6875rem; color: var(--jy-muted); line-height: 1.8; }
.jy-motion-option input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--jy-ink); }
.jy-noscript { position: fixed; left: 20px; bottom: 20px; right: 20px; z-index: 40; padding: 16px; background: var(--jy-surface); border: 1px solid var(--jy-border); font-size: 0.8125rem; }

.jy-motion-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0 24px; }
.jy-motion-controls button { min-height: 44px; padding: 10px; border: 1px solid var(--jy-border); font-size: 0.8125rem; text-align: center; }
.jy-motion-controls button[aria-pressed="true"] { background: var(--jy-soft); border-color: var(--jy-ink); }
.jy-motion-controls button:disabled { opacity: .5; }
.jy-profile-card { max-width: 720px; margin: 12px 0 36px; padding-bottom: 28px; border-bottom: 1px solid var(--jy-border); }
.jy-profile-card h2 { margin-bottom: 12px; font-size: 1.625rem; line-height: 1.4; letter-spacing: -.035em; }
.jy-profile-card p { margin-top: 10px; color: var(--jy-muted); font-size: 0.9375rem; line-height: 1.85; }
.jy-profile-card .jy-meta { font-size: 0.8125rem; }
.jy-profile-contributions { margin-top: 28px; }
.jy-profile-contributions > h2 { margin-bottom: 18px; font-size: 1.25rem; }
.jy-contribution-row { display: block; width: 100%; padding: 20px 0; border-bottom: 1px solid var(--jy-border); border-radius: 0; text-align: left; }
.jy-contribution-row p { margin: 8px 0; font-size: 0.875rem; line-height: 1.85; }
.jy-contribution-row .jy-meta { font-size: 0.75rem; }
#jy-contribution-dialog .jy-action-evidence > p { margin: 16px 0; font-size: 1rem; line-height: 1.95; overflow-wrap: anywhere; }
#jy-contribution-dialog .jy-action-evidence .jy-meta { margin-block: 12px; font-size: 0.8125rem; line-height: 1.75; }
#jy-contribution-dialog .jy-content-keywords { margin: 14px 0 20px; }
#jy-contribution-dialog .jy-action-evidence > button { display: block; width: 100%; min-height: 44px; padding: 11px 0; border-top: 1px solid var(--jy-border); border-radius: 0; font-size: 0.875rem; line-height: 1.7; text-align: left; }

.jy-experience-page { width: min(100%, 1120px); min-width: 0; margin: 0 auto; padding: 30px var(--jy-page-gutter) max(48px, env(safe-area-inset-bottom)); overflow-wrap: anywhere; }
.jy-experience-page > h2 { margin: 32px 0 16px; font-size: 1.5rem; line-height: 1.5; letter-spacing: -.025em; }
.jy-experience-page > h3 { margin: 28px 0 12px; font-size: 1.1875rem; line-height: 1.5; }
.jy-experience-page > p:not([class]) { max-width: 800px; margin: 14px 0 24px; font-size: 1rem; line-height: 1.9; }
.jy-experience-page blockquote { max-width: 800px; margin: 22px 0 30px; padding: 8px 0 8px 20px; border-left: 1px solid var(--jy-line); font-size: 1rem; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.jy-experience-page pre, .jy-experience-page .jy-run-card pre { max-width: 100%; margin: 18px 0; padding: 16px; background: var(--jy-soft); color: var(--jy-ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.875rem; line-height: 1.9; }
.jy-experience-page > ul, .jy-experience-page > ol { max-width: 820px; margin: 12px 0 28px; padding-left: 24px; font-size: 0.9375rem; line-height: 1.9; }
.jy-experience-page > ul > li + li, .jy-experience-page > ol > li + li { margin-top: 12px; }
.jy-experience-page > ol > li > p { margin: 6px 0 16px; color: var(--jy-muted); }
.jy-experience-page dl:not(.jy-condition-grid), .jy-guide-details dl { margin: 16px 0 22px; font-size: 0.875rem; line-height: 1.85; }
.jy-experience-page dl:not(.jy-condition-grid) dt, .jy-guide-details dt { margin-top: 14px; color: var(--jy-ink); font-weight: 550; }
.jy-experience-page dl:not(.jy-condition-grid) dd, .jy-guide-details dd { margin: 5px 0 16px; color: var(--jy-muted); }
.jy-experience-heading { max-width: 800px; padding: 34px 0 28px; }
.jy-experience-heading h1 { margin: 10px 0 16px; font-size: clamp(1.875rem, 3.8vw, 2.875rem); line-height: 1.35; letter-spacing: -.04em; }
.jy-experience-heading > p { color: var(--jy-muted); font-size: 0.9375rem; line-height: 1.9; }
.jy-experience-heading > .jy-eyebrow { font-size: 0.75rem; line-height: 1.5; }
.jy-section-guide { max-width: 800px; margin: 14px 0 30px; font-size: 0.9375rem; line-height: 1.85; }
.jy-section-guide > p { margin-bottom: 10px; }
.jy-guide-details { margin-top: 12px; color: var(--jy-muted); font-size: 0.875rem; line-height: 1.85; }
.jy-guide-details summary { width: fit-content; min-height: 44px; padding: 8px 0; cursor: pointer; color: var(--jy-ink); }
.jy-guide-details summary:focus-visible { outline: 2px solid var(--jy-ink); outline-offset: 4px; }
.jy-guide-details[open] summary { margin-bottom: 8px; }
.jy-guide-details p + p, .jy-guide-details li + li { margin-top: 8px; }
.jy-guide-details ul, .jy-guide-details ol { margin: 8px 0 16px; padding-left: 22px; }
.jy-guide-note { margin: 16px 0; padding-left: 16px; border-left: 1px solid var(--jy-line); color: var(--jy-muted); font-size: 0.875rem; line-height: 1.85; }
.jy-entry-shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 20px 0 28px; }
.jy-entry-shortcuts > button, .jy-entry-shortcuts > a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; font-size: 0.875rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.jy-sample-note { margin: 16px 0 24px; color: var(--jy-muted); font-size: 0.8125rem; line-height: 1.8; }
.jy-example-author { display: block; margin: 8px 0 12px; color: var(--jy-muted); font-size: 0.8125rem; line-height: 1.75; }
button.jy-example-author { min-height: 36px; padding: 5px 0; }
.jy-flow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 16px; margin: 14px 0 32px; padding: 0; list-style: none; }
.jy-flow-steps > li, .jy-flow-steps > button, .jy-flow-steps > a { min-width: 0; border-bottom: 1px solid var(--jy-border); border-radius: 0; color: var(--jy-muted); font-size: 0.875rem; line-height: 1.7; }
.jy-flow-steps > button, .jy-flow-steps > a, .jy-flow-steps > li > button { display: block; width: 100%; min-height: 48px; padding: 10px 0; text-align: left; text-decoration: none; }
.jy-flow-steps [aria-current="step"], .jy-flow-steps [aria-selected="true"], .jy-flow-steps > [aria-current="step"] { color: var(--jy-ink); border-bottom-color: var(--jy-ink); font-weight: 550; }
.jy-step-intro { max-width: 800px; margin-bottom: 26px; }
.jy-step-intro h2 { margin-bottom: 12px; font-size: 1.5rem; line-height: 1.45; letter-spacing: -.025em; }
.jy-step-intro p { color: var(--jy-muted); font-size: 0.9375rem; line-height: 1.9; }
.jy-condition-grid, .jy-evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px; margin: 22px 0 30px; }
.jy-condition-grid > *, .jy-evidence-grid > * { min-width: 0; margin: 0; padding: 18px 0; border-top: 1px solid var(--jy-border); }
.jy-condition-grid h3, .jy-evidence-grid h3 { margin-bottom: 8px; font-size: 1.0625rem; line-height: 1.5; }
.jy-condition-grid p, .jy-evidence-grid p, .jy-condition-grid dd, .jy-evidence-grid dd { margin: 6px 0 0; color: var(--jy-muted); font-size: 0.875rem; line-height: 1.85; }
.jy-condition-grid dt, .jy-evidence-grid dt { font-size: 0.875rem; font-weight: 550; }
dl.jy-condition-grid { grid-template-columns: minmax(100px, .6fr) minmax(0, 2fr); column-gap: 22px; }
dl.jy-condition-grid > dt, dl.jy-condition-grid > dd { margin: 0; padding: 13px 0; line-height: 1.85; }
.jy-run-card { min-width: 0; margin: 24px 0; padding: 24px 0; border-block: 1px solid var(--jy-border); }
.jy-run-card h2, .jy-run-card h3 { margin-bottom: 14px; font-size: 1.3125rem; line-height: 1.5; }
.jy-run-card p { margin: 12px 0; font-size: 0.9375rem; line-height: 1.9; }
.jy-run-card pre { max-width: 100%; overflow-x: auto; margin: 18px 0; padding: 16px; background: var(--jy-soft); font-size: 0.8125rem; line-height: 1.8; }
.jy-table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; margin: 22px 0 30px; }
.jy-evaluation-table { width: 100%; min-width: 620px; border-collapse: collapse; text-align: left; font-size: 0.875rem; line-height: 1.8; }
.jy-evaluation-table caption { padding: 0 0 12px; text-align: left; color: var(--jy-muted); font-size: 0.8125rem; }
.jy-evaluation-table th, .jy-evaluation-table td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--jy-border); vertical-align: top; }
.jy-evaluation-table thead th { border-bottom-color: var(--jy-ink); font-weight: 550; }
.jy-evaluation-table tbody th { font-weight: 500; }
.jy-demo-form { max-width: 800px; margin: 24px 0; }
.jy-demo-form fieldset { min-width: 0; margin: 24px 0; padding: 20px 0 0; border: 0; border-top: 1px solid var(--jy-border); }
.jy-demo-form legend { max-width: 100%; padding: 0 12px 0 0; font-size: 1.0625rem; font-weight: 550; line-height: 1.6; }
.jy-demo-form label { display: block; margin: 18px 0 8px; font-size: 0.875rem; line-height: 1.8; }
.jy-demo-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .jy-demo-form select, .jy-demo-form textarea { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 46px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--jy-line); border-radius: 3px; background: var(--jy-surface); color: var(--jy-ink); font-size: 1rem; line-height: 1.7; }
.jy-demo-form textarea { min-height: 140px; resize: vertical; }
.jy-demo-form > label + input, .jy-demo-form > label + select, .jy-demo-form > label + textarea { margin-top: 0; }
.jy-demo-form > button[type="submit"] { min-height: 44px; margin-top: 16px; padding: 10px 16px; border: 1px solid var(--jy-border); font-size: 0.875rem; }
.jy-demo-form [data-form-status] > p { margin: 18px 0 12px; font-size: 0.875rem; line-height: 1.85; }
.jy-demo-form input[type="checkbox"], .jy-demo-form input[type="radio"] { width: 18px; height: 18px; margin: 0 8px 0 0; accent-color: var(--jy-ink); vertical-align: middle; }
.jy-demo-form :disabled { color: var(--jy-muted); background: var(--jy-soft); }
.jy-field-hint { margin: 6px 0 16px; color: var(--jy-muted); font-size: 0.8125rem; line-height: 1.8; }
.jy-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 26px 0 18px; }
.jy-form-actions > button, .jy-form-actions > a { min-height: 44px; padding: 10px 18px; border: 1px solid var(--jy-border); border-radius: 3px; font-size: 0.875rem; line-height: 1.7; text-decoration: none; }
.jy-form-actions > button[type="submit"] { background: var(--jy-ink); border-color: var(--jy-ink); color: var(--jy-bg); }
.jy-workspace-grid, .jy-catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 34px; margin: 28px 0; }
.jy-workspace-panel, .jy-catalog-card { min-width: 0; padding: 22px 0; border-top: 1px solid var(--jy-border); }
.jy-workspace-panel h2, .jy-workspace-panel h3, .jy-catalog-card h2, .jy-catalog-card h3 { margin-bottom: 12px; font-size: 1.3125rem; line-height: 1.45; }
.jy-workspace-panel p, .jy-catalog-card p { margin: 10px 0; color: var(--jy-muted); font-size: 0.875rem; line-height: 1.85; }
.jy-workspace-panel button, .jy-catalog-card button { padding-inline: 0; font-size: 0.875rem; }
.jy-empty-note { max-width: 740px; padding: 20px 0; color: var(--jy-muted); font-size: 0.875rem; line-height: 1.9; }

@media (min-width: 641px) and (max-width: 1040px) {
  .jy-header { gap: 12px; }
  .jy-navigation { gap: 0; }
  .jy-navigation button { padding-inline: 5px; font-size: 0.8125rem; }
  .jy-header-tools { gap: 0; }
  .jy-header-tools button { min-width: 40px; padding-inline: 6px; }
  .jy-key-hint { display: none; }
}

@media (min-width: 1600px) {
  .jy-header { min-height: 94px; }
}

@media (max-width: 900px) {
  .jy-header { gap: 12px; }
  .jy-navigation { gap: 0; }
  .jy-navigation button { font-size: 0.8125rem; padding-inline: 6px; }
  .jy-header-tools { gap: 0; }
  .jy-key-hint { display: none; }
}

@media (max-width: 1000px) {
  #jy-app[data-local-open] .jy-reader { width: min(100%, 960px); margin-inline: auto; }
  #jy-app[data-local-open] .jy-experience-page { width: min(100%, 1120px); margin-inline: auto; }
  body[data-local-open] { overflow: hidden; }
  .jy-reader-graph { inset: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); width: min(560px, calc(100% - 36px)); margin-inline: auto; box-shadow: 0 0 0 100vmax #00000040; }
}

@media (min-width: 641px) and (max-height: 780px) {
  .jy-home-intro h1 { font-size: clamp(1.875rem, 3.1vw, 2.875rem); margin-top: 12px; }
  .jy-home-description { margin-top: 14px; font-size: 0.8125rem; }
  .jy-context { padding-top: 8px; }
  .jy-context h1 { font-size: 1.5rem; }
  #jy-context-description { margin-bottom: 7px; line-height: 1.65; }
}

@media (min-width: 641px) and (max-height: 660px) {
  .jy-header { min-height: 62px; padding-block: 8px; }
  #jy-home { padding-top: 0; padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .jy-home-intro { padding-bottom: 8px; }
  .jy-home-intro .jy-eyebrow { display: none; }
  .jy-home-intro h1 { margin-top: 0; font-size: clamp(1.6875rem, 3.1vw, 2.3125rem); line-height: 1.3; }
  .jy-home-description { margin-top: 10px; font-size: 0.75rem; line-height: 1.65; }
  .jy-context h1 { margin-bottom: 5px; font-size: 1.375rem; }
  #jy-context-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.75rem; line-height: 1.5; }
  #jy-context-links > .jy-context-content ~ .jy-context-content { display: none; }
  #jy-context-links > button, #jy-context-links > a { min-height: 32px; padding-block: 4px; font-size: 0.75rem; }
  .jy-space-toolbar { min-height: 40px; padding-top: 0; }
  .jy-space-actions button { min-height: 38px; }
}

@media (min-width: 641px) and (max-height: 460px) {
  :root { --jy-page-gutter: 24px; }
  .jy-header { min-height: 52px; padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 4px; }
  #jy-home { column-gap: 18px; }
  .jy-home-intro h1 { font-size: 1.5625rem; }
  .jy-home-description { display: none; }
  .jy-context { padding-top: 4px; }
  .jy-context h1 { font-size: 1.1875rem; }
  #jy-context-description { -webkit-line-clamp: 1; }
  #jy-context-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
  #jy-context-links > .jy-context-content { grid-column: 1 / -1; }
  .jy-relation-preview { max-height: 150px; margin-top: 4px; padding-block: 4px; gap: 2px; }
  #jy-app[data-preview-open] .jy-home-intro h1 { display: none; }
  .jy-reader-graph { top: 12px; bottom: 12px; }
  .jy-local-space { min-height: 80px; margin-block: 2px; }
}

@media (max-width: 640px) {
  :root { --jy-page-gutter: 20px; }
  .jy-header { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; min-height: 0; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 0; }
  .jy-brand { font-size: 1.5rem; justify-self: start; }
  .jy-header-tools { grid-column: 2; grid-row: 1; }
  .jy-header-tools button { min-width: 40px; padding-inline: 6px; }
  .jy-navigation { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; margin: 0 -4px; }
  .jy-navigation button { min-height: 42px; padding-inline: 4px; font-size: 0.8125rem; }
  #jy-home { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; padding-top: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  /* The fixed slot keeps the sphere stable; with larger user fonts it may grow instead of clipping. */
  .jy-home-intro, #jy-app[data-space-level="global"] .jy-home-intro { position: relative; grid-column: 1; grid-row: 1; align-self: auto; height: auto; min-height: 124px; padding-bottom: 0; }
  .jy-home-intro h1 { margin-top: 0; font-size: clamp(1.375rem, 6vw, 1.625rem); letter-spacing: -.045em; line-height: 1.4; }
  .jy-home-intro .jy-eyebrow { display: none; }
  .jy-slogan-line { display: inline; }
  .jy-home-description { margin-top: 6px; font-size: 0.75rem; line-height: 1.6; }
  #jy-app[data-space-level="global"] .jy-home-description { display: none; }
  .jy-discovery-start { min-height: 44px; margin-top: 4px; padding: 4px 0; font-size: 0.75rem; }
  .jy-exploration-bar { grid-column: 1; grid-row: 2; gap: 4px; min-height: 36px; }
  .jy-exploration-tools { gap: 0; }
  .jy-exploration-tools button { padding-inline: 4px; }
  .jy-breadcrumbs { gap: 0 2px; }
  .jy-breadcrumbs button { flex: 1 1 auto; padding-inline: 2px; }
  .jy-breadcrumbs button:last-child { flex-grow: 2; }
  .jy-space-stage { position: relative; display: grid; grid-column: 1; grid-row: 3; grid-template-columns: minmax(0, 1fr); min-height: 0; min-width: 0; }
  #jy-app:not([data-space-level="global"]) .jy-space-stage { grid-template-rows: minmax(0, 1fr) auto; gap: 4px; }
  .jy-main-space { grid-column: 1; grid-row: 1; width: 100%; height: 100%; align-self: auto; }
  .jy-context { display: grid; grid-column: 1; grid-row: 2; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); column-gap: 10px; padding: 3px 0 2px; }
  .jy-context h1 { margin: 0 0 4px; font-size: 1.1875rem; }
  #jy-app:not([data-space-level="global"]) .jy-space-stage { display: contents; }
  #jy-app:not([data-space-level="global"]) .jy-main-space { grid-column: 1; grid-row: 3; }
  #jy-app:not([data-space-level="global"]) .jy-context { grid-column: 1; grid-row: 1; align-self: center; height: auto; min-height: 124px; padding: 0; align-content: center; }
  #jy-app:not([data-space-level="global"]) .jy-home-intro { pointer-events: none; }
  #jy-app:not([data-space-level="global"]) .jy-relation-preview { pointer-events: auto; }
  #jy-app[data-preview-open] .jy-context { visibility: hidden; }
  .jy-context .jy-branch-links { gap: 0; flex-wrap: nowrap; justify-content: space-between; }
  .jy-context .jy-branch-links button { min-height: 44px; font-size: 0.75rem; padding: 2px 0; }
  #jy-context-description { grid-column: 1; margin-bottom: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.75rem; line-height: 1.55; }
  #jy-context-links { grid-column: 2; grid-row: 1 / 3; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; min-width: 0; }
  #jy-context-links > button, #jy-context-links > a { min-height: 36px; padding: 2px 0; font-size: 0.75rem; line-height: 1.5; }
  #jy-context-links > .jy-context-content { grid-column: 1 / -1; }
  #jy-context-links > .jy-context-content ~ .jy-context-content { display: none; }
  #jy-context-links[data-single] > .jy-context-all { grid-column: 1 / -1; }
  .jy-context-content > span + span { margin-top: 1px; }
  .jy-context-content > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .jy-person-actions { grid-column: 1 / -1; gap: 0 12px; margin-top: 0; }
  .jy-person-actions button, .jy-person-actions a { min-height: 32px; font-size: 0.75rem; }
  .jy-space-toolbar { display: grid; grid-column: 1; grid-row: 4; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 4px; min-height: 0; padding-top: 0; }
  #jy-space-caption { grid-column: 1 / -1; max-width: none; min-height: 17px; font-size: 0.6875rem; line-height: 1.5; }
  .jy-depth-controls { grid-column: 1; gap: 0; }
  .jy-depth-controls button { min-width: 44px; min-height: 44px; padding-inline: 4px; font-size: 0.8125rem; white-space: nowrap; }
  .jy-space-actions { grid-column: 2; gap: 2px; }
  .jy-space-actions button { min-width: 44px; min-height: 44px; padding-inline: 2px; font-size: 0.75rem; }
  .jy-action-full { display: none; }
  .jy-action-compact { display: inline; }
  .jy-preview-note { grid-column: 1; grid-row: 5; padding-top: 3px; font-size: 0.6875rem; }
  .jy-preview-note > span { max-width: none; }
  .jy-presentation-switch { flex-shrink: 0; }
  .jy-presentation-switch button { padding-inline: 8px; font-size: 0.75rem; }
  #jy-app[data-preview-open] .jy-home-intro > div { visibility: hidden; }
  .jy-relation-preview { position: absolute; inset: 0; height: 100%; min-height: 124px; max-height: none; margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 44px 36px minmax(44px, 1fr); gap: 0 12px; }
  .jy-relation-heading { grid-column: 1; grid-row: 1; min-width: 0; gap: 6px; }
  .jy-relation-heading strong { font-size: 0.875rem; }
  .jy-relation-heading button { min-height: 44px; min-width: 44px; flex-basis: 44px; }
  #jy-relation-description { display: -webkit-box; grid-column: 1 / -1; grid-row: 2; -webkit-line-clamp: 2; font-size: 0.75rem; line-height: 18px; }
  .jy-relation-list { grid-column: 1 / -1; grid-row: 3; display: flex; gap: 14px; min-height: 44px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .jy-preview-link { flex: 0 0 auto; width: auto; min-height: 44px; gap: 0; padding: 2px 6px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; font-size: 0.75rem; line-height: 1.45; }
  .jy-preview-link small { max-width: none; font-size: 0.6875rem; text-align: left; }
  .jy-preview-evidence { min-height: 44px; padding: 4px 6px; font-size: 0.6875rem; }
  .jy-relation-preview > [data-action="explore-preview"] { grid-column: 2; grid-row: 1; min-height: 44px; padding: 0; font-size: 0.6875rem; }
  #jy-app[data-journey-open] #jy-context-links { display: flex; flex-direction: column; gap: 0; align-self: center; }
  #jy-app[data-journey-open] #jy-context-description { -webkit-line-clamp: 3; }
  #jy-app[data-journey-open] .jy-journey-steps { gap: 6px; margin-bottom: 0; }
  #jy-app[data-journey-open] .jy-journey-steps button { min-height: 36px; font-size: 0.6875rem; }
  #jy-context-links > .jy-journey-read, #jy-context-links > .jy-journey-next { min-height: 44px; margin: 0; }
  .jy-library, .jy-reader { padding-top: 18px; }
  .jy-page-heading { padding: 28px 0 32px; }
  .jy-page-heading > p:last-child { font-size: 0.8125rem; }
  .jy-content-row { padding-block: 22px; }
  .jy-content-row p { font-size: 0.8125rem; }
  .jy-article { margin-top: 26px; }
  .jy-article h1 { font-size: 1.8125rem; line-height: 1.5; }
  .jy-article h2 { font-size: 1.3125rem; }
  .jy-article p { font-size: 1rem; line-height: 1.95; }
  .jy-article .jy-lead, .jy-article .jy-article-lead { font-size: 1.125rem; }
  .jy-reader-graph { inset: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); width: auto; padding: 20px; box-shadow: 0 0 0 100vmax #00000040; }
  .jy-local-space { flex-basis: 220px; }
  .jy-reader-relations { max-height: 35%; }
  .jy-dialog-panel { padding: 18px 20px 24px; }
  .jy-dialog-heading { margin-bottom: 18px; }
  .jy-search-form label { font-size: 1.5rem; }
  .jy-profile-card { margin-bottom: 26px; padding-bottom: 22px; }
  .jy-profile-card h2 { font-size: 1.4375rem; }
  .jy-profile-card p { font-size: 0.875rem; }
  .jy-experience-page { padding-top: 18px; }
  .jy-experience-page > h2 { font-size: 1.3125rem; }
  .jy-experience-page > h3 { font-size: 1.125rem; }
  .jy-experience-page blockquote { padding-left: 16px; }
  .jy-experience-heading { padding: 24px 0 20px; }
  .jy-experience-heading h1 { font-size: 1.8125rem; }
  .jy-experience-heading > p, .jy-step-intro p { font-size: 0.875rem; }
  .jy-section-guide { margin-bottom: 24px; font-size: 0.875rem; }
  .jy-entry-shortcuts { gap: 4px 18px; margin-block: 14px 24px; }
  .jy-flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin-bottom: 26px; }
  .jy-step-intro h2 { font-size: 1.3125rem; }
  .jy-condition-grid, .jy-evidence-grid, .jy-workspace-grid, .jy-catalog-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.jy-condition-grid { grid-template-columns: minmax(76px, .7fr) minmax(0, 1.7fr); column-gap: 14px; }
  .jy-run-card { margin-block: 18px; padding-block: 18px; }
  .jy-demo-form fieldset { margin-block: 20px; }
  .jy-form-actions { gap: 8px; }
  .jy-form-actions > button, .jy-form-actions > a { padding-inline: 14px; }
}

@media (max-width: 640px) and (max-height: 640px) {
  #jy-home { padding-top: 5px; padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .jy-home-intro, #jy-app[data-space-level="global"] .jy-home-intro { padding-bottom: 0; }
  .jy-home-intro h1 { font-size: 1.375rem; }
  #jy-context-description { -webkit-line-clamp: 1; }
  #jy-app:not([data-space-level="global"]) .jy-home-description { display: none; }
}

/* Landscape phones and heavily zoomed small windows: the portrait stack has no room left for the sphere,
   so text and context move to a left column and the sphere keeps the right column at full height. */
@media (max-width: 640px) and (max-height: 460px) {
  .jy-header { grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 8px; padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 2px; }
  .jy-brand { font-size: 1.25rem; }
  .jy-navigation { grid-column: 2; grid-row: 1; justify-content: center; margin: 0; }
  .jy-navigation button { min-height: 36px; padding-inline: 4px; font-size: 0.75rem; }
  .jy-header-tools { grid-column: 3; grid-row: 1; }
  .jy-header-tools button { min-height: 36px; }
  #jy-home { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 12px; padding-top: 2px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  .jy-home-intro, #jy-app[data-space-level="global"] .jy-home-intro, #jy-app:not([data-space-level="global"]) .jy-home-intro { grid-column: 1; grid-row: 1 / 3; height: auto; min-height: 124px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
  .jy-home-intro h1 { font-size: 1.25rem; line-height: 1.3; }
  .jy-home-description { display: none; }
  .jy-exploration-bar { grid-column: 2; grid-row: 1; min-height: 30px; }
  .jy-exploration-tools button { min-height: 30px; }
  /* The context aside is a child of the stage, so the stage stays display: contents and both land in the page grid. */
  .jy-space-stage, #jy-app:not([data-space-level="global"]) .jy-space-stage { display: contents; }
  .jy-main-space, #jy-app:not([data-space-level="global"]) .jy-main-space { grid-column: 2; grid-row: 2; width: 100%; height: 100%; min-height: 120px; align-self: stretch; }
  .jy-context, #jy-app:not([data-space-level="global"]) .jy-context { display: flex; flex-direction: column; justify-content: center; grid-column: 1; grid-row: 1 / 3; height: auto; min-height: 124px; align-self: stretch; padding: 0; }
  .jy-context h1 { font-size: 1.0625rem; margin-bottom: 2px; }
  #jy-context-description { display: -webkit-box; -webkit-line-clamp: 2; }
  #jy-context-links { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  #jy-context-links > .jy-context-content ~ .jy-context-content { display: none; }
  .jy-relation-preview { grid-template-rows: 44px minmax(36px, auto) minmax(44px, 1fr); }
  .jy-space-toolbar { display: flex; grid-column: 1 / -1; grid-row: 3; justify-content: space-between; min-height: 36px; gap: 8px; }
  #jy-space-caption { display: none; }
  .jy-depth-controls button, .jy-space-actions button { min-height: 36px; }
  .jy-preview-note { display: none; }
}

/* Below this height a single screen cannot hold the header, text and a usable sphere: let the page scroll. */
@media (max-height: 300px) {
  body[data-view="home"] { overflow: auto; }
  #jy-app[data-view="home"] { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  #jy-home { height: auto; }
  .jy-main-space, #jy-app:not([data-space-level="global"]) .jy-main-space { min-height: 200px; }
}

@media (max-width: 640px) and (max-height: 660px) {
  #jy-app[data-view="home"][data-space-level="person"] .jy-context { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 12px; min-height: 68px; padding: 8px 0; }
  #jy-app[data-view="home"][data-space-level="person"] .jy-context h1 { grid-column: 1; grid-row: 1; margin: 0; font-size: 1.125rem; line-height: 1.4; }
  #jy-app[data-view="home"][data-space-level="person"] #jy-context-description,
  #jy-app[data-view="home"][data-space-level="person"] .jy-context .jy-person-actions { display: none; }
  #jy-app[data-view="home"][data-space-level="person"] #jy-context-links { display: block; grid-column: 2; grid-row: 1; }
  #jy-app[data-view="home"][data-space-level="person"] #jy-context-links > [data-action="open-current-list"] { min-height: 44px; padding: 3px 0; font-size: 0.8125rem; line-height: 1.6; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.jy-prewrap { white-space: pre-wrap; }
.jy-index-group { grid-column: 1 / -1; margin: 18px 0 2px; color: var(--jy-muted); font-size: 0.75rem; font-weight: 500; letter-spacing: .06em; }
.jy-index-list > .jy-index-group:first-child { margin-top: 0; }
.jy-error { position: fixed; left: 20px; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 14px 18px; background: var(--jy-surface); color: var(--jy-ink); border: 1px solid var(--jy-ink); font-size: 0.875rem; line-height: 1.6; box-shadow: 0 16px 48px #00000024; }
.jy-error p { flex: 1 1 240px; }
.jy-error a { text-underline-offset: 4px; }

/* Windows high contrast and similar forced palettes: selection state must not rely on our own colours alone. */
@media (forced-colors: active) {
  .jy-theme-options button[aria-pressed="true"], .jy-form-actions > button[type="submit"], .jy-motion-controls button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  .jy-content-filters button[aria-pressed="true"], .jy-presentation-switch button[aria-pressed="true"], .jy-depth-controls button[aria-pressed="true"], .jy-navigation button[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
  .jy-inline-keyword { border-bottom: 1px solid LinkText; }
  .jy-reader-graph, .jy-dialog-panel, .jy-error { border: 1px solid CanvasText; }
  .jy-space-placeholder { border-color: CanvasText; }
}
