/* ───────────────────────────────────────────────────────
   kariochi · components-docs.css
   Documentation and gallery patterns: GLANCE system overview,
   FOUNDATIONS color/type/icon/voice tables, APP PATTERNS
   (filter-sheet, asset-tabs, streak), and footer.
   Extracted from components.css (split 2026-05-30).
   ─────────────────────────────────────────────────────── */

/* ═════════════════════════════════════════════════════════════════
   GLANCE — system at a glance under the hero
   ═════════════════════════════════════════════════════════════════ */

.glance {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-16);
}
.glance .g-cell {
  background: var(--bg-surface);
  padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3);
  min-height: 220px;
}
.glance .g-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--fg-tertiary);
  display: flex; align-items: baseline; justify-content: space-between;
}
.glance .g-label .n {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--text-xs);
  letter-spacing: 0; text-transform: none;
  color: var(--fg-primary); font-variant-numeric: tabular-nums;
}
.glance .g-swatches { display: flex; flex-direction: column; gap: 6px; }
.glance .g-swatch {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--text-xs);
}
.glance .g-swatch .chip {
  width: 22px; height: 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.glance .g-swatch .name { color: var(--fg-primary); font-weight: var(--weight-medium); }
.glance .g-swatch .hex {
  font-family: ui-monospace, monospace;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
}
.glance .g-type { display: flex; flex-direction: column; gap: var(--space-2); }
.glance .g-type .line {
  display: flex; align-items: baseline; gap: var(--space-2);
  color: var(--fg-primary); letter-spacing: -0.01em;
}
.glance .g-type .line code {
  font-family: ui-monospace, monospace;
  font-size: var(--text-xs); color: var(--fg-tertiary);
  margin-left: auto; font-weight: var(--weight-regular);
  letter-spacing: 0;
}
.glance .g-space { display: flex; flex-direction: column; gap: 6px; }
.glance .g-space .row {
  display: grid; grid-template-columns: 30px 1fr 40px;
  gap: var(--space-2); align-items: center;
  font-size: var(--text-xs);
}
.glance .g-space .row code {
  font-family: ui-monospace, monospace;
  color: var(--fg-tertiary);
}
.glance .g-space .bar {
  background: var(--brand-primary);
  height: 4px; border-radius: 2px;
}
.glance .g-space .px {
  font-family: ui-monospace, monospace;
  color: var(--fg-primary); font-variant-numeric: tabular-nums;
  text-align: right;
}
.glance .g-radii {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.glance .g-radii .box {
  aspect-ratio: 1/1;
  background: var(--bg-brand-soft);
  border: 1.5px solid var(--brand-primary);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 4px;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  color: var(--fg-brand);
  font-weight: var(--weight-semibold);
}

/* ═════════════════════════════════════════════════════════════════
   FOUNDATIONS — color usage table, type rules, icon guide, voice
   ═════════════════════════════════════════════════════════════════ */

.token-table {
  display: grid;
  grid-template-columns: 28px 200px 1fr;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.token-table .row {
  display: contents;
}
.token-table .row > * {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
  font-size: var(--text-sm);
  display: flex; align-items: center;
}
.token-table .row:last-child > * { border-bottom: 0; }
.token-table .chip {
  width: 18px; height: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  padding: 0;
}
.token-table .token-name {
  font-family: ui-monospace, monospace;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--fg-primary);
}
.token-table .token-when {
  font-size: var(--text-xs);
  color: var(--fg-secondary);
  line-height: 1.5;
}

/* type-rule rows */
.type-rules { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.type-rules .rule-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.type-rules .rule-card .demo {
  color: var(--fg-primary);
  margin-bottom: 4px;
}
.type-rules .rule-card .when {
  font-size: var(--text-xs);
  color: var(--fg-secondary);
  line-height: 1.5;
}
.type-rules .rule-card .when code {
  font-family: ui-monospace, monospace;
  background: var(--bg-subtle); padding: 1px 5px; border-radius: var(--radius-sm);
}

/* icon usage */
.icon-guide {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.icon-guide .ic-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
}
.icon-guide .ic-card .ic-stage {
  width: 100%; height: 56px;
  display: grid; place-items: center;
  color: var(--fg-primary);
}
.icon-guide .ic-card .ic-size {
  font-family: ui-monospace, monospace; font-size: var(--text-xs);
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
}
.icon-guide .ic-card .ic-when {
  font-size: var(--text-xs); color: var(--fg-secondary); text-align: center;
  line-height: 1.5;
}

/* voice rows */
.voice-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.voice-table .head, .voice-table .row {
  display: contents;
}
.voice-table .head > * {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-tertiary);
  background: var(--bg-app);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.voice-table .row > * {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 14px;
  font-size: var(--text-sm);
  line-height: 1.5;
}
.voice-table .row:last-child > * { border-bottom: 0; }
.voice-table .bad { color: var(--fg-tertiary); text-decoration: line-through; text-decoration-color: var(--status-error-fg); text-decoration-thickness: 1.5px; }
.voice-table .good { color: var(--fg-primary); font-weight: var(--weight-medium); }

/* compact subsection title */
.subsection {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  display: flex; align-items: baseline; gap: var(--space-3);
}
.subsection h3 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.015em;
}
.subsection .sub-label {
  font-size: var(--text-xs); color: var(--fg-tertiary);
  font-weight: var(--weight-medium);
}

/* ══════════════════════════════════════════════════════════════════
   APP PATTERNS — filter sheet, asset tabs, streak
   ═════════════════════════════════════════════════════════════════ */

/* Filter sheet — popover with multiple chip groups */
.filter-sheet {
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-4) 0;
  display: flex; flex-direction: column;
}
.filter-group {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-3);
}
.filter-group:last-of-type { border-bottom: 0; margin-bottom: 0; }
.filter-group-head {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-tertiary);
}
.filter-group .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-chip {
  display: inline-flex; align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  background: transparent;
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast);
}
.filter-chip:hover { color: var(--fg-primary); background: var(--bg-hover); }
.filter-chip.is-on {
  background: var(--fg-primary);
  color: var(--bg-surface);
}
.filter-sheet-foot {
  display: flex; justify-content: flex-end;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border-subtle);
  margin: 0 calc(var(--space-4) * -1) 0;
  padding: var(--space-2) var(--space-4);
}
.filter-sheet-foot .reset-all {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast);
}
.filter-sheet-foot .reset-all:hover { color: var(--fg-primary); background: var(--bg-hover); }

/* Asset tabs — tab with format chip + status dot inside */
.asset-tabs {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-1);
}
.asset-tab {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-3) calc(var(--space-3) + 1px);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  background: transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  position: relative;
  transition: color var(--duration-fast), background var(--duration-fast);
}
.asset-tab:hover { color: var(--fg-primary); background: var(--bg-hover); }
.asset-tab.is-active {
  color: var(--fg-primary);
  font-weight: var(--weight-semibold);
}
.asset-tab.is-active::after {
  content: ""; position: absolute;
  left: var(--space-3); right: var(--space-3); bottom: 0;
  height: 2px; background: var(--brand-primary);
  border-radius: 2px 2px 0 0;
}
.asset-tab > svg { width: 15px; height: 15px; color: var(--fg-tertiary); flex-shrink: 0; }
.asset-tab.is-active > svg { color: var(--fg-primary); }
.fmt-chip {
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  background: var(--bg-brand-soft);
  color: var(--fg-brand);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  line-height: 1.4;
}
.asset-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--status-success-fg);
  flex-shrink: 0;
}
.asset-dot.muted   { background: var(--border-strong); }
.asset-dot.pending { background: var(--status-warning-fg); }

/* Streak widget — daily streak compact card */
.streak-widget {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  min-width: 280px;
}
.streak-widget .fire-box {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: rgba(208, 141, 30, 0.10);
  display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.streak-widget .fire-box svg { width: 18px; height: 18px; color: var(--status-warning-fg); }
.streak-widget .streak-meta { flex: 1; min-width: 0; }
.streak-widget .streak-top {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--fg-primary);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.streak-widget .streak-sub {
  font-size: var(--text-xs);
  color: var(--fg-tertiary);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.streak-widget .streak-bar {
  width: 48px; height: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  position: relative;
  flex-shrink: 0;
}
.streak-widget .streak-bar::after {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--pct, 14%);
  background: var(--brand-primary);
  border-radius: var(--radius-full);
}

/* ════════════════════════════════════════════════════════════════════════
   FOOTER NOTE
   ════════════════════════════════════════════════════════════════════════ */

.footer {
  margin-top: var(--space-16);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm); color: var(--fg-tertiary);
  display: flex; align-items: center; justify-content: space-between;
}
.footer b { color: var(--fg-primary); font-weight: var(--weight-semibold); }
.footer-mark {
  font-family: "Bricolage Grotesque", Inter, sans-serif;
  font-weight: 800;
  font-size: var(--text-sm);
  letter-spacing: -0.04em;
  text-transform: lowercase;
  color: var(--fg-primary);
  font-optical-sizing: auto;
}
.footer-mark em {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  color: var(--brand-primary);
  letter-spacing: -0.02em;
}
