:root {
  --lco-ink: #ffffff;
  --lco-muted: #b8b8c0;
  --lco-panel: rgba(24, 12, 38, 0.95);
  --lco-line: rgba(216, 180, 254, 0.24);
  --lco-accent: #c084fc;
  --lco-focus: #f0abfc;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--lco-focus) !important; outline-offset: 3px !important; }
:where(button, a, input, select, textarea) { touch-action: manipulation; }
::selection { background: rgba(192, 132, 252, 0.4); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.45); }
::-webkit-scrollbar-thumb { background: #52637b; border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #71829a; }

/* Full-screen activity canvas
   Legacy lessons simulated a phone/iPad inside a rounded frame. The real
   browser viewport is now the device, so only the outermost shell is reset. */
html:has(body[data-lco-activity]) {
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  background: #0e0717;
}

body[data-lco-activity] {
  width: 100%;
  min-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 !important;
  overscroll-behavior: none;
  --text-main: #ffffff;
  --text-color: #ffffff;
  --text: #ffffff;
  --text-dim: #c8c8d0;
  --text-muted: #c8c8d0;
}

body[data-lco-activity] :where(h1, h2, h3, h4, h5, h6, .title, .subtitle, label, legend) {
  color: #ffffff !important;
}

body[data-lco-activity] > :is(
  #app-container,
  #game-container,
  #app,
  .app-container,
  #appShell,
  #appRoot,
  #game-shell,
  #app-wrapper
) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  aspect-ratio: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body[data-lco-activity] > :is(.host, .shell) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body[data-lco-activity] > .host > #appShell,
body[data-lco-activity] > .shell > #appRoot {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  aspect-ratio: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* This activity is a naturally scrolling page, not a simulated-device frame. */
body[data-lco-activity="ions-equation-solubility-and-observations"] > #app-container {
  width: 100% !important;
  max-width: 64rem !important;
  height: auto !important;
  min-height: 0 !important;
  margin-inline: auto !important;
}

body[data-lco-activity] > .lco-legacy-breadcrumb { display: none !important; }

body[data-lco-activity] :where(img, video) {
  max-width: 100%;
  height: auto;
}

@media (max-width: 820px) {
  body[data-lco-activity] :where(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
    font-size: max(16px, 1em) !important;
  }

  body[data-lco-activity] :where(.modal-content, [role="dialog"] > div) {
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  body[data-lco-activity] > :is(#app-container, #game-container, #app, .app-container, #appShell, #appRoot, #game-shell, #app-wrapper) {
    --app-width: clamp(300px, 44vw, 440px);
  }
}

.lco-quick-nav { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 2147483000; font: 600 14px/1.2 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--lco-ink); }
.lco-quick-nav__toggle { width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 0; border: 1px solid rgba(216, 180, 254, 0.5); border-radius: 15px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(47, 27, 70, 0.98), rgba(18, 8, 30, 0.98)); color: #ffffff; box-shadow: 0 12px 32px rgba(7, 2, 14, 0.55), 0 0 24px rgba(168, 85, 247, 0.12), inset 0 1px rgba(255, 255, 255, 0.08); backdrop-filter: blur(16px); cursor: pointer; transition: transform 160ms ease, border-color 160ms ease; }
.lco-quick-nav__toggle:hover { transform: translateY(-2px); border-color: #e9d5ff; }
.lco-quick-nav__toggle svg { width: 22px; height: 22px; }
.lco-quick-nav__menu { position: absolute; right: 0; bottom: 58px; width: min(250px, calc(100vw - 24px)); padding: 8px; border: 1px solid var(--lco-line); border-radius: 16px; background: var(--lco-panel); box-shadow: 0 20px 56px rgba(0, 0, 0, 0.52); backdrop-filter: blur(18px); transform-origin: bottom right; }
.lco-quick-nav__menu[hidden] { display: none; }
.lco-quick-nav__eyebrow { margin: 4px 8px 7px; color: var(--lco-muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.lco-quick-nav__menu a { min-height: 44px; padding: 10px 12px; border-radius: 11px; display: flex; align-items: center; gap: 10px; color: var(--lco-ink); text-decoration: none; transition: background 150ms ease, color 150ms ease; }
.lco-quick-nav__menu a:hover { background: rgba(192, 132, 252, .15); color: #ffffff; }
.lco-quick-nav__menu a span:first-child { width: 22px; color: #ffffff; text-align: center; }

body[data-lco-page="library"] { min-height: 100vh; margin: 0; background: #ffffff; color: #17131c; color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
body[data-lco-page="library"] .site-shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
body[data-lco-page="library"] .site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid #e5e1e8; background: rgba(255, 255, 255, .92); backdrop-filter: blur(18px); }
body[data-lco-page="library"] .site-header-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
body[data-lco-page="library"] .site-brand { display: flex; align-items: center; gap: 11px; color: #17131c; font-weight: 760; text-decoration: none; letter-spacing: -.015em; }
body[data-lco-page="library"] .site-brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #ffffff; font-size: 12px; font-weight: 900; box-shadow: 0 8px 20px rgba(109, 40, 217, .24); }
body[data-lco-page="library"] .site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
body[data-lco-page="library"] .site-nav a { min-height: 40px; padding: 10px 12px; border-radius: 10px; color: #403a44; text-decoration: none; font-size: 14px; font-weight: 650; }
body[data-lco-page="library"] .site-nav a:hover, body[data-lco-page="library"] .site-nav a[aria-current="page"] { background: #eee9f1; color: #17131c; }
body[data-lco-page="library"] .page-band { padding: clamp(54px, 8vw, 92px) 0 44px; background: linear-gradient(135deg, #6d28d9 0%, #7e22ce 48%, #4c1d95 100%); box-shadow: inset 0 -1px rgba(255,255,255,.2); }
body[data-lco-page="library"] .page-kicker { margin: 0 0 12px; color: #ffffff; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
body[data-lco-page="library"] h1 { max-width: 850px; margin: 0; color: #fff; font-size: clamp(42px, 7vw, 78px); line-height: .98; letter-spacing: -.055em; }
body[data-lco-page="library"] .page-intro { max-width: 720px; margin: 22px 0 0; color: rgba(255,255,255,.88); font-size: clamp(17px, 2.2vw, 21px); line-height: 1.65; }
body[data-lco-page="library"] .page-main { padding-bottom: 80px; }
body[data-lco-page="library"] .content-section { margin-top: 42px; }
body[data-lco-page="library"] .content-section-title { margin: 0 0 14px; color: #17131c; font-size: 15px; letter-spacing: .04em; }
body[data-lco-page="library"] .link-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body[data-lco-page="library"] .link-row, body[data-lco-page="library"] .site-card { position: relative; border: 1px solid #e2dce6; border-radius: 18px; background: #ffffff; color: #17131c; text-decoration: none; box-shadow: 0 10px 28px rgba(32, 24, 38, .07); transition: transform 170ms ease, border-color 170ms ease, background 170ms ease; }
body[data-lco-page="library"] .link-row { min-height: 82px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
body[data-lco-page="library"] .link-row:hover, body[data-lco-page="library"] .site-card:hover { transform: translateY(-3px); border-color: #bbb3c0; background: #fbfafc; }
body[data-lco-page="library"] .row-tag { color: #625c66; font-size: 12px; line-height: 1.4; text-align: right; }
body[data-lco-page="library"] .card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
body[data-lco-page="library"] .card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-lco-page="library"] .site-card { min-height: 260px; padding: 28px; display: flex; flex-direction: column; }
body[data-lco-page="library"] .site-card .card-meta { color: #514b55; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
body[data-lco-page="library"] .site-card h2 { margin: 34px 0 10px; color: #17131c; font-size: 26px; letter-spacing: -.03em; }
body[data-lco-page="library"] .site-card p { margin: 0; color: #57515b; line-height: 1.6; }
body[data-lco-page="library"] .card-footer { margin-top: auto; padding-top: 28px; color: #17131c; font-weight: 750; }
body[data-lco-page="library"] .site-footer { border-top: 1px solid #e5e1e8; background: #ffffff; color: #625c66; }
body[data-lco-page="library"] .site-footer-inner { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 13px; }

@media (max-width: 760px) {
  body[data-lco-page="library"] .site-shell { width: min(100% - 28px, 1120px); }
  body[data-lco-page="library"] .site-header-inner { padding: 11px 0; align-items: flex-start; flex-direction: column; gap: 8px; }
  body[data-lco-page="library"] .site-nav { justify-content: flex-start; }
  body[data-lco-page="library"] .site-nav a { padding-inline: 8px; font-size: 12px; }
  body[data-lco-page="library"] .page-band { padding-top: 42px; }
  body[data-lco-page="library"] .link-list, body[data-lco-page="library"] .card-grid, body[data-lco-page="library"] .card-grid.two { grid-template-columns: 1fr; }
  body[data-lco-page="library"] .link-row { align-items: flex-start; }
  body[data-lco-page="library"] .site-card { min-height: 220px; }
  body[data-lco-page="library"] .site-footer-inner { padding: 20px 0; align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (prefers-contrast: more) { :root { --lco-line: rgba(255,255,255,.55); } .lco-quick-nav__toggle, .lco-quick-nav__menu { border-width: 2px; } }
