.header-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin-left: auto;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--blue);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.brand img.brand-logo--light {
  display: block;
}

.brand img.brand-logo--dark {
  display: none;
}

html[data-theme="dark"] .brand img.brand-logo--light {
  display: none;
}

html[data-theme="dark"] .brand img.brand-logo--dark {
  display: block;
}

.badge-featured {
  background: #fef3c7;
  color: #92400e;
}

html[data-theme="dark"] .badge-featured {
  background: #78350f;
  color: #fde68a;
}

html[data-theme="dark"] .app-header,
html[data-theme="dark"] .app-footer,
html[data-theme="dark"] .card,
html[data-theme="dark"] .nav-toggle,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .dash-shortcuts a,
html[data-theme="dark"] .admin-tabs,
html[data-theme="dark"] .admin-finder,
html[data-theme="dark"] .admin-bulk-bar {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .admin-tabs {
  background: #0b1220;
}

html[data-theme="dark"] .admin-user-card.is-waiting-email,
html[data-theme="dark"] .dash-stat.is-hot {
  background: #1f2937;
}

html[data-theme="dark"] .flash-ok {
  background: #14532d;
  color: #bbf7d0;
}

html[data-theme="dark"] .flash-error {
  background: #7f1d1d;
  color: #fecaca;
}

html[data-theme="dark"] .coin-photo-empty,
html[data-theme="dark"] .coin-thumb-empty {
  background: #1e293b;
  color: var(--muted);
}

html[data-theme="dark"] .btn-ghost {
  background: transparent;
  color: var(--blue);
}

.btn-google,
.btn-facebook {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.72rem 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

.btn-google:hover,
.btn-facebook:hover {
  text-decoration: none;
  background: #f8f9fa;
  border-color: #c6c9ce;
  color: #202124;
}

.btn-google .oauth-logo,
.btn-facebook .oauth-logo {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: block;
}

html[data-theme="dark"] .btn-google,
html[data-theme="dark"] .btn-facebook {
  background: #fff;
  color: #3c4043;
  border-color: #dadce0;
}

html[data-theme="dark"] .btn-google:hover,
html[data-theme="dark"] .btn-facebook:hover {
  background: #f8f9fa;
  color: #202124;
}

.auth-social {
  margin: 0 0 0.35rem;
}

.auth-social-buttons {
  display: grid;
  gap: 0.55rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.75rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.numis-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.numis-lightbox[hidden] {
  display: none !important;
}

.numis-lightbox img {
  max-width: min(92vw, 720px);
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.numis-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.6rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  cursor: pointer;
}

.coin-zoom[data-lightbox-src] {
  cursor: zoom-in;
}

.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.share-bar-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
}

.share-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.coin-ratings-card h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.coin-ratings-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 1rem;
}

.coin-rating-stat {
  display: grid;
  gap: 0.1rem;
}

.coin-rating-stat strong {
  font-size: 1.2rem;
}

.coin-ratings-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.coin-ratings-list li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: var(--bg);
}

.coin-ratings-list p {
  margin: 0.4rem 0 0;
}

.coin-rate-form {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.related-coins {
  margin-top: 1.25rem;
}

.related-coins h2,
.recent-viewed h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.recent-viewed {
  margin-bottom: 1rem;
}

.recent-grid .coin-card {
  text-decoration: none;
  color: #163a6b;
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.recent-grid .coin-card .meta {
  color: rgba(0, 0, 0, 0.75);
}

.numista-import-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.numista-import-preview img {
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.numista-prices ul {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}

.numista-picker {
  margin-bottom: 1rem;
}

.numista-picker-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.numista-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.65rem 0;
}

.numista-picker-row input[type="search"],
.numista-picker-row input[type="text"] {
  flex: 1 1 12rem;
}

.numista-results {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.numista-result {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: inherit;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.numista-result:hover {
  border-color: var(--accent, #1e4d8c);
}

.numista-result img,
.numista-result .coin-thumb-empty {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  display: block;
  background: #dbe3ea;
  border: 1px solid var(--line);
}

.numista-result span {
  display: grid;
  gap: 0.15rem;
}

@media (max-width: 640px) {
  .share-bar {
    align-items: flex-start;
  }
}

@media print {
  .app-header,
  .app-footer,
  .no-print,
  .nav-toggle,
  .theme-toggle,
  .flash,
  .share-bar,
  .coin-ratings-card,
  .related-coins,
  .breadcrumb {
    display: none !important;
  }

  .app-main {
    width: 100%;
    margin: 0;
  }

  .print-catalog {
    box-shadow: none;
    border: 0;
  }
}
