:root {
  color-scheme: light;
  --nav: #0e1832;
  --ink: #14213e;
  --muted: #51617c;
  --blue: #244ad7;
  --line: #e0e6f1;
  --paper: #f2f5fb;
  --white: #fff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
p, h1, h2, h3 { margin: 0; }
a { color: inherit; text-decoration: none; }
button, textarea, select { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid #4b72fc; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 29px 16px 19px;
  color: #fff;
  background: var(--nav);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 5px; font-weight: 790; letter-spacing: -.035em; white-space: nowrap; font-size: 1.04rem; }
.brand img { flex: none; }
.brand small { display: block; margin-top: 4px; font-size: .57rem; font-weight: 700; letter-spacing: .13em; color: #aab9db; }
.rail-caption { color: #aab9db; letter-spacing: .16em; font-size: .63rem; font-weight: 780; margin: 45px 10px 11px; }
.rail nav { display: grid; gap: 5px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #c1cce6;
  font-weight: 650;
  font-size: .9rem;
}
.nav-link:hover { background: #1d2a4d; color: #fff; }
.nav-link[aria-current] { color: #fff; background: #22356b; border-color: #374f90; }
.nav-link[aria-current] .icon { color: #a8beff; }
.rail-note { margin-top: auto; padding: 14px 12px; border: 1px solid #2b3c67; border-radius: 14px; background: #15223f; color: #dbe5fc; font-size: .8rem; }
.rail-note .icon { color: #8bead8; margin-right: 4px; width: 17px; height: 17px; }
.rail-note p { margin-top: 6px; color: #aebcda; line-height: 1.5; }
.workspace { width: 100%; max-width: 1460px; margin-inline: auto; padding: 0 clamp(19px, 3.15vw, 48px); }
.topbar { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mobile-brand { display: none; }
.breadcrumb { font-size: .86rem; color: var(--muted); }
.breadcrumb span { padding: 0 8px; color: #667790; }
.breadcrumb strong { color: var(--ink); font-weight: 730; }
.level { display: inline-flex; gap: 7px; align-items: center; border: 1px solid #dbe4f4; border-radius: 999px; padding: 6px 11px; background: #f9fbff; color: #36507c; white-space: nowrap; font-size: .75rem; font-weight: 680; }
.level span { display: block; background: #108270; width: 7px; height: 7px; border-radius: 50%; }
.hero {
  min-height: 250px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 48%);
  align-items: center;
  overflow: hidden;
  padding: 24px clamp(23px, 3.4vw, 53px);
  border-radius: 25px;
  background: radial-gradient(ellipse at 86% 14%, #3c70f5 0%, transparent 50%), linear-gradient(117deg, #16277d, #2548dc 86%);
  color: #fff;
  box-shadow: 0 12px 24px #2449c41a;
  isolation: isolate;
}
.eyebrow { color: #405999; font-size: .64rem; line-height: 1.3; letter-spacing: .13em; font-weight: 790; margin-bottom: 4px; }
.hero-label { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 13px; color: #e9f1ff; padding: 5px 8px; border: 1px solid #98b3fa74; background: #15277b55; border-radius: 6px; }
.hero-label .icon { width: 14px; height: 14px; color: #91f1dd; }
.hero h1 { font-size: clamp(2.8rem, 5.15vw, 5.15rem); font-weight: 830; line-height: .98; letter-spacing: -.074em; }
.hero h1 em { font-style: normal; color: #9cf5e0; }
.hero-copy > p:last-child { color: #e3ebff; font-size: clamp(.88rem, 1.25vw, 1.03rem); line-height: 1.52; max-width: 335px; margin-top: 13px; }
.hero-art { width: 100%; max-width: 530px; height: auto; justify-self: end; }
.layout { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1.63fr) minmax(265px, 1fr); gap: 17px; align-items: start; }
.card { border: 1px solid var(--line); background: var(--white); border-radius: 19px; padding: 20px; box-shadow: 0 5px 18px #344e7810; scroll-margin-top: 17px; }
.card-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.card h2 { font-size: 1.21rem; letter-spacing: -.034em; line-height: 1.14; font-weight: 790; }
.tile { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tile-blue { background: #e9eeff; color: #2c4cc6; }
.tile-mint { background: #e1f6ef; color: #06745e; }
.tile-lilac { background: #f0eaff; color: #673ab4; }
textarea { display: block; width: 100%; min-height: 123px; resize: vertical; border: 1px solid #ccd8ed; border-radius: 12px; padding: 12px 13px; background: #f7f9fe; color: var(--ink); line-height: 1.55; }
textarea::placeholder { color: #596985; opacity: 1; }
.form-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; margin: 8px 0 13px; color: var(--muted); font-size: .75rem; }
.form-meta .icon { width: 14px; height: 14px; margin-right: 3px; }
#count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.practice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid #e0e7f8; border-radius: 11px; background: #f4f7ff; cursor: pointer; }
.practice-copy { display: grid; gap: 3px; line-height: 1.3; }
.practice strong { font-size: .83rem; }
.practice small { color: var(--muted); font-size: .74rem; }
.practice input { appearance: none; width: 41px; height: 23px; position: relative; flex: none; border: 1px solid #9aabc8; border-radius: 999px; background: #dae3f3; margin: 0; cursor: pointer; }
.practice input::before { content: ""; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px #1f304251; transition: transform .16s; }
.practice input:checked { background: var(--blue); border-color: var(--blue); }
.practice input:checked::before { transform: translateX(18px); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 44px; padding: 9px 13px; border-radius: 10px; font-size: .88rem; font-weight: 740; }
.primary { background: var(--blue); border: 1px solid var(--blue); color: #fff; }
.primary:hover { background: #1839b5; }
.primary .icon { width: 17px; height: 17px; }
.quiet { background: #fff; color: #405471; border: 1px solid #dbe4f1; }
.quiet:hover { background: #eef3fc; }
.filter { position: relative; display: block; margin-bottom: 10px; }
.filter select { appearance: none; display: block; width: 100%; min-height: 39px; padding: 7px 32px 7px 10px; border: 1px solid #dbe5f3; border-radius: 9px; background: #f7f9fe; color: var(--ink); font-weight: 680; font-size: .79rem; }
.filter .icon { position: absolute; right: 9px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); pointer-events: none; color: #4d6387; }
#examples { display: grid; gap: 6px; max-height: 233px; overflow: auto; scrollbar-width: thin; padding: 3px; margin: -3px; }
.sample { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 49px; padding: 5px 8px; text-align: left; border: 1px solid #e1e7f2; border-radius: 10px; background: #fff; color: var(--ink); }
.sample:hover { background: #f3f7ff; border-color: #adbee9; }
.sample-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.sample-icon .icon { width: 17px; height: 17px; }
.sample-motion { background: #eaf0ff; color: #3458cb; }
.sample-force { background: #e5f7f0; color: #127762; }
.sample-energy { background: #fff1db; color: #8b4d00; }
.sample-matter { background: #e0f5fa; color: #126777; }
.sample-wave { background: #efe9ff; color: #653cac; }
.sample-copy { display: grid; gap: 2px; flex: 1; font-weight: 750; font-size: .79rem; }
.sample-copy small { font-size: .67rem; font-weight: 600; color: var(--muted); }
.sample > .icon { width: 15px; height: 15px; color: #45608d; }
.library-hint { color: var(--muted); font-size: .73rem; margin-top: 9px; }
.output { grid-column: 1 / -1; }
.empty { padding: 15px; border: 1px dashed #cfdaf0; border-radius: 10px; background: #f7f9fd; }
.muted { color: var(--muted); line-height: 1.5; font-size: .87rem; }
.result-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 14px; padding: 12px; background: #eff6ff; border: 1px solid #d9e7fd; border-radius: 11px; }
.topic { color: #254c91; font-size: .83rem; font-weight: 750; }
.result { background: #d7f4e8; color: #15503f; border-radius: 8px; padding: 6px 10px; font-size: 1.02rem; font-weight: 800; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; counter-reset: step; }
.steps.continuation { counter-reset: step 3; margin-top: 6px; }
.steps li { counter-increment: step; position: relative; padding: 13px 13px 13px 46px; border: 1px solid #e0e7f4; border-radius: 11px; overflow-wrap: anywhere; }
.steps li::before { content: counter(step); position: absolute; top: 12px; left: 12px; width: 23px; height: 23px; border-radius: 7px; display: grid; place-items: center; background: #e9efff; color: #3051be; font-size: .76rem; font-weight: 800; }
.steps h3 { margin-bottom: 6px; font-size: .92rem; }
.steps p { margin-bottom: 5px; color: var(--muted); font-size: .85rem; line-height: 1.52; white-space: pre-line; }
.steps p:last-child { margin-bottom: 0; }
.steps .formula { color: var(--ink); font-weight: 740; }
.practice-tip { margin: 12px 0 6px; font-size: .85rem; color: var(--muted); }
.practice-answer summary { cursor: pointer; color: var(--blue); font-size: .88rem; font-weight: 760; padding: 10px 0; }
.notice { padding: 13px; border: 1px solid #efd49f; border-radius: 11px; background: #fff7e4; color: #634713; font-size: .88rem; line-height: 1.5; }
.notice p { margin-top: 5px; }
footer { display: flex; justify-content: space-between; gap: 10px; padding: 17px 0 23px; color: var(--muted); font-size: .74rem; }
@media (max-width: 1050px) {
  .shell { grid-template-columns: 185px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .brand { gap: 7px; font-size: .96rem; }
  .brand img { width: 35px; height: 35px; }
  .brand small { font-size: .52rem; }
}
@media (max-width: 830px) {
  .shell { display: block; }
  .workspace { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .rail { position: fixed; inset: auto 0 0; z-index: 3; height: auto; padding: 5px 12px calc(5px + env(safe-area-inset-bottom)); }
  .rail .brand, .rail-caption, .rail-note, .breadcrumb { display: none; }
  .rail nav { max-width: 500px; width: 100%; margin-inline: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-link { flex-direction: column; justify-content: center; gap: 3px; padding: 4px 3px; min-height: 48px; font-size: .68rem; }
  .nav-link .icon { width: 17px; height: 17px; }
  .mobile-brand { display: flex; padding: 0; font-size: .98rem; }
  .topbar { min-height: 60px; }
}
@media (max-width: 620px) {
  .workspace { padding-inline: 14px; }
  .hero { min-height: 206px; padding: 19px; border-radius: 19px; grid-template-columns: minmax(0, 1fr); }
  .hero-art { position: absolute; z-index: -1; right: -19%; top: 11%; width: 73%; opacity: .31; }
  .hero h1 { font-size: clamp(2.65rem, 12vw, 3.6rem); }
  .hero-copy > p:last-child { max-width: 29ch; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 13px; }
  .card { padding: 15px; border-radius: 15px; }
  .output { grid-row: 2; }
  .card-heading { margin-bottom: 12px; }
  .card h2 { font-size: 1.13rem; }
  .actions .primary { flex: 1; }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .practice input::before { transition: none; } }

.account-screen, .developer { display:none; }
html[data-view="access"] .shell, html[data-view="developer"] .shell { display:none; }
html[data-view="access"] .account-screen { display:grid; place-items:center; min-height:100dvh; padding:max(20px,env(safe-area-inset-top)) 16px max(20px,env(safe-area-inset-bottom)); background:radial-gradient(ellipse at top right,#dce7ff,transparent 68%); }
.access-card { width:min(100%,425px); padding:clamp(20px,6vw,32px); background:#fff; border:1px solid var(--line); border-radius:22px; box-shadow:0 14px 36px #22356b19; }
.access-card .eyebrow { margin-top:13px; }
.access-card h1, .developer h1 { font-size:clamp(1.55rem,6vw,2.2rem); line-height:1.15; letter-spacing:-.045em; }
.access-description { margin:8px 0 13px; color:var(--muted); font-size:.91rem; line-height:1.48; }
.access-alert { margin:8px 0 12px; padding:8px 10px; background:#eaf0ff; border-radius:8px; color:var(--ink); font-size:.85rem; }
.access-card label { display:block; margin:12px 0; font-size:.84rem; font-weight:730; }
.access-card label[hidden] { display:none; }
.access-card input { display:block; width:100%; min-height:46px; margin-top:5px; padding:9px 11px; border:1px solid #c2cfe8; border-radius:9px; font:inherit; font-size:16px; font-weight:500; background:#f7f9fe; color:var(--ink); }
.access-card button { min-height:43px; width:100%; border-radius:9px; font-weight:730; }
.link-button { margin-top:5px; border:0; background:transparent; color:var(--blue); }
.account-bar { display:flex; align-items:center; gap:8px; }
#session-label { color:var(--muted); font-size:.75rem; max-width:20ch; overflow-wrap:anywhere; }
.account-button { min-height:40px; border-radius:9px; font-weight:680; font-size:.8rem; padding:7px 10px; white-space:nowrap; }
.account-button:disabled { opacity:.55; cursor:default; }
html[data-view="developer"] .developer { display:block; width:min(100%,1120px); margin:auto; padding:max(18px,env(safe-area-inset-top)) 15px 35px; }
.developer-header { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.developer-header .sign-out { margin-left:auto; }
.developer-status { min-height:20px; color:var(--muted); font-size:.83rem; margin:10px 0; }
.developer-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin:12px 0; }
.developer-metrics div { display:grid; gap:5px; padding:12px; color:#fff; border-radius:11px; background:#213bac; }
.developer-metrics span { font-size:.75rem; }
.developer-metrics strong { font-size:1.4rem; }
.developer-block { margin-top:12px; }
.developer-block header, .developer-paging { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:9px; }
.developer-paging { justify-content:flex-end; margin:12px 0 0; font-size:.8rem; }
.table-scroll { overflow:auto; }
table { border-collapse:collapse; width:100%; text-align:left; font-size:.84rem; }
th, td { border-bottom:1px solid var(--line); padding:10px 8px; white-space:nowrap; }
th { color:#38558a; background:#f4f7ff; }
@media(max-width:520px) { #session-label { display:none; } }

#institution-fields { min-width:0; margin:15px 0; padding:10px; border:1px solid var(--line); border-radius:10px; }
#institution-fields[hidden], #institution-results[hidden] { display:none; }
#institution-fields legend { padding:0 4px; font-weight:750; font-size:.88rem; }
#institution-fields label { margin:5px 0 8px; }
#institution-fields select { display:block; width:100%; min-height:42px; margin-top:5px; border:1px solid #c2cfe8; border-radius:9px; padding:6px; font:inherit; font-size:16px; color:var(--ink); background:#f7f9fe; }
#institution-results-count { font-size:.78rem; color:var(--muted); margin:7px 0; }
#institution-results { list-style:none; padding:0; margin:0; max-height:180px; overflow:auto; border:1px solid var(--line); border-radius:8px; }
#institution-results li+li { border-top:1px solid var(--line); }
#institution-results button { display:block; min-height:39px; padding:7px 8px; text-align:left; color:var(--ink); background:#fff; border:0; border-radius:0; font-size:.78rem; }
#institution-results button:hover, #institution-results button:focus-visible { background:#eaf0ff; }
