/* Aligned with platform /dxp es tokens: theme-t.css + theme-shell.css */
:root {
  color-scheme: light;
  --font: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sidebar-w: 260px;
  --es-chrome-row-h: max(3.5rem, 2.75rem);
  --es-shell-max: 1600px;
  --es-aside-dur: 0.28s;
  --es-aside-ease: cubic-bezier(0.33, 1, 0.68, 1);
  --es-backdrop: rgba(15, 23, 42, 0.42);
  --t-bg: #f8fafc;
  --t-surface: #ffffff;
  --t-fg: #0f172a;
  --t-muted: #64748b;
  --t-bd: #e2e8f0;
  --t-accent: #06b6d4;
  --t-on-accent: #ffffff;
  --t-r: 6px;
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #06b6d4;
  --es-chrome-stripe: color-mix(in srgb, var(--text) 2%, var(--bg));
  --es-bar-fg: #f1f5f9;
  --es-bar-fg-muted: #cbd5e1;
  --es-float-card-shadow:
    0 1px 2px color-mix(in srgb, var(--text) 4%, transparent),
    0 8px 22px color-mix(in srgb, var(--text) 8%, transparent);
}

[data-theme="dark"] {
  color-scheme: dark;
  --t-bg: #0f1114;
  --t-surface: #15171a;
  --t-fg: #f1f5f9;
  --t-muted: #94a3b8;
  --t-bd: rgba(148, 163, 184, 0.14);
  --t-accent: #22d3ee;
  --t-on-accent: #0f172a;
  --bg: #0f1114;
  --bg-elevated: #15171a;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.14);
  --accent: #22d3ee;
  --es-chrome-stripe: color-mix(in srgb, var(--text) 2.5%, var(--bg));
  --es-bar-fg: #e2e8f0;
  --es-bar-fg-muted: #94a3b8;
  --es-backdrop: rgba(0, 0, 0, 0.5);
  --es-float-card-shadow:
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.38);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

body.manual {
  margin: 0;
  min-height: 100vh;
}

.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;
}

.chrome_row {
  border-bottom: 1px solid var(--border);
  background: var(--es-chrome-stripe);
}

.manual-page {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.manual-aside {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  max-width: 100%;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.manual-aside__head {
  min-height: var(--es-chrome-row-h);
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.manual-aside__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.manual-aside__brand-mark {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: block;
}

.manual-aside__brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-aside__brand:hover {
  color: var(--accent);
}

.manual-aside__brand:hover .manual-aside__brand-mark {
  opacity: 0.92;
}

.manual-aside__nav {
  flex: 1;
  overflow: auto;
  padding: 0.75rem 0 1.5rem;
}

.manual-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.manual-nav-list > li + li {
  margin-top: 2px;
}

.manual-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 1rem 0.55rem 1.1rem;
  margin: 0 0.5rem;
  border-radius: var(--t-r);
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.manual-nav-link:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

.manual-nav-link.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.manual-nav-link__label {
  font-weight: 600;
  font-size: 0.875rem;
}

.manual-nav-link__hint {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}

.manual-nav-link.is-active .manual-nav-link__hint {
  color: var(--muted);
}

.manual-space {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.manual-bar {
  position: sticky;
  top: 0;
  z-index: 20;
}

.manual-bar__inner {
  min-height: var(--es-chrome-row-h);
  max-width: var(--es-shell-max);
  margin: 0 auto;
  padding: 0 1rem 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.manual-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: var(--t-r);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.manual-nav-toggle:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.manual-nav-toggle__icon {
  width: 1.1rem;
  height: 1px;
  background: currentColor;
  box-shadow:
    0 -5px 0 currentColor,
    0 5px 0 currentColor;
}

.manual-bar__title {
  flex: 1;
  min-width: 0;
}

.manual-page-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: var(--es-chrome-row-h);
}

.manual-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.manual-theme-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--t-r);
  border: 1px solid color-mix(in srgb, var(--text) 12%, var(--border));
  background: var(--bg-elevated);
  cursor: pointer;
  position: relative;
}

.manual-theme-btn::after {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--text);
}

[data-theme="dark"] .manual-theme-btn::after {
  box-shadow:
    inset -4px -3px 0 0 var(--bg-elevated),
    inset 0 0 0 2px var(--text);
}

.manual-space__crumbs {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.manual-crumbs {
  list-style: none;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
  max-width: var(--es-shell-max);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
}

.manual-crumbs__a {
  color: var(--muted);
  text-decoration: none;
}

.manual-crumbs__a:hover {
  color: var(--accent);
}

.manual-crumbs__sep {
  color: var(--muted);
  user-select: none;
}

.manual-crumbs__here {
  color: var(--text);
  font-weight: 500;
}

.manual-main {
  flex: 1;
  width: 100%;
  max-width: var(--es-shell-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.manual-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.manual-prose {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text);
}

.manual-prose > :first-child {
  margin-top: 0;
}

.manual-prose > :last-child {
  margin-bottom: 0;
}

.manual-prose h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

.manual-prose h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.manual-prose h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.manual-prose p {
  margin: 0 0 0.85rem;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

.manual-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.manual-prose a:hover {
  text-decoration-thickness: 2px;
}

.manual-prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid var(--border);
}

.manual-prose pre {
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 1rem;
  border-radius: var(--t-r);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow: auto;
  box-shadow: var(--es-float-card-shadow);
}

.manual-prose pre code {
  padding: 0;
  border: none;
  background: none;
}

.manual-modules__h {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.manual-module-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.manual-module-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: var(--t-r);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--es-float-card-shadow);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.manual-module-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-1px);
}

.manual-module-card__title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.manual-module-card__desc {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.manual-pages__h {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.manual-pages__list {
  margin: 0;
  padding-left: 1.25rem;
}

.manual-pages__list a {
  color: var(--accent);
}

.manual-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: var(--es-backdrop);
}

@media (max-width: 900px) {
  .manual-nav-toggle {
    display: flex;
  }

  .manual-aside {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform var(--es-aside-dur) var(--es-aside-ease);
    box-shadow: none;
  }

  .manual-aside.is-open {
    transform: translateX(0);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  }

  [data-theme="dark"] .manual-aside.is-open {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  }

  .manual-backdrop:not([hidden]) {
    display: block;
  }

  .manual-page {
    flex-direction: column;
  }

  .manual-space {
    width: 100%;
  }
}
