:root {
    --bg: #0f0623;
--bg-accent:
  /* Top-left glow (original) */
  radial-gradient(1200px 800px at 10% -10%, #250f5a 0%, transparent 55%),

  /* Bottom-right glow (mirrored) */
  radial-gradient(1200px 800px at 95% 110%, #250f5a 0%, transparent 35%),

  /* Dark fade */
  radial-gradient(900px 600px at 120% 10%, #000000 0%, transparent 40%),

  /* Base */
  #000000;

    --panel: #15171a;
    --panel-2: #101114;
    --border: rgba(255,255,255,.08);
    --muted: #a8acb3;
    --text: #eef0f6;
    --brand: #9a8bff;
    --focus: #ffffff;
    --focus-ring: rgba(111, 49, 255, 0.28);
    --shadow: 0 10px 30px rgba(0,0,0,.45);
    --radius: 14px;
    --topbar-h: 56px;
  }
  @media (prefers-color-scheme: light) {
    :root { color-scheme: dark; }
  }
/* Prevent iOS/Android tap highlight “flash” on buttons/thumbnails */
*{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

button, a, .icon-btn, .altthumb, .thumb, .altthumbs-wrap, .altthumbs{
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
    touch-action: manipulation;
}

/* Keep keyboard accessibility without showing outlines on touch */
.icon-btn:focus{ outline: none; }
.icon-btn:focus-visible{ outline: 2px solid rgba(255,255,255,.35); outline-offset: 2px; }
/* ✅ Always cover the viewport with your gradient (prevents black overscroll) */
html, body{
  height: 100%;
  margin: 0;
  touch-action: pan-x pan-y;
}

html{
  background: #000; /* fallback */
}

html::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-accent);
  background-repeat: no-repeat;
  background-size: cover;
  transform: translateZ(0); /* helps iOS paint */
}

/* Body is transparent over the gradient */

body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--topbar-h);
  min-height: 100vh;
  padding-bottom: 60px; /* for fixed footer on desktop */
}
  /* Top bar */
.topbar {
  position: fixed;
  top: 0;
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: linear-gradient(180deg, rgba(21,23,26,.75) 0%, rgba(16,17,20,.55) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
  .icon-btn{ display:inline-flex; align-items:center; justify-content:center; padding:10px; border:1px solid var(--border); border-radius:10px; background:var(--panel); color:var(--text); cursor:pointer; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
  .icon-btn:hover{ background: rgba(255,255,255,.08); }
  .icon-btn.is-active{ color:#ffffff; border-color:rgba(255,255,255,.35); background:rgba(255,255,255,.10); }
  .icon-btn.is-active .material-symbols-outlined{ font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
  .material-symbols-outlined{ font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; font-size:22px; line-height:1; }
  /* Flyouts */
  .flyout-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.45); backdrop-filter: blur(2px); z-index:120; display:none; opacity:0; transition:opacity .2s ease; }
  .flyout-overlay.open{ display:block; opacity:1; }
  .flyout{ position:fixed; top:0; bottom:0; width:min(88vw, 380px); background:linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%); border:1px solid var(--border); box-shadow:var(--shadow); z-index:130; display:flex; flex-direction:column; transform: translateX(var(--start-x)); transition: transform .25s ease; }
  .flyout.open{ transform: translateX(0); }
  .flyout.left{ left:0; border-left:none; --start-x:-100%; }
  .flyout.right{ right:0; border-right:none; --start-x:100%; }
  .flyout header{ display:flex; align-items:center; justify-content:space-between; padding:12px; border-bottom:1px solid var(--border); }
  .flyout .content{ padding:12px; overflow:auto; display:grid; gap:10px; font-size:14px; line-height:1.5; }
  /* Layout */
  .container{
  max-width:1080px;
  margin:0 auto;
  padding:16px 16px 16px;
  display:block;          /* no grid here */
  flex: 1 0 auto;
}
 header.page{
  display:grid;
  gap:5px;
  margin: 5px auto 0px; /* ↓ from 4px to 0px */
  max-width:720px;        /* NEW – match searchwrap */
}

@keyframes purplePulse {
  0% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.12) saturate(1.25);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

  .eyebrow{ font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); font-weight:700; }
  h2.page-title{ font-size:clamp(22px, 3.2vw, 34px); line-height:1.2; margin:0; }
  .subtitle{ color:var(--muted); max-width:70ch; }
  /* Search */
  .searchwrap{
  position: relative;   /* ✅ anchor for dropdown */
  top: auto;            /* ✅ prevents header gap */
  z-index: 50;
  padding-top: 10px;
  backdrop-filter: blur(6px);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 720px;
  margin: 0 auto;
}

  .searchbar{ position:relative; width:100%; }
  .searchbar input{ width:100%; padding:12px 46px; background:linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%); color:var(--text); border:1px solid var(--border); border-radius:var(--radius); font-size:16px; outline:none; box-shadow:var(--shadow); transition: border-color .15s ease, box-shadow .2s ease; }
  .searchbar input:focus-visible{ border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow); }
  @media (hover: hover) and (pointer: fine) {
  .searchbar input:hover{
    border-color: #ffffff;
  }
}
  .searchbar .icon{ position:absolute; left:14px; top:50%; transform:translateY(-50%); opacity:.65; pointer-events:none; }
  .clearbtn{ position:absolute; right:6px; top:50%; transform:translateY(-50%); border:0; background:transparent; color:var(--muted); padding:8px; border-radius:10px; cursor:pointer;  display:none;}
  .clearbtn:hover{ color:var(--text); }
  /* Autocomplete */

/* Autocomplete (full width of search row, but no layout shifting) */
.ac{
  position: absolute;
  left: 0;
  right: 0;

  /* anchor it under the searchwrap row without using top on searchwrap */
  top: calc(100% + 10px);

  width: 100%;
  transform: none;

  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow);
  max-height: 360px;
  overflow: auto;
  display: none;
  z-index: 60;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ac.open{ display:block; }

  .ac-section{ padding:6px 6px 10px; }
  .ac-title{ display:flex; align-items:center; gap:8px; padding:8px 10px; font-weight:700; font-size:13px; color:var(--text); background:rgba(255,255,255,.03); border-radius:10px; border:1px solid var(--border); }
  .ac-meta{ margin-left:auto; font-weight:600; color:var(--muted); font-size:12px; }
  .ac-subtitle{ font-size:13px; font-weight:600; color:var(--muted); margin:6px 0 4px 8px; display:flex; align-items:center; gap:6px; cursor:pointer; user-select:none; }
  .ac-subtitle .material-symbols-outlined{ font-size:16px; line-height:1; opacity:.8; }
  .ac-list{ margin-top:6px; display:grid; gap:4px; }
  .ac-item{ cursor:pointer; padding:10px 12px; border-radius:10px; border:1px solid transparent; display:grid; grid-template-columns:1fr auto; align-items:center; gap:8px; }
  .ac-item:hover, .ac-item[aria-selected="true"]{ background:rgba(255,255,255,.04); border-color:var(--border); }
  .ac-issue{ font-size:14px; font-weight:600; }
  .ac-sub{ font-size:12px; color:var(--muted); }
  .ac-empty{ padding:10px; font-size:13px; color:var(--muted); }
  /* Results */
  .result{ margin-top:18px; width:100%; display:grid; justify-items:center; }
 .card {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  margin-bottom: 18px;
  /* ✨ Glass effect */
  background: rgba(0, 0, 0, 0.08); /* transparent white layer */
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  /* 🌫️ White border and shape */
  border: 1px solid rgba(46, 46, 46, 0.5);
  border-radius: var(--radius);
  /* 📦 Shadow & spacing */
  padding: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
  .thumb{ position:relative; overflow:hidden; display:grid; justify-items:center; align-content:start; }
  .thumb img{ width:100%; aspect-ratio: 3/4; height:auto; object-fit:contain; border-radius:2px; background:rgba(255,255,255,.04); display:block; }
  .altthumbs-wrap{
    margin-top:8px;
    max-height:210px;
    overflow-y:auto;
    overflow-x:hidden; /* prevent sideways scroll/jitter on mobile */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    border:1px solid var(--border);
    border-radius:10px;
    padding:6px;
    background:rgba(255,255,255,.04);
  }
  .altthumbs{ display:grid; grid-template-columns:repeat(auto-fit, minmax(165px, 1fr)); gap:6px; }
  .altthumb{ background:transparent; border:1px solid var(--border); border-radius:8px; padding:2px; cursor:pointer; }
  .altthumb:hover{ border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.03); }
  .altthumb img{ width:100%; aspect-ratio:3/4; object-fit:cover; border-radius:6px; display:block; }
  .altthumbs .alt-divider{ grid-column:1 / -1; height:1px; background:var(--border); margin:6px 0; }

  /* Owner section divider inside thumbnail window */
  .altthumbs .alt-owner-divider{
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 6px;
    opacity: 0.9;
    width: 100%;
    min-width: 0;
  }
  .altthumbs .alt-owner-divider .lbl{
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
    min-width: 0;
  }
  .altthumbs .alt-owner-divider .line{
    height: 1px;
    flex: 1;
    background: var(--border);
    min-width: 0;
  }
  .pillgrid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:10px; }
  .pill{ background:rgba(255,255,255,.04); border:1px solid var(--border); padding:8px 10px; border-radius:12px; font-size:13px; min-height:40px; display:grid; gap:3px; overflow-wrap:anywhere; }
  .pill label{ color:var(--muted); font-size:11px; }
  .pill.pill-link{ cursor:pointer; }
  .pill.pill-link:hover{ border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.08); }
  .pill.pill-link:focus-visible{ outline: 2px solid rgba(255,255,255,.35); outline-offset: 2px; }
  .pill select {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 13px;
    padding: 0;
    margin: 0;
    outline: none;
  }
  .pill select option {
    color: #000;
  }
  .more{ margin-top:12px; background:rgba(255,255,255,.04); border:1px solid var(--border); border-radius:12px; max-height:330px; overflow:auto; }
  
  .kv{ display:grid; grid-template-columns:220px 1fr; gap:6px; padding:10px 12px; border-bottom:1px dashed rgba(255,255,255,.06) }
  .kv:last-child{ border-bottom:none; }
  .kv .v{ overflow-wrap:anywhere; }
  .empty{ margin-top:24px; border:1px dashed var(--border); border-radius:var(--radius); padding:24px; text-align:center; color:var(--muted); }
  #result .empty{ margin-top:22px; padding-top:12px; padding-right:24px; padding-bottom:16px; padding-left:24px; }
  *{ scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
  *::-webkit-scrollbar{ height:10px; width:10px; }
  *::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.25); border-radius:20px; }
  *::-webkit-scrollbar-track{ background: transparent; }
  @media (max-width: 780px){
    .card{ grid-template-columns:140px 1fr; }
    .pillgrid{ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .kv{ grid-template-columns:120px 1fr; }

   /* Let the right column's children (pill box + CSV panel) participate in the card grid */
.card > :nth-child(2){ display: contents; }
/* Pill box stays in the right column (unchanged visually) */
.card .pillgrid{ grid-column: 2; }
/* The scrollable info window spans across both columns under thumb + pills */
.card .more{ grid-column: 1 / -1; }
.details-toggle{ grid-column: 1 / -1; }
/* Prevent any accidental horizontal overflow while keeping your look */
.card, .card > *{ min-width: 0; }
 html{ background-attachment: scroll; }  /* instead of body */
  .searchwrap{ position: relative; top:auto; backdrop-filter:none; }
  }
  @media (prefers-reduced-motion: reduce){ .card, .searchbar input, .thumb img, .flyout, .icon-btn, .altthumb img, .mc-issue-overlay, .mini-issue-header img { transition:none !important; animation:none !important; } }
  /* Remove box, border, radius, and padding for topbar icons */
.topbar .icon-btn {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
}
.topbar .icon-btn:hover {
  background: transparent;
  opacity: 0.75; /* subtle hover cue */
}

/* Make checklist hover match shuffle hover */
#listBtn.icon-btn:hover{
  border-color: rgba(255,255,255,0.6) !important;
  background: rgba(255,255,255,0.08) !important;
  opacity: 1 !important; /* important: prevents the faded look */
}

#listBtn.icon-btn:focus,
#listBtn.icon-btn:focus-visible{
  outline: none;
  box-shadow: none;
}
.icon-btn[disabled],
.icon-btn:disabled {
  opacity: 0.4;                 /* dim greyed look */
  cursor: not-allowed;          /* disabled pointer */
  background: var(--panel-2);   /* darker grey background */
  border-color: rgba(255,255,255,0.05);
  color: var(--muted);          /* softer icon/text */
  pointer-events: none;         /* block interaction */
}
.icon-btn[disabled]:hover {
  background: var(--panel-2);   /* prevent hover light-up */
}
/* desktop/tablet default */
#result .empty .protip-img { max-width: 60%; }
/* phones: make it bigger + reduce only the bottom gap */
@media (max-width: 780px){
  #result .empty .protip-img { max-width: 90%; margin: 0 auto 4px; }
  #result .empty small { font-size: 14px; line-height: 1.3; display:block; text-align:center; padding:0 8px; }
  #result .empty { padding-top:16px; padding-right:10px; padding-bottom:6px; padding-left:10px; }
}
.subtitle {
  visibility: hidden;
  height: 2px;   /* ↓ almost no space */
  line-height: 0;
  padding: 0;
  margin: 0;
}
#site-footer{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align:center;
  color:var(--muted);
  font-size:13px;
  padding:12px 0;
  border-top:1px solid var(--border);
  margin-top:0;         /* IMPORTANT: remove the big push-up margin */
  background: rgba(0,0,0,0.85); /* optional but usually needed so it’s readable */
  backdrop-filter: blur(10px);  /* optional, matches your glass style */
  z-index: 80; /* higher than result content, lower than flyouts (120/130) */
}
#site-footer span{ opacity:.7; }
/* ============================
   Shared transitions
   ============================ */
.altthumbs-wrap,
.more,
.pill,
.card .icon-btn {
  transition: border-color 0.2s ease, background 0.2s ease;
}
/* ============================
   Desktop / pointer hover
   ============================ */
/* ALT THUMB WINDOW + INFO PANEL */
.more:hover {
  border-color: rgba(255,255,255,0.6);
}
/* ALT THUMBNAILS */
.altthumb:hover {
  border-color: rgba(255,255,255,0.6) !important;
  background: rgba(255,255,255,0.08);
}

/* PILL HOVER — only if pill contains a dropdown */
.pill.has-dd:hover {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
}

@media (hover: none) {
  /* Pill active state — only if pill contains a dropdown */
  .pill.has-dd:active {
    border-color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.12);
  }
}

/* CARD ICON BUTTONS (zoom / rotate / edit) */
.card .icon-btn:hover {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
}
/* ============================
   Mobile / touch states
   ============================ */
@media (hover: none) {
  /* Keep :active highlight for the info window */
  .more:active {
    border-color: rgba(255,255,255,0.8) !important;
    background: rgba(255,255,255,0.05);
  }
  /* Pill active state */
  .pill:active {
    border-color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.12);
  }
  /* ✅ Mobile: remove thumbnail tap highlight (prevents border "jump" and flash) */
  .altthumb:active {
    border-color: var(--border);
    background: transparent;
  }
  /* Also remove focus outlines on tap for these buttons */
  .altthumb:focus { outline: none; }
  .altthumb:focus-visible { outline: none; }
  /* Prevent transition flashes on rapid re-render */
  .altthumb { transition: none !important; }
  /* Icon buttons tap highlight */
  .card .icon-btn:active {
    border-color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.12);
  }
}
/* Hover for shuffle + popup buttons */
#myCollectionMineBtn.icon-btn:hover,

#myCollectionBtn.icon-btn:hover,
.zoom-popup-close:hover,
.zoom-popup-btn:hover {
  border-color: rgba(255,255,255,0.6) !important;
  background: rgba(255,255,255,0.08) !important;
}
/* Subset hover: turn white */
.ac-subtitle:hover {
  color: #ffffff !important;
}
/* Subset clicked/expanded: stays white */
.ac-subtitle[aria-expanded="true"] {
  color: #ffffff !important;
}
/* Optional: also brighten the chevron icon */
.ac-subtitle:hover .material-symbols-outlined,
.ac-subtitle[aria-expanded="true"] .material-symbols-outlined {
  color: #ffffff !important;
  opacity: 1 !important;
}
/* Custom dropdown (Option B) */
.custom-dd-wrapper {
  position: relative;
  width: 100%;
}
.custom-dd-trigger {
  background: transparent;
  padding: 2px 0;
  font-size: 13px;
  cursor: pointer;
}
.custom-dd-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 150px;       /* 👈 YOUR NEW HEIGHT — CHANGE THIS */
  overflow-y: auto;
  box-shadow: var(--shadow);
  display: none;
  z-index: 5000;
}
.custom-dd-list.open {
  display: block;
}
.custom-dd-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}
.custom-dd-item:hover {
  background: rgba(255,255,255,0.08);
}
.dd-arrow {
  font-size: 10px;
  opacity: 0.6;
  float: right;
  pointer-events: none;
  margin-left: 6px;
  display: none !important;
}
.details-toggle {
  width: 100%;
  text-align: left;
  padding: 6px 0;
  margin-top: 10px;
  margin-bottom: 4px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: pointer;
  overflow:auto; 
}
.details-toggle:hover {
  color: var(--accent, #fff);
  border-bottom-color: var(--accent, #fff);
}
.details-toggle::after {
  content: " ▼";
  float: right;
  opacity: 0.7;
}
.details-toggle[aria-expanded="true"]::after {
  content: " ▼";
}
@media (max-width:780px){
  /* Mobile: background scrolls (avoids fixed-bg bugs) */
  html{
    background-attachment: scroll;
  }
  /* Mobile only: remove footer bar/text entirely */
  body{
    padding-bottom: 0 !important;
  }
  #site-footer{
    display: none !important;
  }
  #result{
    padding-bottom: 24px !important;
  }
}
/* ===== Newly Added Sets ticker under search bar ===== */
.new-sets-viewport {
  position: relative;
  overflow: hidden;
  height: 1.4em; /* adjusted in JS */
}
.new-sets-list {
  list-style: none;
  margin: 0;
  padding: 0;
  transition: transform 0.35s ease-out;
}
.new-sets-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 2px 0;
}
.new-sets-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}
@media (max-width: 780px) {
}

/* Color enhancements for ticker pills */
.new-sets-pill.new {
  background: rgba(154, 139, 255, 0.18); /* soft purple */
  border-color: rgba(154, 139, 255, 0.45);
  color: #cfc5ff;
  font-weight: 700;
}

.new-sets-pill.feature {
  background: rgba(0, 255, 209, 0.14); /* teal glow */
  border-color: rgba(0, 255, 209, 0.45);
  color: #9fffe8;
  font-weight: 700;
}

/* Center the ticker under the search + shuffle */
.new-sets-viewport {
  margin: 0 auto;
  text-align: center;
  display: flex;
  justify-content: center;
}

.new-sets-list {
  text-align: left; /* keep text aligned but container centered */
}

/* Adjust spacing above and below the ticker */
.new-sets-viewport {
  margin-top: 22px !important;   /* more space above (under search bar) */
  margin-bottom: 0px !important; /* less space before the diagram */
}

/* Tighter space between ticker and diagram/result */
.result {
  margin-top: 22px !important;
}

.comic-cut-nav{
  width:100%;
  max-width:none;
  margin:10px 0 12px;
  display:none;
  align-items:center;
  gap:10px;
  padding:0;
  border:none;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.comic-cut-nav.is-visible{ display:flex; }
.card .comic-cut-nav{
  grid-column:1 / -1;
}
.comic-cut-nav-btn{
  appearance:none;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  font-size:13px;
  font-weight:700;
  min-height:40px;
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
  display:flex;
  align-items:center;
  flex:1 1 0;
  transition:border-color .18s ease, background .18s ease, transform .18s ease, opacity .18s ease;
}
.comic-cut-nav-btn:hover{
  border-color:rgba(255,255,255,.6);
  background:rgba(255,255,255,.08);
  opacity:1;
}
.comic-cut-nav-btn:active{ transform:translateY(1px); }
.comic-cut-nav-btn[disabled]{ opacity:.38; cursor:default; pointer-events:none; }
.comic-cut-nav-btn:first-child{ justify-content:flex-start; text-align:left; }
.comic-cut-nav-btn:last-child{ justify-content:flex-end; text-align:right; }
@media (max-width:780px){
  .comic-cut-nav{ margin:0 0 10px; padding:0; gap:8px; }
  .comic-cut-nav-btn{ font-size:13px; min-height:38px; padding:8px; }
}

/* Make ticker text smaller on mobile */
@media (max-width: 480px) {
  .new-sets-list li {
    font-size: 11px;
  }

  .new-sets-pill {
    font-size: 9px;
    padding: 1px 4px;
  }

  .new-sets-viewport {
    margin-top: 18px !important; /* keeps spacing nice */
  }
}

.new-sets-pill.protip {
  background: rgba(255, 214, 0, 0.16); /* soft yellow */
  border-color: rgba(255, 214, 0, 0.55);
  color: #ffe89a;
  font-weight: 800;
}

.ac-title--clickable {
  cursor: pointer;
  user-select: none;
}

.ac-title--clickable:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ac-title--clickable:active {
  background: rgba(255, 255, 255, 0.10);
}

.ac-title--clickable:focus {
  outline: 2px solid rgba(255, 255, 255, 0.25);
  outline-offset: 2px;
}


.view-toggle-row{
  width:100%;
  display:flex;
  justify-content:center;
  gap:10px;
  margin: 0 0 14px;
  flex-wrap:wrap;
}
.view-toggle-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 38px 10px 14px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
  font-size:13px;
  font-weight:700;
  letter-spacing:.02em;
  transition:border-color .18s ease, background .18s ease, transform .18s ease;
}
.view-toggle-btn:hover{
  border-color:rgba(255,255,255,.35);
  background:rgba(255,255,255,.08);
}
.view-toggle-btn[aria-pressed="true"]{
  border-color:rgba(154,139,255,.55);
  background:rgba(154,139,255,.18);
  color:#f3f0ff;
}
.view-toggle-btn .material-symbols-outlined{
  font-size:18px;
}
.comic-cuts-list{
  width:100%;
  display:grid;
  gap:8px;
  margin-top:10px;
}
.comic-cuts-head,
.comic-cuts-row{
  display:grid;
  grid-template-columns:minmax(0,2.6fr) minmax(84px,.9fr) minmax(84px,.9fr) repeat(4, minmax(72px,.75fr));
  gap:10px;
  align-items:center;
}
.comic-cuts-head{
  padding:0 4px 6px;
  border-bottom:1px solid rgba(255,255,255,.10);
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.comic-cuts-row{
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.03);
  cursor:pointer;
  transition:border-color .18s ease, background .18s ease, transform .18s ease;
}
.comic-cuts-row:hover{
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.06);
  transform:translateY(-1px);
}
.comic-cuts-row:focus{
  outline:2px solid rgba(255,255,255,.25);
  outline-offset:2px;
}
.comic-cuts-name,
.comic-cuts-sn,
.comic-cuts-cardnum{
  min-width:0;
  font-size:13px;
  font-weight:600;
}
.comic-cuts-name{
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  word-break:break-word;
}
.comic-cuts-sn,
.comic-cuts-cardnum{
  color:var(--muted);
  font-weight:700;
}
.comic-cuts-check{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:24px;
}
.comic-cuts-check .material-symbols-outlined{
  font-size:18px;
}
.comic-cuts-check.is-yes{ color:#ffffff; }
.comic-cuts-check.is-no{ color:rgba(255,255,255,.22); }
@media (max-width: 780px){
  .view-toggle-row{
    justify-content:flex-start;
  }
  .view-toggle-btn{
    flex:1 1 calc(50% - 10px);
    justify-content:center;
  }
  .comic-cuts-head,
  .comic-cuts-row{
    grid-template-columns:minmax(0,1.9fr) minmax(44px,.52fr) minmax(50px,.56fr) repeat(4, minmax(34px,.38fr));
    gap:4px;
  }
  .comic-cuts-head{
    font-size:9px;
    letter-spacing:.05em;
  }
  .comic-cuts-row{
    padding:10px 8px;
  }
  .comic-cuts-name,
  .comic-cuts-sn,
  .comic-cuts-cardnum{
    font-size:11px;
  }
  .comic-cuts-check .material-symbols-outlined{
    font-size:16px;
  }
}

.mini-results {
  width: 100%;
  display: grid;
  /* desktop: allow more than 3 per row, smaller tiles */
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* Instagram-style tiles */

.mini-row {
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: grid;
  place-items: center;
}

.mini-row:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.mini-row:active {
  transform: translateY(0px) scale(0.99);
  background: rgba(255,255,255,0.09);
}

.mini-row:focus {
  outline: 2px solid rgba(255, 255, 255, 0.25);
  outline-offset: 2px;
}

.mini-tile-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* keep your current image behavior */
  background: rgba(255,255,255,0.04);
  display: block;
}

.mini-issue-header{
  /* Issue cover tile inside the same grid as other mini results */
  padding: 0;
  display: block;
  cursor: pointer;
}

.mini-issue-header img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;

  /* OPEN (expanded) = black & white */
  filter: grayscale(1);
}

.mini-issue-header.mini-issue-collapsed img{
  /* CLOSED (collapsed) = color */
  filter: none;
  opacity: 1;
}

.mini-issue-label{
  font-size: 11px;
  display:none;
}

/* My Collection issue tile overlay (title + Open/Close button) */
/* Uses the same "mini result" popover feel: blurred tint over image + glass card + mini-popover-view button */
.mini-issue-header{ position: relative; overflow: hidden; }

/* Overlay layer (tint + blur over the cover image) */
.mc-issue-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 10px;

  /* mini-popover look */
  background: rgba(10,10,12,.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* interaction */
  pointer-events:none;

  /* Smooth reveal */
  opacity: 0;
  transform: translateY(10px) scale(0.99);
  transition:
    opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

/* Show on hover/focus (desktop/tablet) */
/* Show on hover/focus ONLY on devices that actually have hover */
@media (hover: hover) {
  .mini-issue-header:hover .mc-issue-overlay,
  .mini-issue-header:focus-within .mc-issue-overlay{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Always show when expanded (so Close is visible) */
.mini-issue-header:not(.mini-issue-collapsed) .mc-issue-overlay{
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* On mobile, show only after first tap (mc-popover-open) */
.mini-issue-header.mc-popover-open .mc-issue-overlay{
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* If there is no imagecomic/cover, keep the overlay visible by default */
.mini-issue-header.mini-issue-no-cover .mc-issue-overlay{
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Glass card */
.mc-issue-overlay-panel{
  font-size: 11px;
  pointer-events:auto; /* enable button clicks */
  width: 100%;
  max-width: 260px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.22);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  text-align: center;
  font-family: Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}

.mc-issue-overlay-divider{
  margin: 4px 0 2px;
}

.mc-issue-overlay-footer{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mc-issue-overlay-count{
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  color: rgba(255,255,255,.78);
  text-shadow: 0 2px 10px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.65);
}

/* Button sizing (button look comes from .mini-popover-view) */
.mc-issue-overlay-btn{
  width: auto;
  max-width: none;
  margin-top: 0;
  padding-left: 14px;
  padding-right: 14px;
}

.mc-issue-overlay-title{
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.15;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 2px 10px rgba(0,0,0,.75), 0 1px 2px rgba(0,0,0,.85);

  display: -webkit-box;
  -webkit-box-orient: vertical;

  /* ✅ add both */
  line-clamp: 3;
  -webkit-line-clamp: 3;

  overflow: hidden;
}

@media (max-width: 480px){
  .mini-issue-header img{ width: 100%; height: 100%; }
}

.mini-thumb-ph {
  width: 100%;
  height: 100%;
  opacity: 0.35;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.08) 10px,
    rgba(255,255,255,0.03) 10px,
    rgba(255,255,255,0.03) 20px
  );
}

/* ============================
   Mini tile corner flags
   ============================ */
.mini-flag{
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;

  font-size: 9px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;

  padding: 3px 6px;
  border-radius: 999px;

  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
pointer-events: none;

  box-shadow:
    0 14px 28px rgba(0,0,0,.60),
    0 6px 16px rgba(0,0,0,.48),
    0 0 0 1px rgba(255,255,255,.10);

  text-shadow: 0 2px 10px rgba(0,0,0,.82), 0 1px 2px rgba(0,0,0,.92);
}

.mini-row.mini-popover-open .mini-flag{ display:none; }

/* Color themes */
.mini-flag.error{
  background: rgba(255, 60, 60, 0.16);
  border-color: rgba(255, 60, 60, 0.45);
  color: #ffffff;
}

.mini-flag.first-appearance{
  background: rgba(0, 255, 140, 0.14);
  border-color: rgba(0, 255, 140, 0.45);
  color: #ffffff;
}

.mini-flag.reprint{
  background: rgba(255, 214, 0, 0.16);
  border-color: rgba(255, 214, 0, 0.55);
  color: #ffffff;
}

.mini-flag.user-status{
  top: 8px;
  bottom: auto;
  left: 8px;
  transform: none;
  max-width: calc(100% - 16px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-flag.user-status.on-the-hunt{
  background: rgba(87, 168, 255, 0.18);
  border-color: rgba(87, 168, 255, 0.45);
  color: #ffffff;
}

.mini-flag.user-status.trade-sale{
  background: rgba(255, 146, 68, 0.18);
  border-color: rgba(255, 146, 68, 0.48);
  color: #ffffff;
}

.mini-flag.user-status.pc{
  background: rgba(163, 114, 255, 0.18);
  border-color: rgba(163, 114, 255, 0.48);
  color: #ffffff;
}


.mini-badge-stack{
  position:absolute;
  bottom:8px;
  left:50%;
  transform:translateX(-50%);
  z-index:7;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  width:calc(100% - 16px);
  pointer-events:none;
}

.mini-badge-stack .mini-flag{
  position:static;
  top:auto;
  bottom:auto;
  left:auto;
  transform:none;
  max-width:100%;
}

.mini-badge-divider{
  width:44px;
  height:1px;
  background:rgba(255,255,255,0.52);
  box-shadow:0 2px 10px rgba(0,0,0,.58), 0 0 10px rgba(255,255,255,.08);
  border-radius:999px;
}

.mini-flag.issue-meta{
  background:rgba(12,12,16,0.42);
  border-color:rgba(255,255,255,0.16);
  color:#ffffff;
}

/* Hide old row text UI in tile mode (kept for safety) */
.mini-left,
.mini-main,
.mini-issue,
.mini-meta,
.mini-dot,
.mini-arrow {
  display: none !important;
}

.mini-left
 {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mini-thumb {
  width: 44px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  place-items: center;
}

.mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mini-thumb-ph {
  width: 100%;
  height: 100%;
  opacity: 0.35;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.08) 6px,
    rgba(255,255,255,0.03) 6px,
    rgba(255,255,255,0.03) 12px
  );
}

.mini-main {
  min-width: 0;
}

/* --- Anti-stretch rules for long titles (desktop + mobile) --- */
.mini-row { max-width: 100%; box-sizing: border-box; }
.mini-left { min-width: 0; }
.mini-main { min-width: 0; }
.mini-meta span { min-width: 0; }

@media (max-width: 900px) {
  .mini-results { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
@media (max-width: 520px) {
  /* mobile: 3 per row, slightly smaller */
  .mini-results { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mini-row { border-radius: 10px; }
}

.mini-meta { font-size: 11px; line-height: 1.25; }
.mini-meta strong { font-size: 11px; font-weight: 400; }

/* ============================
   Mini-result popover (over clicked tile)
   ============================ */
.mini-popover{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
  /* blur + slight tint over the image */
  background: rgba(10,10,12,.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.mini-popover.open{ display:flex; }

.mini-popover-card{
  width: 100%;
  max-width: 260px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.22);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  padding: 10px 12px 12px;  /* 🔻 was 14px 14px 16px */
  gap: 6px;                 /* 🔻 was 12px */
  display: grid;
  place-items: center;
  text-align: center;
  font-family: Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}

.mini-popover-cardnum{
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.15;
  color: rgba(255,255,255,.92);

  /* Keep long issue titles tidy */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-popover-actions{
  display:flex;
  justify-content: center;
  align-items:center;
  gap:8px;
  width: 100%;
}

/* Overlay View button (only affects the popover view button) */
.mini-popover-view {
  font-size: 11px;
  flex:0 0 auto;
  width:auto;
  border-radius: 14px;
  padding:6px 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.95);

  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.mini-popover-view .material-symbols-outlined{
  font-size:18px;
  line-height:1;
  display:block;
}

/* Keep overlay text and icons centered/aligned */
.mini-popover-card,
.mc-issue-overlay-panel{
  box-sizing:border-box;
}

.mini-popover-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.mini-popover-cardnum,
.mini-popover-serial,
.mc-issue-overlay-title,
.mc-issue-overlay-count{
  width:100%;
  text-align:center;
}

.mini-popover-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  width:auto;
  max-width:100%;
}

.mini-popover-view,
.mini-popover-hunt,
.mc-issue-overlay-btn{
  appearance:none;
  -webkit-appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  vertical-align:middle;
}

.mini-popover-view{
  min-height:44px;
  gap:0;
  flex:0 0 auto;
  width:auto;
  min-width:0;
}

.mini-popover-hunt,
.mc-issue-overlay-btn{
  min-height:44px;
}

.mini-popover-hunt .material-symbols-outlined,
.mc-issue-overlay-btn .material-symbols-outlined{
  font-size:20px;
  line-height:1;
  display:block;
}

.mc-issue-overlay-btn{
  width:auto;
  min-width:0;
  height:44px;
  padding:4px 10px;
}

.mini-popover-hunt {
  flex:0 0 auto;
  width:auto;
  min-width:0;
  height:auto;
  min-height:0;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:none;
  background:transparent;
  color:rgba(255,255,255,0.96);
  box-shadow:none;
  border-radius:0;
  transition:transform 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.mini-popover-hunt .material-symbols-outlined{
  font-size:22px;
}

.mini-popover-hunt:hover{
  color:#ffffff;
  transform:translateY(-1px) scale(1.04);
}

.mini-popover-hunt:active{
  transform:translateY(0) scale(0.96);
}

.mini-popover-hunt.is-active{
  color:#ffffff;
}

.mini-popover-hunt.is-active .material-symbols-outlined{
  font-variation-settings: 'FILL' 1;
}

.mini-popover-hunt:disabled{
  opacity:.6;
  cursor:not-allowed;
  transform:none;
}

.mini-popover-view:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.30);
  transform: translateY(-1px);
}

.mini-popover-view:active {
  transform: translateY(0px) scale(0.99);
  background: rgba(255,255,255,0.16);
}

/* Mini-results subset header underline: fade to white on hover */
.mini-subset-header{
  border-bottom-color: rgba(255,255,255,0.10); /* default line */
  transition: border-bottom-color 0.22s ease;  /* 👈 fade */
}

.mini-subset-header:hover{
  border-bottom-color: #ffffff !important;     /* hover line */
}

/* Hide ticker while checklist dropdown is open */
body.ticker-hidden .new-sets-viewport{ display:none !important; }
body.browse-list-open #protipSlider,
body.browse-list-open #randomCardDayWrap{ display:none !important; }

  /* Ticker: hidden by default; shown only on first visit or logo click */
  .new-sets-viewport { display: none; }

  /* Prevent last result row from hiding under fixed footer */
#result {
  padding-bottom: 90px;
}

.mini-popover-divider{
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,.18);
  margin: 3px 0 3px;   /* 🔻 was 6px 0 6px */
}

.mini-popover-serial{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(255,255,255,.78);
}

/* ============================
   Mini popover spacing tweaks
   - Pull Card # and Serial closer to the divider
   - Keep space between Serial and View button
   ============================ */
.mini-popover-cardnum{
  margin-bottom: 2px;   /* tighter above divider */
}

.mini-popover-divider{
  margin: 2px 0 2px;    /* tighter spacing around the line */
}

.mini-popover-serial{
  margin-top: 2px;      /* closer to divider */
  margin-bottom: 10px;  /* keeps space before View button */
}

/* keep View button from creeping upward */
.mini-popover-actions{
  margin-top: 0;
}

/* ===== Auth (login) UI in right flyout ===== */
.auth-toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.03);
  color:var(--text);
  cursor:pointer;
  font-weight:800;
}
.auth-toggle:hover{ background:rgba(255,255,255,0.06); }
.auth-toggle .material-symbols-outlined{ font-size:20px; opacity:.85; }

.auth-card{
  padding:12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.02);
}
.auth-row{ display:grid; gap:8px; }
.auth-label{ font-size:12px; color:var(--muted); font-weight:600; }
.auth-input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  color:var(--text);
  outline:none;
}
.auth-input:focus-visible{ border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow); }
.auth-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:6px; }
.auth-btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.04);
  color:var(--text);
  cursor:pointer;
}
.auth-btn:hover{ background:rgba(255,255,255,0.08); }
/* Align Request Membership button with the right edge of the login fields */
#authLoggedOut .auth-actions{
  width:100%;
}
#authLoggedOut #requestMembershipBtn{
  margin-left:auto;
}
#authLoggedOut #authStatus{
  flex-basis:100%;
}

.left-protip-shortcuts{
  display:grid;
  gap:8px;
  margin:0 0 16px 0;
}
.left-protip-shortcut-btn{
  width:100%;
  justify-content:flex-start;
  gap:10px;
  font-weight:800;
}
.left-protip-shortcut-btn .material-symbols-outlined{
  font-size:20px;
  opacity:.9;
}
.auth-status{ font-size:12px; color:var(--muted); }
.auth-status.ok{ color:#9be6b5; }
.auth-status.err{ color:#ff9aa2; }

/* Prevent iOS zoom on focus */
@media (max-width: 780px) {
  .auth-input,
  .searchbar input,
  input[type="email"],
  input[type="password"],
  input[type="text"] {
    font-size: 16px !important;
  }
}
.auth-input {
  line-height: 1.4;
}

.mini-subset-header:hover{
  border-bottom-color: #ffffff !important;
}

/* ===== Page magnifier (card-shaped) ===== */
.imagepage{ position: relative; width: 100%; }
.imagepage img{ -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }

.page-magnifier{
  position:absolute;
  z-index: 50;

  width: 150px;
  height: 200px;
  margin: 0;

  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 14px 28px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.08);

  /* ✅ OUTER cutout outline (white, bolder, further out) */
  outline: 2px dashed #fff;
  outline-offset: -2px;

  background-repeat: no-repeat;
  background-color: rgba(0,0,0,0.18);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);

  pointer-events: none;

  left: 50%;
  top: 50%;

  opacity: 0;
  transform: translate(-50%, -50%) translateY(2px) scale(0.92);
  transition:
    opacity .16s cubic-bezier(.2,.8,.2,1),
    transform .16s cubic-bezier(.2,.8,.2,1);
}

/* (removed the inner ::after cutout since you want it OUTSIDE the zoom area) */

.page-magnifier.on{
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0) scale(1);
}

@media (max-width: 600px){
  /* Smaller lens on phones */
  .page-magnifier{ width: 110px; height: 150px; }
}

@media (prefers-reduced-motion: reduce){
  .page-magnifier{ transition:none !important; }
}

.imagepage.hide-cursor,
.imagepage.hide-cursor * {
  cursor: none !important;
}

/* When page image (imagepage mode) is active, fully disable native touch/drag */
.imagepage.page-active{
  width: 100%;
  overflow: hidden;
}

.imagepage.page-active img{
  touch-action: none;
  -webkit-user-drag: none;
  aspect-ratio: auto !important;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: min(70vh, 70dvh, 560px);
  object-fit: contain;
}

@media (max-width: 780px){
  .imagepage.page-active img{
    max-height: min(58vh, 58dvh, 420px);
  }
}

@media (hover: none) and (pointer: coarse) {
  .custom-dd-trigger {
    pointer-events: none;
  }
}

/* ===== Add Card Modal ===== */
  .modal-overlay{
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .modal-overlay.open{ display:block; }

  .modal{
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    width: min(92vw, 820px);

    /* Use dynamic viewport height when available (prevents mobile browser chrome clipping) */
    max-height: min(88vh, 820px);
    max-height: min(88dvh, 820px);

    overflow: hidden;
    z-index: 2100;

    /* ✅ Ensure footer never gets clipped: header/body/footer as a flex column */
    display: none;
    flex-direction: column;

    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    box-shadow: var(--shadow);
  }
  .modal.open{ display:flex; }

  .modal header{
    flex: 0 0 auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
  }
  .modal header strong{ font-size: 14px; letter-spacing: .02em; }

  .modal .modal-body{
    flex: 1 1 auto;
    padding: 12px 14px;
    overflow: auto;
    /* Let flexbox control height; avoids calc mistakes + clipping */
    max-height: none;
    -webkit-overflow-scrolling: touch;
  }

  .modal .modal-footer{
    flex: 0 0 auto;
    display:flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    /* iOS safe area (home indicator) */
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
  }
.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
@media (max-width: 780px){
  .form-grid{ grid-template-columns: 1fr; }
}

.form-field{
  display:grid;
  gap:6px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.form-field label{
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.form-section{
  grid-column: 1 / -1;
  position: relative;
  z-index: 0;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
.form-section.form-section--open{
  overflow: visible;
}
.form-section.has-open-dropdown{
  z-index: 20;
}
.form-section-body,
.form-field,
.modal-dd{
  position: relative;
  overflow: visible;
}
.form-field.has-open-dropdown{
  z-index: 25;
}
.form-section + .form-section{
  margin-top: 2px;
}
.form-section-header{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-radius: inherit;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.form-section-header:hover{
  background: rgba(255,255,255,0.06);
}
.form-section--locked-collapsed .form-section-header{
  cursor: not-allowed;
  opacity: .62;
}
.form-section--locked-collapsed .form-section-header:hover{
  background: rgba(255,255,255,0.03);
}
.form-section-header:focus-visible{
  outline: 2px solid rgba(255,255,255,.25);
  outline-offset: -2px;
}
.form-section-title{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.form-section-chevron{
  font-size: 18px;
  line-height: 1;
  opacity: .78;
  transition: transform .18s ease;
}
.form-section-header[aria-expanded="false"] .form-section-chevron{
  transform: rotate(-90deg);
}
/* Locked sections use a lock glyph, not a chevron; keep it upright/vertical. */
.form-section--locked-collapsed .form-section-chevron{
  transform: none !important;
}
.form-section-header[aria-expanded="false"]{
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
.form-section--open .form-section-header{
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.form-section-body{
  padding: 12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.form-section-body[hidden]{
  display:none !important;
}
.form-section--open .form-section-header{
  border-bottom-color: rgba(255,255,255,0.10);
}
@media (max-width: 780px){
  .form-section-body{
    grid-template-columns: 1fr;
  }
}
.form-control{
  width:100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  padding: 10px 10px;
  outline: none;
  font-size: 14px;
}
.form-control:focus-visible{
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow);
}
/* Keep normal-user SN on Card as an active dropdown instead of a greyed field. */
.modal-dd .modal-dd-trigger[disabled],
.modal-dd.add-sn-on-card-dd-disabled .modal-dd-trigger{
  opacity: 1;
  cursor: pointer;
  color: var(--text);
  background: rgba(0,0,0,0.18);
}

/* Keep the normal-user Serial Number autofill field from flashing/highlighting on click. */
.form-control.serial-autofill-locked,
.form-control.serial-autofill-locked:focus,
.form-control.serial-autofill-locked:focus-visible{
  border-color: rgba(255,255,255,0.10) !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: default;
  caret-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Locked Master-backed autofill fields in Add Card for normal collection users. */
.form-control.add-autofill-locked,
.form-control.add-autofill-locked:focus,
.form-control.add-autofill-locked:focus-visible{
  border-color: rgba(255,255,255,0.10) !important;
  background: rgba(255,255,255,0.055) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: default;
  caret-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.modal-dd.add-sn-on-card-dd-disabled .modal-dd-trigger,
.modal-dd.add-sn-on-card-dd-disabled .modal-dd-trigger:focus,
.modal-dd.add-sn-on-card-dd-disabled .modal-dd-trigger:focus-visible{
  border-color: rgba(255,255,255,0.10) !important;
  background: rgba(255,255,255,0.055) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: not-allowed;
}
.form-control.select{
  background: rgba(0,0,0,0.14);
}
.form-note{
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px 0;
  line-height: 1.4;
}
.modal-msg{
  font-size: 13px;
  color: var(--muted);
}
.modal-msg.ok{ color:#9be6b5; }
.modal-msg.err{ color:#ff9aa2; }

.save-progress-wrap{
  min-width: min(320px, 42vw);
  display:grid;
  gap:6px;
}
.save-progress-label{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  color:var(--muted);
}
.save-progress-label strong{
  color:var(--text);
  font-weight:800;
}
.save-progress-track{
  width:100%;
  height:8px;
  overflow:hidden;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.07);
}
.save-progress-fill{
  width:0%;
  height:100%;
  border-radius:999px;
  background:rgba(154,139,255,.72);
  box-shadow:0 0 18px rgba(154,139,255,.32);
  transition:width .18s ease;
}
.save-progress-fill.is-indeterminate{
  width:38%;
  animation:saveProgressIndeterminate 1s ease-in-out infinite;
}
@keyframes saveProgressIndeterminate{
  0%{ transform:translateX(-110%); }
  100%{ transform:translateX(285%); }
}
@media (max-width:780px){
  .modal-footer{ align-items:stretch; }
  .save-progress-wrap{ min-width:100%; }
}

/* Compact custom dropdowns for Add/Edit Card modals only */
.modal-native-select{
  position:absolute !important;
  opacity:0 !important;
  pointer-events:none !important;
  width:1px !important;
  height:1px !important;
  margin:0 !important;
  padding:0 !important;
}
.modal-dd{
  position:relative;
  width:100%;
}
.modal-dd-trigger{
  width:100%;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(0,0,0,0.18);
  color:var(--text);
  padding:10px 38px 10px 10px;
  outline:none;
  font-size:14px;
  text-align:left;
  cursor:pointer;
  min-height:42px;
}
.modal-dd-trigger::after{
  content:'▼';
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  font-size:10px;
  opacity:.7;
  pointer-events:none;
}
.modal-dd.open .modal-dd-trigger,
.modal-dd-trigger:focus-visible{
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow);
}
.modal-dd-list{
  position:absolute;
  top:calc(100% + 6px);
  left:0;
  right:0;
  background:linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:var(--shadow);
  max-height:220px;
  overflow:auto;
  display:none;
  z-index:2600;
}
.modal-dd.open .modal-dd-list{ display:block; }
.modal-dd-option{
  padding:10px 12px;
  font-size:14px;
  cursor:pointer;
}
.modal-dd-option:hover,
.modal-dd-option[aria-selected='true']{
  background:rgba(255,255,255,.08);
}
.modal.modal-dd-scroll-lock .modal-body{
  overflow:hidden;
  overscroll-behavior:contain;
}
.modal-dd-list{
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y;
}
@media (hover: none) and (pointer: coarse){
  .modal.modal-dd-scroll-lock .modal-body{
    overflow:auto;
  }
  .modal-dd-list{
    max-height:min(180px, 34vh);
  }
}


/* Shared dropdown styling for non-modal areas (filters, archive, etc.) */
.uniform-native-select{
  position:absolute !important;
  opacity:0 !important;
  pointer-events:none !important;
  width:1px !important;
  height:1px !important;
  margin:0 !important;
  padding:0 !important;
}
.uniform-dd{
  position:relative;
  width:100%;
}
.uniform-dd-trigger{
  width:100%;
  position:relative;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(0,0,0,0.18);
  color:var(--text);
  padding:10px 38px 10px 10px;
  outline:none;
  font-size:14px;
  text-align:left;
  cursor:pointer;
  min-height:42px;
}
.uniform-dd-trigger::after{
  content:'▼';
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  font-size:10px;
  opacity:.7;
  pointer-events:none;
}
.uniform-dd.open .uniform-dd-trigger,
.uniform-dd-trigger:focus-visible{
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow);
}
.uniform-dd-list{
  position:absolute;
  top:calc(100% + 6px);
  left:0;
  right:0;
  background:linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:var(--shadow);
  max-height:220px;
  overflow:auto;
  display:none;
  z-index:2600;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y;
}
.uniform-dd.open .uniform-dd-list{ display:block; }
.uniform-dd-option{
  padding:10px 12px;
  font-size:14px;
  cursor:pointer;
}
.uniform-dd-option:hover,
.uniform-dd-option[aria-selected='true']{
  background:rgba(255,255,255,.08);
}
.archive-series-row .uniform-dd,
.mc-field .uniform-dd{
  width:100%;
}


/* ===== Image upload fields (Add/Edit Card) ===== */
.image-upload-wrap{
  display:grid;
  gap:10px;
}
.image-upload-dropzone{
  border:1px dashed rgba(255,255,255,.22);
  border-radius:14px;
  padding:12px;
  background:rgba(255,255,255,.02);
  display:grid;
  gap:10px;
  text-align:center;
  cursor:pointer;
  transition:border-color .18s ease, background .18s ease;
}
.image-upload-dropzone:hover,
.image-upload-dropzone.is-dragover{
  border-color:rgba(255,255,255,.6);
  background:rgba(255,255,255,.05);
}
.image-upload-help{
  font-size:12px;
  color:var(--muted);
  line-height:1.4;
}
.image-upload-preview-wrap{
  display:none;
  gap:8px;
  justify-items:center;
}
.image-upload-preview-wrap.has-image{ display:grid; }
.image-upload-preview{
  width:100%;
  max-width:220px;
  aspect-ratio:3/4;
  object-fit:contain;
  border-radius:10px;
  background:rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.08);
}
.image-upload-path{
  width:100%;
  font-size:11px;
  color:var(--muted);
  overflow-wrap:anywhere;
}
.image-upload-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
}
.image-upload-actions .auth-btn{
  min-width:124px;
}
.image-upload-dropzone.is-locked{
  cursor:not-allowed;
  opacity:.72;
}
.image-upload-dropzone.is-locked:hover{
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.02);
}

/* ===== Privacy Modal ===== */
.privacy-user-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.privacy-user-meta{
  min-width:0;
  display:grid;
  gap:4px;
}
.privacy-user-name{
  font-weight:700;
  overflow-wrap:anywhere;
}
.privacy-user-email{
  font-size:12px;
  color:var(--muted);
  overflow-wrap:anywhere;
}
.privacy-switch{
  position:relative;
  display:inline-flex;
  align-items:center;
  width:48px;
  height:28px;
  flex:0 0 auto;
}
.privacy-switch input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
  margin:0;
}
.privacy-switch-ui{
  width:48px;
  height:28px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.12);
  transition:background .18s ease, border-color .18s ease;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.03);
}
.privacy-switch-ui::after{
  content:'';
  position:absolute;
  top:3px;
  left:3px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 10px rgba(0,0,0,.35);
  transition:transform .18s ease;
}
.privacy-switch input:checked + .privacy-switch-ui{
  background:rgba(154,139,255,.34);
  border-color:rgba(154,139,255,.65);
}
.privacy-switch input:checked + .privacy-switch-ui::after{
  transform:translateX(20px);
}
.privacy-switch input:disabled + .privacy-switch-ui{
  opacity:.6;
}
.privacy-user-state{
  font-size:11px;
  font-weight:700;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.06em;
}

.privacy-toggle-stack{
  display:flex;
  align-items:center;
  gap:12px;
  flex:0 0 auto;
}
.privacy-toggle-group{
  display:grid;
  gap:6px;
  justify-items:center;
}
.privacy-toggle-label{
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  white-space:nowrap;
}
.privacy-switch.is-secondary .privacy-switch-ui{
  background:rgba(255,255,255,.08);
}
.privacy-switch.is-secondary input:checked + .privacy-switch-ui{
  background:rgba(87,168,255,.28);
  border-color:rgba(87,168,255,.55);
}

/* ===== Edit Card Modal ===== */
.danger-btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,90,90,0.35);
  background: rgba(255, 90, 90, 0.12);
  color: #ffd6d6;
  cursor:pointer;
}
.danger-btn:hover{ background: rgba(255, 90, 90, 0.18); border-color: rgba(255,90,90,0.55); }
.danger-btn:disabled{ opacity:.45; cursor:not-allowed; }

/* Owner divider in thumbnail (alt) window */
.alt-owner-label{
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  opacity:.75;
  /* allow wrapping instead of truncation */
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  max-width:100%;
  word-break:break-word;
}
.alt-owner-rule{
  height:1px;
  background:rgba(255,255,255,.16);
  flex:1 1 120px;
  min-width:60px;
}

/* ===== Pro Tip Slider (replaces single protip-icon.png image) ===== */
.protip-slider{
  position: relative;
  width: 100%;
  margin: 0 auto;
  max-width: 720px; /* keeps it from getting huge on desktop; image sizing still controlled by .protip-img */
}
.protip-viewport{
  overflow: hidden;
  border-radius: 12px;
}
.protip-track{
  display: flex;
  gap: 0;
  transform: translateX(0%);
  transition: transform 260ms ease;
  will-change: transform;
}
.protip-slide{
  flex: 0 0 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.protip-slide:focus-visible{
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 3px;
  border-radius: 12px;
}
.protip-slide img{
  display:block;
}

/* Controls */
.protip-controls{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
}
.protip-navbtn{
  appearance:none;
  border:1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.protip-navbtn:hover{ background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); }
.protip-navbtn:active{ transform: scale(0.98); }

.protip-dots{
  display:flex;
  gap: 8px;
  align-items:center;
  justify-content:center;
}
.protip-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  padding: 0;
}
.protip-dot[aria-current="true"]{
  background: rgba(255,255,255,0.55);
  border-color: rgba(255,255,255,0.55);
}




/* ===== Random Card of the Day ===== */
.random-card-day-wrap{
  width: 100%;
  max-width: 720px;
  margin: 22px auto 0;
  text-align: left;
}
.random-card-day-btn{
  width: 100%;
  display: grid;
  grid-template-columns: minmax(110px, 150px) 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  text-align: left;
}
.random-card-day-btn:hover{
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
}
.random-card-day-btn:focus-visible{
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 3px;
}
.random-card-day-media{
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.random-card-day-media img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.random-card-day-copy{
  min-width: 0;
  display: grid;
  gap: 7px;
}
.random-card-day-kicker{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.random-card-day-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(154, 139, 255, 0.45);
  background: rgba(154, 139, 255, 0.16);
  color: #d8d1ff;
  letter-spacing: .12em;
}
.random-card-day-title{
  margin: 0;
  font-size: clamp(18px, 2.7vw, 24px);
  line-height: 1.2;
}
.random-card-day-meta,
.random-card-day-caption{
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.random-card-day-empty{
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
@media (max-width: 780px){
  .random-card-day-wrap{
    min-height: 430px;
  }
  .random-card-day-btn{
    grid-template-columns: 1fr;
    min-height: 410px;
  }
  .random-card-day-media{
    max-width: 200px;
    min-height: 260px;
    margin: 0 auto;
  }
  .random-card-day-media img{
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
  }
  .random-card-day-copy{
    text-align: center;
  }
  .random-card-day-kicker{
    justify-content: center;
  }
}

/* ===== Pro Tip Popup ===== */
.protip-popup-overlay{
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.protip-popup-overlay.open{ display:flex; }
.protip-popup{
  width: min(920px, 100%);
  max-height: min(86vh, 860px);
  max-height: min(86dvh, 860px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(21,23,26,.96) 0%, rgba(16,17,20,.98) 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.protip-popup-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.protip-popup-title-wrap{ display:grid; gap:4px; min-width:0; }
.protip-popup-kicker{
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
.protip-popup-title{
  margin:0;
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.15;
}
.protip-popup-close{
  flex: 0 0 auto;
}
.protip-popup-body{
  overflow:auto;
  padding: 18px 16px 20px;
  display:grid;
  gap: 18px;
  -webkit-overflow-scrolling: touch;
}
.protip-popup-copy{
  display:grid;
  gap: 12px;
  color: var(--text);
  line-height: 1.65;
  font-size: 14px;
}
.protip-popup-copy p{ margin:0; }
.protip-popup-copy ul{
  margin:0;
  padding-left: 18px;
  color: var(--muted);
}
.protip-popup-copy li + li{ margin-top: 8px; }
.protip-popup-gallery{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.protip-popup-figure{
  margin:0;
  display:grid;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.protip-popup-figure img{
  width: 100%;
  height: auto;
  display:block;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}
.protip-popup-figure figcaption{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
@media (max-width: 780px){
  .protip-popup-overlay{ padding: 12px; }
  .protip-popup{ max-height: min(90vh, 900px); max-height: min(90dvh, 900px); }
  .protip-popup-body{ padding: 14px 12px 16px; }
  .protip-popup-gallery{ grid-template-columns: 1fr; }
}


/* ===== Comic Cut Stats dashboard popup ===== */
.ccs-dashboard{
  display:grid;
  gap:16px;
}
.ccs-dashboard-hero{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:14px;
  align-items:stretch;
  padding:15px;
  border:1px solid rgba(154,139,255,.34);
  background:
    radial-gradient(420px 180px at 10% 0%, rgba(154,139,255,.24), transparent 65%),
    linear-gradient(180deg, rgba(154,139,255,.13), rgba(255,255,255,.025));
  box-shadow:0 18px 44px rgba(0,0,0,.28);
}
.ccs-dashboard-hero-copy{
  display:grid;
  align-content:center;
  gap:8px;
  min-width:0;
}
.ccs-dashboard-eyebrow{
  color:var(--muted);
  font-size:11px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.ccs-dashboard-hero-title{
  margin:0;
  font-size:clamp(22px, 4vw, 40px);
  line-height:1.02;
  font-weight:900;
}
.ccs-dashboard-hero-note{
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
}
.ccs-dashboard-scorecard{
  display:grid;
  place-items:center;
  text-align:center;
  padding:16px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.18);
}
.ccs-dashboard-scorecard strong{
  display:block;
  font-size:clamp(34px, 7vw, 62px);
  line-height:1;
}
.ccs-dashboard-scorecard span{
  display:block;
  margin-top:6px;
  color:var(--muted);
  font-size:11px;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.ccs-stat-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.ccs-stat-card{
  min-width:0;
  display:grid;
  gap:6px;
  padding:13px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.035);
}
.ccs-stat-card label{
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--muted);
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.ccs-stat-card label .material-symbols-outlined{
  font-size:17px;
  color:var(--brand);
}
.ccs-stat-card strong{
  font-size:22px;
  line-height:1.1;
  overflow-wrap:anywhere;
}
.ccs-stat-card span{
  color:var(--muted);
  font-size:11px;
  line-height:1.35;
}
.ccs-dashboard-section{
  display:grid;
  gap:10px;
}
.ccs-dashboard-section-title{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  color:var(--text);
  font-size:13px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.ccs-dashboard-section-title .material-symbols-outlined{
  font-size:19px;
  color:var(--brand);
}
.ccs-list-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.ccs-list-card{
  min-width:0;
  display:grid;
  gap:10px;
  padding:13px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
}
.ccs-list-card.is-wide{
  grid-column:1 / -1;
}
.ccs-list-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:var(--text);
  font-size:12px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.ccs-list-heading small{
  color:var(--muted);
  font-size:10px;
  font-weight:800;
}
.ccs-rank-list{
  display:grid;
  gap:8px;
}
.ccs-rank-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
}
.ccs-rank-num{
  width:28px;
  height:28px;
  display:inline-grid;
  place-items:center;
  border:1px solid rgba(154,139,255,.38);
  background:rgba(154,139,255,.12);
  font-size:11px;
  font-weight:900;
}
.ccs-rank-name{
  min-width:0;
  display:grid;
  gap:2px;
}
.ccs-rank-name strong{
  font-size:13px;
  line-height:1.25;
  overflow-wrap:anywhere;
}
.ccs-rank-name span{
  color:var(--muted);
  font-size:11px;
  overflow-wrap:anywhere;
}
.ccs-rank-value{
  min-width:48px;
  text-align:right;
  font-size:13px;
  font-weight:900;
}
.ccs-rank-row--rare{
  grid-template-columns:auto minmax(0,1fr) minmax(62px,auto);
}
.ccs-rank-row--rare .ccs-rank-value{
  min-width:62px;
  font-variant-numeric:tabular-nums;
}
.ccs-rank-list--rare .ccs-rank-name span{
  display:block;
  max-width:100%;
}
.ccs-bar{
  grid-column:2 / 4;
  height:7px;
  background:rgba(255,255,255,.08);
  overflow:hidden;
}
.ccs-bar-fill{
  height:100%;
  width:0;
  background:rgba(154,139,255,.68);
  box-shadow:0 0 20px rgba(154,139,255,.25);
}
.ccs-pill-row{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}
.ccs-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:5px 9px;
  border:1px solid rgba(255,255,255,.13);
  background:rgba(0,0,0,.18);
  color:rgba(255,255,255,.84);
  font-size:10px;
  font-weight:900;
  letter-spacing:.07em;
  line-height:1.1;
  text-transform:uppercase;
}
.ccs-pill.purple{ border-color:rgba(154,139,255,.38); background:rgba(154,139,255,.12); }
.ccs-pill.green{ border-color:rgba(80,220,125,.34); background:rgba(80,220,125,.10); }
.ccs-pill.gold{ border-color:rgba(255,214,0,.35); background:rgba(255,214,0,.10); }
.ccs-pill.red{ border-color:rgba(255,70,70,.35); background:rgba(255,70,70,.10); }
.ccs-empty{
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
  padding:12px;
  border:1px dashed var(--border);
  background:rgba(255,255,255,.02);
}
@media (max-width:900px){
  .ccs-stat-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ccs-dashboard-hero{ grid-template-columns:1fr; }
}
@media (max-width:780px){
  .ccs-list-grid{ grid-template-columns:1fr; }
  .ccs-list-card.is-wide{ grid-column:auto; }
}
@media (max-width:480px){
  .ccs-stat-grid{ grid-template-columns:1fr; }
  .ccs-rank-row{ grid-template-columns:auto minmax(0,1fr) auto; gap:8px; }
  .ccs-bar{ grid-column:1 / -1; }
}


/* Keep the slider image sizing exactly as your existing protip image rules */
#result .empty .protip-img{ max-width: 60%; }
@media (max-width: 780px){
  #result .empty .protip-img{ max-width: 90%; margin: 0 auto 4px; }
}


.search-separator {
  color: var(--muted);
  font-weight: 400;
  opacity: 0.6;
  padding: 0 6px;
  user-select: none;
}


/* Icon-only filter button */

/* Make filter icon button match sort button style */
.mc-filters-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:34px;
  width:34px;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--panel);
  cursor:pointer;
}
.mc-filters-toggle:hover{
  background:var(--panel-2);
}
.mc-filters-toggle .mc-filter-ic{
  font-size:20px;
}

.mc-filters-toggle .mc-filters-left{display:none !important;}
.mc-filters-toggle{padding:6px 8px;}


/* Active/open state for filter + sort toolbar buttons */
.mc-sort-icon-btn[data-open="true"],
.mc-filters-toggle[data-open="true"],
.mc-sort-icon-btn[aria-expanded="true"],
.mc-filters-toggle[aria-expanded="true"]{
  background: rgba(154, 139, 255, 0.18) !important;
  border-color: rgba(154, 139, 255, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(154, 139, 255, 0.18) inset;
}
.mc-sort-icon-btn[data-open="true"] .mc-sort-icon,
.mc-filters-toggle[data-open="true"] .mc-filter-ic,
.mc-sort-icon-btn[aria-expanded="true"] .mc-sort-icon,
.mc-filters-toggle[aria-expanded="true"] .mc-filter-ic{
  color: var(--brand);
}


/* Center specific columns on desktop */
@media (min-width: 768px){
  .comic-cuts-head div:nth-child(4),
  .comic-cuts-head div:nth-child(5),
  .comic-cuts-head div:nth-child(6),
  .comic-cuts-head div:nth-child(7),
  .comic-cuts-row div:nth-child(4),
  .comic-cuts-row div:nth-child(5),
  .comic-cuts-row div:nth-child(6),
  .comic-cuts-row div:nth-child(7){
    text-align:center;
    justify-self:center;
  }
}
