:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --accent: #0071e3;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 16px;
}

.brand-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand h1 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 600;
}

.brand-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.nav {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav button {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.nav button:hover {
  background: #f5f5f7;
}

.nav button.active {
  background: #e8f2fd;
  color: var(--accent);
  font-weight: 600;
}

.nav .count {
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.sidebar-foot .ghost {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
}

.main {
  padding: 24px 28px 40px;
  overflow: auto;
}

.view.hidden {
  display: none;
}

.hero {
  max-width: 960px;
}

.hero h2 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.stat {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.tag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tag-table th,
.tag-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.tag-table th {
  color: var(--muted);
  font-weight: 500;
}

.list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.list-header h2 {
  margin: 0;
  font-size: 22px;
}

.list-header .meta {
  color: var(--muted);
  font-size: 14px;
}

.search {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 15px;
  margin-bottom: 16px;
}

.page-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
}

.page-list li {
  border-bottom: 1px solid var(--line);
}

.page-list li:last-child {
  border-bottom: none;
}

.page-list a {
  display: block;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
}

.page-list a:hover {
  background: #f5f5f7;
}

.page-list .path {
  font-size: 13px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.page-list .label {
  font-size: 14px;
  margin-top: 2px;
}

.page-detail header {
  margin-bottom: 16px;
}

.page-detail h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.page-detail .crumb {
  font-size: 13px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef0f3;
  color: #424245;
}

.preview-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}
