/* Golden Era · shared public UI. Earth owns its canvas and workspace layout. */
:root {
  color-scheme: dark;
  --surface: #0e100e;
  --surface-raised: #171a16;
  --surface-warm: #20221b;
  --text: #efeee6;
  --text-secondary: #b9bcb1;
  --text-muted: #999f93;
  --accent: #d8bc83;
  --accent-pale: #f0dfb7;
  --line: rgba(221, 218, 196, .15);
  --line-strong: rgba(216, 188, 131, .44);
  --blue: #c6cdbb;
  --radius: 12px;
  --radius-control: 8px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}
body { color: var(--text); background: var(--surface); font-family: var(--font-ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { text-underline-offset: .2em; }
::selection { color: var(--text); background: #605137; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.view { scrollbar-color: #656b5e var(--surface); scrollbar-width: thin; transform:none; transition:opacity 180ms ease-out,visibility 180ms; }
.view:not(.is-active) { pointer-events: none; }
.skip-link { position: fixed; z-index: 150; top: 12px; left: 12px; padding: 12px 16px; transform: translateY(-160%); border: 1px solid var(--accent); border-radius: var(--radius-control); color: #181b13; background: var(--accent-pale); font-size: 14px; text-decoration: none; }
.skip-link:focus { transform: translateY(0); }
.no-script { position: fixed; z-index: 140; top: 24px; left: 24px; max-width: min(640px, calc(100% - 48px)); padding: 24px; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); background: var(--surface-raised); font-size: 14px; line-height: 1.7; }
.no-script a, .brand-link:hover .brand-text { color: var(--accent-pale); }
.brand-link { color: inherit; text-decoration: none; }

/* One navigation scale. The Earth stylesheet supplies its own bar. */
:is(.galaxy-view, .library-view) > .topbar { gap: 24px; min-height: 76px; padding: 16px clamp(24px, 4.4vw, 80px); border-color: var(--line); background: var(--surface); backdrop-filter: none; }
:is(.galaxy-view, .library-view) .brand-lockup { gap: 12px; }
:is(.galaxy-view, .library-view) .brand-mark { flex: 0 0 auto; width: 32px; height: 32px; box-shadow: none; }
:is(.galaxy-view, .library-view) .brand-text { color: var(--text); font-family: var(--display); font-size: 18px; font-weight: 400; letter-spacing: .12em; }
.galaxy-view .brand-sub { display: none; }
:is(.galaxy-view, .library-view) .top-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
:is(.galaxy-view, .library-view) :is(.nav-btn, .back-btn, .login-trigger) { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-control); color: var(--text-secondary); background: transparent; font-size: 13px; letter-spacing: 0; transform: none; }
:is(.galaxy-view, .library-view) :is(.nav-btn, .back-btn):hover { color: var(--text); background: var(--surface-raised); border-color: var(--line); }
:is(.galaxy-view, .library-view) .nav-btn:is([aria-current="page"], .is-current, [aria-pressed="true"]) { color: var(--accent-pale); border-color: var(--line); background: var(--surface-raised); }
:is(.galaxy-view, .library-view) .login-trigger { width: 44px; min-width: 44px; margin-left: 8px; padding: 0; border-color: var(--line); }
:is(.galaxy-view, .library-view) .login-trigger:hover { color: var(--accent-pale); border-color: var(--line-strong); background: var(--surface-raised); }
.compact-btn, .primary-btn, .quiet-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--text); background: var(--surface-raised); cursor: pointer; font-size: 13px; font-weight: 500; line-height: 1.45; letter-spacing: 0; text-decoration: none; transition: color .12s, background .12s, border-color .12s; }
.primary-btn { color: #181b13; border-color: var(--accent); background: var(--accent); box-shadow: none; }
.quiet-btn { color: var(--text-secondary); background: transparent; }
.compact-btn:hover, .quiet-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-warm); transform: none; }
.primary-btn:hover { color: #181b13; background: var(--accent-pale); border-color: var(--accent-pale); transform: none; }
:is(.compact-btn, .quiet-btn)[aria-pressed="true"] { color: var(--accent-pale); border-color: var(--line-strong); background: var(--surface-warm); }

/* Home: one editorial heading, one primary action, a quieter living map. */
.galaxy-view { display: grid; grid-template-columns: minmax(380px, .9fr) minmax(0, 1.15fr); grid-template-rows: auto minmax(560px, 1fr) auto; overflow-x: hidden; overflow-y: auto; background: var(--surface); }
.galaxy-view > .topbar { grid-column: 1 / -1; grid-row: 1; }
.galaxy-view > .star-field { opacity: .045; overflow:hidden; }
.galaxy-intro { position: relative; z-index: 3; grid-column: 1; grid-row: 2; align-self: center; max-width: 680px; padding: 48px 16px 48px clamp(32px, 6vw, 112px); }
.eyebrow { display: block; margin: 0 0 16px; color: var(--accent); font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: .12em; text-transform: uppercase; }
.galaxy-intro > .eyebrow { margin-bottom: 24px; font-size: 12px; letter-spacing: .1em; }
.galaxy-intro h1 { max-width: 580px; margin: 0 0 24px; color: var(--text); font-family: var(--display); font-size: clamp(48px, 5.1vw, 76px); font-weight: 400; line-height: 1.05; letter-spacing: -.045em; text-wrap: balance; }
.galaxy-intro h1 :is(em, span), .gold-dot { color: var(--accent); font-style: normal; }
.galaxy-intro > p:not(.eyebrow):not(.intro-footnote) { max-width: 390px; margin: 0; color: var(--text-secondary); font-size: 16px; line-height: 1.75; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.intro-actions :is(.primary-btn, .quiet-btn) { min-height: 48px; padding: 12px 20px; font-size: 14px; }
.intro-actions .quiet-btn { border-color: transparent; }
.intro-stats { display: flex; flex-wrap: wrap; gap: 16px 32px; max-width: 420px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.intro-stats span { display: grid; gap: 8px; }
.intro-stats strong { color: var(--text); font-size: 24px; font-weight: 400; font-variant-numeric: tabular-nums; }
.galaxy-intro > .intro-footnote { margin: 24px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.75; letter-spacing: .02em; }
.galaxy-view > .orrery-stage { grid-column: 2; grid-row: 2; min-width: 0; min-height: 560px; max-height: 860px; overflow: hidden; }
.galaxy-view .orrery-stage::before { background: radial-gradient(ellipse, #d8bc8308, transparent 62%); }
.galaxy-view .central-star { border-color: #d8bc8366; box-shadow: 0 0 8px #d8bc8355, 0 0 40px #9b793e33; }
.galaxy-view .central-star::before { opacity: .45; }
.galaxy-view .planet-sphere { box-shadow: inset -14px -12px 24px #0009, 0 0 12px #d8bc8312; }
.galaxy-view .p-search .planet-sphere { box-shadow: inset -18px -16px 30px #000b, 0 0 16px #87b2c533; }
.galaxy-view .planet-label { max-width: 140px; padding: 6px 8px; border: 1px solid transparent; border-radius: 4px; color: var(--text-secondary); background: #0e100ee6; font-family: var(--font-ui); font-size: calc(13px / var(--planet-depth)); line-height: 1.4; letter-spacing: 0; backdrop-filter: none; }
.galaxy-view .planet:not(.is-occulted) { opacity:1!important; }
.galaxy-view .planet:hover .planet-label, .galaxy-view .planet:focus-visible .planet-label { color: var(--text); border-color: var(--line-strong); }
.galaxy-view .stage-hint { max-width: calc(100% - 64px); bottom: 24px; padding: 0; border: 0; color: var(--text-muted); background: transparent; font-size: 12px; line-height: 1.6; letter-spacing: 0; text-align: center; }
.module-rail { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 0 clamp(24px, 4.4vw, 80px) 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.module-rail-kicker { grid-column: 1 / -1; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text-muted); font-size: 12px; line-height: 1.5; letter-spacing: .08em; }
.module-rail button { display: grid; grid-template-columns: 1fr auto; gap: 8px; min-width: 0; min-height: 88px; padding: 16px 20px; border: 0; border-right: 1px solid var(--line); color: var(--text); background: transparent; cursor: pointer; text-align: left; transition: background .12s, color .12s; }
.module-rail button:first-of-type { padding-left: 0; }
.module-rail button:last-child { border-right: 0; }
.module-rail button:hover { color: var(--accent-pale); background: #d8bc8305; }
.module-rail-index { grid-column: 1; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.module-rail-label { grid-column: 1; font-size: 16px; line-height: 1.4; }
.module-rail-arrow { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--accent); font-size: 16px; }

/* Collection: one scan path for identity, summary and actions. */
.library-view { display: block; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); }
.library-view > .topbar { position: sticky; top: 0; }
.library-view > .star-field { display: none; }
.library-shell { position: relative; z-index: 2; width: min(1440px, 100%); margin: 0 auto; padding: 32px clamp(24px, 4vw, 56px) 40px; }
.library-heading { display: grid; grid-template-columns: 1fr 1.35fr; align-items: center; gap: 32px; margin-bottom: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.library-heading .eyebrow { margin-bottom: 12px; }
.library-heading h1 { margin: 0; color: var(--text); font-family: var(--display); font-size: clamp(36px, 3.4vw, 44px); font-weight: 400; line-height: 1.1; letter-spacing: -.04em; }
.library-heading-note { max-width: 650px; }
.library-heading-note > p, .library-heading > p { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
.library-heading-note > .library-storage-note { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.library-about { margin-top: 4px; }
.library-about > summary { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text-muted); font-size: 12px; line-height: 1.5; list-style: none; cursor: pointer; }
.library-about > p { margin: 8px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
:is(.library-about, .library-manage, .library-advanced) > summary::-webkit-details-marker { display: none; }
:is(.library-about, .library-manage, .library-advanced) > summary::after { flex: 0 0 6px; width: 6px; height: 6px; margin: -3px 2px 0 0; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); content: ""; }
:is(.library-about, .library-manage, .library-advanced)[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
:is(.library-about, .library-manage, .library-advanced) > summary:hover { color: var(--text); }
.library-stats { display: flex; flex-wrap: wrap; gap: 8px 0; margin-top: 12px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.library-stats span { padding: 0 12px; border-right: 1px solid var(--line); }
.library-stats span:first-child { padding-left: 0; }
.library-stats span:last-child { padding-right: 0; border-right: 0; }
.library-stats strong { color: var(--text); font-weight: 500; }
.library-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) auto; align-items: center; gap: 16px; margin-bottom: 16px; }
.library-search { position: relative; display: grid; min-width: 0; }
.library-search label { color: var(--text-muted); font-size: 12px; }
.library-search input[type="search"] { width: 100%; min-width: 0; min-height: 52px; padding: 12px 16px 12px 44px; border: 1px solid #6b705d; border-radius: var(--radius-control); color: var(--text); background: var(--surface-raised); font-size: 16px; line-height: 1.5; }
.library-search input::placeholder { color: var(--text-muted); opacity: 1; }
.library-search input:focus { border-color: var(--accent); }
.library-search > span[aria-hidden] { position: absolute; top: 50%; left: 16px; color: var(--accent); font-size: 24px; line-height: 1; transform: translateY(-50%); pointer-events: none; }
.library-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.library-actions select { min-height: 44px; max-width: 100%; padding: 10px 28px 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--text-secondary); background: var(--surface); font-size: 12px; }
.library-actions .compact-btn { min-height: 44px; padding: 10px 12px; color: var(--text-secondary); background: transparent; font-size: 12px; }
.library-actions #addResource { color: var(--text); }
.library-actions #compareResources:disabled { display: none; }
.library-manage { position: relative; }
.library-manage > summary { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--text-secondary); font-size: 12px; line-height: 1.5; list-style: none; cursor: pointer; }
.library-manage[open] > summary { color: var(--accent-pale); border-color: var(--line-strong); background: var(--surface-raised); }
.library-manage-actions { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; display: grid; gap: 4px; width: 160px; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-raised); box-shadow: 0 12px 32px #0006; }
.library-manage-actions .compact-btn { justify-content: flex-start; width: 100%; min-height: 44px; text-align: left; }
.library-manage:not([open]) > .library-manage-actions { display: none; }
.library-actions :is(#exportLibrary, #importLibrary) { border-color: transparent; }
.library-actions :is(#exportLibrary, #importLibrary):hover { border-color: var(--line); }
.library-filter-group { display: grid; gap: 8px; margin-bottom: 8px; padding-bottom: 16px; }
.library-filters, .library-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.library-filters button { min-height: 44px; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-control); color: var(--text-secondary); background: transparent; cursor: pointer; font-size: 13px; line-height: 1.5; }
.library-filters button:hover { color: var(--text); background: var(--surface-raised); }
.library-filters button[aria-pressed="true"] { color: var(--accent-pale); border-color: var(--line-strong); background: #d8bc830c; }
.filter-chip { white-space: nowrap; }
.library-tags:empty { display: none; }
.library-tags button, .library-tags span, .library-tags label { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.library-tags label:not(:first-child) { margin-left: 12px; }
.library-tags select { max-width: 100%; min-height: 44px; padding: 10px 28px 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--text-secondary); background: var(--surface); font-size: 12px; }
.library-advanced { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.library-advanced > summary { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; list-style: none; cursor: pointer; }
.library-advanced #resultCount { margin-left: auto; padding: 0; border: 0; color: var(--text-muted); background: transparent; font-size: 12px; line-height: 1.5; }
.library-advanced > .library-tags { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto minmax(140px, 1fr) auto; gap: 12px; padding: 8px 0 16px; }
.library-advanced .library-tags label { margin: 0; }
.library-advanced:not([open]) > .library-tags { display: none; }
.library-tags .quiet-btn { min-height: 44px; padding: 10px 12px; border-color: transparent; font-size: 12px; }
.library-body { min-height: 160px; }
.resource-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.resource-card { position: relative; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.75fr) 112px; grid-template-rows: auto auto auto; column-gap: 32px; row-gap: 8px; align-items: start; min-width: 0; padding: 20px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; overflow-wrap: anywhere; transition: border-color .12s; }
.resource-card:hover { border-color: var(--line-strong); background: transparent; box-shadow: none; transform: none; }
.resource-top { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 4px 12px; margin: 0; }
.resource-category { color: var(--accent); font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: .04em; }
.resource-status { display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; padding: 0; border: 0; border-radius: 0; color: #b6c1ad; background: transparent; font-size: 12px; line-height: 1.5; }
.resource-status::before { flex: 0 0 4px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; content: ""; }
.resource-status[data-state="partial"] { color: var(--accent); }
.resource-status[data-state="pending"] { color: var(--text-muted); }
.resource-status[data-state="personal"] { color: #c0bda9; }
.resource-card h2 { grid-column: 1; grid-row: 2; margin: 0; color: var(--text); font-family: var(--font-ui); font-size: 22px; font-weight: 500; line-height: 1.3; letter-spacing: -.025em; }
.resource-card h2 a { color: inherit; text-decoration: none; }
.resource-title-button { width: 100%; margin: 0; padding: 0; border: 0; border-radius: 2px; color: inherit; background: transparent; cursor: pointer; font: inherit; line-height: inherit; text-align: left; overflow-wrap: anywhere; }
.resource-title-button:hover { color: var(--accent-pale); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .2em; }
.resource-card > p { grid-column: 2; grid-row: 1 / 3; max-width: 76ch; margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.65; }
.resource-tags { grid-column: 2; grid-row: 3; display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; }
.resource-tags span { padding: 0; border: 0; border-radius: 0; color: var(--text-muted); background: transparent; font-size: 12px; line-height: 1.5; }
.resource-meta { grid-column: 1; grid-row: 3; display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 0; padding: 0; border: 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.resource-meta a { color: var(--accent-pale); }
.resource-actions { grid-column: 3; grid-row: 1 / 4; display: grid; gap: 8px; margin: 0; align-self: center; }
.resource-actions button, .resource-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 10px 8px; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--text-secondary); background: transparent; cursor: pointer; font-size: 12px; line-height: 1.5; text-decoration: none; white-space: nowrap; }
.resource-actions button:hover, .resource-actions a:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-raised); }
.resource-actions button[aria-pressed="true"] { color: var(--accent-pale); border-color: var(--line-strong); background: #d8bc830c; }
.load-more { grid-column: 1 / -1; justify-self: center; min-width: 220px; margin-top: 24px; }
.library-empty { padding: 48px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--text-secondary); text-align: center; font-size: 15px; line-height: 1.7; }
.library-empty h2 { margin: 0 0 12px; color: var(--text); font-size: 24px; font-weight: 500; }
.library-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.library-footer p { max-width: 620px; margin: 0; }
.library-footer a { color: var(--accent-pale); }

/* Details: a reading surface with a separate, bounded notes area. */
dialog.resource-dialog, dialog.login-dialog { margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); background: var(--surface-raised); box-shadow: 0 24px 80px #0009; }
dialog.resource-dialog { width: min(900px, calc(100% - 48px)); max-height: calc(100dvh - 48px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #656b5e var(--surface-raised); scrollbar-width: thin; }
.resource-dialog::backdrop, .login-dialog::backdrop { background: #080a08c9; backdrop-filter: blur(6px); }
.detail-inner { padding: 32px; }
.detail-head { position: sticky; z-index: 3; top: 0; display: flex; align-items: start; justify-content: space-between; gap: 24px; margin: -32px -32px 24px; padding: 24px 32px; border-bottom: 1px solid var(--line); background: var(--surface-raised); }
.detail-head > div { min-width: 0; }
.detail-head .eyebrow { margin-bottom: 12px; }
.detail-head h2 { margin: 0; color: var(--text); font-family: var(--display); font-size: clamp(28px, 3vw, 36px); font-weight: 400; line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere; }
.detail-head > button { flex: 0 0 auto; min-width: 44px; }
.detail-head p, .detail-inner > p { color: var(--text-secondary); font-size: 14px; line-height: 1.75; }
.detail-head p { margin: 12px 0 0; }
.detail-inner > .detail-kicker { margin: 0 0 12px; color: var(--accent); font-size: 12px; line-height: 1.6; }
.detail-inner > .detail-summary { max-width: 68ch; margin: 0 0 24px; color: var(--text-secondary); font-size: 16px; line-height: 1.75; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
.detail-inner > .detail-grid { margin: 32px 0; }
.detail-inner > .detail-block { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.detail-block { min-width: 0; }
.detail-block.full-width { grid-column: 1 / -1; }
.detail-block h3 { margin: 0 0 12px; color: var(--accent-pale); font-size: 14px; font-weight: 500; line-height: 1.5; letter-spacing: 0; text-transform: none; }
.detail-block p, .detail-block li { color: var(--text-secondary); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.detail-block p { max-width: 72ch; margin: 0 0 12px; }
.detail-block ul, .detail-block ol { margin: 0 0 12px; padding-left: 24px; }
.detail-block li + li { margin-top: 8px; }
.detail-block a { color: var(--accent-pale); overflow-wrap: anywhere; }
.detail-block a:hover { color: var(--text); }
.detail-block dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 16px; margin: 0; font-size: 13px; line-height: 1.65; }
.detail-block dt { color: var(--text-muted); }
.detail-block dd { min-width: 0; margin: 0; color: var(--text-secondary); overflow-wrap: anywhere; }
.resource-dialog label { display: block; margin: 0 0 8px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.resource-dialog input, .resource-dialog textarea, .resource-dialog select { width: 100%; max-width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); color: var(--text); background: var(--surface); font-size: 16px; line-height: 1.6; }
.resource-dialog textarea { min-height: 144px; resize: vertical; }
.resource-dialog .detail-block > :is(input, textarea, select) { margin-bottom: 16px; }
.resource-dialog form.detail-block { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.resource-dialog form.detail-block > label { margin: 0; }
.resource-dialog form.detail-block > :is(input, textarea, select) { margin-bottom: 8px; }
.resource-dialog form.detail-block > button { justify-self: start; margin-top: 8px; }
.detail-inner > .detail-block:has(textarea) { grid-column: 1 / -1; margin-top: 32px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.resource-dialog input::placeholder, .resource-dialog textarea::placeholder { color: var(--text-muted); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.detail-note, .detail-block .note-status { color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.detail-block .note-status { margin: 12px 0 0; }
.source-note { margin: 24px 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.source-note h3 { margin: 0 0 12px; color: var(--text); font-size: 18px; font-weight: 500; line-height: 1.5; }
.source-note p { margin: 0 0 12px; color: var(--text-secondary); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.source-note .resource-meta { margin: 0 0 12px; padding: 0; border: 0; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
.compare-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere; }
.compare-card > h3 { margin: 0 0 24px; color: var(--text); font-size: 20px; font-weight: 500; line-height: 1.4; }
.compare-card .detail-block + .detail-block { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.compare-card .detail-block h3 { margin-bottom: 8px; color: var(--text-muted); font-size: 12px; }
.compare-card > a { margin-top: 16px; }
.site-toast { position: fixed; z-index: 100; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 32px); padding: 16px 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--accent-pale); background: var(--surface-raised); box-shadow: 0 12px 40px #0006; font-size: 14px; line-height: 1.6; text-align: center; transform: translateX(-50%); pointer-events: none; }

/* Fields retain the collection's reading rhythm. */
.module-view { display: grid; grid-template-rows: max-content; place-items: start center; overflow-x: hidden; overflow-y: auto; padding: 64px 24px; overscroll-behavior: contain; background: var(--surface); }
.module-view > .star-field { opacity: .04; }
.module-card { width: min(1000px, 100%); min-width: 0; min-height: 0; height: auto; padding: 40px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: var(--surface-raised); text-align: left; box-shadow: none; }
.module-orb { width: 40px; margin: 0 0 24px; box-shadow: none; }
.module-title { margin-bottom: 16px; color: var(--text); font-family: var(--display); font-size: clamp(36px, 4.5vw, 52px); font-weight: 400; line-height: 1.1; letter-spacing: -.035em; }
.module-desc { max-width: 68ch; color: var(--text-secondary); font-size: 16px; line-height: 1.75; }
#moduleContent { margin: 32px 0; }
.module-links { display: flex; flex-wrap: wrap; gap: 12px; }
.module-back { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 16px; border: 1px solid transparent; border-radius: var(--radius-control); color: var(--text-secondary); background: transparent; font-size: 13px; transform: none; }
.module-back:hover { color: var(--text); border-color: var(--line); background: var(--surface-warm); transform: none; }
.module-note { margin-top: 24px; padding: 16px 20px; border-left: 2px solid var(--line-strong); border-radius: 0 var(--radius-control) var(--radius-control) 0; color: var(--text-secondary); background: var(--surface); font-size: 14px; line-height: 1.75; }
.module-note p { margin: 0; }
.source-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin-top: 24px; }
.source-list article { min-width: 0; padding: 24px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; overflow-wrap: anywhere; }
.source-list :is(h2, h3, .resource-title-button) { margin: 0 0 12px; color: var(--text); font-family: var(--font-ui); font-size: 22px; font-weight: 500; line-height: 1.35; letter-spacing: -.02em; }
.source-list p { margin: 0 0 12px; color: var(--text-secondary); font-size: 14px; line-height: 1.75; }
.source-list a { color: var(--accent-pale); font-size: 14px; line-height: 1.7; }
.source-list .resource-status { margin-bottom: 12px; }

/* Identity uses the same surfaces and native form controls. */
dialog.login-dialog { width: min(520px, calc(100% - 48px)); max-height: calc(100dvh - 48px); overflow: auto; backdrop-filter: none; }
.login-inner { padding: 32px; }
.login-head { position: sticky; z-index: 3; top: 0; display: flex; align-items: start; justify-content: space-between; gap: 16px; margin: -32px -32px 24px; padding: 24px 32px; border-bottom: 1px solid var(--line); background: var(--surface-raised); }
.login-eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 12px; line-height: 1.5; letter-spacing: .08em; }
.login-title { margin: 0; color: var(--text); font-family: var(--display); font-size: 30px; font-weight: 400; line-height: 1.2; letter-spacing: -.025em; }
.login-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--text-secondary); background: transparent; font-size: 20px; transform: none; }
.login-close:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-warm); transform: none; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 24px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.auth-tab { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 4px; color: var(--text-muted); background: transparent; font-size: 14px; letter-spacing: 0; }
.auth-tab.is-selected { color: var(--text); background: var(--surface-warm); box-shadow: none; }
.auth-providers { display: grid; gap: 8px; }
.auth-provider { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--text-secondary); background: transparent; font-size: 14px; text-align: left; }
.auth-provider::after { content: none; }
.auth-provider:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-warm); }
.provider-mark { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 4px; }
.provider-microsoft { gap: 2px; padding: 4px; }
.auth-divider { gap: 12px; margin: 24px 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; letter-spacing: 0; text-transform: none; }
.auth-divider::before, .auth-divider::after { background: var(--line); }
.auth-form { gap: 16px; }
.login-field { display: grid; gap: 8px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; letter-spacing: 0; }
.login-input { width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); color: var(--text); background: var(--surface); font-size: 16px; line-height: 1.5; }
.login-input::placeholder { color: var(--text-muted); }
.password-field .login-input { padding-right: 68px; }
.password-toggle { right: 4px; min-width: 56px; min-height: 44px; padding: 8px; border-radius: 4px; color: var(--accent-pale); font-size: 12px; }
.auth-row { align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.remember-option, .consent-option { color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.remember-option { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.remember-option input, .consent-option input { width: 16px; height: 16px; accent-color: var(--accent); }
.auth-link { min-height: 44px; padding: 8px 0; color: var(--accent-pale); font-size: 13px; line-height: 1.5; }
.auth-primary { min-height: 48px; padding: 12px 16px; border: 1px solid var(--accent); border-radius: var(--radius-control); color: #181b13; background: var(--accent); box-shadow: none; font-size: 14px; font-weight: 500; }
.auth-primary:hover { background: var(--accent-pale); border-color: var(--accent-pale); }
.registration-steps { gap: 8px; margin-bottom: 24px; }
.registration-step { display: grid; place-items: center; min-height: 44px; padding: 8px; border-color: var(--line); color: var(--text-muted); font-size: 12px; }
.registration-step.is-current { color: var(--accent-pale); border-color: var(--accent); }
.registration-copy { color: var(--text-secondary); font-size: 14px; line-height: 1.75; }
.auth-status { min-height: 24px; margin: 16px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.auth-status[data-tone="success"] { color: #b6c9a5; }
.auth-status[data-tone="error"] { color: #ebafa1; }
.auth-signout { min-height: 44px; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--text-secondary); background: transparent; font-size: 12px; }
.login-note { margin: 16px 0 0; padding-top: 16px; border-color: var(--line); color: var(--text-muted); font-size: 12px; line-height: 1.7; }

/* The original public eclipse keeps its interaction, with quieter materials. */
#scene { background: radial-gradient(circle at 50% 48%, #252318 0, var(--surface) 34%, #090b09 100%); }
#scene::before { opacity: .24; }
#scene #dust { opacity: .24; }
#scene .aura { filter: blur(64px); }
#scene .horizon { box-shadow: none; }
#scene .ring--outer { border-color: var(--line-strong); box-shadow: none; }
#scene .ring--fine { border-color: #d8bc8377; box-shadow: 0 0 16px #d8bc8322; }
#scene .core { background: radial-gradient(circle at 35% 30%, #24251b, #080a08 65%); box-shadow: inset -24px -24px 48px #0008; }
#scene .corona { opacity: .55; }
#scene .portal-caption { position:absolute; top:calc(100% + 32px); left:50%; display:grid; gap:12px; width:280px; transform:translateX(-50%); color:var(--text); text-align:center; }
#scene .portal-caption strong { font-family:var(--display); font-size:36px; font-weight:400; letter-spacing:-.025em; }
#scene .portal-caption > span { color:var(--accent); font-family:var(--font-ui); font-size:14px; letter-spacing:.02em; }

/* Retain pause and reduced-motion recovery behavior. */
.motion-paused *, .motion-paused *::before, .motion-paused *::after { animation-play-state: paused !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
.motion-paused .scene:not(.is-leaving) { animation: none !important; opacity: 1; }
.motion-paused .portal { animation: none !important; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.motion-paused .horizon { animation: none !important; opacity: .72; transform: translate(-50%, -50%) scaleX(1); }
.motion-paused .orbit { animation: none !important; opacity: 1; }

@media (min-width: 1800px) {
  .galaxy-intro { padding-left: max(88px, calc((100vw - 1664px) / 2)); }
}
@media (max-width: 1100px) {
  .galaxy-view { grid-template-columns: minmax(340px, .95fr) minmax(0, 1.05fr); }
  .galaxy-intro { padding-left: 32px; }
  .galaxy-intro h1 { font-size: 56px; }
  .module-rail button { padding-inline: 12px; }
  .module-rail-label { font-size: 14px; }
  .library-toolbar { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .library-actions { justify-content: flex-start; }
  .resource-card { grid-template-columns: minmax(200px, 1fr) minmax(250px, 1.5fr) 104px; column-gap: 24px; }
}
@media (max-width: 900px) {
  .galaxy-view { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(440px, 1fr) auto; }
  .galaxy-intro { grid-column: 1; grid-row: 2; max-width: 720px; padding: 40px 32px 0; }
  .galaxy-intro h1 { font-size: clamp(48px, 7vw, 64px); }
  .galaxy-intro > p:not(.eyebrow):not(.intro-footnote) { max-width: 520px; }
  .galaxy-view > .orrery-stage { grid-column: 1; grid-row: 3; min-height: 440px; }
  .module-rail { grid-row: 4; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 32px 32px; }
  .module-rail button { min-height: 88px; padding: 16px; border-bottom: 1px solid var(--line); }
  .module-rail button:first-of-type { padding-left: 16px; }
  .module-rail button:nth-of-type(3n) { border-right: 0; }
  .module-rail button:nth-of-type(n+4) { border-bottom: 0; }
  .library-heading { grid-template-columns: 1fr; gap: 20px; }
  .library-heading-note { max-width: 680px; }
  .resource-card { grid-template-columns: minmax(0, 1fr) 112px; column-gap: 24px; }
  .resource-top { grid-column: 1; grid-row: 1; }
  .resource-card h2 { grid-column: 1; grid-row: 2; }
  .resource-card > p { grid-column: 1; grid-row: 3; }
  .resource-tags { grid-column: 1; grid-row: 4; }
  .resource-meta { grid-column: 1; grid-row: 5; }
  .resource-actions { grid-column: 2; grid-row: 1 / 6; }
}
@media (max-width: 700px) {
  :is(.galaxy-view, .library-view) > .topbar { gap: 12px; min-height: 72px; padding: 12px 20px; }
  :is(.galaxy-view, .library-view) .brand-lockup { gap: 8px; }
  :is(.galaxy-view, .library-view) .brand-mark { width: 28px; height: 28px; }
  :is(.galaxy-view, .library-view) .brand-text { font-size: 15px; letter-spacing: .06em; }
  :is(.galaxy-view, .library-view) .top-actions { gap: 0; }
  :is(.galaxy-view, .library-view) :is(.nav-btn, .back-btn) { padding-inline: 10px; font-size: 12px; }
  :is(.galaxy-view, .library-view) .login-trigger { margin-left: 4px; }
  .galaxy-view .topbar .nav-btn[data-go="galaxyView"] { display: none; }
  .library-view > .topbar { flex-wrap: wrap; }
  .library-view .top-actions { width: 100%; justify-content: space-between; }
  .galaxy-intro { padding: 32px 24px 0; }
  .galaxy-intro > .eyebrow { margin-bottom: 20px; font-size: 12px; letter-spacing: .04em; }
  .galaxy-intro h1 { margin-bottom: 24px; font-size: clamp(44px, 10vw, 56px); }
  .galaxy-intro > p:not(.eyebrow):not(.intro-footnote) { font-size: 15px; }
  .intro-actions { gap: 8px; margin-top: 24px; }
  .intro-actions :is(.primary-btn, .quiet-btn) { padding: 12px; font-size: 13px; }
  .intro-stats { margin-top: 24px; gap: 16px 24px; }
  .galaxy-intro > .intro-footnote { margin-top: 20px; }
  .galaxy-view { display:flex; flex-direction:column; }
  .galaxy-view > .topbar { flex:0 0 auto; order:0; }
  .galaxy-intro { display:contents; }
  .galaxy-intro > .eyebrow { order:1; margin:24px 24px 16px; }
  .galaxy-intro h1 { order:2; width:calc(100% - 48px); margin:0 24px 20px; }
  .galaxy-intro > p:not(.eyebrow):not(.intro-footnote) { order:3; margin:0 24px; }
  .intro-actions { order:4; margin:20px 24px 0; }
  .galaxy-view > .orrery-stage { order:5; flex:0 0 380px; width:100%; height:380px; min-height:380px; margin-top:16px; }
  .galaxy-intro .intro-stats { order:6; margin:16px 24px 0; padding-top:16px; }
  .intro-stats span { display:flex; align-items:baseline; gap:6px; }
  .galaxy-intro > .intro-footnote { order:7; margin:16px 24px 24px; }
  .galaxy-view > .module-rail { order:8; }
  .galaxy-view > .orrery-stage { min-height: 400px; }
  .galaxy-view .stage-hint { display: none; }
  .galaxy-view .planet-label { max-width: 110px; padding: 4px 6px; font-size: calc(13px / var(--planet-depth)); }
  .module-rail { margin: 0 24px 24px; }
  .module-rail button, .module-rail button:first-of-type { padding: 16px 8px; }
  .module-rail-label { font-size: 14px; }
  .library-shell { padding: 16px 20px 32px; }
  .library-heading { gap: 12px; margin-bottom: 16px; padding-bottom: 16px; }
  .library-heading h1 { font-size: 34px; }
  .library-heading-note > p { font-size: 14px; }
  .library-stats { gap: 8px 0; }
  .library-stats span { padding-inline: 8px; }
  .library-actions { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:8px; }
  .library-actions #librarySort { width:100%; min-width:0; }
  .library-actions .library-manage { grid-column:3; grid-row:1; }
  .library-actions #compareResources:not(:disabled) { grid-column:1/-1; justify-self:start; }
  .library-actions .compact-btn { padding-inline: 8px; }
  .library-filters { flex-wrap: nowrap; gap: 4px; max-width: 100%; padding-bottom: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .library-filters button { flex: 0 0 auto; padding: 10px; font-size: 12px; white-space: nowrap; }
  .library-advanced > .library-tags { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
  .library-advanced label[for="verificationFilter"] { grid-column: 1; grid-row: 1; }
  .library-advanced label[for="readingFilter"] { grid-column: 2; grid-row: 1; }
  .library-advanced #verificationFilter { grid-column: 1; grid-row: 2; }
  .library-advanced #readingFilter { grid-column: 2; grid-row: 2; }
  .library-advanced select { width: 100%; min-width: 0; font-size: 16px; }
  .library-advanced #clearFilters { grid-column: 1 / -1; justify-self: start; }
  .library-tags label:not(:first-child) { margin-left: 0; }
  .library-advanced > summary { min-height: 44px; }
  .resource-card { display: flex; flex-direction: column; gap: 12px; padding: 20px 0; }
  .resource-card h2 { font-size: 22px; }
  .resource-actions { display: flex; align-self: stretch; gap: 8px; }
  .resource-actions :is(button, a) { width: auto; min-width: 104px; }
  .library-footer { align-items: flex-start; }
  dialog.resource-dialog, dialog.login-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .detail-inner, .login-inner { padding: 24px; }
  .detail-head { gap: 16px; margin: -24px -24px 24px; padding: 20px 24px; }
  .detail-head h2 { font-size: 28px; }
  .detail-head > button { padding-inline: 12px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-inner > .detail-block:has(textarea) { padding: 16px; }
  .compare-grid { grid-template-columns: minmax(0, 1fr); }
  .source-note { padding: 20px; }
  .module-view { padding: 24px 12px; }
  .module-card { padding: 24px; }
  .module-title { font-size: 40px; }
  .module-desc { font-size: 15px; }
  .source-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .source-list :is(h2, h3, .resource-title-button) { font-size: 22px; }
  .login-title { font-size: 28px; }
  .login-head { gap: 12px; margin: -24px -24px 24px; padding: 20px 24px; }
  .auth-row { align-items: center; }
}
@media (max-width: 380px) {
  :is(.galaxy-view, .library-view) > .topbar { padding-inline: 12px; }
  :is(.galaxy-view, .library-view) .brand-mark { display: none; }
  .galaxy-intro, .library-shell { padding-inline: 20px; }
  .galaxy-intro h1 { font-size: 42px; }
  .intro-actions { align-items: stretch; flex-direction: column; }
  .module-rail { margin-inline: 20px; }
  .module-rail-label { font-size: 13px; }
  .detail-inner, .login-inner { padding: 20px; }
  .detail-head, .login-head { margin: -20px -20px 20px; padding: 16px 20px; }
}
@media (max-width:380px) {
  .galaxy-view > .topbar { align-self:stretch; width:100%; max-width:100%; padding-inline:12px; gap:4px; }
  .galaxy-view .brand-mark { display:none; }
  .galaxy-view .top-actions .nav-btn { padding-inline:6px; }
  .galaxy-view .top-actions .login-trigger { margin-left:0; }
  .library-view .top-actions { flex-wrap:wrap; justify-content:flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .module-rail button, .resource-card, .primary-btn { transition: none; }
  .resource-card:hover, .primary-btn:hover { transform: none; }
}
