/* ============================================
   NewsHub Design System
   Based on DESIGN.md — Restrained, Violet accent
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Palette (OKLCH) */
  --bg: oklch(1.000 0.000 0);
  --surface: oklch(0.970 0.003 294.3);
  --ink: oklch(0.130 0.007 294.3);
  --primary: oklch(0.533 0.125 294.3);
  --primary-hover: oklch(0.473 0.125 294.3);
  --accent: oklch(0.580 0.140 200.0);
  --muted: oklch(0.550 0.005 294.3);
  --border: oklch(0.900 0.003 294.3);
  --hover-bg: oklch(0.960 0.004 294.3);

  /* Typography */
  --font-heading: 'Noto Sans SC', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Scale (1.125 ratio, fixed rem) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.75rem;

  /* Spacing (4px base) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Layout */
  --content-max: 960px;
  --detail-max: 680px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;

  /* Shadows */
  --shadow-card: 0 1px 3px oklch(0 0 0 / 0.06);
  --shadow-card-hover: 0 4px 16px oklch(0 0 0 / 0.10);

  /* Z-index scale */
  --z-sticky: 100;
  --z-dropdown: 200;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 250ms;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--primary-hover);
}

/* --- Site Header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: var(--z-sticky);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--primary);
}

.header-nav {
  display: flex;
  gap: var(--space-md);
}

.header-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
}

.header-nav a:hover {
  color: var(--ink);
}

/* --- Site Main --- */
.site-main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-3xl);
}

/* --- Page Header --- */
.page-header {
  margin-bottom: var(--space-md);
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: var(--space-xs);
}

/* --- Tab Bar (pill segment control) --- */
.tab-bar {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  background: var(--surface);
  border-radius: 14px;
  margin-bottom: var(--space-xl);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  flex-shrink: 0;
  padding: 9px 22px;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-base) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--ink);
  font-weight: 600;
  background: var(--bg);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.07), 0 0 0 0.5px oklch(0 0 0 / 0.06);
}

.tab-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: oklch(0 0 0 / 0.05);
  color: var(--muted);
  line-height: 1.7;
  min-width: 22px;
  text-align: center;
}

.tab.active .tab-count {
  background: oklch(0.533 0.125 294.3 / 0.12);
  color: var(--primary);
}

/* --- Sub-tag Bar --- */
.sub-tag-bar {
  display: none;
  gap: 6px;
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: wrap;
  align-items: center;
}

.sub-tag-bar::-webkit-scrollbar { display: none; }

.sub-tag-bar.active {
  display: flex;
}

.sub-tag-label {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  margin-right: 2px;
}

.sub-tag-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1.5;
}

.sub-tag-btn:hover {
  color: var(--ink);
  border-color: var(--primary);
  background: oklch(0.533 0.125 294.3 / 0.04);
}

.sub-tag-btn.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px oklch(0.533 0.125 294.3 / 0.25);
}

/* Overflow: hide tags beyond 8, show expand button */
.sub-tag-overflow {
  display: none;
}

.sub-tag-bar.expanded .sub-tag-overflow {
  display: inline-flex;
}

.sub-tag-expand {
  flex-shrink: 0;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  background: oklch(0.533 0.125 294.3 / 0.08);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}

.sub-tag-expand:hover {
  background: oklch(0.533 0.125 294.3 / 0.16);
}

.sub-tag-bar.expanded .sub-tag-expand {
  display: none;
}

/* --- Tab spacer & Archive dropdown --- */
.tab-spacer {
  flex: 1;
  min-width: 0;
}

/* --- Archive trigger button --- */
.archive-trigger {
  flex-shrink: 0;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.archive-trigger:hover {
  color: var(--ink);
  border-color: var(--primary);
}

/* --- Archive bottom sheet --- */
.archive-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.3);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-base) var(--ease-out);
}

.archive-overlay.show {
  opacity: 1;
  visibility: visible;
}

.archive-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 60vh;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px oklch(0 0 0 / 0.12);
  z-index: 950;
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.archive-sheet.open {
  transform: translateY(0);
}

.archive-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.archive-sheet-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink);
}

.archive-sheet-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
  background: var(--surface);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.archive-sheet-close:hover {
  background: var(--hover-bg);
  color: var(--ink);
}

.archive-sheet-body {
  overflow-y: auto;
  padding: var(--space-sm) 0;
  -webkit-overflow-scrolling: touch;
}

.archive-sheet-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  color: var(--ink);
  transition: background var(--duration-fast) var(--ease-out);
}

.archive-sheet-item:hover {
  background: var(--hover-bg);
}

.archive-sheet-item.active {
  background: oklch(0.533 0.125 294.3 / 0.06);
}

.archive-sheet-item.active .sheet-issue {
  color: var(--primary);
  font-weight: 700;
}

.sheet-issue {
  font-weight: 600;
  min-width: 56px;
}

.sheet-date {
  font-size: var(--text-sm);
  color: var(--muted);
}

.sheet-tag {
  margin-left: auto;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: oklch(0.533 0.125 294.3 / 0.10);
  color: var(--primary);
}

.sheet-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-sm) var(--space-lg);
}

.sheet-all {
  color: var(--primary);
  font-weight: 500;
  justify-content: center;
}

/* --- Date Slider --- */
.date-nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: var(--space-sm);
}

.date-nav::-webkit-scrollbar { display: none; }

.date-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}

.date-btn:hover {
  color: var(--ink);
  background: var(--hover-bg);
}

.date-btn.active {
  color: var(--primary);
  font-weight: 600;
  background: oklch(0.533 0.125 294.3 / 0.08);
}

/* --- Language Badge --- */
.badge-lang {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: oklch(0.580 0.140 200.0 / 0.10);
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* --- GitHub Card Variant --- */
.card-github {
  border-left: 3px solid var(--accent);
}

.card-github .card-title {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
}

.card-stars {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.card-github-footer {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--space-xs);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border);
}

.github-lang,
.github-stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.github-lang {
  color: var(--accent);
}

.github-stars {
  color: var(--muted);
}

/* --- News Grid --- */
.news-grid {
  display: none;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

.news-grid.active {
  display: grid;
  animation: crossfade var(--duration-slow) var(--ease-out);
}

@keyframes crossfade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- News Card --- */
.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--duration-slow) var(--ease-out),
              box-shadow var(--duration-slow) var(--ease-out);
}

.news-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-card-hover);
}

.card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--hover-bg);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--muted);
}

.badge-curated {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: oklch(0.533 0.125 294.3 / 0.12);
  color: var(--primary);
  letter-spacing: 0.03em;
}

.card-curator-note {
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--accent);
  font-style: italic;
  padding: 4px 8px;
  border-left: 2px solid var(--accent);
  background: oklch(0.580 0.140 200.0 / 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.card-source {
  font-weight: 600;
  color: var(--primary);
}

.card-time {
  color: var(--muted);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}

.card-title a {
  color: var(--ink);
}

.card-title a:hover {
  color: var(--primary);
}

.card-summary {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: oklch(0.580 0.140 200.0 / 0.10);
  color: var(--accent);
}

.card-source-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--primary);
  margin-top: auto;
  padding-top: var(--space-sm);
}

.card-source-link:hover {
  color: var(--primary-hover);
}

/* --- Grid Footer --- */
.grid-footer {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-md);
  font-size: var(--text-xs);
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.grid-footer-hint {
  display: block;
  margin-top: var(--space-xs);
  font-style: italic;
}

/* --- Empty State --- */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
}

.empty-icon {
  font-size: 2rem;
  color: var(--border);
  margin-bottom: var(--space-md);
}

.empty-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-xs);
}

.empty-desc {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* --- News Detail --- */
.detail {
  max-width: var(--detail-max);
  margin: 0 auto;
}

.detail-header {
  margin-bottom: var(--space-xl);
}

.detail-meta-top {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
  color: var(--muted);
}

.category-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: oklch(0.533 0.125 294.3 / 0.10);
  color: var(--primary);
  text-decoration: none;
}

.category-badge:hover {
  background: oklch(0.533 0.125 294.3 / 0.18);
}

.detail-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: var(--space-md);
}

.detail-source-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-sm);
  color: var(--muted);
  flex-wrap: wrap;
}

.source-link {
  font-weight: 500;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.detail-curator-note {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--accent);
  font-style: italic;
  border-left: 3px solid var(--accent);
  background: oklch(0.580 0.140 200.0 / 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.detail-cover {
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.detail-cover img {
  width: 100%;
}

.detail-body {
  max-width: 65ch;
  line-height: 1.7;
}

.detail-body p {
  margin-bottom: var(--space-md);
  text-wrap: pretty;
}

.detail-footer {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.scrape-note {
  font-size: var(--text-xs);
  color: var(--muted);
}

.back-link {
  font-size: var(--text-sm);
  font-weight: 500;
}

/* --- Static Pages --- */
.static-page {
  max-width: var(--detail-max);
  margin: 0 auto;
}

.static-page h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-xl);
  text-wrap: balance;
}

.static-page h2 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.static-page p,
.static-page li {
  line-height: 1.7;
  max-width: 65ch;
  margin-bottom: var(--space-sm);
}

.static-page ol,
.static-page ul {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.category-list {
  display: grid;
  gap: var(--space-sm);
}

.category-list dt {
  font-weight: 600;
  color: var(--primary);
}

.category-list dd {
  margin-left: 0;
  margin-bottom: var(--space-md);
  color: var(--muted);
}

/* --- Admin --- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-md);
}

.admin-table th,
.admin-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.admin-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table code {
  font-size: var(--text-sm);
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 3px;
}

.admin-result {
  padding: var(--space-sm) var(--space-md);
  background: oklch(0.533 0.125 294.3 / 0.08);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
}

.inline-form {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.input-sm {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
}

.input-sm:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px oklch(0.533 0.125 294.3 / 0.15);
}

.btn-sm {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.btn-sm:hover {
  background: var(--hover-bg);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--primary);
}

.btn-ghost:hover {
  background: oklch(0.533 0.125 294.3 / 0.08);
}

.btn-danger {
  background: none;
  border-color: transparent;
  color: oklch(0.55 0.18 20);
}

.btn-danger:hover {
  background: oklch(0.55 0.18 20 / 0.08);
}

/* --- Site Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-lg);
  text-align: center;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.footer-inner p {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* --- Focus --- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Responsive --- */
@media (max-width: 959px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 639px) {
  :root {
    --text-2xl: 1.5rem;
    --text-xl: 1.25rem;
    --text-lg: 1.125rem;
  }

  .site-main {
    padding: var(--space-lg) var(--space-md) var(--space-2xl);
  }

  .header-inner {
    padding: var(--space-sm) var(--space-md);
  }

  /* Mobile nav: compact scrolling rows */
  .date-nav {
    gap: 1px;
  }

  .date-btn {
    padding: 4px 10px;
    font-size: 11px;
  }

  .tab-bar {
    display: flex;
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
  }

  .tab {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 9px;
  }

  .tab-count {
    font-size: 10px;
    padding: 1px 5px;
  }

  .sub-tag-bar {
    gap: 3px;
    margin-bottom: var(--space-md);
  }

  .sub-tag-btn {
    padding: 4px 10px;
    font-size: 11px;
  }

  .card-body {
    padding: var(--space-md);
  }

  .detail-header,
  .static-page h1 {
    font-size: var(--text-xl);
  }

  /* Mobile: full-height sheet on small screens */
  .archive-sheet {
    max-height: 75vh;
    border-radius: 12px 12px 0 0;
  }

  .archive-sheet-item {
    padding: var(--space-sm) var(--space-md);
  }

  .archive-trigger {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .news-grid.active {
    animation: none;
  }
}
