/* Final overrides loaded last: mobile header, admin placement, and light theme readability. */

.site-header .admin-panel-header-btn,
.header-actions .admin-panel-header-btn,
.admin-panel-header-btn{
  display:none!important;
}

body.is-admin .main-nav .admin-only-nav{
  display:inline-flex!important;
}

body:not(.is-admin) .main-nav .admin-only-nav{
  display:none!important;
}

.theme-toggle,
#headerNotificationBell,
.header-notification-bell{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  border-radius:50%!important;
  padding:0!important;
}

.theme-toggle svg{
  width:20px!important;
  height:20px!important;
}

#headerNotificationBell svg,
#headerNotificationBell .bell-icon,
.header-notification-bell svg{
  width:21px!important;
  height:21px!important;
}

.theme-toggle:hover,
#headerNotificationBell:hover,
.header-notification-bell:hover{
  background:rgba(148,163,184,.12)!important;
  transform:none!important;
}

@media(max-width:860px){
  .site-header .admin-panel-header-btn,
  .header-actions .admin-panel-header-btn,
  .site-header #loginBtn.logged-in,
  .site-header #loginBtn.user-account-pill{
    display:none!important;
  }

  .main-nav .admin-only-nav{
    display:flex!important;
  }

  .mobile-menu-backdrop{
    z-index:100001!important;
    background:transparent!important;
    pointer-events:none!important;
    opacity:0!important;
  }

  body.mobile-nav-open .mobile-menu-backdrop{
    pointer-events:none!important;
  }

  .main-nav{
    z-index:100002!important;
    pointer-events:auto!important;
    box-shadow:none!important;
  }

  #mobileMenuBtn,
  .mobile-menu-btn{
    z-index:100003!important;
  }

  .theme-toggle,
  #headerNotificationBell,
  .header-notification-bell{
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
  }

  .main-nav .mobile-login-btn,
  .main-nav .mobile-register-btn{
    justify-content:center!important;
    text-align:center!important;
    min-height:48px!important;
    line-height:1.2!important;
    gap:8px!important;
  }

  .main-nav .mobile-login-btn::before,
  .main-nav .mobile-register-btn::before{
    margin:0!important;
  }

  .main-nav .mobile-register-btn.logout-mode{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    color:#ffffff!important;
    background:#7f1d1d!important;
    border-color:#7f1d1d!important;
  }
}

#imageLightbox:not(.hidden),
.lightbox:not(.hidden){
  position:fixed!important;
  inset:0!important;
  z-index:2147483100!important;
}

#imageLightbox:not(.hidden) .lightbox-backdrop,
.lightbox:not(.hidden) .lightbox-backdrop{
  position:fixed!important;
  inset:0!important;
  z-index:0!important;
  background:rgba(2,6,23,.88)!important;
}

#imageLightbox:not(.hidden) .lightbox-panel,
.lightbox:not(.hidden) .lightbox-panel{
  position:relative!important;
  z-index:1!important;
}

#imageLightbox:not(.hidden) .lightbox-close,
#imageLightbox:not(.hidden) .lightbox-nav,
#imageLightbox:not(.hidden) .lightbox-counter{
  z-index:2147483101!important;
}

html[data-theme="light"] .hero-white,
html[data-theme="light"] .hero-title,
html[data-theme="light"] .home-hero h1,
html[data-theme="light"] .page-title,
html[data-theme="light"] .coins-page .page-title{
  color:#0b1728!important;
  text-shadow:none!important;
}

html[data-theme="light"] .hero-gold{
  color:#c98b00!important;
}

html[data-theme="light"] .hero-copy,
html[data-theme="light"] .page-subtitle,
html[data-theme="light"] .coins-page .page-subtitle,
html[data-theme="light"] .market-hero p,
html[data-theme="light"] .section .sub{
  color:#526278!important;
}

html[data-theme="light"] .badge{
  background:#fff7e8!important;
  border-color:#e8bd62!important;
  color:#9a6500!important;
}

html[data-theme="light"] .stats-strip{
  background:#ffffff!important;
  border-color:#d6dfeb!important;
}

html[data-theme="light"] .stats-strip span{
  color:#526278!important;
}

html[data-theme="light"] .section{
  border-color:#d6dfeb!important;
}

html[data-theme="light"] .feature-item b,
html[data-theme="light"] .step-card h3{
  color:#0b1728!important;
}

html[data-theme="light"] .feature-item p,
html[data-theme="light"] .step-card p{
  color:#526278!important;
}

html[data-theme="light"] .coin-type-card,
html[data-theme="light"] .coin-card,
html[data-theme="light"] .note-card,
html[data-theme="light"] .market-card,
html[data-theme="light"] .market-sell-card{
  background:#ffffff!important;
  border-color:#cfd8e6!important;
  color:#142033!important;
}

html[data-theme="light"] .coin-card-body,
html[data-theme="light"] .note-bottom{
  background:#ffffff!important;
  color:#142033!important;
}

html[data-theme="light"] .coin-card h3,
html[data-theme="light"] .note-card-head h3,
html[data-theme="light"] .market-card h3,
html[data-theme="light"] .coin-type-card b{
  color:#0b1728!important;
}

html[data-theme="light"] .coin-card p,
html[data-theme="light"] .note-card-head p,
html[data-theme="light"] .note-description,
html[data-theme="light"] .coin-type-card span,
html[data-theme="light"] .market-card p,
html[data-theme="light"] .market-seller,
html[data-theme="light"] .market-note{
  color:#526278!important;
}

html[data-theme="light"] .coin-card-head span,
html[data-theme="light"] .coin-specs span,
html[data-theme="light"] .note-card-meta span,
html[data-theme="light"] .pick-badge{
  background:#eef3f9!important;
  border-color:#cfd8e6!important;
  color:#142033!important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .market-filter-bar,
html[data-theme="light"] .market-filter-bar input,
html[data-theme="light"] .market-filter-bar select{
  background:#ffffff!important;
  color:#142033!important;
  border-color:#c7d2e2!important;
}

html[data-theme="light"] .market-info-box,
html[data-theme="light"] .market-catalog-preview,
html[data-theme="light"] .market-ref-empty,
html[data-theme="light"] .market-empty,
html[data-theme="light"] .market-loading{
  background:#f8fafc!important;
  color:#526278!important;
  border-color:#cfd8e6!important;
}

html[data-theme="light"] .market-info-box b,
html[data-theme="light"] .market-catalog-preview b,
html[data-theme="light"] .market-ref-empty b{
  color:#142033!important;
}

html[data-theme="light"] .market-info-box p,
html[data-theme="light"] .market-catalog-preview p{
  color:#526278!important;
}

html[data-theme="light"] .market-form-grid label,
html[data-theme="light"] .market-form label span,
html[data-theme="light"] .market-actions span{
  color:#526278!important;
}

html[data-theme="light"] .market-calc{
  background:#fff7e6!important;
  border-color:#f1cf86!important;
  color:#9a6500!important;
}

html[data-theme="light"] .market-preview,
html[data-theme="light"] .market-user-photo{
  background:#ffffff!important;
  border-color:#cfd8e6!important;
  color:#526278!important;
}

html[data-theme="light"] .market-user-photo img,
html[data-theme="light"] .market-preview img{
  background:#f8fafc!important;
  border-color:#cfd8e6!important;
}

html[data-theme="light"] .main-nav{
  background:transparent!important;
  box-shadow:none!important;
  border-color:transparent!important;
}

html[data-theme="light"] .main-nav::before{
  color:#9a6500!important;
}

html[data-theme="light"] .main-nav .nav-link,
html[data-theme="light"] .main-nav .mobile-login-btn,
html[data-theme="light"] .main-nav .mobile-register-btn{
  color:#142033!important;
}

html[data-theme="light"] .main-nav .nav-link.active{
  color:#9a6500!important;
  background:rgba(215,149,21,.14)!important;
  border-color:rgba(215,149,21,.35)!important;
}

/* Market has dynamic inline-injected styles; these selectors intentionally win late. */
html[data-theme="light"] .market-page,
html[data-theme="light"] .market-hero,
html[data-theme="light"] .market-page section{
  background:#f4f7fb!important;
  color:#142033!important;
}

html[data-theme="light"] .market-page h1,
html[data-theme="light"] .market-page h2,
html[data-theme="light"] .market-page h3,
html[data-theme="light"] .market-detail-head h2,
html[data-theme="light"] .market-catalog-box h3{
  color:#0b1728!important;
  text-shadow:none!important;
}

html[data-theme="light"] .market-card,
html[data-theme="light"] .market-detail-box,
html[data-theme="light"] .market-detail-head,
html[data-theme="light"] .market-detail-main,
html[data-theme="light"] .market-detail-thumbs button,
html[data-theme="light"] .market-catalog-box,
html[data-theme="light"] .market-catalog-grid div,
html[data-theme="light"] .market-signature-line,
html[data-theme="light"] .market-note,
html[data-theme="light"] .market-filter-bar{
  background:#ffffff!important;
  border-color:#cfd8e6!important;
  color:#142033!important;
}

html[data-theme="light"] .market-detail-modal{
  background:rgba(20,32,51,.46)!important;
}

html[data-theme="light"] .market-detail-meta span,
html[data-theme="light"] .market-pages button,
html[data-theme="light"] .market-open-btn{
  background:#eef3f9!important;
  border-color:#cfd8e6!important;
  color:#142033!important;
}

html[data-theme="light"] .market-catalog-grid span,
html[data-theme="light"] .market-page-info,
html[data-theme="light"] .market-detail-panel .market-seller{
  color:#526278!important;
}

html[data-theme="light"] .market-catalog-grid b,
html[data-theme="light"] .market-signature-line b,
html[data-theme="light"] .market-detail-actions .btn.dark{
  color:#142033!important;
}

html[data-theme="light"] .market-detail-actions .btn.dark,
html[data-theme="light"] .market-detail-actions .btn.ghost{
  background:#f8fafc!important;
  border-color:#cfd8e6!important;
}

html[data-theme="light"] .market-detail-price{
  color:#bf850d!important;
}

/* Shared pagination for Catalog, Market, and Collection. */
.content-page-bar,
.market-page-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin:18px 0 2px;
}

.market-page-info{
  color:rgba(255,255,255,.68);
  font-size:13px;
}

.market-pages{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.market-pages button{
  border:1px solid rgba(255,255,255,.16);
  background:#111827;
  color:#fff;
  border-radius:10px;
  padding:9px 12px;
  cursor:pointer;
}

.market-pages button.active{
  background:var(--gold);
  color:#111827;
  border-color:var(--gold);
  font-weight:900;
}

.market-pages button:disabled{
  opacity:.45;
  cursor:not-allowed;
}

html[data-theme="light"] .market-detail-close{
  background:#9b2c23!important;
  color:#ffffff!important;
}

@media(min-width:861px){
  html[data-theme="light"] .site-header .main-nav,
  html[data-theme="light"] .main-nav{
    background:transparent!important;
    box-shadow:none!important;
    border:0!important;
  }
}

html[data-theme="light"] .collection-auto-value-panel{
  background:#ffffff!important;
  border-color:#cfd8e6!important;
  color:#142033!important;
  box-shadow:0 16px 38px rgba(20,32,51,.08)!important;
}

html[data-theme="light"] .collection-auto-value-head h2,
html[data-theme="light"] .collection-auto-grade-card b{
  color:#0b1728!important;
}

html[data-theme="light"] .collection-auto-value-head p,
html[data-theme="light"] .collection-auto-grade-card small{
  color:#526278!important;
}

html[data-theme="light"] .collection-auto-grade-card{
  background:#f8fafc!important;
  border-color:#cfd8e6!important;
  color:#142033!important;
}

html[data-theme="light"] .collection-auto-grade-card span{
  color:#334155!important;
}

html[data-theme="light"] .collection-auto-grade-card.grade-unc{
  border-color:#86c79a!important;
}

html[data-theme="light"] .collection-auto-grade-card.grade-vf{
  border-color:#d8a43e!important;
}

.coin-year-pro-row.coin-year-price-card{
  grid-template-columns:minmax(180px,.85fr) minmax(320px,1.15fr)!important;
  align-items:center!important;
  gap:12px!important;
}

.coin-year-collection-actions{
  grid-column:1 / -1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  flex-wrap:wrap!important;
  padding-top:12px!important;
  margin-top:4px!important;
  border-top:1px solid #e5e7eb!important;
}

.coin-year-collection-actions .collection-action{
  height:40px!important;
  min-width:118px!important;
  border-radius:999px!important;
  background:#ffffff!important;
  color:#334155!important;
  border:1px solid #dbe2ea!important;
  box-shadow:0 8px 18px rgba(15,23,42,.06)!important;
  justify-content:center!important;
}

.coin-year-collection-actions .collection-action.owned.active{
  background:#dcfce7!important;
  border-color:#86efac!important;
  color:#166534!important;
}

.coin-year-collection-actions .collection-action.wanted.active{
  background:#fef3c7!important;
  border-color:#fcd34d!important;
  color:#92400e!important;
}

.coin-year-collection-actions .collection-grade{
  height:32px!important;
  padding:0 9px!important;
}

.coin-year-collection-actions .coin-collection-qty input{
  width:58px!important;
  min-width:58px!important;
  height:24px!important;
  padding:0 6px!important;
  border:0!important;
  background:#111827!important;
  color:#fff!important;
  border-radius:999px!important;
  font-weight:900!important;
}

html[data-theme="light"] .coin-year-collection-actions .coin-collection-qty input{
  background:#ffffff!important;
  color:#142033!important;
  border:1px solid #cfd8e6!important;
}

#imageLightbox:not(.hidden) #lightboxImage{
  background:transparent!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}

#imageLightbox:not(.hidden) .lightbox-panel{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}

@media(max-width:900px){
  .coin-year-pro-row.coin-year-price-card{
    grid-template-columns:1fr!important;
  }
  .coin-year-collection-actions{
    justify-content:flex-start!important;
  }
}

.collection-remove{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-family:Arial, sans-serif!important;
  font-size:20px!important;
  line-height:1!important;
  color:#991b1b!important;
  background:#fee2e2!important;
  border:1px solid #fecaca!important;
  opacity:1!important;
}

.collection-value-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin:18px 0 22px;
}

.collection-value-summary-card{
  border:1px solid #cfd8e6;
  background:#ffffff;
  color:#142033;
  border-radius:18px;
  padding:16px;
  text-align:left;
  box-shadow:0 14px 34px rgba(20,32,51,.08);
  cursor:pointer;
}

.collection-value-summary-card span{
  display:block;
  color:#526278;
  font-weight:900;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.collection-value-summary-card b{
  display:block;
  margin-top:8px;
  color:#0b1728;
  font-size:24px;
  line-height:1.05;
}

.collection-value-summary-card small{
  display:block;
  margin-top:7px;
  color:#64748b;
  font-weight:800;
}

.collection-value-summary-card.owned{
  border-color:#bbf7d0;
}

.collection-value-summary-card.wishlist,
.collection-value-summary-card.coin-wishlist{
  border-color:#f5d58a;
}

.collection-auto-value-wrap.compact-values .collection-auto-value-panel{
  display:none;
}

.collection-auto-value-wrap.compact-values[data-open-panel="bank-owned"] .collection-auto-value-panel[data-panel-id="bank-owned"],
.collection-auto-value-wrap.compact-values[data-open-panel="bank-wishlist"] .collection-auto-value-panel[data-panel-id="bank-wishlist"],
.collection-auto-value-wrap.compact-values[data-open-panel="coin-owned"] .collection-auto-value-panel[data-panel-id="coin-owned"],
.collection-auto-value-wrap.compact-values[data-open-panel="coin-wishlist"] .collection-auto-value-panel[data-panel-id="coin-wishlist"]{
  display:block;
}

@media(max-width:1000px){
  .collection-value-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:560px){
  .collection-value-summary-grid{
    grid-template-columns:1fr;
  }
}

/* Final light-theme readability pass */
.auth-panel #authTitle,
.auth-panel h2{
  color:#ffffff!important;
  opacity:1!important;
  visibility:visible!important;
}

html[data-theme="light"] #loginBtn.user-account-pill,
html[data-theme="light"] #loginBtn.logged-in,
html[data-theme="light"] .site-header .login-btn.logged-in{
  color:#142033!important;
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
}

html[data-theme="light"] #loginBtn.user-account-pill .user-name,
html[data-theme="light"] #loginBtn.logged-in .user-name{
  color:#142033!important;
}

html[data-theme="light"] .account-simple-page,
html[data-theme="light"] .account-simple-head,
html[data-theme="light"] .account-simple-card,
html[data-theme="light"] .account-simple-stats div{
  background:#ffffff!important;
  color:#142033!important;
  border-color:#d9e2ef!important;
}

html[data-theme="light"] .account-simple-head h1,
html[data-theme="light"] .account-simple-card h2,
html[data-theme="light"] .account-card-title h2,
html[data-theme="light"] .account-simple-stats b,
html[data-theme="light"] .account-action-list b,
html[data-theme="light"] .account-kicker{
  color:#0b1728!important;
  opacity:1!important;
}

html[data-theme="light"] .account-simple-head p,
html[data-theme="light"] .account-simple-stats span,
html[data-theme="light"] .account-simple-card p,
html[data-theme="light"] .account-simple-card label,
html[data-theme="light"] .account-simple-card small,
html[data-theme="light"] .account-mini-note{
  color:#526278!important;
  opacity:1!important;
}

html[data-theme="light"] .account-action-list button,
html[data-theme="light"] .account-notification-row{
  background:#f8fafc!important;
  color:#142033!important;
  border-color:#d9e2ef!important;
}

html[data-theme="light"] .signature-card-readonly{
  background:#ffffff!important;
  border-color:#d9e2ef!important;
  color:#142033!important;
}

html[data-theme="light"] .signature-card-readonly .signature-image{
  background:#f8fafc!important;
}

html[data-theme="light"] .signature-card-readonly h3,
html[data-theme="light"] .signature-card-readonly .signature-readonly-name{
  color:#142033!important;
  opacity:1!important;
}

html[data-theme="light"] .signature-card-readonly p,
html[data-theme="light"] .signature-card-readonly .signature-readonly-used{
  color:#526278!important;
  opacity:1!important;
}

html[data-theme="light"] .market-offer-box{
  background:#ffffff!important;
  color:#142033!important;
  border-color:#d9e2ef!important;
}

html[data-theme="light"] .market-offer-box h2,
html[data-theme="light"] .market-offer-item b,
html[data-theme="light"] .market-offer-box label{
  color:#142033!important;
  opacity:1!important;
}

html[data-theme="light"] .market-offer-item,
html[data-theme="light"] .market-offer-status{
  color:#526278!important;
}

html[data-theme="light"] .market-offer-close{
  color:#142033!important;
}

html[data-theme="light"] .market-offer-box input,
html[data-theme="light"] .market-offer-box textarea{
  background:#ffffff!important;
  color:#142033!important;
  border-color:#cfd8e6!important;
}

/* Stable mobile drawer: loaded last to neutralize older conflicting menu rules. */
@media(max-width:860px){
  body.mobile-nav-open{
    overflow:hidden!important;
  }

  .site-header{
    z-index:100100!important;
  }

  .mobile-menu-backdrop{
    position:fixed!important;
    inset:72px 0 0 0!important;
    background:rgba(15,23,42,.38)!important;
    opacity:0!important;
    pointer-events:none!important;
    z-index:100050!important;
    transition:opacity .2s ease!important;
  }

  body.mobile-nav-open .mobile-menu-backdrop{
    opacity:1!important;
    pointer-events:auto!important;
  }

  .site-header .main-nav,
  .main-nav{
    position:fixed!important;
    top:72px!important;
    right:0!important;
    left:auto!important;
    bottom:auto!important;
    width:min(430px,88vw)!important;
    height:calc(100dvh - 72px)!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:8px!important;
    padding:20px 14px 18px!important;
    margin:0!important;
    overflow:auto!important;
    transform:translateX(105%)!important;
    transition:transform .22s ease!important;
    z-index:100120!important;
    pointer-events:auto!important;
    border-radius:0!important;
  }

  body.mobile-nav-open .site-header .main-nav,
  body.mobile-nav-open .main-nav{
    transform:translateX(0)!important;
  }

  html[data-theme="dark"] .site-header .main-nav,
  html[data-theme="dark"] .main-nav{
    background:#07111f!important;
    border-left:1px solid rgba(148,163,184,.22)!important;
    box-shadow:-24px 0 70px rgba(0,0,0,.46)!important;
  }

  html[data-theme="light"] .site-header .main-nav,
  html[data-theme="light"] .main-nav{
    background:#ffffff!important;
    border-left:1px solid #d9e2ef!important;
    box-shadow:-24px 0 70px rgba(20,32,51,.18)!important;
  }

  .main-nav::before{
    content:"ÍSLENSKIR SEÐLAR"!important;
    display:block!important;
    color:#a77310!important;
    font-size:13px!important;
    font-weight:900!important;
    letter-spacing:1.8px!important;
    margin:2px 0 12px!important;
    text-align:left!important;
  }

  .main-nav .nav-link,
  .main-nav .mobile-login-btn,
  .main-nav .mobile-register-btn{
    width:100%!important;
    min-height:54px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:13px!important;
    padding:0 14px!important;
    border-radius:14px!important;
    border:1px solid transparent!important;
    background:transparent!important;
    font-size:17px!important;
    font-weight:850!important;
    line-height:1.2!important;
    text-align:left!important;
    white-space:nowrap!important;
  }

  html[data-theme="light"] .main-nav .nav-link,
  html[data-theme="light"] .main-nav .mobile-login-btn{
    color:#142033!important;
  }

  html[data-theme="dark"] .main-nav .nav-link,
  html[data-theme="dark"] .main-nav .mobile-login-btn{
    color:#e5e7eb!important;
  }

  .main-nav .nav-link.active{
    background:rgba(215,149,21,.14)!important;
    border-color:rgba(215,149,21,.35)!important;
    color:#9a6500!important;
  }

  .mobile-auth{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    margin-top:auto!important;
    padding-top:16px!important;
    border-top:1px solid #d9e2ef!important;
  }

  html[data-theme="dark"] .mobile-auth{
    border-top-color:rgba(148,163,184,.22)!important;
  }

  .main-nav .mobile-login-btn,
  .main-nav .mobile-register-btn{
    justify-content:center!important;
    text-align:center!important;
  }

  .main-nav .mobile-login-btn::before,
  .main-nav .mobile-register-btn::before{
    content:none!important;
  }

  .main-nav .mobile-login-btn.logged-in{
    background:#ffffff!important;
    color:#142033!important;
    border-color:#94a3b8!important;
  }

  html[data-theme="dark"] .main-nav .mobile-login-btn.logged-in{
    background:#0f172a!important;
    color:#f8fafc!important;
    border-color:#334155!important;
  }

  .main-nav .mobile-register-btn.logout-mode{
    background:#7f1d1d!important;
    border-color:#7f1d1d!important;
    color:#ffffff!important;
  }

  .main-nav .mobile-register-btn.logout-mode *,
  html[data-theme="light"] .main-nav .mobile-register-btn.logout-mode,
  html[data-theme="light"] .main-nav .mobile-register-btn.logout-mode *{
    color:#ffffff!important;
  }
}
