/* Shared component structure. Each design sets the tokens: --fg, --muted, --line, --glass, --glass-line, --accent, --radius. */
.linked h2 { margin: 0 0 12px; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.linked ul { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.linked a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: calc(var(--radius, 16px) - 4px); color: inherit; text-decoration: none;
  border: 1px solid var(--line); transition: background 0.2s, border-color 0.2s; }
.linked a:hover { background: var(--hover, rgba(127, 127, 127, 0.1)); }
.linked img, .linked-dot { width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover; background: var(--line); }
.linked-text { display: flex; flex-direction: column; min-width: 0; }
.linked-text small { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.linked-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tracks { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.track { display: grid; grid-template-columns: 36px 1fr minmax(60px, 30%) 44px; gap: 12px; align-items: center; padding: 8px 12px 8px 8px;
  border-radius: 14px; border: 1px solid var(--line); }
.track.on { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.track-play { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; background: var(--fg); color: var(--bg); font-size: 12px; line-height: 36px; padding: 0; }
.track-play::after { content: '▶'; }
.track.playing .track-play::after { content: '❚❚'; font-size: 10px; letter-spacing: -1px; }
.track-progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; cursor: pointer; }
.track-bar { display: block; height: 100%; width: 0; background: var(--accent); }
.track-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; text-align: right; }

.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 48px 72px; background: rgba(5, 5, 6, 0.72);
  -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4); opacity: 0; transition: opacity 0.3s ease; color: #f5f5f4; }
.lightbox.on { opacity: 1; }
html.lb-open, html.lb-open body { overflow: hidden; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-height: 100%; }
.lightbox img { max-width: min(1100px, 100%); max-height: calc(100svh - 200px); border-radius: 10px; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8); }
.lightbox figcaption { max-width: 640px; text-align: center; font-size: 14px; }
.lightbox figcaption p { margin: 0 0 4px; }
.lightbox figcaption small { color: #a3a3a3; }
.lb-nav, .lb-close { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.16); color: #fff; font-size: 22px;
  background: rgba(255, 255, 255, 0.08); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); cursor: pointer; }
.lb-nav:hover, .lb-close:hover { background: rgba(255, 255, 255, 0.16); }
.lb-prev { left: 16px; top: 50%; } .lb-next { right: 16px; top: 50%; }
.lb-close { right: 16px; top: 16px; font-size: 15px; }
.lb-count { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); font-size: 12px; color: #a3a3a3; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .lightbox { padding: 64px 12px; } .lb-nav { top: auto; bottom: 16px; } }

.prose { line-height: 1.7; overflow-wrap: break-word; }
.prose h1, .prose h2, .prose h3 { line-height: 1.25; letter-spacing: -0.02em; margin: 1.8em 0 0.6em; }
.prose h1 { font-size: 1.6em; } .prose h2 { font-size: 1.3em; } .prose h3 { font-size: 1.1em; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 1.1em; }
.prose a { color: var(--accent); }
.prose code { font: 0.88em ui-monospace, 'SF Mono', Menlo, monospace; padding: 0.1em 0.35em; border-radius: 6px; background: var(--line); }
.prose pre { padding: 16px; border-radius: 14px; overflow: auto; background: var(--code-bg, rgba(127, 127, 127, 0.1)); border: 1px solid var(--line); }
.prose pre code { padding: 0; background: none; font-size: 13px; line-height: 1.6; }
.prose blockquote { padding-left: 16px; border-left: 2px solid var(--accent); color: var(--muted); }
.prose img { max-width: 100%; border-radius: 12px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.prose .mermaid { margin: 0 0 1.1em; padding: 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--code-bg, rgba(127, 127, 127, 0.06)); overflow-x: auto; text-align: center; min-height: 80px; }
.prose .mermaid svg { max-width: 100%; height: auto; }
.prose .mermaid.failed { text-align: left; white-space: pre; font: 13px ui-monospace, 'SF Mono', Menlo, monospace; color: var(--muted); }
/* Mermaid names its label groups .label. Page label styles stay off them, both while mermaid measures and once drawn. */
svg .label { margin: 0; letter-spacing: normal; text-transform: none; color: inherit; font-weight: inherit; }
.sh-btn.small { width: fit-content; height: 36px; margin: 4px auto 0; padding: 0 16px; gap: 6px; font-size: 13px; }
