:root {
  --bg: #ffffff;
  --surface: #f6f6f4;
  --text: #0b0b0b;
  --muted: #5c5c5c;
  --border: #e6e6e3;
  --accent: #0b0b0b;
  --accent-soft: #f0f0ee;
  --accent-ink: #ffffff;
  --todo-bg: #fff1a8;
  --todo-text: #5a4a00;
  --radius: 14px;
}
[data-app="pro"] {
  --accent: #10b98a;
  --accent-soft: #e3fbf3;
  --accent-ink: #062b21;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0c;
    --surface: #161616;
    --text: #f2f2f0;
    --muted: #a3a3a0;
    --border: #262626;
    --accent: #f2f2f0;
    --accent-soft: #1d1d1d;
    --accent-ink: #0c0c0c;
    --todo-bg: #4a3f00;
    --todo-text: #ffe98a;
  }
  [data-app="pro"] {
    --accent: #1fe5b6;
    --accent-soft: #0f2a23;
    --accent-ink: #062b21;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px; flex-wrap: wrap; padding-block: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { border-radius: 9px; border: 1px solid var(--border); }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.pro-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.25em;
  background: #1fe5b6; color: #062b21; padding: 3px 7px 3px 9px; border-radius: 6px;
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px;
  padding: 6px 10px; border-radius: 8px;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }

/* Document */
.doc { padding: 48px 0 72px; }
.eyebrow {
  margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 16px; }
h2 {
  font-size: 22px; letter-spacing: -0.02em; font-weight: 800; line-height: 1.25;
  margin: 48px 0 12px; padding-top: 24px; border-top: 1px solid var(--border);
  scroll-margin-top: 88px;
}
h3 { font-size: 17px; font-weight: 600; margin: 28px 0 8px; }
p, li { color: var(--text); }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 12px; }
.updated { font-size: 14px; color: var(--muted); margin: 0 0 24px; }
a { color: var(--text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
[data-app="pro"] .doc a { text-decoration-color: var(--accent); }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
strong { font-weight: 600; }

.toc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; margin: 8px 0 8px;
}
.toc-title { margin: 0 0 6px; font-weight: 600; font-size: 14px; color: var(--muted); }
.toc ol { margin: 0; columns: 2 240px; column-gap: 32px; }
.toc a { text-decoration: none; font-size: 15px; }
.toc a:hover { text-decoration: underline; }

.card, .note {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px; margin: 20px 0;
}
.note { background: var(--accent-soft); border-color: transparent; }
.note p:first-child, .card p:first-child { margin-top: 0; }
.note p:last-child, .card p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { background: var(--surface); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

dl.info { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 20px; margin: 16px 0; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; font-weight: 500; }
@media (max-width: 560px) {
  dl.info { grid-template-columns: 1fr; gap: 2px; }
  dl.info dd { margin-bottom: 10px; }
}

mark.todo { background: var(--todo-bg); color: var(--todo-text); padding: 1px 6px; border-radius: 5px; font-weight: 600; }

/* Hub */
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 32px 0; }
.app-card {
  display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: 20px; padding: 24px; background: var(--bg);
  transition: border-color .15s, transform .15s;
}
.app-card:hover { border-color: var(--text); transform: translateY(-2px); }
.app-card img { width: 64px; height: 64px; border-radius: 15px; border: 1px solid var(--border); }
.app-card h2 { border: 0; padding: 0; margin: 0; font-size: 22px; }
.app-card p { margin: 0; color: var(--muted); }
.links { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.links li { margin: 0; }
.links a {
  display: block; text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; background: var(--bg);
}
.links a:hover { border-color: var(--accent); }
.links strong { display: block; }
.links span { color: var(--muted); font-size: 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 24px; }
.footer-inner p { margin: 0; color: var(--muted); }
.footer-inner nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--text); }
.toc li { margin: 0 0 6px; break-inside: avoid; }
