/* FreakLabs Library Browser — "Cinematheque archive"
   Near-black cool-neutral base, a single restrained vermilion accent,
   poster-forward grid. Schibsted Grotesk (UI) + JetBrains Mono (metadata). */

:root {
  /* Base neutrals — not pure black, a faint cool cast */
  --bg:        #0b0c0e;
  --bg-2:      #101216;
  --surface:   #16181c;
  --surface-2: #1b1e23;
  --line:      #24272d;
  --line-2:    #2e323a;

  /* Text */
  --text:      #f3f4f6;
  --text-2:    #a3a9b3;
  --text-3:    #6a7079;

  /* The one accent: vermilion. Used sparingly. */
  --accent:    #ff5436;
  --accent-2:  #ff6f55;
  --accent-dim: rgba(255, 84, 54, 0.14);

  --ok:        #4ec98a;

  --radius:    6px;
  --radius-lg: 10px;

  --ui:   "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow: 0 10px 30px -12px rgba(0,0,0,0.7);
  --ease:  cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  /* subtle radial vignette toward the edges + a faint top glow */
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,84,54,0.05), transparent 55%),
    radial-gradient(140% 120% at 50% 120%, #08090b, var(--bg) 60%);
  background-attachment: fixed;
}

/* very faint film-grain texture overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease), color .18s var(--ease);
}
.btn:hover { border-color: var(--line-2); background: #22262c; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a0a06;
  font-weight: 600;
}
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-2); background: var(--surface); }

.btn-block { width: 100%; justify-content: center; height: 42px; font-size: 15px; }

.btn.is-busy { pointer-events: none; opacity: 0.85; }
.btn.is-busy .refresh-ico { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11,12,14,0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 12px 26px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-glyph {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #1a0a06;
  background: var(--accent);
  padding: 3px 7px;
  border-radius: 4px;
  line-height: 1;
}
.brand-name {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  color: var(--text);
}

/* view tabs */
.views { display: flex; gap: 2px; flex: 0 0 auto; }
.view-tab {
  position: relative;
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 8px 4px;
  margin: 0 12px;
  transition: color .18s var(--ease);
}
.view-tab:first-child { margin-left: 0; }
.view-tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -13px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s var(--ease);
}
.view-tab:hover { color: var(--text-2); }
.view-tab.is-active { color: var(--text); }
.view-tab.is-active::after { transform: scaleX(1); }
.view-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 7px;
  margin-left: 5px;
  vertical-align: middle;
}
.view-tab.is-active .view-count { color: var(--accent); border-color: rgba(255,84,54,0.4); }

/* controls cluster (right) */
.controls { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: 1 1 auto; justify-content: flex-end; }

.search { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; }
#search {
  width: 230px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--ui);
  font-size: 13.5px;
  padding: 0 12px 0 33px;
  transition: border-color .18s var(--ease), background .18s var(--ease), width .2s var(--ease);
}
#search::placeholder { color: var(--text-3); }
#search:focus { outline: none; border-color: var(--accent); background: var(--bg-2); }
#search::-webkit-search-cancel-button { filter: grayscale(1) opacity(0.5); }

.sort select {
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-2);
  font-family: var(--ui);
  font-size: 13px;
  padding: 0 30px 0 12px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a7079' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.sort select:hover { color: var(--text); }
.sort select:focus { outline: none; border-color: var(--accent); color: var(--text); }

.sync { display: flex; align-items: center; gap: 10px; }
.sync-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------- stage */
.stage {
  position: relative;
  z-index: 2;
  max-width: 1680px;
  margin: 0 auto;
  padding: 30px 26px 80px;
}

.library { display: none; }
.library.is-active { display: block; }

/* poster grid: dense on desktop, graceful collapse */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 26px 20px;
}

/* ---------------------------------------------------------------- cards */
.card {
  display: flex;
  flex-direction: column;
  outline: none;
  /* staggered reveal on load */
  opacity: 0;
  transform: translateY(8px);
  animation: cardIn .5s var(--ease) forwards;
}
@keyframes cardIn { to { opacity: 1; transform: none; } }
.card.is-hidden { display: none; }

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .26s var(--ease), border-color .26s var(--ease), box-shadow .26s var(--ease);
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--ease), filter .26s var(--ease);
}

.card:hover .poster,
.card:focus-visible .poster {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.card:focus-visible .poster { border-color: var(--accent); }
.card:hover .poster img { transform: scale(1.05); }

.badge-rating {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  background: rgba(8,9,11,0.78);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: -0.02em;
  z-index: 2;
}

.poster-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px;
  background: linear-gradient(to top, rgba(8,9,11,0.94) 8%, rgba(8,9,11,0.55) 45%, transparent 75%);
  opacity: 0;
  transition: opacity .26s var(--ease);
}
.card:hover .poster-overlay,
.card:focus-visible .poster-overlay { opacity: 1; }
.overlay-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
  /* Never let a long synopsis fill (and overflow) the poster: clamp to a
     handful of lines and ellipsise. Adapts to whatever the card height is. */
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overlay-meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-2);
  letter-spacing: -0.01em;
}

.card-meta { padding: 9px 2px 0; }
.card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: -0.01em;
}
.meta-dot { opacity: 0.5; }

/* ---------------------------------------------------------------- states */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 20px;
  color: var(--text-2);
}
.state h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.state p { margin: 0; font-size: 14px; max-width: 420px; }
.state strong { color: var(--accent-2); font-weight: 600; }
.state-error h2 { color: var(--accent-2); }
.state-noresults { padding: 70px 20px; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  z-index: 40;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 18px;
  font-size: 13.5px;
  color: var(--text);
  max-width: min(520px, 90vw);
  opacity: 0;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.is-error { border-color: rgba(255,84,54,0.55); }
.toast.is-error::before { content: ""; }
.toast.is-ok { border-color: rgba(78,201,138,0.5); }

/* ---------------------------------------------------------------- auth */
.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-shell { width: 100%; max-width: 380px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px 32px;
  box-shadow: var(--shadow);
}
.auth-mark { display: flex; align-items: center; gap: 9px; margin-bottom: 26px; }
.mark-glyph {
  font-weight: 700; font-size: 13px; color: #1a0a06;
  background: var(--accent); padding: 3px 7px; border-radius: 4px; line-height: 1;
}
.mark-text { font-weight: 600; font-size: 14px; letter-spacing: 0.02em; color: var(--text-2); }
.auth-title { margin: 0 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.auth-sub { margin: 0 0 24px; font-size: 13.5px; color: var(--text-3); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.field-input {
  height: 42px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--ui);
  font-size: 15px;
  padding: 0 13px;
  transition: border-color .18s var(--ease);
}
.field-input:focus { outline: none; border-color: var(--accent); }
.auth-error {
  background: var(--accent-dim);
  border: 1px solid rgba(255,84,54,0.4);
  border-radius: var(--radius);
  color: var(--accent-2);
  font-size: 13px;
  padding: 9px 12px;
  margin-bottom: 18px;
}
.auth-foot {
  text-align: center;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1040px) {
  .topbar-inner { flex-wrap: wrap; gap: 14px; }
  .controls { order: 3; width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  #search { width: 100%; flex: 1 1 200px; }
  .views { order: 2; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 12px 16px; }
  .stage { padding: 20px 16px 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px 12px; }
  .sync { flex: 1 1 100%; justify-content: space-between; }
  .sync-time { font-size: 10px; }
  .btn-label { display: none; }
  #refreshBtn { padding: 0 12px; }
  .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .card { opacity: 1; transform: none; }
}

/* ================================================================ admin */
.brand-tag {
  margin-left: 10px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-dim);
  border: 1px solid rgba(255,84,54,0.28);
  border-radius: 999px;
}

.btn-outline {
  background: transparent;
  border-color: var(--line-2);
  color: var(--text);
}
.btn-outline:hover { background: var(--surface-2); border-color: var(--accent); color: #fff; }

.admin {
  max-width: 1120px;
  margin: 0 auto;
  padding: 38px 28px 90px;
  position: relative;
  z-index: 2;
}

.admin-section {
  margin-bottom: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  padding: 24px 24px 26px;
}
.admin-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.admin-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.admin-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 18px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat-num {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.meta-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.meta-list > div {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.meta-list dt {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 6px;
}
.meta-list dd { margin: 0; font-size: 14px; color: var(--text); }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
}
.pill-ok   { color: var(--ok); border-color: rgba(78,201,138,0.4); background: rgba(78,201,138,0.1); }
.pill-warn { color: var(--accent-2); border-color: rgba(255,84,54,0.4); background: var(--accent-dim); }

/* export */
.export-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.export-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.export-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.export-meta { margin: 0 0 8px; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.export-actions { display: flex; gap: 8px; margin-top: auto; }
.export-actions .btn { height: 34px; }

/* live diagnostics */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok  { background: var(--ok); box-shadow: 0 0 0 3px rgba(78,201,138,0.18); }
.dot-bad { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.diag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.diag-table th, .diag-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}
.diag-table thead th {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  font-weight: 500;
}
.diag-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.diag-table .mono { font-family: var(--mono); color: var(--text-2); }
.diag-table tbody tr:last-child td { border-bottom: none; }
.diag-table .row-drift td { background: var(--accent-dim); }
.diag-note { margin: 14px 2px 0; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }

.state-inline {
  padding: 18px;
  text-align: left;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.state-inline p { margin: 0; }

@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .meta-list { grid-template-columns: 1fr; }
  .export-grid { grid-template-columns: 1fr; }
  .admin { padding: 24px 16px 70px; }
}

/* admin alert (wipe-to-zero guard) */
.admin-alert {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 32px;
  padding: 18px 20px;
  border: 1px solid rgba(255,84,54,0.4);
  border-left-width: 3px;
  border-radius: var(--radius-lg);
  background: var(--accent-dim);
}
.admin-alert-icon {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #1a0a06;
  font-weight: 700;
  font-family: var(--mono);
}
.admin-alert-body h2 { margin: 0 0 6px; font-size: 16px; }
.admin-alert-body p { margin: 0 0 8px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.admin-alert-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-alert-hint { font-size: 12.5px; color: var(--text-3); }
.btn-clear { height: 32px; }
.snap-dl { display: flex; gap: 6px; justify-content: flex-end; }
.snap-dl .btn { height: 30px; padding: 0 11px; }

/* shareable public-link bar (admin Snapshots panel) */
.share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.share-bar-text { font-size: 13px; color: var(--text-2); line-height: 1.6; flex: 1 1 320px; }
.share-bar-text strong { color: var(--text); font-weight: 600; }
.share-url {
  display: block;
  width: 100%;
  margin-top: 10px;
  height: 34px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 0 11px;
}
.share-url:focus { outline: none; border-color: var(--accent); }
.share-bar-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* ================================================================ public snapshot viewer */
.snap-stage { max-width: 1120px; }

.snap-caption {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.snap-caption strong { color: var(--text); font-weight: 600; }
.snap-caption-dim { color: var(--text-3); font-family: var(--mono); font-size: 12px; }

.snap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.snap-table th,
.snap-table td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.snap-table thead th {
  position: sticky;
  top: 61px; /* below the sticky topbar */
  z-index: 5;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}
.snap-table td.num,
.snap-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.snap-table td.mono { font-family: var(--mono); color: var(--text-2); }
.snap-table tbody tr:last-child td { border-bottom: none; }
.snap-table tbody tr:hover td { background: var(--accent-dim); }
.snap-name { color: var(--text); font-weight: 500; }

/* sortable header affordance */
.snap-table th.sortable { cursor: pointer; transition: color .15s var(--ease); }
.snap-table th.sortable:hover { color: var(--text); }
.snap-table th.sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.snap-table th.sortable::after {
  content: "";
  display: inline-block;
  width: 0; height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0;
  transition: opacity .15s var(--ease);
}
.snap-table th.sortable:hover::after { opacity: 0.4; border-top: 5px solid currentColor; }
.snap-table th.is-sorted-asc::after  { opacity: 1; border-bottom: 5px solid var(--accent); border-top: 0; }
.snap-table th.is-sorted-desc::after { opacity: 1; border-top: 5px solid var(--accent); border-bottom: 0; }
.snap-table th.is-sorted-asc, .snap-table th.is-sorted-desc { color: var(--text); }

.snap-foot {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 26px 44px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

@media (max-width: 640px) {
  .snap-table th, .snap-table td { padding: 10px 11px; }
  .snap-table thead th { top: 0; } /* topbar wraps on mobile; don't double-offset */
}
