/* Knowledge Base → Community (pages/community.js): platform tabs, the newest-videos grid, topic chips and one ruled board
   per platform. Flat: hairlines and white cards, no shadows on controls (DESIGN.md). */
.cm { padding-bottom: 60px; }
.cm-hero { margin: 18px 0 22px; }
.cm-hero .title { margin: 0 0 8px; }
.cm-hero .lead { margin: 0 0 6px; max-width: 70ch; }
.cm-hero .small { margin: 0; }

/* platform tabs: links, the current one Ink-filled */
.cm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.cm-tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid hsl(var(--border)); border-radius: 999px; background: hsl(var(--card)); color: inherit; font-size: 14px; font-weight: 500; text-decoration: none; transition: background-color .15s, border-color .15s; }
.cm-tabs a:hover { border-color: hsl(var(--muted-foreground) / .45); }
.cm-tabs a b { font-weight: 600; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.cm-tabs a svg { width: 16px; height: 16px; flex: none; }
.cm-tabs a[aria-current="page"] { background: hsl(var(--foreground)); border-color: hsl(var(--foreground)); color: hsl(var(--background)); }
.cm-tabs a[aria-current="page"] b { color: inherit; opacity: .75; }

/* a board: white card, title on a 2px ink rule, ruled rows */
.cm-board { margin: 0 0 22px; padding: 18px 20px 8px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); scroll-margin-top: 90px; }
.cm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid hsl(var(--foreground)); }
.cm-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 20px; font-weight: 600; }
.cm-hico svg { display: block; width: 20px; height: 20px; }
.cm-head .link { font-size: 14px; font-weight: 600; white-space: nowrap; }
.cm-group { margin: 14px 0 0; font-size: 12.5px; font-weight: 600; color: hsl(var(--muted-foreground)); }
.cm-list { list-style: none; margin: 0; padding: 0; }
.cm-row { display: grid; grid-template-columns: 28px 36px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid hsl(var(--border)); }
.cm-list:last-child .cm-row:last-child { border-bottom: 0; }
.cm-rank { font-size: 13px; font-weight: 600; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; text-align: right; }
.cm-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.cm-ico svg { width: 20px; height: 20px; }
.cm-main { min-width: 0; }
.cm-name { font-weight: 600; font-size: 15.5px; color: inherit; text-decoration: none; }
.cm-name:hover { color: var(--link); text-decoration: underline; }
.cm-sub { display: block; margin-top: 1px; font-size: 13px; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }
.cm-main p { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: hsl(var(--muted-foreground)); max-width: 75ch; }
.cm-fig { text-align: right; min-width: 92px; }
.cm-fig b { display: block; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.cm-fig small { font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.cm-go { height: 36px; }

/* newest videos */
.cm-videos { padding-bottom: 14px; }
.cm-vgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.cm-vid { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: inherit; text-decoration: none; }
.cm-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: hsl(var(--muted)); }
.cm-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cm-vid b { margin-top: 4px; font-size: 14.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-vid:hover b { color: var(--link); text-decoration: underline; }
.cm-vid small { font-size: 13px; color: hsl(var(--muted-foreground)); }
.cm-note { margin: 12px 0 0; }

/* X topics */
.cm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.cm-chip { display: inline-flex; flex-direction: column; gap: 1px; padding: 8px 14px; border: 1px solid hsl(var(--border)); border-radius: 12px; color: inherit; text-decoration: none; transition: border-color .15s; }
.cm-chip:hover { border-color: var(--link); }
.cm-chip b { font-size: 14.5px; font-weight: 600; }
.cm-chip small { font-size: 12.5px; color: hsl(var(--muted-foreground)); }

.cm-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 18px 20px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); }
.cm-foot p { margin: 0; max-width: 70ch; font-size: 14.5px; color: hsl(var(--muted-foreground)); }
.cm-foot p b { color: hsl(var(--foreground)); }

@media (max-width: 1100px) { .cm-vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* phones: rank and icon stay on the left, the figure and Open go under the name */
@media (max-width: 640px) {
  .cm-board { padding: 14px 14px 4px; }
  .cm-row { grid-template-columns: 22px 32px minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 0; align-items: start; }
  .cm-rank { padding-top: 8px; }
  .cm-ico { width: 32px; height: 32px; border-radius: 8px; }
  .cm-ico svg { width: 18px; height: 18px; }
  .cm-main { grid-column: 3 / 5; }
  .cm-fig { grid-column: 3; align-self: center; text-align: left; min-width: 0; }
  .cm-fig b { display: inline; font-size: 17px; margin-right: 4px; }
  .cm-go { grid-column: 4; height: 34px; }
  .cm-fig:empty { display: none; }
  .cm-vgrid { gap: 14px 12px; }
  .cm-tabs a { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) { .cm-tabs a, .cm-chip { transition: none; } }
