@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0c0c0f;
  --bg-2: #121218;
  --bg-3: #1a1a24;
  --surface: #1e1e2a;
  --surface-2: #252535;
  --border: #2a2a3d;
  --border-2: #33334a;
  --text: #eeeef5;
  --text-2: #a0a0bc;
  --text-3: #6060808a;
  --accent: #f0a500;
  --accent-dim: #f0a50022;
  --accent-2: #e05c3a;
  --green: #3ecf8e;
  --green-dim: #3ecf8e18;
  --blue: #4b8eff;
  --blue-dim: #4b8eff18;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.6);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg: #f4f3f0;
  --bg-2: #eeece8;
  --bg-3: #e8e5df;
  --surface: #ffffff;
  --surface-2: #f9f8f6;
  --border: #dddad4;
  --border-2: #ccc9c2;
  --text: #1a1814;
  --text-2: #5a5650;
  --text-3: #9a9690;
  --accent: #d4840a;
  --accent-dim: #d4840a18;
  --accent-2: #c94a28;
  --green: #1a9e6a;
  --green-dim: #1a9e6a18;
  --blue: #2b6fd4;
  --blue-dim: #2b6fd418;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.14);
}

html {
  scroll-behavior: smooth;
}

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

/* ── Noise texture overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #0c0c0f;
  letter-spacing: -0.5px;
}

.logo-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.4px;
}

.logo-title span {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  color: var(--text-2);
}

.theme-toggle:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  transform: rotate(20deg);
}

/* ── Auth Menu ── */
.auth-menu {
  position: relative;
}

.auth-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.auth-btn #auth-icon {
  font-size: 16px;
}

.auth-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 220px;
  max-width: 300px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
  overflow: hidden;
}

.auth-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

#auth-content {
  padding: 8px;
}

.auth-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
}

.auth-option:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--text);
}

.auth-option:last-child {
  margin-bottom: 0;
}

.auth-option.google { border-color: var(--border); }
.auth-option.github { border-color: var(--border); }
.auth-option.signout { border-color: var(--accent-2); color: var(--accent-2); }
.auth-option.signout:hover { background: rgba(224,92,58,0.08); }

.user-info {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.user-info .user-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 3px;
}

.user-info .user-email {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  word-break: break-all;
}

.count-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  letter-spacing: 0.3px;
}

/* ── Hero / Controls ── */
.controls-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 20px;
}

.hero-text {
  margin-bottom: 20px;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  color: var(--text);
}

.hero-text h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-text p {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 300;
}

.controls-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Search ── */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 15px;
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

#search-input::placeholder {
  color: var(--text-3);
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--surface-2);
}

#search-input:not(:placeholder-shown) {
  border-color: var(--accent);
}

/* ── Filters ── */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--border-2);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0c0c0f;
  font-weight: 600;
}

/* ── App Grid ── */
.grid-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.section-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.results-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.results-count strong {
  color: var(--accent);
}

#app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ── App Card ── */
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
  animation: cardIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
  cursor: pointer;
}

.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-2);
}

.app-card:hover::before {
  opacity: 1;
}

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

/* Card stagger */
.app-card:nth-child(1) { animation-delay: 0.04s; }
.app-card:nth-child(2) { animation-delay: 0.08s; }
.app-card:nth-child(3) { animation-delay: 0.12s; }
.app-card:nth-child(4) { animation-delay: 0.16s; }
.app-card:nth-child(5) { animation-delay: 0.20s; }
.app-card:nth-child(6) { animation-delay: 0.24s; }
.app-card:nth-child(7) { animation-delay: 0.28s; }
.app-card:nth-child(8) { animation-delay: 0.32s; }

/* ── Card: top row ── */
.card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.app-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
  padding: 4px;
}

.app-logo-fallback {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
}

.app-header-text {
  flex: 1;
  min-width: 0;
}

.app-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-category {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 4px;
  padding: 1px 7px;
  letter-spacing: 0.3px;
}

.maintainer-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

.maintainer-badge[data-type="organization"] {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

.maintainer-badge[data-type="individual"] {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

/* ── Card: description ── */
.app-description {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  font-weight: 300;
}

/* ── Card: uses + alt ── */
.app-meta-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-item {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 1px;
  flex-shrink: 0;
}

.meta-value {
  color: var(--text-2);
  font-size: 13px;
}

.alt-name {
  color: var(--accent-2);
  font-weight: 500;
}

/* ── Card: platforms ── */
.platforms-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.platform-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-3);
  background: var(--bg-3);
  letter-spacing: 0.3px;
}

/* ── Card: actions ── */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-primary {
  background: var(--accent);
  color: #0c0c0f;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: #f5b830;
  box-shadow: 0 4px 14px rgba(240,165,0,0.35);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
  transform: translateY(-1px);
}

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

/* ── Empty state ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 14px;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-left {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.7;
}

.footer-left a {
  color: var(--accent);
  text-decoration: none;
}

.footer-left a:hover {
  text-decoration: underline;
}

.footer-right {
  display: flex;
  gap: 16px;
}

.footer-link {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--text);
}

.footer-link-bug {
  color: var(--accent);
}

/* ── Submit App header button ── */
.btn-submit-app {
  padding: 7px 14px;
  background: var(--accent);
  color: #0c0c0f;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn-submit-app:hover {
  background: #f5b830;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(240,165,0,0.35);
}

/* ── Report button ── */
.report-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 13px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  line-height: 1;
}

.report-btn:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
  background: rgba(224,92,58,0.08);
}

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  transform: translateY(16px);
  transition: transform 0.28s cubic-bezier(0.34,1.3,0.64,1);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-wide { max-width: 640px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}

/* ── Forms ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-2);
  letter-spacing: 0.2px;
}

.required { color: var(--accent); }
.optional  { color: var(--text-3); font-size: 10px; }

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  width: 100%;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-3);
  font-size: 13px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(224,92,58,0.1);
}

.form-group select option {
  background: var(--bg-2);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px !important;
  font-family: var(--font-body) !important;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.checkbox-label:hover {
  border-color: var(--accent);
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
}

.form-msg {
  font-size: 13px;
  font-family: var(--font-mono);
  min-height: 20px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  padding: 0;
  transition: all 0.2s;
}

.form-msg.error {
  color: var(--accent-2);
  background: rgba(224,92,58,0.08);
  padding: 8px 12px;
  border: 1px solid rgba(224,92,58,0.25);
}

.form-msg.success {
  color: var(--green);
  background: var(--green-dim);
  padding: 8px 12px;
  border: 1px solid rgba(62,207,142,0.25);
}

.btn-submit {
  width: 100%;
  padding: 11px;
  font-size: 14px;
  margin-top: 4px;
  transition: all var(--transition);
}

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

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 1200;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-2);
}

::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
  }

  .controls-section {
    padding: 28px 16px 16px;
  }

  .grid-section {
    padding: 8px 16px 48px;
  }

  #app-grid {
    grid-template-columns: 1fr;
  }

  .count-badge {
    display: none;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .logo-title {
    font-size: 17px;
  }

  .hero-text h1 {
    font-size: 24px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Focus visible for keyboard navigation ── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Remove outline for mouse-clicked elements */
*:not(:focus-visible) {
  outline: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NEW FEATURES: Nav, Detail page, Rankings, Votes, Auth-gate, Added-by
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Nav Link (Rankings) ── */
.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 20px;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--accent);
  color: #0c0c0f;
}

/* ── View Sections ── */
.view-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  min-height: 60vh;
}

/* ── Rank Badge ── */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  background: var(--accent);
  color: #0c0c0f;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  flex-shrink: 0;
}

.rank-badge.rank-lg {
  min-width: 36px;
  height: 30px;
  font-size: 14px;
  border-radius: 8px;
  margin-left: 10px;
  vertical-align: middle;
}

/* ── App Stats Row (card) ── */
.app-stats-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-item {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-item.card-rating {
  color: var(--accent);
  font-weight: 600;
}

/* ── Added By Badge ── */
.added-by-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.added-by-badge.team {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.added-by-badge.user {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

/* Mini avatar inside addedBy badge */
.added-by-avatar-mini {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.added-by-avatar-mini.official-avatar-mini {
  background: var(--accent);
  color: #0c0c0f;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 6px;
  letter-spacing: -0.3px;
}

img.added-by-avatar-mini {
  border: 1px solid var(--border);
}

span.added-by-avatar-mini:not(.official-avatar-mini) {
  background: var(--blue);
  color: #fff;
}

a.added-by-link {
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--transition), border-color var(--transition);
}
a.added-by-link:hover {
  opacity: 0.8;
  border-color: var(--blue);
}

/* ── App Link ── */
.app-link {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.app-link:hover {
  color: var(--accent);
}

/* ── Detail Page ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--text);
}

.detail-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px;
}

.detail-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 14px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.detail-logo {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: contain;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
  padding: 8px;
}

.detail-logo-fallback {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  color: var(--accent);
}

.detail-header-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.detail-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 4vw, 34px);
  color: var(--text);
  letter-spacing: -0.5px;
  width: 100%;
  margin-bottom: 4px;
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-section h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.detail-section p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.detail-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

/* -- Compact detail layout containers -- */
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.detail-stats-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-actions-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-actions-row .vote-buttons {
  display: flex;
  gap: 8px;
}

.detail-actions-row .vote-buttons .vote-btn {
  flex: 1;
  justify-content: center;
}

.detail-actions-row .detail-links {
  display: flex;
  gap: 8px;
}

.detail-actions-row .detail-links .btn-lg {
  flex: 1;
  text-align: center;
  justify-content: center;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.vote-buttons {
  display: flex;
  gap: 12px;
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
}

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

.vote-btn.active.like-btn {
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--green);
}

.vote-btn.active.dislike-btn {
  border-color: var(--accent-2);
  background: rgba(224,92,58,0.08);
  color: var(--accent-2);
}

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

.vote-count {
  font-family: var(--font-mono);
  font-size: 13px;
}

.detail-links {
  display: flex;
  gap: 12px;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 14px;
}

.detail-report {
  align-self: flex-start;
  margin-top: 8px;
  padding: 6px 14px;
  font-size: 12px;
}

/* ── Rankings Page ── */
.rankings-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 0;
}

.rankings-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.rankings-subtitle {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 28px;
}

.rankings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.ranking-item:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateX(4px);
}

.ranking-item.top-1 {
  border-color: #ffd700;
  background: rgba(255,215,0,0.06);
}

.ranking-item.top-2 {
  border-color: #c0c0c0;
  background: rgba(192,192,192,0.04);
}

.ranking-item.top-3 {
  border-color: #cd7f32;
  background: rgba(205,127,50,0.04);
}

.ranking-pos {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--accent);
  min-width: 32px;
  text-align: center;
}

.top-1 .ranking-pos { color: #ffd700; }
.top-2 .ranking-pos { color: #c0c0c0; }
.top-3 .ranking-pos { color: #cd7f32; }

.rank-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
  padding: 3px;
}

.rank-logo-fallback {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}

.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  display: block;
}

.ranking-cat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.ranking-metrics {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}

.ranking-score {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  min-width: 60px;
  text-align: right;
}

/* ── Login Prompt Modal ── */
.login-prompt-body {
  text-align: center;
  padding: 12px 0;
}

.login-prompt-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.login-prompt-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
}

.login-prompt-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-prompt-buttons .auth-option {
  justify-content: center;
}

/* ── Account Linking Modal ── */
#account-link-modal .login-prompt-text strong {
  color: var(--accent);
}

#account-link-modal .login-prompt-sub strong {
  color: var(--text);
  font-weight: 600;
}

.auth-option.link-cancel {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-body);
  transition: background var(--transition), border-color var(--transition);
}

.auth-option.link-cancel:hover {
  background: var(--bg-3);
  border-color: var(--border-2);
}

/* ── Responsive additions ── */
@media (max-width: 768px) {
  .nav-link {
    font-size: 11px;
    padding: 4px 8px;
  }

  .detail-page {
    padding: 20px 14px;
  }

  .detail-header {
    gap: 12px;
  }

  .detail-logo, .detail-logo-fallback {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    font-size: 24px;
    padding: 4px;
  }

  .detail-name {
    font-size: 20px;
  }

  .detail-header-actions {
    gap: 6px;
  }

  .bookmark-btn, .share-btn {
    padding: 6px 10px;
    font-size: 13px;
  }

  .detail-tags {
    gap: 4px;
  }

  .detail-tag {
    font-size: 10px;
    padding: 2px 7px;
  }

  .detail-body {
    gap: 12px;
  }

  .detail-section h3 {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .detail-section p {
    font-size: 13px;
    line-height: 1.6;
  }

  .desc-content {
    font-size: 13px;
    line-height: 1.6;
  }

  .desc-content.collapsed {
    max-height: 90px;
  }

  .features-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .features-list li {
    font-size: 13px;
    padding: 4px 0 4px 20px;
  }

  .screenshots-gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  .detail-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* Hide heavy sections on mobile (comparison table stays, wrapped in scrollable container) */
  .security-badges,
  .sysreq-block,
  .version-history-section,
  .edit-requests-section,
  .creator-section,
  .similar-section {
    display: none !important;
  }

  .install-method {
    padding: 8px 12px;
    gap: 8px;
  }

  .install-label {
    font-size: 11px;
    min-width: 50px;
  }

  .install-cmd {
    font-size: 11px;
  }

  .detail-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .detail-stat-card {
    padding: 8px;
  }

  .stat-number {
    font-size: 16px;
  }

  .stat-label {
    font-size: 10px;
  }

  .detail-stats-actions {
    flex-direction: column;
    gap: 12px;
  }

  .detail-actions-row {
    flex-direction: column;
    gap: 8px;
  }

  .detail-actions-row .vote-buttons {
    width: 100%;
  }

  .vote-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .detail-actions-row .detail-links {
    flex-wrap: wrap;
    width: 100%;
  }

  .detail-actions-row .detail-links .btn-lg {
    padding: 10px 14px;
    font-size: 13px;
  }

  .detail-secondary-actions {
    flex-wrap: wrap;
  }

  .detail-secondary-actions .report-btn,
  .detail-secondary-actions .btn-direct-edit {
    font-size: 12px;
    padding: 6px 10px;
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  /* Reviews compact on mobile */
  .review-text-input {
    font-size: 13px;
  }

  .review-card {
    padding: 12px;
  }

  .ranking-metrics {
    display: none;
  }
}

@media (max-width: 480px) {
  .ranking-score {
    display: none;
  }

  .detail-page {
    padding: 16px 10px;
  }

  .detail-header {
    gap: 10px;
  }

  .detail-logo, .detail-logo-fallback {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 20px;
  }

  .detail-name {
    font-size: 18px;
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .detail-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .stat-number {
    font-size: 14px;
  }

  .vote-btn {
    padding: 6px 8px;
    font-size: 12px;
    gap: 4px;
  }

  .btn-lg {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* Also hide install methods on very small screens */
  .install-methods {
    display: none;
  }

  .screenshots-gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
  }

  .detail-tags {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EDIT REQUEST (PR-style) + Enhanced Auth Profile
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Auth Avatar in Header ── */
.auth-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent);
  flex-shrink: 0;
}

.auth-dropdown-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  margin-bottom: 8px;
}

.user-provider {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

.user-uid {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  opacity: 0.6;
  margin-top: 2px;
}

/* ── Edit Request Modal ── */
.er-hint {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 18px;
  line-height: 1.5;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--blue);
}

/* ── Submitter Card in Modal ── */
.er-submitter-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.er-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.er-avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.er-submitter-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.er-submitter-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.er-submitter-email {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.er-provider-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Edit Requests Section (Detail Page) ── */
.edit-requests-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.edit-requests-section h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-requests-section h3::before {
  content: "✏️";
}

.edit-requests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.er-empty,
.er-loading {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  padding: 16px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* ── Edit Request Card (overrides on changelog-card) ── */

/* ── Locked Badge ── */
.er-locked-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--card-bg);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 1px 8px;
}

/* ── View All ER Button ── */
.view-all-er-btn {
  display: inline-block;
  margin-top: 12px;
  font-weight: 600;
  text-decoration: none;
}

/* ── Dedicated Edit Requests Page ── */
.er-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 0;
}
.er-page-header {
  margin-bottom: 20px;
}
.er-back-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.er-back-link:hover {
  text-decoration: underline;
}
.er-page-header h2 {
  margin: 8px 0 0;
  font-size: 22px;
  color: var(--text-1);
}
.er-status-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.er-filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-2);
  background: var(--card-bg);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.er-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.er-filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.er-full-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Responsive for Edit Requests / Version History ── */
@media (max-width: 560px) {
  .changelog-header-left {
    flex-wrap: wrap;
  }
  .changelog-tags {
    flex-wrap: wrap;
  }
  .er-status-filters {
    flex-wrap: wrap;
  }
  .er-page {
    padding: 16px 0;
  }
  .version-page {
    padding: 16px 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BADGES — Verified, Team, Role
   ═══════════════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  vertical-align: middle;
}

.badge-verified {
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(75, 142, 255, 0.3);
}

.badge-team {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(240, 165, 0, 0.3);
}

.badge-role {
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.badge-admin {
  color: var(--accent-2);
  background: rgba(224, 92, 58, 0.1);
  border: 1px solid rgba(224, 92, 58, 0.3);
}

.badge-maintainer {
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(62, 207, 142, 0.3);
}

.badge-corp {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   NAV LINKS
   ═══════════════════════════════════════════════════════════════════════════════ */

.nav-link-admin {
  color: var(--accent-2) !important;
}

.auth-option.profile-link {
  text-decoration: none;
  color: var(--text);
}

.auth-option.profile-link:hover {
  background: var(--surface-2);
}

.user-role {
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RECOMMENDATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

.recommendations-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.rec-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.rec-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.rec-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.rec-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 2px;
  flex-shrink: 0;
}

.rec-logo-fallback {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-2);
  flex-shrink: 0;
}

.rec-info {
  flex: 1;
  min-width: 0;
}

.rec-name {
  display: block;
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-cat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.rec-rating {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════════════════════════════════════════ */

.profile-page, .org-page, .admin-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-2);
  flex-shrink: 0;
}

.profile-avatar-fallback {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 3px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  color: var(--text-2);
  flex-shrink: 0;
}

.profile-header-text {
  flex: 1;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-email {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

.profile-bio {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 14px;
}

.profile-website {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
}

.profile-joined {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
}

.profile-follow-info {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.profile-follow-info .follow-count strong {
  color: var(--text);
  font-weight: 600;
}

.btn-follow {
  margin-top: 10px;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-follow:hover {
  background: var(--accent);
  color: var(--bg);
}

.btn-follow.following {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-follow.following:hover {
  background: transparent;
  border-color: var(--red, #e74c3c);
  color: var(--red, #e74c3c);
}

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

.profile-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 100px;
}

.profile-edit-section, .profile-section {
  margin-bottom: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.profile-edit-section h3, .profile-section h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.profile-form {
  max-width: 560px;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.profile-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition);
}

.profile-list-item:hover {
  border-color: var(--accent);
}

.org-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.profile-list-info {
  flex: 1;
  min-width: 0;
}

.profile-list-name {
  display: block;
  font-weight: 600;
  font-size: 13px;
}

.profile-list-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.profile-list-role {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.profile-empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  padding: 16px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-active {
  background: var(--green);
  color: #000;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  transition: all var(--transition);
}

.btn-icon:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ORGANIZATION PAGE
   ═══════════════════════════════════════════════════════════════════════════════ */

.org-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.org-logo {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  border: 2px solid var(--border-2);
  flex-shrink: 0;
}

.org-logo-fallback {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  border: 2px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.org-header-text {
  flex: 1;
}

.org-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.org-desc {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14px;
}

.org-website {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
}

.org-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
}

.org-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.org-section {
  margin-bottom: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.org-section h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.org-add-member {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.org-member-input {
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  flex: 1;
  min-width: 180px;
}

.org-member-select {
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.org-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.org-member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.org-member-name {
  flex: 1;
  font-weight: 500;
  font-size: 13px;
}

.org-ownership-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.org-transfer-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ADMIN DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════════ */

.admin-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 24px;
}

.admin-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 110px;
  flex: 1;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.admin-tab {
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-card-header strong {
  font-size: 14px;
}

.admin-card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}

.admin-card-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.admin-card-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-card-meta a {
  color: var(--blue);
}

.admin-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.admin-empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  padding: 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.admin-form {
  max-width: 600px;
}

.admin-form-full {
  max-width: 800px;
}

/* ── Admin Form Fieldsets ── */
.admin-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 18px 6px;
  margin-bottom: 18px;
  background: var(--surface);
}

.admin-fieldset-legend {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  padding: 0 8px;
  letter-spacing: 0.3px;
}

.admin-fieldset-mod {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.admin-fieldset-mod .admin-fieldset-legend {
  color: var(--accent);
}

.admin-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

/* ── Admin Users List ── */

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.admin-user-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 200px;
}

.admin-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-2);
  flex-shrink: 0;
}

.admin-user-avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1.5px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-2);
  flex-shrink: 0;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
}

.admin-user-name {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-user-email {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.admin-user-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-role-select {
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   VERSION HISTORY
   ═══════════════════════════════════════════════════════════════════════════════ */

.version-history-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.version-history-section h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-history-section h3::before {
  content: "📋";
}

.version-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view-all-versions-btn {
  display: inline-block;
  margin-top: 12px;
  font-weight: 600;
  text-decoration: none;
}

/* ── Unified Changelog Card (VH + ER) ── */
.changelog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition);
}

.changelog-card:hover {
  border-color: var(--border-2);
}

.changelog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.changelog-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.changelog-number {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.changelog-type {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: capitalize;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  background: var(--bg-2);
}

.changelog-type-initial {
  color: var(--green);
  border-color: rgba(62, 207, 142, 0.3);
  background: var(--green-dim);
}

.changelog-type-restore {
  color: var(--accent);
  border-color: rgba(255, 107, 53, 0.3);
  background: rgba(255, 107, 53, 0.08);
}

.changelog-status-open {
  color: var(--green);
  background: var(--green-dim);
  border-color: rgba(62, 207, 142, 0.3);
}

.changelog-status-merged {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.3);
}

.changelog-status-closed {
  color: var(--accent-2);
  background: rgba(224, 92, 58, 0.08);
  border-color: rgba(224, 92, 58, 0.25);
}

.changelog-er-link {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.changelog-er-link:hover {
  text-decoration: underline;
}

.changelog-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

.changelog-message {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}

.changelog-card .changelog-message:last-of-type:not(:first-of-type) {
  font-style: italic;
  color: var(--text-2);
  padding-left: 10px;
  border-left: 2px solid var(--border-2);
  font-weight: 400;
}

.changelog-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.changelog-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-2);
  flex-shrink: 0;
}

.changelog-avatar-fallback {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1.5px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  color: var(--text-2);
  flex-shrink: 0;
}

.changelog-author-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.changelog-author-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.changelog-author-role {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}

.changelog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.changelog-field-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(240, 165, 0, 0.2);
}

.changelog-diff-toggle {
  align-self: flex-start;
  font-size: 12px;
}

.changelog-diff-panel {
  margin-top: 4px;
}

.version-restore-btn {
  align-self: flex-start;
  font-size: 12px;
  margin-top: 4px;
}

/* ── Dedicated Version History Page ── */
.version-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 0;
}
.version-page-header {
  margin-bottom: 20px;
}
.version-back-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.version-back-link:hover {
  text-decoration: underline;
}
.version-page-header h2 {
  margin: 8px 0 0;
  font-size: 22px;
  color: var(--text-1);
}
.version-full-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Creator Profile Card ────────────────────────────────────────────────── */
.creator-section {
  margin-top: 24px;
}
.creator-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.creator-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.creator-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.creator-card-avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  flex-shrink: 0;
}
.creator-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.creator-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.creator-card-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.creator-card-joined {
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ── OpenLib Official Avatar ── */
.openlib-creator-card {
  cursor: pointer;
}

.openlib-avatar {
  background: var(--accent) !important;
  color: #0c0c0f !important;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.5px;
}

/* ── Claim Ownership Section ── */
.claim-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.claim-section h3 {
  font-size: 14px;
  margin-bottom: 6px;
}

.claim-description {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.5;
}

.btn-claim-ownership {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-claim-ownership:hover {
  background: var(--accent);
  color: #0c0c0f;
}

.btn-claim-ownership:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ENHANCED EDIT REQUEST COMMENTS & REVIEWS
   ═══════════════════════════════════════════════════════════════════════════════ */

.er-approvals {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green);
  background: var(--green-dim);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(62, 207, 142, 0.3);
}

.er-comments-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.er-comment {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-2);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.er-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.er-comment-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.er-comment-body {
  flex: 1;
  min-width: 0;
}

.er-comment.comment-approval {
  border-left: 3px solid var(--green);
}

.er-comment.comment-rejection {
  border-left: 3px solid var(--accent-2);
}

.er-comment.comment-merge {
  border-left: 3px solid #a855f7;
}

.er-comment-author {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  margin-right: 6px;
}

.er-comment-text {
  color: var(--text-2);
  word-break: break-word;
}

.er-comment-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.er-load-more-btn {
  background: none;
  border: 1px solid var(--border-2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.er-load-more-btn:hover {
  background: var(--bg-2);
  border-color: var(--accent);
}

.er-comment-form {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.er-comment-input {
  flex: 1;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.er-comment-input:focus {
  outline: none;
  border-color: var(--accent);
}

.er-review-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

/* ── Edit Request Diff View ── */
.er-diff-container {
  overflow: hidden;
}

.er-diff-container.open {
  overflow: auto;
  margin-top: 10px;
}

.diff-loading {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  padding: 8px;
}

.diff-empty-msg {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  padding: 8px;
}

.diff-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 500px;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 13px;
  table-layout: fixed;
}

.diff-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.diff-table th {
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.diff-table th:first-child { width: 22%; }
.diff-table th.diff-old { width: 39%; }
.diff-table th.diff-new { width: 39%; }

.diff-table td {
  padding: 8px 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
  overflow-wrap: anywhere;
}

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

.diff-table tr:hover td {
  background: var(--surface);
}

.diff-field-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.diff-cell {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.diff-cell-old {
  background: rgba(224, 92, 58, 0.04);
}

.diff-cell-new {
  background: rgba(62, 207, 142, 0.04);
}

.diff-empty {
  color: var(--text-3);
  font-style: italic;
  font-size: 12px;
}

.diff-tag {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  margin: 1px 2px;
  color: var(--text-2);
}

.diff-row-long .diff-cell {
  font-size: 12px;
  line-height: 1.6;
  max-height: 150px;
  overflow: auto;
}

/* Structured diff renderers for complex fields */
.diff-json {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow: auto;
  color: var(--text-2);
  margin: 0;
}

.diff-inline-table {
  font-size: 12px;
  margin: 4px 0;
}

.diff-inline-table th,
.diff-inline-table td {
  padding: 4px 8px;
}

.diff-install-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}

.diff-install-item code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-2);
}

/* Changelog diff panel inherits diff-table styling */
.changelog-diff-panel .diff-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

@media (max-width: 600px) {
  .diff-table { font-size: 11px; }
  .diff-table th { font-size: 10px; padding: 6px 6px; }
  .diff-table td { padding: 6px 6px; }
  .diff-table th:first-child { width: 25%; }
  .diff-table th.diff-old { width: 37.5%; }
  .diff-table th.diff-new { width: 37.5%; }
  .diff-field-name { font-size: 10px; }
  .diff-row-long .diff-cell { max-height: 100px; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   VERIFY SUBMISSIONS SCREEN
   ═══════════════════════════════════════════════════════════════════════════════ */

.verify-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.verify-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.verify-subtitle {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 24px;
}

.verify-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.verify-stat-card {
  flex: 1;
  min-width: 120px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.verify-stat-card .stat-number {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
}

.verify-stat-card .stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.verify-stat-pending .stat-number { color: #ffc107; }
.verify-stat-changes .stat-number { color: #ff9800; }
.verify-stat-approved .stat-number { color: #4caf50; }
.verify-stat-rejected .stat-number { color: #f44336; }

/* Verify Cards */
.verify-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.verify-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s;
}

.verify-card:hover {
  border-color: var(--border-2);
}

.verify-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.verify-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.verify-card-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.verify-card-logo-fallback {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-2);
  flex-shrink: 0;
}

.verify-card-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-right: 6px;
}

.verify-card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

.verify-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.verify-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 3px;
}

.verify-field p {
  font-size: 13px;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

.verify-field p a {
  color: var(--blue);
  text-decoration: none;
}

.verify-field p a:hover {
  text-decoration: underline;
}

.verify-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.verify-platforms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Verify Feedback */
.verify-feedback {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  margin-bottom: 12px;
}

.verify-feedback-changes {
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.25);
}

.verify-feedback-rejected {
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.25);
}

.verify-feedback-approved {
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.25);
}

/* Verify Comments */
.verify-comments {
  margin: 8px 0;
}

.verify-comments-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.verify-comment-form {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.verify-comment-input {
  flex: 1;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.verify-comment-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Verify Actions */
.verify-actions {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.verify-actions .btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
}

/* Profile Team Actions */
.profile-team-actions {
  margin: 20px 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb, 99, 102, 241), 0.06), rgba(var(--accent-rgb, 99, 102, 241), 0.02));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-verify-submissions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SUBMISSION VERIFICATION UI
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Submission Status Filters */
.sub-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.sub-filter-btn {
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}

.sub-filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.sub-filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Submission Review Cards */
.sub-review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-review-card {
  padding: 16px;
}

.sub-status-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.sub-status-pending { background: rgba(255, 193, 7, 0.12); border-color: rgba(255, 193, 7, 0.3); color: #ffc107; }
.sub-status-approved { background: rgba(76, 175, 80, 0.12); border-color: rgba(76, 175, 80, 0.3); color: #4caf50; }
.sub-status-rejected { background: rgba(244, 67, 54, 0.12); border-color: rgba(244, 67, 54, 0.3); color: #f44336; }
.sub-status-changes_requested { background: rgba(255, 152, 0, 0.12); border-color: rgba(255, 152, 0, 0.3); color: #ff9800; }

/* Submission Detail View */
.sub-review-details {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.sub-review-row {
  display: flex;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.sub-review-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  min-width: 110px;
  flex-shrink: 0;
  padding-top: 1px;
}

.sub-review-value {
  color: var(--text);
  word-break: break-word;
}

.sub-review-value a {
  color: var(--blue);
  text-decoration: none;
}

.sub-review-value a:hover {
  text-decoration: underline;
}

.sub-review-logo {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
}

.platform-tag {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-right: 3px;
}

/* Submission Review Feedback */
.sub-review-feedback {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.25);
  color: var(--text);
  margin: 8px 0;
}

.sub-review-feedback.sub-review-rejected {
  background: rgba(244, 67, 54, 0.08);
  border-color: rgba(244, 67, 54, 0.25);
}

/* Submission Comments */
.sub-comments-section {
  margin: 8px 0;
}

.sub-comments-loading {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.sub-comment-form {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.sub-comment-input {
  flex: 1;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.sub-comment-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Comment type colors */
.comment-changes-requested { border-left: 3px solid #ff9800; }
.comment-resubmission { border-left: 3px solid var(--blue); }

/* Resubmit Modal Feedback */
.resubmit-feedback-box {
  padding: 12px 16px;
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  margin-bottom: 16px;
}

/* Profile Submission Feedback */
.profile-list-feedback {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
  margin-top: 2px;
}

/* btn-danger for reject */
.btn-danger {
  background: #f44336;
  color: #fff;
  border: none;
}
.btn-danger:hover {
  background: #d32f2f;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   REPORT MODERATION & ENFORCEMENT
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Tab badge (notification count) */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

/* Report cards list */
.report-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.report-card:hover {
  border-color: var(--accent);
}

.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}

.report-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}

.report-status-icon {
  font-size: 14px;
}

.report-card-date {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

.report-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-field {
  font-size: 13px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.report-field-label {
  font-weight: 600;
  color: var(--text-2);
  min-width: 80px;
  flex-shrink: 0;
}

.report-field-value {
  color: var(--text);
  word-break: break-word;
}

.report-app-link {
  color: var(--blue);
  text-decoration: none;
  font-size: 13px;
}

.report-app-link:hover {
  text-decoration: underline;
}

/* Report action buttons */
.report-card-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-actions-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.report-enforcement-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.report-enforcement-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Button variants for moderation */
.btn-warning {
  background: #ff9800;
  color: #0c0c0f;
  border: none;
  font-weight: 600;
}

.btn-warning:hover {
  background: #f57c00;
}

.btn-xs {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Moderation status badges */
.badge-mod-restricted {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.badge-mod-removed {
  background: rgba(229, 57, 53, 0.15);
  color: #e53935;
  border: 1px solid rgba(229, 57, 53, 0.3);
}

/* Moderation banner on app detail page */
.mod-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.mod-banner-restricted {
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  color: #ff9800;
}

.mod-banner-removed {
  background: rgba(229, 57, 53, 0.1);
  border: 1px solid rgba(229, 57, 53, 0.3);
  color: #e53935;
}

.mod-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.mod-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  line-height: 1.4;
}

.mod-banner-text strong {
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   OPENLIB TEAM PAGE
   ═══════════════════════════════════════════════════════════════════════════════ */

.team-page, .team-manage-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* Profile Header */
.team-profile-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.team-avatar-lg {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px;
  max-height: 64px;
  font-size: 24px !important;
  border: 3px solid var(--accent);
}

.team-profile-info {
  flex: 1;
  min-width: 200px;
}

.team-profile-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.team-profile-bio {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.team-profile-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.team-link {
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity var(--transition);
}

.team-link:hover { opacity: 0.8; }

.team-link-text {
  font-size: 12px;
  color: var(--text-3);
}

.team-manage-btn {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 12px;
  white-space: nowrap;
}

/* Team Stats Grid */
.team-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.team-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.team-stat-card .stat-number {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
}

/* Team Sections */
.team-section {
  margin-bottom: 32px;
}

.team-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.team-section-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 14px;
}

.team-empty {
  color: var(--text-3);
  font-size: 13px;
  padding: 12px 0;
}

/* Team Member Cards */
.team-members-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-member-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.team-member-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.team-member-avatar {
  width: 48px;
  height: 48px;
  max-width: 48px;
  max-height: 48px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  border: 2px solid var(--border-2);
}

.team-member-avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #0c0c0f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.team-member-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.team-member-name {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.team-member-bio {
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-meta {
  font-size: 11px;
  color: var(--text-3);
}

.badge-team-role {
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(75, 142, 255, 0.3);
}

/* Curated Apps Grid */
.team-curated-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.team-curated-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.team-curated-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.team-curated-logo {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  border-radius: 10px;
  object-fit: contain;
}

.team-curated-logo-fallback {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
}

.team-curated-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.team-curated-cat {
  font-size: 11px;
  color: var(--text-3);
}

/* ── Team Management Page Styles ── */
.tm-section {
  margin-bottom: 24px;
}

.tm-section h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.tm-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 14px;
}

.tm-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tm-sub-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

/* Team Member Management Rows */
.tm-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.tm-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.tm-member-avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #0c0c0f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.tm-member-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.tm-member-avatar-fallback-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.tm-member-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tm-member-name {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tm-member-email {
  font-size: 11px;
  color: var(--text-2);
}

.tm-member-meta {
  font-size: 10px;
  color: var(--text-3);
}

.tm-member-actions {
  flex-shrink: 0;
}

.tm-role-fixed {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
}

/* Permissions Cards */
.tm-perm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.tm-perm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}

.tm-perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.tm-perm-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}

.tm-perm-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

/* Add Member Tab */
.tm-search-wrap {
  margin-bottom: 14px;
}

.tm-search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition);
}

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

.tm-user-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

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

.tm-user-name {
  font-weight: 600;
  font-size: 13px;
}

.tm-user-email {
  font-size: 11px;
  color: var(--text-2);
}

.tm-more-note {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  padding: 8px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — New Views
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .profile-header, .org-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-name, .org-name {
    justify-content: center;
    font-size: 20px;
  }

  .profile-stats, .org-stats, .admin-stats {
    flex-direction: column;
  }

  .admin-user-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-user-controls {
    width: 100%;
  }

  .org-add-member {
    flex-direction: column;
  }

  .rec-grid {
    grid-template-columns: 1fr;
  }

  .sub-review-row {
    flex-direction: column;
    gap: 2px;
  }

  .sub-review-label {
    min-width: auto;
  }

  .sub-filters {
    flex-wrap: wrap;
  }

  .verify-field-row {
    grid-template-columns: 1fr;
  }

  .verify-stats {
    flex-direction: column;
  }

  .verify-actions {
    flex-direction: column;
  }

  .verify-card-header {
    flex-direction: column;
  }

  .team-page, .team-manage-page {
    padding: 20px 14px 48px;
  }

  .team-profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .team-profile-name {
    justify-content: center;
    font-size: 20px;
  }

  .team-profile-links {
    justify-content: center;
  }

  .team-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-curated-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tm-perm-grid {
    grid-template-columns: 1fr;
  }

  .tm-member-row, .tm-user-row {
    flex-wrap: wrap;
  }

  .report-card-header {
    flex-direction: column;
  }

  .report-actions-row,
  .report-enforcement-row {
    flex-direction: column;
  }

  .report-field {
    flex-direction: column;
    gap: 2px;
  }
}

/* ═══════════════════════════════════════════════════════════
   NEW FEATURE STYLES
   ═══════════════════════════════════════════════════════════ */

/* ── Detail: Meta Bar (version, license, filesize, date, developer) ── */
.detail-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}

.dev-pill a {
  color: var(--accent);
  text-decoration: none;
}

.dev-pill a:hover {
  text-decoration: underline;
}

/* ── Detail: Tags ── */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}

.detail-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 3px 10px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.2px;
}

.detail-tag:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

/* ── Detail: Header Actions (bookmark, share) ── */
.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bookmark-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.bookmark-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.bookmark-btn.bookmarked {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Share Dropdown ── */
.share-dropdown-wrap {
  position: relative;
}

.share-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.share-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 100;
  overflow: hidden;
}

.share-dropdown.open {
  display: flex;
  flex-direction: column;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}

.share-option:hover {
  background: var(--surface-2);
  color: var(--text);
}

.share-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ── Screenshots / Preview Gallery ── */
/* ── Screenshots: Adaptive Masonry Grid ── */
.screenshots-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  align-items: start;
}

.screenshot-item {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  background: var(--bg-2);
  line-height: 0;
}

.screenshot-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.screenshot-item[data-ratio="portrait"] {
  grid-row: span 2;
}

.screenshot-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter var(--transition);
}

.screenshot-item:hover .screenshot-thumb {
  filter: brightness(1.05);
}

/* ── Screenshot Lightbox ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
  animation: lbFadeIn 0.2s ease;
  gap: 0;
}

.lightbox-content {
  position: relative;
  max-width: 88vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  user-select: none;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  z-index: 2;
  transition: background var(--transition), transform var(--transition);
}

.lightbox-close:hover {
  background: var(--accent-2);
  color: #fff;
  transform: scale(1.1);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
  transition: background var(--transition), transform var(--transition);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-counter {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  pointer-events: none;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

@media (max-width: 480px) {
  .lightbox-content {
    max-width: 96vw;
    max-height: 85vh;
  }
  .lightbox-img {
    max-width: 96vw;
    max-height: 82vh;
    border-radius: var(--radius-sm);
  }
  .lightbox-nav {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}

/* ── Expandable Description ── */
.expandable-desc {
  position: relative;
}

.desc-content {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.desc-content.collapsed {
  max-height: 120px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

.desc-toggle-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
}

.desc-toggle-btn:hover {
  border-color: var(--accent);
}

/* ── Features List ── */
.features-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.features-list li {
  font-size: 14px;
  color: var(--text);
  padding: 6px 0;
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}

.features-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
}

/* ── Installation Methods ── */
.install-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-method {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 60px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.install-cmd {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  overflow-x: auto;
  white-space: nowrap;
}

.copy-cmd-btn {
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.copy-cmd-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface-2);
}

/* ── System Requirements ── */
.sysreq-block {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* ── Comparison Table ── */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 14px;
}

.comparison-table th {
  background: var(--bg-3);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.comparison-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

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

.comparison-table tr:hover td {
  background: var(--surface);
}

.comp-yes {
  color: var(--green);
  font-weight: 600;
}

.comp-no {
  color: var(--text-3);
}

.comp-na {
  color: var(--text-3);
  font-style: italic;
}

/* ── Comparison Editor ── */
.comp-editor-hint {
  font-size: 12px;
  color: var(--text-3);
  margin: 0 0 8px;
  line-height: 1.4;
}

.comp-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--bg-2);
}

.comp-editor-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  display: block;
}

.comp-editor-cols {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.comp-col-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.comp-col-entry {
  display: flex;
  align-items: center;
  gap: 4px;
}

.comp-col-input {
  width: 150px;
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}

.comp-editor-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.comp-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.comp-feature-input {
  width: 140px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  flex-shrink: 0;
}

.comp-row-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.comp-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

.comp-cell-type {
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.comp-cell-text {
  width: 100px;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}

.comp-row-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  align-items: center;
}

.comp-row-actions .btn {
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1;
  min-width: auto;
}

/* ── Trust / Security Badges ── */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface);
}

.trust-verified {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

.trust-team {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

.trust-source {
  border-color: var(--border-2);
  color: var(--text-2);
}

/* ── Rank Movement Indicators ── */
.rank-move {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  margin-left: 6px;
}

.rank-up {
  color: var(--green);
}

.rank-down {
  color: var(--accent-2);
}

/* ── Reviews Section ── */
.reviews-section {
  margin-top: 8px;
}

.reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.reviews-header h3 {
  margin-bottom: 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-2);
}

.review-sort-btns {
  display: flex;
  gap: 4px;
}

.review-sort-btn {
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--transition);
}

.review-sort-btn:hover {
  color: var(--text-2);
  border-color: var(--border-2);
}

.review-sort-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Review Form ── */
.review-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.review-rating-input {
  display: flex;
  gap: 2px;
}

.review-star {
  font-size: 20px;
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--transition), transform 0.15s;
  user-select: none;
}

.review-star:hover,
.review-star.hovered {
  color: var(--accent);
  transform: scale(1.15);
}

.review-star.selected {
  color: var(--accent);
}

.review-title-input,
.review-text-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition);
  resize: vertical;
}

.review-title-input:focus,
.review-text-input:focus {
  outline: none;
  border-color: var(--accent);
}

.review-signin-hint {
  font-size: 14px;
  color: var(--text-3);
  font-style: italic;
  padding: 12px;
  text-align: center;
}

/* ── Review Cards ── */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.review-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.review-avatar-fallback {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
}

.review-author-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.review-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}

.review-stars {
  display: flex;
  gap: 1px;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 4px;
}

.review-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.review-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 8px;
}

.review-actions {
  display: flex;
  gap: 10px;
}

.review-helpful-btn {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
}

.review-helpful-btn:hover {
  color: var(--text-2);
  border-color: var(--border-2);
  background: var(--surface-2);
}

.review-msg {
  font-size: 14px;
  color: var(--text-3);
  text-align: center;
  padding: 20px;
  font-style: italic;
}

/* ── Review Vote Active State ── */
.review-helpful-btn.review-vote-active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Reviews Header Actions ── */
.reviews-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.write-review-btn {
  white-space: nowrap;
}

.write-review-btn.review-already-done {
  opacity: 0.6;
  cursor: default;
}

/* ── Review Form Wrapper ── */
.review-form-wrapper {
  margin-bottom: 16px;
}

.review-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.review-submitted-msg {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 16px;
  text-align: center;
}

.review-success-icon {
  font-size: 16px;
}

/* ── View All Reviews Button ── */
.view-all-reviews-btn {
  display: inline-block;
  margin-top: 12px;
  text-decoration: none;
  text-align: center;
  width: 100%;
}

/* ── Reviews Preview (max 3) ── */
.reviews-preview .review-card:nth-child(n+4) {
  display: none;
}

/* ── Dedicated Reviews Page ── */
.reviews-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

.reviews-page-header {
  margin-bottom: 20px;
}

.reviews-back-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 8px;
  display: inline-block;
}

.reviews-back-link:hover {
  text-decoration: underline;
}

.reviews-page-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text);
  margin: 4px 0 12px;
}

.reviews-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reviews-page .review-sort-btns {
  margin-bottom: 16px;
}

/* ── Similar Apps Section ── */
.similar-section {
  margin-top: 8px;
}

.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.similar-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
}

.similar-card:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.similar-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
  padding: 2px;
}

.similar-logo-fallback {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}

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

.similar-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.similar-cat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.similar-likes {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* ── Card Tags ── */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue);
  background: var(--blue-dim);
  border-radius: 3px;
  padding: 2px 6px;
  letter-spacing: 0.1px;
}

/* ── Card Meta Pills (version, license) ── */
.card-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.card-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
}

/* ── Card Bookmark Button ── */
.card-bookmark-btn {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.card-bookmark-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.card-bookmark-btn.bookmarked {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ── Detail Secondary Actions ── */
.detail-secondary-actions {
  display: flex;
  gap: 8px;
}

.detail-secondary-actions .btn-direct-edit {
  flex: 1;
  text-align: center;
  justify-content: center;
  margin-top: 0;
}

.btn-direct-edit {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-direct-edit:hover {
  background: var(--accent);
  color: #0c0c0f;
}

/* ── Logo Upload Group (submit form) ── */
.logo-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.logo-url-input {
  flex: 1;
  min-width: 180px;
}

.logo-or {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
}

.logo-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.logo-upload-label:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
  color: var(--text);
}

.logo-file-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

/* ── Detail page responsive overrides ── */
@media (max-width: 600px) {
  .detail-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .screenshots-gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  .install-method {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .similar-grid {
    grid-template-columns: 1fr;
  }

  .detail-meta-bar {
    gap: 6px;
  }

  .reviews-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .comparison-table {
    font-size: 12px;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 8px 10px;
  }

  .comp-col-inputs {
    flex-direction: column;
  }

  .comp-col-input {
    width: 100%;
  }

  .comp-row {
    flex-direction: column;
    gap: 4px;
  }

  .comp-feature-input {
    width: 100%;
  }

  .comp-cell-text {
    width: 80px;
  }

  .share-dropdown {
    right: auto;
    left: 0;
  }

  .features-list {
    grid-template-columns: 1fr;
  }
}

/* ── Admin Error Banner ── */
.admin-error-banner {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: var(--text);
  margin: 12px 0 20px;
  font-size: 13px;
}

.admin-error-banner strong {
  color: var(--accent-2);
}

.admin-error-banner ul {
  margin: 6px 0 4px 18px;
  list-style: disc;
}

.admin-error-banner ul li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}

.admin-error-banner p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 12px;
}

/* ── Submission Review Extended Fields ── */
.sub-features-list {
  margin: 4px 0 0 16px;
  list-style: disc;
  font-size: 13px;
  color: var(--text-2);
}

.sub-features-list li {
  margin-bottom: 2px;
}

.sub-screenshot-link {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--blue);
  text-decoration: none;
  margin: 2px 4px 2px 0;
}

.sub-screenshot-link:hover {
  background: var(--surface-2);
}

.sub-submitter-uid {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.sub-submitter-email {
  font-size: 12px;
  color: var(--text-2);
}

.sub-lookup-user-btn {
  font-size: 11px !important;
  padding: 2px 8px !important;
  margin-left: 6px;
}

.sub-review-submitter-row {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

/* ── Verify Extended Fields ── */
.verify-card-logo-preview {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
}

.verify-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.verify-screenshots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.verify-screenshot-thumb {
  width: 80px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition);
}

.verify-screenshot-thumb:hover {
  transform: scale(1.05);
}

.verify-install-methods code {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  background: var(--bg-3);
  border-radius: 4px;
  margin: 2px 0;
}

.verify-sysreq {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-3);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-2);
  margin: 4px 0;
}

/* ── Version Update Banner ── */
#version-update-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 10000;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  pointer-events: none;
}
#version-update-banner.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.version-banner-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  backdrop-filter: blur(12px);
  max-width: 520px;
  white-space: nowrap;
}
.version-banner-text {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text);
}
.version-banner-text strong {
  color: var(--accent);
  font-weight: 600;
}
.version-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.version-btn-update {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #000;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.version-btn-update:hover {
  background: #ffb51a;
  transform: scale(1.04);
}
.version-btn-dismiss {
  font-size: 15px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.version-btn-dismiss:hover {
  color: var(--text);
  background: var(--bg-3);
}
@media (max-width: 540px) {
  .version-banner-inner {
    flex-direction: column;
    white-space: normal;
    text-align: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
  }
}

/* [VULN-13R FIX] Replace inline style="display:none" with CSS class */
.initially-hidden { display: none; }
.logo-file-input { display: none; }
.modal-actions-row { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* ── Web-only app styles ── */
.web-only-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: opacity 0.25s ease, max-height 0.25s ease, margin 0.25s ease, padding 0.25s ease;
  max-height: 30px;
  overflow: hidden;
}

.btn-open-app {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}
.btn-open-app:hover {
  background: #6ba3ff !important;
  transform: translateY(-1px);
}

.btn-open-web {
  border-color: var(--blue) !important;
  color: var(--blue) !important;
}
.btn-open-web:hover {
  background: var(--blue-dim) !important;
}

.web-only-hint {
  font-size: 13px;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  line-height: 1.5;
  transition: opacity 0.25s ease, max-height 0.25s ease, margin 0.25s ease, padding 0.25s ease;
  max-height: 120px;
  overflow: hidden;
}

/* Override global .initially-hidden { display: none } for smooth animation */
.web-only-label.initially-hidden {
  display: inline-flex;
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}
.web-only-hint.initially-hidden {
  display: block;
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.web-only-preview-hint {
  font-size: 12px;
  opacity: 0.8;
  font-style: italic;
}

.field-dimmed {
  opacity: 0.5;
  pointer-events: auto;
}
.field-dimmed input {
  background: var(--bg-3);
}

.verify-web-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--blue-dim);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--blue);
  margin: 4px 0 8px;
}

/* ── Screenshot Upload ── */
.screenshot-upload-area {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--bg-3);
}

.screenshot-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.screenshot-previews:empty {
  display: none;
}

.screenshot-preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  background: var(--surface);
}

.screenshot-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.screenshot-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.screenshot-preview-item:hover .screenshot-remove-btn {
  opacity: 1;
}

.screenshot-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}

.screenshot-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.screenshot-file-input {
  display: none;
}

.screenshot-hint {
  font-size: 11px;
  color: var(--text-3);
}

.screenshot-url-fallback {
  margin-top: 8px;
}

.screenshot-url-toggle {
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
}

.screenshot-url-toggle:hover {
  color: var(--text-2);
}

.screenshot-url-fallback textarea {
  margin-top: 6px;
}

.screenshot-empty {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  padding: 8px 0;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS FIX — Global overflow prevention & layout corrections
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Global overflow prevention ── */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── Text overflow safety for URLs and long words ── */
.app-description,
.detail-section p,
.desc-content,
.meta-value,
.review-body,
.er-description {
  overflow-wrap: break-word;
  word-break: break-word;
}

.meta-value a,
.detail-links a,
.detail-section a {
  overflow-wrap: break-word;
  word-break: break-all;
}

/* ── Comparison table: scrollable wrapper instead of hiding ── */
.comparison-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ═══ 768px — Tablet / Small Laptop ═══ */
@media (max-width: 768px) {
  /* ── Header fixes ── */
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    gap: 8px;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
  }

  .btn-submit-app {
    padding: 6px 10px;
    font-size: 12px;
    order: 10;
  }

  .nav-link {
    padding: 4px 8px;
    font-size: 11px;
  }

  .auth-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  #auth-label {
    display: none;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  /* ── Card grid: single column, no overflow ── */
  #app-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .app-card {
    padding: 16px;
    gap: 10px;
  }

  /* ── Card actions: wrap buttons ── */
  .card-actions {
    flex-wrap: wrap;
  }

  .card-actions .btn {
    min-width: 0;
    flex: 1 1 calc(50% - 4px);
    font-size: 12px;
    padding: 8px 10px;
  }

  /* ── Recommendation grid ── */
  .rec-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  /* ── Detail: stats grid 2 columns ── */
  .detail-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* ── Detail: buttons full width ── */
  .detail-actions-row .detail-links {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .detail-actions-row .detail-links .btn-lg {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .detail-actions-row .vote-buttons {
    width: 100%;
  }

  .detail-actions-row .vote-buttons .vote-btn {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    justify-content: center;
  }

  /* ── Detail: secondary actions ── */
  .detail-secondary-actions {
    flex-wrap: wrap;
  }

  .detail-secondary-actions .report-btn,
  .detail-secondary-actions .btn-direct-edit {
    flex: 1 1 calc(50% - 4px);
    text-align: center;
    justify-content: center;
    font-size: 12px;
  }

  /* ── Comparison table: show with scroll instead of hiding ── */
  .comparison-table {
    display: table !important;
    font-size: 12px;
    min-width: 320px;
  }

  /* ── Screenshot gallery ── */
  .screenshots-gallery {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
  }

  /* ── Lightbox ── */
  .lightbox-content {
    max-width: 95vw;
    max-height: 88vh;
  }

  .lightbox-img {
    max-width: 95vw;
    max-height: 85vh;
  }

  .lightbox-close {
    top: -8px;
    right: -8px;
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  /* ── Install methods: scrollable ── */
  .install-cmd {
    max-width: 100%;
    overflow-x: auto;
  }

  /* ── Modal: fit within mobile viewport ── */
  .modal-overlay {
    padding: 10px;
  }

  .modal {
    max-width: 100%;
    padding: 20px;
  }

  /* ── Filters wrap ── */
  .filters {
    flex-wrap: wrap;
    gap: 6px;
  }

  .filter-btn {
    font-size: 12px;
    padding: 5px 10px;
  }
}

/* ═══ 480px — Mobile ═══ */
@media (max-width: 480px) {
  /* ── Header: compact mobile layout ── */
  .header-inner {
    padding: 6px 10px;
    gap: 6px;
  }

  .logo-title {
    font-size: 16px;
  }

  .logo-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
    border-radius: 7px;
  }

  .header-actions {
    gap: 6px;
  }

  .btn-submit-app {
    padding: 5px 8px;
    font-size: 11px;
  }

  .nav-link {
    padding: 3px 6px;
    font-size: 10px;
  }

  .nav-link-admin {
    display: none;
  }

  .theme-toggle {
    width: 30px;
    height: 30px;
  }

  /* ── Hero text ── */
  .hero-text h1 {
    font-size: 22px;
  }

  .hero-text p {
    font-size: 13px;
  }

  .controls-section {
    padding: 20px 10px 12px;
  }

  .grid-section {
    padding: 6px 10px 40px;
  }

  /* ── Cards ── */
  .app-card {
    padding: 14px;
    gap: 8px;
  }

  .app-logo, .app-logo-fallback {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .app-name {
    font-size: 15px;
  }

  .app-description {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .app-stats-row {
    gap: 8px;
  }

  .stat-item {
    font-size: 10px;
  }

  .card-actions {
    flex-direction: column;
    gap: 6px;
  }

  .card-actions .btn {
    flex: 1 1 100%;
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
  }

  .card-meta-pills {
    display: none;
  }

  .card-tags {
    display: none;
  }

  /* ── Platform tags compact ── */
  .platforms-row {
    gap: 4px;
    flex-wrap: wrap;
  }

  .platform-tag {
    font-size: 9px;
    padding: 1px 4px;
  }

  /* ── Detail page ── */
  .detail-page {
    padding: 14px 10px;
  }

  .detail-header {
    gap: 10px;
  }

  .detail-logo, .detail-logo-fallback {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    font-size: 22px;
  }

  .detail-name {
    font-size: 18px;
  }

  .detail-body {
    gap: 10px;
  }

  .detail-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .detail-stat-card {
    padding: 8px 6px;
  }

  .stat-number {
    font-size: 16px;
  }

  .stat-label {
    font-size: 9px;
  }

  /* ── Detail buttons: full width stacked ── */
  .detail-actions-row {
    flex-direction: column;
    gap: 8px;
  }

  .detail-actions-row .detail-links {
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .detail-actions-row .detail-links .btn-lg {
    flex: none;
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
  }

  .detail-actions-row .vote-buttons {
    width: 100%;
  }

  .vote-btn {
    padding: 8px 10px;
    font-size: 12px;
    gap: 4px;
  }

  .detail-secondary-actions {
    flex-direction: column;
    gap: 6px;
  }

  .detail-secondary-actions .report-btn,
  .detail-secondary-actions .btn-direct-edit {
    flex: none;
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
  }

  /* ── Detail info grid ── */
  .detail-info-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  /* ── Screenshots: smaller thumbnails ── */
  .screenshots-gallery {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
  }

  /* ── Lightbox: full-width ── */
  .lightbox-content {
    max-width: 98vw;
    max-height: 85vh;
  }

  .lightbox-img {
    max-width: 98vw;
    max-height: 80vh;
    border-radius: var(--radius-sm);
  }

  .lightbox-nav {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }

  .lightbox-close {
    top: -6px;
    right: -6px;
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  /* ── Install methods: compact ── */
  .install-method {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 10px;
  }

  .install-label {
    font-size: 10px;
    min-width: auto;
  }

  .install-cmd {
    font-size: 11px;
    width: 100%;
    overflow-x: auto;
    max-width: 100%;
  }

  /* ── Comparison table: compact scrollable ── */
  .comparison-table {
    display: table !important;
    font-size: 11px;
    min-width: 280px;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 6px 8px;
  }

  /* ── Modal ── */
  .modal-overlay {
    padding: 8px;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    padding: 16px;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 92vh;
  }

  /* ── Footer ── */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* ── Recommendation cards ── */
  .rec-card {
    padding: 10px;
  }

  .rec-logo, .rec-logo-fallback {
    width: 36px;
    height: 36px;
  }

  /* ── Similar apps ── */
  .similar-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── Rankings ── */
  .ranking-item {
    padding: 10px 12px;
    gap: 10px;
  }

  .ranking-pos {
    font-size: 14px;
    min-width: 24px;
  }

  .rank-logo, .rank-logo-fallback {
    width: 32px;
    height: 32px;
  }

  .ranking-name {
    font-size: 13px;
  }

  /* ── Forms ── */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* ── Reviews ── */
  .review-card {
    padding: 10px;
  }

  .review-header {
    flex-wrap: wrap;
    gap: 6px;
  }

  .reviews-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ═══ 360px — Very small phones ═══ */
@media (max-width: 360px) {
  .header-inner {
    padding: 6px 8px;
  }

  .logo-title {
    font-size: 14px;
  }

  .btn-submit-app {
    font-size: 10px;
    padding: 4px 6px;
  }

  .nav-link {
    display: none;
  }

  .app-card {
    padding: 12px;
  }

  .detail-page {
    padding: 10px 8px;
  }
}

/* ── Z-index fix: hide auth dropdown when any modal is open ── */
body:has(.modal-overlay.open) .auth-dropdown.open {
  opacity: 0;
  pointer-events: none;
}

/* ── Trending Home Section ── */
.trending-home-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: none;
}

/* ── Trending Filter Buttons ── */
.trending-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.trending-filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.trending-filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.trending-filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
