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

:root {
  --bg: #0f0f13;
  --surface: #18181f;
  --surface2: #21212a;
  --border: #2c2c38;
  --accent: #7c6af5;
  --accent-hover: #9585ff;
  --text: #e8e8f0;
  --muted: #888899;
  --error: #f87171;
  --success: #4ade80;
  --actor: #60a5fa;
  --director: #f97316;
  --writer: #34d399;
  --both: #a78bfa;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0 2rem;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  height: 56px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: background 0.15s;
}

.nav-toggle:hover span { background: var(--text); }

.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  position: relative;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-logout { color: var(--muted) !important; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Layout ── */
.main-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header h2 { font-size: 1.4rem; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h3 { font-size: 1rem; font-weight: 600; }
.count { color: var(--muted); font-weight: 400; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.btn-remove:hover { color: var(--error); background: rgba(248,113,113,0.1); }

/* ── Auth ── */
.auth-wrap {
  max-width: 420px;
  margin: 4rem auto;
}

.auth-wrap h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-form input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.auth-form input:focus { border-color: var(--accent); }

.auth-switch {
  margin-top: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Flash ── */
.flash-container { margin-bottom: 1rem; }

.flash {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.flash-error { background: rgba(248,113,113,0.15); border: 1px solid rgba(248,113,113,0.3); color: var(--error); }
.flash-success { background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.3); color: var(--success); }
.flash-info { background: rgba(124,106,245,0.12); border: 1px solid rgba(124,106,245,0.3); color: var(--accent); }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 6rem 1rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ── Search ── */
.search-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-wrap input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-wrap input:focus { border-color: var(--accent); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 200;
  max-height: 340px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.search-dropdown.hidden { display: none; }

.search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
}

.search-item:hover:not(.added) { background: var(--surface); }
.search-item.added { opacity: 0.5; cursor: default; }

.si-avatar img, .si-avatar .avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.si-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.si-name { font-size: 0.9rem; font-weight: 500; }
.si-meta { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.add-tag { font-size: 0.75rem; color: var(--accent); flex-shrink: 0; }
.added-tag { font-size: 0.75rem; color: var(--muted); flex-shrink: 0; }

.search-empty { padding: 1rem; text-align: center; color: var(--muted); font-size: 0.875rem; }

/* ── Favorites list ── */
.fav-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.fav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.fav-item:last-child { border-bottom: none; }

.fav-avatar img, .fav-avatar .avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.fav-info { flex: 1; display: flex; align-items: center; gap: 0.6rem; }
.fav-name { font-size: 0.9rem; }

/* ── Favorites grid ── */
.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.fav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  text-align: center;
}

.fav-card-avatar {
  cursor: pointer;
}
.fav-card-avatar img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; transition: opacity 0.15s; }
.fav-card-avatar:hover img,
.fav-card-avatar:hover .avatar-lg { opacity: 0.75; }
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--muted); }

.fav-card .btn-remove {
  position: absolute;
  top: 8px;
  right: 8px;
}


.fav-dept { font-size: 0.75rem; color: var(--muted); }

/* ── Type tags ── */
.fav-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 99px;
}

.type-actor { background: rgba(96,165,250,0.15); color: var(--actor); }
.type-director { background: rgba(249,115,22,0.15); color: var(--director); }
.type-writer { background: rgba(52,211,153,0.15); color: var(--writer); }
.type-both { background: rgba(167,139,250,0.15); color: var(--both); }

.media-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--muted);
}

/* ── Intersections ── */
.ix-pair { }

.pair-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.pair-name { font-weight: 600; }
.pair-sep { color: var(--muted); }
.pair-count { font-size: 0.75rem; color: var(--muted); font-weight: 400; margin-left: auto; }

.works-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.work-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  min-width: 0;
  position: relative;
}

.work-poster {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.work-poster-placeholder {
  width: 40px;
  height: 60px;
  background: var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}

.work-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.work-title { font-size: 0.85rem; font-weight: 500; }
.work-year { font-size: 0.75rem; color: var(--muted); }

/* ── Alert section ── */
.alert-section { border-left: 3px solid var(--accent); }
.alert-section h3 { color: var(--accent); margin-bottom: 0.75rem; font-size: 0.95rem; }

.alert-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.75rem; }
.alert-list li { font-size: 0.875rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.alert-list .pair-names { font-weight: 500; }
.alert-list .work-title { color: var(--muted); }

/* ── Avatar placeholder ── */
.avatar-placeholder {
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 1rem;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: slideIn 0.2s ease;
}

.toast.hidden { display: none; }
.toast-success { background: rgba(74,222,128,0.2); border: 1px solid rgba(74,222,128,0.4); color: var(--success); }
.toast-error { background: rgba(248,113,113,0.2); border: 1px solid rgba(248,113,113,0.4); color: var(--error); }

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

/* ── Person modal ── */
.person-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.person-bio {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text);
  max-height: 160px;
  overflow-y: auto;
  padding-right: 0.25rem;
  margin-bottom: 0;
}

.credits-list {
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
  padding: 1rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  max-height: 340px;
  overflow-y: auto;
}

.credit-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.credit-row:last-child { border-bottom: none; }

.credit-year {
  width: 2.5rem;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.credit-title {
  flex: 1;
  font-weight: 500;
  min-width: 0;
}

.credit-role {
  color: var(--muted);
  font-style: italic;
  font-size: 0.8rem;
}

/* ── Empty state ── */
.empty-state { color: var(--muted); text-align: center; padding: 1.5rem 0; font-size: 0.9rem; }

/* ── Account page ── */
.account-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.account-email {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.account-since {
  font-size: 0.8rem;
  color: var(--muted);
}

.account-hint {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.9rem;
}

.admin-on-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(124,106,245,0.12);
  border: 1px solid rgba(124,106,245,0.3);
  padding: 2px 10px;
  border-radius: 99px;
  vertical-align: middle;
}

.card-danger { border-color: rgba(248,113,113,0.2); }

.danger-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.delete-confirm {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.delete-confirm.hidden { display: none; }

/* ── Work card clickable ── */
.work-card {
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.work-card:hover { background: var(--surface); transform: translateY(-1px); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: none;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.modal-close:hover { color: var(--text); background: var(--border); }

.modal-topbar {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 0.75rem 0;
}

.modal-body { padding: 0 1.75rem 1.75rem; }

.modal-loading, .modal-error {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
  font-size: 0.9rem;
}

.modal-layout {
  display: flex;
  gap: 1.5rem;
}

.modal-aside { flex-shrink: 0; }

.modal-poster {
  width: 120px;
  border-radius: 8px;
  display: block;
}

.modal-poster-placeholder {
  width: 120px;
  height: 180px;
  background: var(--surface2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2rem;
}

.modal-main { flex: 1; min-width: 0; }

.modal-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}

.modal-year { font-weight: 400; color: var(--muted); }

.modal-rating {
  font-size: 0.85rem;
  color: #fbbf24;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.modal-meta-item { font-size: 0.8rem; color: var(--muted); }

.modal-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.genre-tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Modal highlight section ── */
.highlight-section {
  background: rgba(124,106,245,0.08);
  border: 1px solid rgba(124,106,245,0.2);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.9rem;
}

.highlight-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.highlight-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 0.15rem 0;
}

.highlight-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.highlight-role {
  color: var(--muted);
  font-style: italic;
}

.modal-tagline {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 0.6rem;
}

.modal-overview {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.modal-credit {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.credit-label {
  font-weight: 600;
  color: var(--text);
  margin-right: 0.25rem;
}

.modal-admin-row {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.btn-danger {
  background: rgba(248,113,113,0.15);
  color: var(--error);
  border: 1px solid rgba(248,113,113,0.3);
}
.btn-danger:hover { background: rgba(248,113,113,0.25); color: var(--error); }

/* ── Admin page ── */
.admin-note {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 0 0 0.6rem;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table .muted { color: var(--muted); }

.new-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.checkbox-row input[type="checkbox"] { width: 1rem; height: 1rem; cursor: pointer; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 0.75rem;
}
.metric-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.metric-value {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.2;
}
.metric-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@media (max-width: 600px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Passkeys ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 1rem 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-passkey {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  justify-content: center;
}
.btn-passkey:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.passkey-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.5rem;
}

.passkey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.passkey-item:last-child { border-bottom: none; }

.passkey-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.passkey-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.passkey-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.passkey-empty {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.passkey-err {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 0.5rem;
}
.passkey-err.hidden { display: none; }

/* ── Works page ── */
.works-card {
  padding: 0;
  overflow: hidden;
}

.works-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.works-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 0.75rem 1.25rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.works-table td {
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.works-table tbody tr:last-child td { border-bottom: none; }

.works-row {
  cursor: pointer;
  transition: background 0.1s;
}

.works-row:hover { background: var(--surface2); }

.works-title-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.works-poster {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.works-poster-placeholder {
  width: 32px;
  height: 48px;
  background: var(--border);
  border-radius: 3px;
  flex-shrink: 0;
}

.works-title { font-weight: 500; }

.works-people {
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 260px;
}

.works-date {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.muted-text { color: var(--muted); }

@media (max-width: 640px) {
  .works-table th:nth-child(2),
  .works-table td:nth-child(2) { display: none; }
}

/* ── Mobile nav ── */
@media (max-width: 640px) {
  .nav {
    padding: 0 1rem;
    height: auto;
    min-height: 56px;
  }

  .nav-brand {
    height: 56px;
    display: flex;
    align-items: center;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0.25rem 0 0.75rem;
    gap: 0;
    border-top: 1px solid var(--border);
  }

  .nav.open .nav-links {
    display: flex;
  }

  .nav-links a {
    font-size: 0.95rem;
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  /* Suppress the bottom-bar active indicator on mobile */
  .nav-links a.active::after {
    display: none;
  }

  .hero-title { font-size: 2.4rem; }
  .hero { padding: 3.5rem 1rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .main-content { padding: 1.5rem 1rem; }
}

/* ── Feed URL ── */
.feed-url-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0 1rem;
}

.feed-url {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
}

.feed-url:focus { outline: none; border-color: var(--accent); }
