/* Shared page rhythm. Loaded after each page's existing theme. */
:root {
  --layout-gap: clamp(20px, 2.4vw, 32px);
  --layout-inset: clamp(20px, 2.4vw, 32px);
  --surface-radius: 12px;
  --surface-border: rgba(196, 162, 248, .23);
  --surface-fill: linear-gradient(145deg, rgba(42, 22, 64, .48), rgba(14, 8, 25, .72));
  --surface-shadow: 0 12px 32px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .025);
}

/* A single root scroll container; no section snapping after wheel/touch input. */
html:has(body.world-page) { overflow-x: clip; scroll-snap-type: none; scroll-behavior: auto; }
body.world-page { overflow-x: clip; overflow-y: visible; }
.world-page :is(.void-world, .extension-replica, .site-footer) { scroll-snap-align: none; }
.world-page :is(.extension-replica, .extension-demo) { scroll-margin-top: 0; }

/* Keep navigation pinned while the workspace scrolls, with its own short-screen scroll. */
body.admin-modern-page { overflow-x: clip; }
@media (min-width: 901px) {
  .admin-modern-page .admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; height: 100dvh; overflow-y: auto; }
  .admin-modern-page .admin-workspace { grid-column: 2; min-width: 0; }
}

.inner-page main { font-size: 16px; }
.inner-page main :where(h1, h2, h3) { text-wrap: balance; }
.inner-page main :where(h2, h3) { line-height: 1.2; }
.inner-page main.section > h1 {
  max-width: 24ch;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.08;
}
.inner-page main > .lead { max-width: 72ch; line-height: 1.65; }
.inner-page main :where(.grid, .extension-hero, .pricing-grid) { gap: 20px; }
.inner-page main :where(.grid, .hero, .page-head, .readiness-strip) > * { min-width: 0; }
.inner-page .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inner-page .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inner-page .grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inner-page :where(.card, .panel, .download-card, .connect-card) { padding: var(--layout-inset); }
.inner-page .feature-card :where(h3, .badge) { max-width: calc(100% - 52px); }
.inner-page .feature-card h3 { margin-bottom: 12px; }
.inner-page .feature-card p { margin-bottom: 0; line-height: 1.65; }
.inner-page .feature-card .rune-icon { width: 36px; height: 36px; top: 22px; right: 22px; }
.inner-page .feature-card.compact { display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.inner-page .feature-card.compact h3 { max-width: none; min-height: 2.4em; margin: 0; }
.inner-page .feature-card.compact .badge { margin: 0; align-self: flex-start; }
.inner-page .feature-card.compact p { margin: 0; }
.inner-page .btn { white-space: normal; text-align: center; line-height: 1.35; }
.inner-page .actions { align-items: stretch; }
.inner-page .actions .btn { display: inline-flex; align-items: center; justify-content: center; }
.inner-page .seo-content { max-width: none; margin: 32px 0; padding: var(--layout-inset); }
.inner-page .seo-content > p { max-width: 80ch; }
.inner-page .seo-content h2 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.2; }
.inner-page .seo-content .grid { margin-bottom: 32px; }
.inner-page .seo-content .grid > .feature-card { background: rgba(7, 2, 15, .34); }

/* All pricing decisions align before the feature lists begin. */
.pricing-page .price-card {
  display: grid;
  grid-template-rows: auto auto 3.2em auto auto 1fr;
  align-content: start;
  gap: 14px;
}
.pricing-page .price-card > .badge { grid-row: 1; align-self: start; justify-self: start; }
.pricing-page .price-card > h2 { grid-row: 2; }
.pricing-page .price-card > p { grid-row: 3; }
.pricing-page .price-card > .price-stack { grid-row: 4; margin: 0; padding: 6px 0; }
.pricing-page .price-card > .btn { grid-row: 5; }
.pricing-page .price-card > .plan-list {
  grid-row: 6;
  align-content: start;
  align-self: start;
  margin: 12px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.pricing-page .price-stack small { font-size: 14px; }
.pricing-page .pricing-faq { gap: 28px 40px; }
.pricing-page .pricing-faq h3 { margin: 0 0 10px; }

/* Installation panels share a stable action column and calmer headings. */
.inner-page .extension-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 28px; }
.inner-page .download-card { justify-content: flex-start; gap: 16px; }
.inner-page .connect-card { position: relative; isolation: isolate; justify-content: center; gap: 20px; }
.inner-page .download-card h2 { margin: 0; font-size: clamp(26px, 3vw, 36px); }
.inner-page .extension-download-content { display: block; }
.inner-page .extension-download-content p { margin: 0; }
.inner-page .download-card .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: auto; padding-top: 8px; position: relative; z-index: 2; }
.inner-page .extension-connect-help .connect-mascot { position: absolute; right: 12px; bottom: 56px; width: 280px; height: auto; max-width: 75%; opacity: .22; transform: none; z-index: -1; pointer-events: none; }
.inner-page .extension-connect-help { display: block; min-height: 140px; }
.inner-page .extension-connect-help p { margin: 0; position: relative; }
.inner-page .connect-card > .btn { margin-top: 0; }
.inner-page .connect-card .status { margin: 0; }
.inner-page .connect-card .status:empty { display: none; }
@media (max-width: 520px) {
  .inner-page .extension-connect-help .connect-mascot { width: 240px; right: 8px; }
}
.inner-page .section.readiness-strip {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 32px;
  margin: 24px 0;
  padding: var(--layout-inset);
  background: linear-gradient(135deg, rgba(42, 16, 74, .56), rgba(7, 2, 15, .66));
}
.inner-page .readiness-strip h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.2; }
.inner-page .section.readiness-strip > div { display: block; }
.inner-page .readiness-strip p { font-size: 16px; line-height: 1.65; }
.inner-page .readiness-strip > .btn { width: 100%; min-width: 0; }

/* Search/list comes first; the longer reference text follows the result. */
.public-maps-page .page-head { display: block; margin-bottom: 28px; }
.public-maps-page .page-head h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1.08; }
.public-maps-page .page-head p { max-width: 72ch; line-height: 1.65; }
.maps-search { display: grid; gap: 8px; max-width: 640px; margin-top: 24px; }
.maps-search[hidden] { display: none; }
.maps-search .table-search { width: 100%; max-width: none; min-width: 0; }
.maps-search > span { font-weight: 700; }
.public-map-card { display: flex; flex-direction: column; gap: 12px; }
.public-map-card > :is(h3, p) { margin: 0; overflow-wrap: anywhere; }
.public-map-card > .badge { align-self: flex-start; }
.public-map-card > .public-map-meta { display: flex; gap: 12px; margin-top: auto; padding-top: 8px; }
.public-map-card > .btn { margin: 0; width: 100%; }
#publicMapsList > .card:only-child:not(.public-map-card) { grid-column: 1 / -1; min-height: 0; }
#publicMapsList > .maps-status { padding: clamp(24px, 4vw, 48px); background: linear-gradient(115deg, rgba(39, 16, 66, .55), rgba(12, 5, 27, .38)); }
.maps-status h2 { margin: 12px 0 8px; font-size: clamp(24px, 3vw, 36px); line-height: 1.15; }
.maps-status p { max-width: 62ch; margin: 0; line-height: 1.6; }
.maps-status--empty { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.maps-empty-art { position: relative; min-height: 210px; border: 1px solid rgba(190, 148, 255, .15); border-radius: 12px; background: radial-gradient(circle at 50% 50%, rgba(124, 58, 237, .24), transparent 68%), rgba(255, 255, 255, .025); overflow: hidden; }
.maps-empty-art::before, .maps-empty-art::after { content: ""; position: absolute; width: 42%; height: 1px; top: 50%; left: 29%; background: rgba(190, 148, 255, .48); transform: rotate(31deg); }
.maps-empty-art::after { transform: rotate(-31deg); }
.maps-empty-art span { position: absolute; width: 38px; height: 38px; border: 1px solid rgba(190, 148, 255, .7); border-radius: 50%; background: radial-gradient(circle, rgba(190, 148, 255, .72) 0 5px, rgba(124, 58, 237, .28) 6px 100%); box-shadow: 0 0 24px rgba(124, 58, 237, .22); }
.maps-empty-art span:first-child { top: calc(50% - 19px); left: calc(50% - 19px); width: 48px; height: 48px; }
.maps-empty-art span:nth-child(2) { top: 14%; left: 14%; }
.maps-empty-art span:nth-child(3) { right: 14%; bottom: 14%; }
.maps-status-copy { min-width: 0; }
.maps-status-copy .btn { margin-top: 24px; }
@media (max-width: 640px) { .maps-status--empty { grid-template-columns: 1fr; } .maps-empty-art { min-height: 144px; } }
#publicMapViewer:empty { display: none; }
.maps-about { margin: 28px 0; border-top: 1px solid var(--line); padding-top: 24px; }
.maps-about > summary { padding: 8px 0; color: var(--text); cursor: pointer; font-size: 18px; font-weight: 700; }
.maps-about .seo-content { margin: 20px 0 0; }

/* Reader and form edges follow their shell instead of arbitrary offsets. */
.inner-page--auth .auth-card { margin-left: 0; padding: 28px; }
.inner-page--auth .auth-card p { line-height: 1.6; }
.inner-page--auth .auth-wrap { min-height: calc(100svh - 78px); padding-top: 48px; padding-bottom: 48px; }
.inner-page--legal .legal-page { max-width: 1040px; }
.inner-page--legal .legal-document { max-width: none; }

/* Profile, plan and discount no longer force overflowing 100% inner heights. */
body.inner-page.control-page--dashboard .dashboard-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body.inner-page.control-page--dashboard .dashboard-main { grid-column: 1 / -1; grid-row: auto; min-height: 0; }
body.inner-page.control-page--dashboard :is(.dashboard-actions, .session-management-panel, .lectures-panel) { grid-column: 1 / -1; }
body.inner-page.control-page--dashboard :where(.tariff-panel, .discount-panel) { grid-column: auto; padding: var(--layout-inset); }
body.inner-page.control-page--dashboard :where(.tariff-panel, .discount-panel) .profile-line { height: auto; flex-direction: column; gap: 16px; }
body.inner-page.control-page--dashboard .discount-counter { margin-top: 0; }
body.inner-page.control-page--dashboard :where(.tariff-panel, .discount-panel) h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.15; }
body.inner-page.control-page--dashboard .stats-split { align-items: center; margin-top: 24px; }
body.inner-page.control-page--dashboard .chart-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.inner-page.control-page--dashboard .chart-legend > div { min-height: 96px; }
body.inner-page.control-page--dashboard .control-head h1 { line-height: 1.05; }
body.inner-page.control-page--dashboard .dashboard-action-card { min-height: 0; gap: 16px; }
body.inner-page.control-page--dashboard .dashboard-action-card p { margin: 0; }
body.inner-page.control-page--dashboard .session-management-panel .profile-line { gap: 24px; }
body.inner-page.control-page--dashboard .session-management-panel .profile-line > div { flex: 1; }
body.inner-page.control-page--dashboard #revokeOtherSessions { flex: 0 0 280px; align-self: start; }
body.inner-page.control-page--dashboard .session-status:empty { min-height: 0; margin: 0; }

.inner-page .hero { gap: 48px; }
.inner-page .hero h1 { font-size: clamp(42px, 5vw, 68px); line-height: 1.05; }
.inner-page .hero .hero-copy { min-width: 0; }
.inner-page .seo-trust-row span { font-size: 14px; line-height: 1.5; }
.try-page .try-steps p,
.try-page .try-settings p { font-size: 16px; line-height: 1.6; }
.try-page .try-steps a,
.try-page .try-text-button { font-size: 14px; line-height: 1.4; }

@media (max-width: 1100px) {
  .inner-page .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .pricing-page .price-card { grid-template-rows: auto auto auto auto auto auto; }
  .inner-page .section.readiness-strip { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .inner-page .readiness-strip > .btn { justify-self: start; max-width: 360px; }
}
@media (max-width: 820px) {
  .inner-page .hero,
  .inner-page .extension-hero,
  .inner-page .grid,
  .inner-page .grid.two { grid-template-columns: minmax(0, 1fr); }
  .inner-page .hero { gap: 28px; }
  .inner-page .hero h1 { font-size: clamp(38px, 9vw, 56px); }
  .inner-page .section.readiness-strip > .btn { max-width: none; }
  body.inner-page.control-page--dashboard .session-management-panel .profile-line { flex-direction: column; }
  body.inner-page.control-page--dashboard #revokeOtherSessions { flex-basis: auto; width: 100%; }
  body.inner-page.control-page--dashboard .stats-split { justify-items: center; }
  body.inner-page.control-page--dashboard .chart-legend { width: 100%; }
}
@media (max-width: 640px) {
  .inner-page .download-card .actions { grid-template-columns: minmax(0, 1fr); }
  .inner-page .grid.four { grid-template-columns: minmax(0, 1fr); }
  .inner-page--auth .auth-card { padding: 24px; }
  body.inner-page.control-page--dashboard .dashboard-layout { grid-template-columns: minmax(0, 1fr); }
  body.inner-page.control-page--dashboard .chart-legend > div { padding: 12px; }
  body.inner-page.control-page--dashboard .chart-legend span:last-child { font-size: 14px; }
}

/* A shared public surface; preserve the character/world and admin workspace. */
.inner-page :where(.panel, .card, .auth-card, .dashboard-main, .discount-panel,
  .tariff-panel, .session-management-panel, .lectures-panel, .lecture-progress,
  .lecture-item, .lecture-form, .download-card, .connect-card, .seo-content,
  .try-demo-card, .try-step, .try-setting-card, .legal-document) {
  border: 1px solid var(--surface-border);
  border-radius: var(--surface-radius);
  clip-path: none;
  background: var(--surface-fill);
  box-shadow: var(--surface-shadow);
}
.inner-page :where(.btn, input, select, textarea) { border-radius: 8px; }

