/* eclipse health marketplace · static site styles
   Low-saturation palette, no framework, light/dark, responsive. */

:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --bg-deep: #efeadd;
  --surface: #fffdf7;
  --surface-2: #f3efe5;
  --ink: #26251f;
  --ink-soft: #514e44;
  --muted: #7a766a;
  --line: #ded7c8;
  --line-strong: #c8bfad;
  --accent: #5f7358;
  --accent-ink: #3d4f37;
  --accent-soft: #e4e9dd;
  --mauve: #7d6b7f;
  --mauve-soft: #ece4ee;
  --warn: #956a2d;
  --warn-soft: #f4e8d3;
  --danger: #8c4a45;
  --danger-soft: #f5e0dd;
  --ok: #4e6d4e;
  --ok-soft: #e1ebdf;
  --shadow-sm: 0 1px 2px rgb(38 37 31 / 6%);
  --shadow-md: 0 2px 4px rgb(38 37 31 / 5%), 0 18px 40px -28px rgb(38 37 31 / 34%);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --container: 1120px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15171a;
  --bg-deep: #1a1d21;
  --surface: #1d2024;
  --surface-2: #23272c;
  --ink: #e9e6df;
  --ink-soft: #c3bfb5;
  --muted: #969287;
  --line: #30353b;
  --line-strong: #41474f;
  --accent: #a2b79b;
  --accent-ink: #c8d7c2;
  --accent-soft: #263026;
  --mauve: #bfaec2;
  --mauve-soft: #2e2830;
  --warn: #d3a563;
  --warn-soft: #332a1e;
  --danger: #d99890;
  --danger-soft: #372523;
  --ok: #9dbd9c;
  --ok-soft: #243026;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 28%);
  --shadow-md: 0 2px 5px rgb(0 0 0 / 30%), 0 22px 48px -30px rgb(0 0 0 / 80%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15171a;
    --bg-deep: #1a1d21;
    --surface: #1d2024;
    --surface-2: #23272c;
    --ink: #e9e6df;
    --ink-soft: #c3bfb5;
    --muted: #969287;
    --line: #30353b;
    --line-strong: #41474f;
    --accent: #a2b79b;
    --accent-ink: #c8d7c2;
    --accent-soft: #263026;
    --mauve: #bfaec2;
    --mauve-soft: #2e2830;
    --warn: #d3a563;
    --warn-soft: #332a1e;
    --danger: #d99890;
    --danger-soft: #372523;
    --ok: #9dbd9c;
    --ok-soft: #243026;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 28%);
    --shadow-md: 0 2px 5px rgb(0 0 0 / 30%), 0 22px 48px -30px rgb(0 0 0 / 80%);
  }
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 8% -8%, var(--accent-soft) 0%, transparent 62%),
    radial-gradient(900px 480px at 96% -18%, var(--mauve-soft) 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.22;
  letter-spacing: -0.015em;
  font-weight: 650;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

li + li {
  margin-top: 0.35em;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  padding: 0.5rem 0.9rem;
}

.skip-link:focus {
  top: 1rem;
}

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

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
  flex-wrap: wrap;
  padding-block: 0.55rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  align-self: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 2px var(--accent);
  position: relative;
  flex: none;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -4px -1px -1px 9px;
  border-radius: 50%;
  background: var(--bg);
}

.brand-name {
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 1.02rem;
  white-space: nowrap;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  font-size: 0.94rem;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.theme-toggle:hover {
  background: var(--surface-2);
  transform: rotate(-8deg);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

[data-theme="dark"] .icon-sun,
:root:not([data-theme="light"]) .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }
}

/* ---------------------------------------------------------------- shared */
main {
  display: block;
  padding-bottom: 5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.lede {
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.6vw, 1.16rem);
  max-width: 62ch;
}

.fine-print {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.62rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--surface);
}

.btn-primary:hover {
  background: var(--accent-ink);
  color: var(--surface);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.btn-small {
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  font-size: 0.86rem;
}

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--warn);
}

.badge-danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
}

.badge-accent {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent-ink);
}

.section {
  padding-top: clamp(3rem, 7vw, 5.5rem);
}

.section-head {
  max-width: 64ch;
  margin-bottom: 2rem;
}

.section-head p {
  color: var(--ink-soft);
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}

/* ---------------------------------------------------------------- hero */
.hero {
  padding-top: clamp(2.5rem, 7vw, 5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.hero-copy h1 {
  margin-bottom: 1.1rem;
}

.accent-text {
  color: var(--accent);
}

.cta-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

.release-card {
  padding: 1.4rem;
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface) 92%, var(--accent-soft)), var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.release-card h2 {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.release-card .version {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.8rem;
}

.release-meta {
  display: grid;
  gap: 0.55rem;
  margin: 1.1rem 0;
  padding: 0;
  list-style: none;
}

.release-meta li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed var(--line);
  margin: 0;
  font-size: 0.86rem;
}

.release-meta span:first-child {
  color: var(--muted);
}

.release-meta span:last-child {
  text-align: right;
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

.release-card .btn {
  width: 100%;
}

/* ---------------------------------------------------------------- home cards */
.pillar {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pillar .pillar-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-bottom: 0.55rem;
}

.pillar .pillar-icon svg {
  width: 19px;
  height: 19px;
}

.pillar p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
}

.pillar .pillar-link {
  margin-top: auto;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.feature {
  padding: 1.2rem;
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.feature p {
  color: var(--ink-soft);
  font-size: 0.89rem;
  margin-bottom: 0;
}

.callout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--warn) 32%, var(--line));
  background: color-mix(in srgb, var(--warn-soft) 62%, var(--surface));
}

.callout svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--warn);
  margin-top: 0.15rem;
}

.callout h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.callout p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), var(--mauve-soft));
  border: 1px solid var(--line);
}

.cta-band h2 {
  margin-bottom: 0.3rem;
}

.cta-band p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------- modules */
.page-head {
  padding-top: clamp(2.2rem, 5vw, 3.6rem);
}

.page-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.page-head p {
  color: var(--ink-soft);
  max-width: 68ch;
}

.market-toolbar {
  margin-top: 1.8rem;
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  background: var(--surface-2);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.search-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
}

.search-field svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  translate: 0 -50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.9rem 0.55rem 2.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.94rem;
}

.search-field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.result-count {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.chip-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.25rem 0.72rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--line-strong);
}

.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent-ink);
  font-weight: 600;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  min-width: 0;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.module-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.module-card h2 {
  font-size: 1.03rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.module-id {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.module-desc {
  color: var(--ink-soft);
  font-size: 0.87rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.module-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.76rem;
}

.module-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.4rem;
  flex-wrap: wrap;
}

.module-actions .btn {
  flex: 1 1 auto;
}

.state-box {
  grid-column: 1 / -1;
  padding: 2.4rem 1.4rem;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink-soft);
}

.state-box h2 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.state-box p {
  margin: 0 auto;
  max-width: 58ch;
  font-size: 0.9rem;
}

.state-box code {
  font-size: 0.82em;
}

/* ---------------------------------------------------------------- dialog */
dialog.module-dialog {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(86vh, 900px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 45%);
  overflow: hidden;
}

dialog.module-dialog::backdrop {
  background: rgb(20 20 18 / 52%);
  backdrop-filter: blur(2px);
}

.dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 900px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.4rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-size: 1.3rem;
  margin: 0.15rem 0;
  overflow-wrap: anywhere;
}

.dialog-close {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-body {
  padding: 1.2rem 1.4rem;
  overflow-y: auto;
}

.dialog-body h3 {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.2rem 0 0.5rem;
}

.dialog-body h3:first-child {
  margin-top: 0;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr);
  gap: 0.4rem 1rem;
  margin: 0;
  font-size: 0.88rem;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

.permission-list li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.48rem 0;
  border-bottom: 1px dashed var(--line);
  margin: 0;
  font-size: 0.88rem;
}

.permission-list code {
  flex: none;
  font-size: 0.76rem;
}

.permission-list span {
  color: var(--ink-soft);
}

.dialog-foot {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 0.9rem 1.4rem 1.2rem;
  border-top: 1px solid var(--line);
}

.notice-inline {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
}

.mono-line {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- docs */
.docs-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  padding-top: clamp(2rem, 5vw, 3.2rem);
}

.docs-toc {
  position: sticky;
  top: 88px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.docs-toc h2 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.docs-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.1rem;
}

.docs-toc li {
  margin: 0;
}

.docs-toc a {
  display: block;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.84rem;
}

.docs-toc a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.docs-main {
  min-width: 0;
}

.docs-main section {
  padding-bottom: 2.2rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;
}

.docs-main section:last-child {
  border-bottom: 0;
}

.docs-main h2 {
  font-size: 1.45rem;
  margin-bottom: 0.7rem;
}

.docs-main h3 {
  margin-top: 1.4rem;
}

.docs-main p,
.docs-main li {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.code-block {
  position: relative;
  margin: 0 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
}

.code-block pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.8rem;
  color: var(--ink);
}

.copy-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.table-scroll {
  overflow-x: auto;
  margin-bottom: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 520px;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  color: var(--ink-soft);
}

td code {
  font-size: 0.8em;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 0.7rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
}

.check-list {
  list-style: none;
  padding: 0;
}

.check-list li {
  position: relative;
  padding-left: 1.7rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42rem;
  width: 0.55rem;
  height: 0.3rem;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.42rem;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0 2.6rem;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-grid p {
  margin: 0 0 0.4rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.disclaimer {
  max-width: 66ch;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .release-card {
    max-width: 520px;
  }
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-toc {
    position: static;
  }
  .docs-toc ol {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }
  .container {
    width: min(var(--container), 100% - 1.6rem);
  }
  .brand-sub {
    display: none;
  }
  .header-inner {
    min-height: 60px;
    gap: 0.4rem;
  }
  .site-nav a {
    padding: 0.36rem 0.6rem;
    font-size: 0.88rem;
  }
  .theme-toggle {
    width: 34px;
    height: 34px;
    margin-left: 0.1rem;
  }
  .hero {
    padding-top: 2rem;
  }
  .cta-row .btn {
    flex: 1 1 100%;
  }
  .detail-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }
  .detail-list dt {
    margin-top: 0.45rem;
  }
  .dialog-head,
  .dialog-body,
  .dialog-foot {
    padding-inline: 1rem;
  }
  .market-toolbar {
    padding: 0.8rem;
  }
  table {
    min-width: 460px;
  }
}

@media (max-width: 380px) {
  .site-nav {
    gap: 0;
  }
  .site-nav a {
    padding-inline: 0.45rem;
  }
}
