@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root,
:root[data-theme="dark"] {
  --bg: #0f172a;
  --bg-soft: #111c34;
  --panel: #1b2742;
  --panel-2: #22304f;
  --text: #e6edf6;
  --muted: #9aa7be;
  --accent: #6366f1;        /* indigo for notes */
  --accent-2: #f59e0b;      /* amber for exams */
  --accent-3: #22c55e;      /* green for approved */
  --border: #2a3a5c;
  --success: #22c55e;
  --danger:  #ef4444;
  --on-accent: #ffffff;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --bg-glow-1: #1a2a55;
  --bg-glow-2: #2a1f55;
  --header-grad: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  --chip-bg: rgba(255,255,255,.05);
  --radius: 14px;
}

:root[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f5fb;
  --text: #0f172a;
  --muted: #5a6679;
  --accent: #4f46e5;
  --accent-2: #d97706;
  --accent-3: #16a34a;
  --border: #d8e0ec;
  --success: #16a34a;
  --danger:  #dc2626;
  --on-accent: #ffffff;
  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --bg-glow-1: #dbe2ff;
  --bg-glow-2: #e6ddff;
  --header-grad: linear-gradient(180deg, rgba(15,23,42,.02), rgba(15,23,42,0));
  --chip-bg: rgba(15,23,42,.04);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f4f7fb;
    --bg-soft: #ffffff;
    --panel: #ffffff;
    --panel-2: #f1f5fb;
    --text: #0f172a;
    --muted: #5a6679;
    --accent: #4f46e5;
    --accent-2: #d97706;
    --accent-3: #16a34a;
    --border: #d8e0ec;
    --success: #16a34a;
    --danger:  #dc2626;
    --on-accent: #ffffff;
    --shadow: 0 10px 30px rgba(15,23,42,.08);
    --bg-glow-1: #dbe2ff;
    --bg-glow-2: #e6ddff;
    --header-grad: linear-gradient(180deg, rgba(15,23,42,.02), rgba(15,23,42,0));
    --chip-bg: rgba(15,23,42,.04);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: radial-gradient(1200px 700px at 10% -10%, var(--bg-glow-1) 0%, transparent 60%),
              radial-gradient(900px 600px at 110% 10%, var(--bg-glow-2) 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  direction: rtl;
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}

/* Header (shared) */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 22px;
  background: var(--panel); background-image: var(--header-grad);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo {
  flex: 0 0 auto; width: 84px; height: 84px; border-radius: 16px;
  background: var(--bg-soft); border: 1px dashed var(--border);
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.brand-text { min-width: 0; }
.brand-text .title { font-weight: 700; font-size: 22px; }
.brand-text .subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s; padding: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

/* Hero */
.na-hero {
  margin-top: 20px; padding: 22px;
  background: var(--panel);
  background-image: linear-gradient(120deg,
    color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center;
}
.na-hero-text { min-width: 0; }
.na-hero-title { font-size: 22px; font-weight: 700; }
.na-hero-sub   { color: var(--muted); font-size: 14px; margin-top: 6px; }
.na-hero-icon {
  font-size: 48px; line-height: 1;
  width: 78px; height: 78px; border-radius: 18px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.na-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.na-stat {
  font-size: 12px; background: var(--chip-bg);
  border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px;
  color: var(--muted);
}
.na-stat b { color: var(--accent); font-weight: 700; margin-left: 4px; }

/* Tabs */
.na-tabs {
  margin-top: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex; gap: 6px;
  overflow-x: auto;
}
.na-tab {
  flex: 1 1 0;
  min-width: 120px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .15s;
  white-space: nowrap;
}
.na-tab:hover { color: var(--text); background: var(--chip-bg); }
.na-tab.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.na-tab .count {
  font-size: 11px; opacity: .75;
  font-variant-numeric: tabular-nums;
}

/* Panel wrapper for each tab */
.na-panel { margin-top: 16px; }
.na-panel[hidden] { display: none !important; }

/* Admin-submit card */
.na-submit-card {
  margin-top: 0;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap;
}
.na-submit-icon {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 22px;
}
.na-submit-text { flex: 1 1 280px; min-width: 0; }
.na-submit-title { font-weight: 700; font-size: 15px; }
.na-submit-sub { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.8; }
.na-admins { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.na-admin-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: 13px; font-weight: 600;
  transition: all .15s;
  text-decoration: none;
  max-width: 100%;
}
.na-admin-chip:hover { background: var(--accent); color: var(--on-accent); }
.na-admin-chip .admin-icon {
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
}
.na-admin-chip .admin-text {
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.na-admin-chip .admin-line-1 {
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.na-admin-chip .admin-name { font-weight: 700; }
.na-admin-chip .admin-role {
  font-size: 11px; opacity: .85; font-weight: 500;
  padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.na-admin-chip .admin-handle {
  font-size: 12px; opacity: .75; font-weight: 600;
  font-feature-settings: "tnum";
  direction: ltr;
}

/* Filter bar */
.na-filter {
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.na-search { position: relative; display: flex; }
.na-search::before {
  content: "🔍";
  position: absolute; top: 50%; right: 12px;
  transform: translateY(-50%);
  font-size: 14px; opacity: .7; pointer-events: none;
}
.na-search input {
  width: 100%;
  padding: 10px 38px 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit; font-size: 14px;
  outline: none; transition: border-color .15s;
}
.na-search input:focus { border-color: var(--accent); }
.na-search input::placeholder { color: var(--muted); }

.na-chips {
  margin-top: 12px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: var(--chip-bg);
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-size: 13px; font-family: inherit;
  cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent); color: var(--accent);
  font-weight: 600;
}
.chip-count { font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }
.chip-group-label {
  font-size: 12px; color: var(--muted); font-weight: 500;
  padding: 6px 0 2px;
  width: 100%;
}

/* Grid */
.na-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

/* Card */
.na-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex; flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.na-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.na-card.exam-card:hover { border-color: color-mix(in srgb, var(--accent-2) 40%, var(--border)); }

.na-card-head {
  display: flex; gap: 12px; align-items: flex-start;
}
.na-card-icon {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 22px;
}
.exam-card .na-card-icon {
  background: color-mix(in srgb, var(--accent-2) 18%, transparent);
  color: var(--accent-2);
}
.na-card-title-wrap { flex: 1 1 auto; min-width: 0; }
.na-card-course {
  font-weight: 700; font-size: 16px; word-break: break-word;
}
.na-card-prof {
  color: var(--muted); font-size: 13.5px; margin-top: 2px;
}
.na-card-prof b { color: var(--text); font-weight: 600; }

.na-meta-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.na-meta-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: var(--chip-bg); color: var(--muted);
  border: 1px solid var(--border);
}
.na-meta-pill.major {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.na-meta-pill.exam-type {
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
  color: var(--accent-2);
  border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent);
}

.na-card-desc {
  color: var(--muted); font-size: 13px; line-height: 1.8;
  margin: 0;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.na-card-footer {
  display: flex; gap: 10px; justify-content: space-between; align-items: center;
  margin-top: auto;
  padding-top: 4px;
  font-size: 12px; color: var(--muted);
}
.na-contributor {
  display: inline-flex; align-items: center; gap: 4px;
}
.na-download {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.na-download:hover { filter: brightness(.92); color: var(--on-accent); }
.exam-card .na-download {
  background: var(--accent-2); border-color: var(--accent-2);
}

/* Request form */
.na-form {
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.na-form-title {
  font-weight: 700; font-size: 17px;
  display: flex; align-items: center; gap: 8px;
}
.na-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px;
}
.na-field { display: flex; flex-direction: column; gap: 6px; }
.na-field.full { grid-column: 1 / -1; }
.na-field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.na-field label .required { color: var(--danger); margin-right: 3px; }
.na-input, .na-select, .na-textarea {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit; font-size: 14px;
  padding: 10px 12px;
  outline: none; transition: border-color .15s;
  width: 100%;
}
.na-input:focus, .na-select:focus, .na-textarea:focus { border-color: var(--accent); }
.na-textarea { min-height: 80px; resize: vertical; }
.na-form-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; justify-content: flex-end;
}
.na-btn {
  padding: 9px 18px; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text);
  transition: all .15s;
}
.na-btn:hover { border-color: var(--accent); color: var(--accent); }
.na-btn.primary {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
}
.na-btn.primary:hover { filter: brightness(.92); color: var(--on-accent); }
.na-btn:disabled { opacity: .6; cursor: not-allowed; }
.na-kind-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.na-kind-pills label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--border);
  background: var(--bg-soft); border-radius: 999px;
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.na-kind-pills label:hover { border-color: var(--accent); color: var(--accent); }
.na-kind-pills input { display: none; }
.na-kind-pills label:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent); color: var(--accent); font-weight: 600;
}

.na-form-msg {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
}
.na-form-msg.ok {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
}
.na-form-msg.err {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}

/* Request cards (approved requests) */
.req-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.req-card.resolved {
  border-color: color-mix(in srgb, var(--accent-3) 45%, var(--border));
  background-image: linear-gradient(120deg,
    color-mix(in srgb, var(--accent-3) 8%, transparent), transparent 60%);
}
.req-head {
  display: flex; align-items: flex-start; gap: 10px;
}
.req-head-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent-3) 18%, transparent);
  color: var(--accent-3);
  font-size: 18px;
}
.req-title { font-weight: 700; font-size: 15px; }
.req-meta  { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.req-note {
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px; color: var(--muted);
  margin: 0;
}
.req-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
}
.req-status.pending  { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); border: 1px solid var(--border); }
.req-status.approved { background: color-mix(in srgb, var(--accent-3) 16%, transparent); color: var(--accent-3); border: 1px solid color-mix(in srgb, var(--accent-3) 35%, transparent); }
.req-status.resolved { background: color-mix(in srgb, var(--accent-3) 22%, transparent); color: var(--accent-3); border: 1px solid color-mix(in srgb, var(--accent-3) 45%, transparent); }
.req-kind {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: var(--chip-bg); color: var(--muted);
  border: 1px solid var(--border);
}
.req-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: auto;
}

/* Empty state */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  grid-column: 1 / -1;
}
.empty-state-icon { font-size: 42px; opacity: .45; }
.empty-state-text { margin-top: 8px; font-size: 14px; }

/* Section header */
.na-section-title {
  margin: 18px 0 8px;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
.na-section-sub {
  color: var(--muted); font-size: 13px; margin-bottom: 6px;
}

/* Footer */
.site-footer {
  margin-top: 40px;
  padding: 18px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* Mobile */
@media (max-width: 640px) {
  .container { padding: 14px 12px 60px; }
  .site-header { padding: 14px 14px; gap: 12px; }
  .brand-logo { width: 64px; height: 64px; border-radius: 14px; }
  .brand-text .title { font-size: 18px; }
  .brand-text .subtitle { font-size: 12px; }

  .na-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 18px 16px;
  }
  .na-hero-icon { margin: 0 auto; width: 64px; height: 64px; font-size: 36px; }
  .na-hero-title { font-size: 18px; }
  .na-hero-sub { font-size: 13px; }
  .na-stats { justify-content: center; }

  .na-tab { min-width: 0; padding: 10px 10px; font-size: 13px; }
  .na-tab .tab-label-full { display: none; }
  .na-tab .count { font-size: 10.5px; }

  /* Admin chips on mobile: full-width, two-row card */
  .na-submit-card { padding: 14px 14px; gap: 10px; }
  .na-admins {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }
  .na-admin-chip {
    display: flex; align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
  }
  .na-admin-chip .admin-text {
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .na-admin-chip .admin-line-1 { width: 100%; }
  .na-admin-chip .admin-handle {
    font-size: 12.5px;
    opacity: .85;
  }

  .na-form-grid { grid-template-columns: 1fr; }

  .na-grid { grid-template-columns: 1fr; gap: 12px; }
  .na-card { padding: 14px 14px; }

  .na-card-footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .na-download { justify-content: center; }
}

/* ---- Footer (updated) ---- */
.site-footer { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.site-footer .footer-main { line-height: 1.9; }
.site-footer .footer-sep { opacity: .5; margin: 0 6px; }
.site-footer .footer-tg {
  font-weight: 700; direction: ltr; display: inline-block;
  color: var(--accent);
}
.site-footer .footer-tg:hover { color: var(--accent-2); }
.site-footer .footer-admin a {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; transition: all .15s;
}
.site-footer .footer-admin a:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Dual download group (file + link) ---- */
.na-dl-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.na-download.na-download-link {
  background: transparent;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.na-download.na-download-link:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); filter: none;
}
.exam-card .na-download.na-download-link {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 45%, transparent);
  background: transparent;
}
.exam-card .na-download.na-download-link:hover {
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
}

/* ---- Reference cards ---- */
.ref-card .na-card-icon {
  background: color-mix(in srgb, var(--accent-3) 18%, transparent);
  color: var(--accent-3);
}
.ref-card:hover { border-color: color-mix(in srgb, var(--accent-3) 40%, var(--border)); }
.ref-card .na-download {
  background: var(--accent-3); border-color: var(--accent-3);
}
.ref-card .na-download.na-download-link {
  background: transparent; color: var(--accent-3);
  border-color: color-mix(in srgb, var(--accent-3) 45%, transparent);
}
.ref-card .na-download.na-download-link:hover {
  background: color-mix(in srgb, var(--accent-3) 12%, transparent);
}
@media (max-width: 640px) {
  .na-dl-group { width: 100%; }
  .na-dl-group .na-download { flex: 1 1 0; justify-content: center; }
}

/* ---------- Clip / clamp with click-to-expand ---------- */
.na-clip {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.na-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.na-clip.is-clipped,
.na-clamp.is-clipped { cursor: pointer; }
.na-clip.is-clipped:hover,
.na-clamp.is-clipped:hover { color: var(--accent); }
.na-clip.is-expanded {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  cursor: pointer;
}
.na-clamp.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
  word-break: break-word;
  cursor: pointer;
}
/* Let the contributor name shrink and clip inside the footer row */
.na-card-footer { min-width: 0; }
.na-card-footer .na-contributor { min-width: 0; flex: 1 1 auto; }
.na-card-footer .na-download { flex: 0 0 auto; }
.na-contributor .na-clip { min-width: 0; flex: 0 1 auto; }
/* Full-width sentinel used for lazy batch loading in the grid */
.na-sentinel { grid-column: 1 / -1; height: 1px; width: 100%; }
