:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f6f5f1;
  --bg-tertiary: #ecebe5;
  --text: #1c1c1a;
  --text-soft: #5f5e5a;
  --text-faint: #8a8983;
  --border: rgba(28, 28, 26, 0.12);
  --border-strong: rgba(28, 28, 26, 0.22);
  --accent: #534AB7;
  --warning: #BA7517;
  --success: #0F6E56;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 48px 32px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.wrap { max-width: 920px; margin: 0 auto; }

header { margin-bottom: 36px; }
h1 { font-size: 24px; font-weight: 500; margin: 0 0 4px; }
.sub { font-size: 14px; color: var(--text-soft); margin: 0; }

.section { margin-bottom: 40px; }
.section-title {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--border-strong);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(28, 28, 26, 0.06);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.card-title { font-size: 16px; font-weight: 500; margin: 0; line-height: 1.3; }

.badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--warning);
  background: rgba(186, 117, 23, 0.1);
  border: 0.5px solid rgba(186, 117, 23, 0.3);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}
.badge.shared {
  color: var(--accent);
  background: rgba(83, 74, 183, 0.1);
  border-color: rgba(83, 74, 183, 0.3);
}

.card-desc { font-size: 13px; color: var(--text-soft); margin: 0 0 14px; flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag {
  font-size: 11px;
  color: var(--accent);
  background: rgba(83, 74, 183, 0.08);
  border-radius: 4px;
  padding: 2px 8px;
}

.card-meta { font-size: 11px; color: var(--text-faint); }

.empty {
  font-size: 13px;
  color: var(--text-faint);
  padding: 16px 0;
}

footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 0.5px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
}

/* ---- Docs: file list ---- */
.filelist { list-style: none; margin: 0; padding: 0; }
.filelist li {
  padding: 12px 0;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.file-title { font-size: 15px; font-weight: 500; color: var(--accent); text-decoration: none; }
.file-title:hover { text-decoration: underline; }
.file-meta { font-size: 12px; color: var(--text-faint); }
.file-desc { flex-basis: 100%; margin: 2px 0 0; font-size: 13px; color: var(--text-soft); }

/* ---- Docs: rendered markdown page ---- */
.doc-wrap { max-width: 720px; }
.doc-head { margin-bottom: 28px; }
.doc-head h1 { margin-bottom: 6px; }
.doc-meta { font-size: 12px; color: var(--text-faint); margin: 8px 0 0; }
.doc-meta a { color: var(--accent); text-decoration: none; }
.doc-meta a:hover { text-decoration: underline; }
.doc { font-size: 15px; line-height: 1.65; }
.doc h1, .doc h2, .doc h3, .doc h4 { font-weight: 500; line-height: 1.3; margin: 1.6em 0 0.5em; }
.doc h1 { font-size: 24px; } .doc h2 { font-size: 20px; } .doc h3 { font-size: 17px; }
.doc p { margin: 0 0 1em; }
.doc a { color: var(--accent); }
.doc ul, .doc ol { margin: 0 0 1em; padding-left: 1.4em; }
.doc li { margin: 0.25em 0; }
.doc blockquote {
  margin: 1em 0; padding: 0.4em 1em;
  border-left: 3px solid var(--border-strong);
  color: var(--text-soft);
}
.doc code {
  background: var(--bg-soft); border-radius: 4px;
  padding: 0.1em 0.35em; font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.doc pre {
  background: var(--bg-soft); border: 0.5px solid var(--border);
  border-radius: 8px; padding: 14px 16px; overflow-x: auto;
}
.doc pre code { background: none; padding: 0; font-size: 13px; }
.doc table { border-collapse: collapse; margin: 1em 0; font-size: 14px; }
.doc th, .doc td { border: 0.5px solid var(--border); padding: 6px 12px; text-align: left; }
.doc th { background: var(--bg-soft); font-weight: 500; }
.doc img { max-width: 100%; border-radius: 8px; }
.doc hr { border: none; border-top: 0.5px solid var(--border); margin: 2em 0; }
