:root {
  /* Match the canonical MD-01 grid surface exactly. */
  --site-grid-line: color-mix(in oklab, oklch(0.79 0.012 262) 14%, transparent);
  --site-grid-major-line: color-mix(in oklab, oklch(0.79 0.012 262) 24%, transparent);

  --deep: oklch(0.255 0.032 266);
  --deep-raised: oklch(0.305 0.034 267);
  --deep-line: oklch(0.385 0.03 267);
  --on-deep: oklch(0.945 0.005 258);
  --on-deep-soft: oklch(0.83 0.012 262);
  --on-deep-muted: oklch(0.715 0.016 264);
  --accent-on-deep: oklch(0.78 0.12 292);
  --complete-on-deep: oklch(0.8 0.16 152);
  --shell-shadow: 0 1px 2px oklch(0.2 0.04 265 / 0.05), 0 10px 28px -18px oklch(0.2 0.04 265 / 0.2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.md-shell-chrome { font-family: var(--sans); }
.chrome-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.site-header { position: relative; z-index: 50; padding: 12px 0 0; }
.desktop-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }

.brand-panel,
.nav-panel,
.header-utility,
.header-primary,
.mobile-menu-button {
  min-height: 44px;
  border: 1px solid var(--deep-line);
  background: color-mix(in oklab, var(--deep) 94%, transparent);
  color: var(--on-deep);
  border-radius: 10px;
  box-shadow: var(--shell-shadow);
  text-decoration: none;
}

.brand-panel { display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.header-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--deep-line);
  border-radius: 8px;
  background: var(--deep-raised);
  color: var(--accent-on-deep);
  font: 800 9px/1 var(--mono);
  letter-spacing: .08em;
}
.header-wordmark { font: 760 10px/1 var(--mono); letter-spacing: .12em; }

.nav-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; }
.nav-panel a {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border-right: 1px solid var(--deep-line);
  color: var(--on-deep-soft);
  text-decoration: none;
  font: 650 9px/1 var(--mono);
  letter-spacing: .06em;
  transition: background-color .18s ease, color .18s ease;
}
.nav-panel a:last-child { border-right: 0; }
.nav-panel a:hover,
.nav-panel a:focus-visible { background: var(--deep-raised); color: var(--on-deep); outline: none; }
.nav-panel strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; }
.nav-code { color: var(--on-deep-muted); font-size: 7px; }

.header-actions { display: flex; gap: 8px; }
.header-utility,
.header-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  font: 700 8px/1 var(--mono);
  letter-spacing: .07em;
  white-space: nowrap;
}
.header-utility:hover,
.header-utility:focus-visible { background: var(--deep-raised); outline: none; }
.header-primary { background: var(--on-deep); color: var(--deep); border-color: var(--on-deep); }
.header-primary:hover,
.header-primary:focus-visible { background: white; outline: none; }

.mobile-header { display: none; }
.mobile-nav { position: relative; }
.mobile-nav summary { list-style: none; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-menu-button { width: 44px; padding: 0; display: grid; place-items: center; cursor: pointer; }
.hamburger { width: 17px; display: grid; gap: 3px; }
.hamburger i { height: 1px; display: block; background: var(--on-deep); transition: transform .18s ease, opacity .18s ease; }
.mobile-nav[open] .hamburger i:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.mobile-nav[open] .hamburger i:nth-child(2) { opacity: 0; }
.mobile-nav[open] .hamburger i:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }
.mobile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, calc(100vw - 28px));
  display: grid;
  padding: 8px;
  border: 1px solid var(--deep-line);
  border-radius: 14px;
  background: var(--deep);
  box-shadow: 0 20px 60px -30px oklch(0.15 0.03 266 / .7);
}
.mobile-route {
  min-height: 46px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--on-deep-soft);
  text-decoration: none;
}
.mobile-route:hover,
.mobile-route:focus-visible { background: var(--deep-raised); outline: none; }
.mobile-route span { color: var(--on-deep-muted); font: 650 8px/1 var(--mono); }
.mobile-route b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 10px/1 var(--mono); letter-spacing: .05em; }
.mobile-route i { color: var(--accent-on-deep); font-style: normal; }
.mobile-menu-cta { margin-top: 4px; border-top: 1px solid var(--deep-line); }

.site-footer { margin-top: 32px; padding: 22px 0 18px; background: var(--deep); color: var(--on-deep); border-top: 1px solid var(--deep-line); }
.footer-state {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--deep-line);
  background: var(--deep-raised);
  border-radius: 12px;
  padding: 10px 13px;
  font: 650 8px/1 var(--mono);
  letter-spacing: .1em;
  color: var(--on-deep-soft);
}
.footer-state > div { display: flex; align-items: center; gap: 8px; }
.footer-state .state-dot { background: var(--complete-on-deep); box-shadow: none; }
.footer-state strong { color: var(--complete-on-deep); }
.footer-grid { display: grid; grid-template-columns: 1.08fr .96fr .96fr; gap: 10px; margin-top: 10px; }
.footer-card { min-width: 0; border: 1px solid var(--deep-line); background: var(--deep-raised); border-radius: 16px; padding: 18px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--deep-line);
  border-radius: 12px;
  background: var(--deep);
  color: var(--accent-on-deep);
  font: 800 11px/1 var(--mono);
}
.footer-wordmark { color: var(--on-deep); font: 760 17px/1 var(--mono); letter-spacing: .12em; }
.footer-role { margin: 12px 0 0; color: var(--on-deep-soft); font-size: 13px; }
.footer-description { margin: 10px 0 0; max-width: 42ch; color: var(--on-deep-muted); font-size: 12px; line-height: 1.55; }
.direct-channel,
.route-list a,
.system-links a { display: flex; align-items: center; gap: 10px; text-decoration: none; border-radius: 9px; transition: background-color .18s ease, border-color .18s ease; }
.direct-channel { justify-content: space-between; margin-top: 18px; border: 1px solid var(--deep-line); padding: 11px; background: var(--deep); }
.direct-channel span { display: grid; }
.direct-channel small,
.footer-card-title,
.route-list a span,
.system-links a span { font: 650 8px/1 var(--mono); letter-spacing: .09em; color: var(--on-deep-muted); }
.direct-channel b { color: var(--on-deep-soft); font-size: 12px; }
.direct-channel i { color: var(--accent-on-deep); font-style: normal; }
.footer-card-title { padding-bottom: 12px; border-bottom: 1px solid var(--deep-line); color: var(--on-deep-soft); }
.route-list,
.system-links { display: grid; gap: 4px; margin-top: 10px; }
.route-list a,
.system-links a { min-height: 38px; padding: 0 9px; color: var(--on-deep-soft); }
.route-list a:hover,
.route-list a:focus-visible,
.system-links a:hover,
.system-links a:focus-visible,
.direct-channel:hover,
.direct-channel:focus-visible { background: var(--deep); border-color: var(--accent-on-deep); outline: none; }
.route-list a span { width: 22px; }
.system-links a span { width: 44px; }
.route-list a b,
.system-links a b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--on-deep-soft); font-size: 12px; }
.route-list a i,
.system-links a i { color: var(--accent-on-deep); font-style: normal; }
.footer-bottom { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; border-top: 1px solid var(--deep-line); padding-top: 12px; color: var(--on-deep-muted); font-size: 10px; }
.footer-accent { color: var(--accent-on-deep); }

/* The old light topbar/footer remain out of the rendering path. */
body > .topbar,
body > .footer { display: none !important; }

@media (max-width: 1100px) {
  .desktop-header { display: none; }
  .mobile-header { display: flex; justify-content: space-between; align-items: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .identity-card { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .chrome-shell { width: min(100% - 28px, 1180px); }
  .site-header { padding-top: 10px; }
  .footer-state { align-items: flex-start; flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
  .identity-card { grid-column: auto; }
  .site-footer { margin-top: 18px; }
}

@media (max-width: 390px) {
  .chrome-shell { width: calc(100% - 22px); }
  .brand-panel { padding: 0 10px; }
  .header-mark { width: 30px; height: 30px; }
  .header-wordmark { font-size: 9px; }
  .footer-card { padding: 14px; }
}

@media (max-width: 639px) {
  :root {
    --site-grid-line: color-mix(in oklab, oklch(0.79 0.012 262) 10%, transparent);
    --site-grid-major-line: color-mix(in oklab, oklch(0.79 0.012 262) 18%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .md-shell-chrome *,
  .md-shell-chrome *::before,
  .md-shell-chrome *::after { transition: none !important; animation: none !important; }
}
