:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --fg: #1d1d1f;
  --card: rgba(255,255,255,.88);
  --muted: #6e6e73;
  --border: rgba(0,0,0,.08);
  --soft: rgba(0,0,0,.045);
  --input: #fff;
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --danger: #dc2626;
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
}
html.dark {
  color-scheme: dark;
  --bg: #111113;
  --fg: #f5f5f7;
  --card: rgba(28,28,30,.92);
  --muted: #a1a1aa;
  --border: rgba(255,255,255,.10);
  --soft: rgba(255,255,255,.07);
  --input: #1c1c1e;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--fg);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(245,158,11,.07), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(59,130,246,.045), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.dark body {
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(245,158,11,.09), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(59,130,246,.06), transparent 60%);
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin-bottom: .45rem; letter-spacing: -.025em; color: var(--fg); }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.08; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { line-height: 1.55; }

.app-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  backdrop-filter: saturate(180%) blur(20px);
}
.dark .app-header { background: rgba(28,28,30,.8); }
.topbar {
  max-width: 1152px; height: 56px; margin: 0 auto; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display:flex; align-items:center; gap:10px; min-width:0; color:var(--fg); font-size:15px; font-weight:750; text-decoration:none; letter-spacing:-.02em; }
.brand-mark {
  width:32px; height:32px; flex:0 0 auto; display:grid; place-items:center;
  border-radius:12px; color:#fff; font-weight:800;
  background: linear-gradient(135deg,#fbbf24,#f97316);
  box-shadow: 0 2px 8px rgba(245,158,11,.28);
}
.desktop-nav { display:flex; align-items:center; gap:2px; }
.nav-pill {
  position:relative; border-radius:999px; padding:7px 14px;
  color:var(--muted); text-decoration:none; font-size:13px; font-weight:600;
  transition:background .18s,color .18s;
}
.nav-pill:hover { background:var(--soft); color:var(--fg); }
.nav-pill.active { background:var(--soft); color:var(--fg); }
.nav-pill.active::after {
  content:""; position:absolute; left:50%; bottom:3px; width:4px; height:4px;
  margin-left:-2px; border-radius:50%; background:var(--amber);
}
.topbar-actions { display:flex; align-items:center; gap:2px; }
.icon-button {
  position:relative; width:36px; height:36px; padding:0; border:0; border-radius:9px;
  display:inline-grid; place-items:center; background:transparent; color:var(--muted);
  cursor:pointer; text-decoration:none; transition:background .18s,color .18s;
}
.icon-button:hover, .icon-button.active { background:var(--soft); color:var(--fg); }
.icon-button svg, .mobile-nav svg {
  width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2;
  stroke-linecap:round; stroke-linejoin:round;
}
.inline-form { display:inline-flex; margin:0; }
.notification-badge {
  position:absolute; top:-2px; right:-3px; min-width:17px; height:17px; padding:0 4px;
  display:inline-flex; align-items:center; justify-content:center; border-radius:999px;
  background:#ef4444; color:#fff; font-size:12px; font-weight:800; line-height:1;
}
.theme-moon { display:none; }
.dark .theme-sun { display:none; }
.dark .theme-moon { display:block; }

.app-main { width:100%; max-width:1152px; margin:0 auto; padding:32px 18px 84px; }
.stack { display:grid; gap:16px; }
.grid { display:grid; gap:16px; }
.grid-2 { display:grid; gap:16px; grid-template-columns:repeat(2,minmax(0,1fr)); }

.card, .list-item {
  background:var(--card); border:1px solid var(--border); border-radius:18px;
  box-shadow:0 1px 3px rgba(0,0,0,.04),0 5px 18px rgba(0,0,0,.055),0 16px 44px rgba(0,0,0,.035);
  backdrop-filter:blur(12px);
}
.card { padding:20px; }
.list-item { padding:16px; transition:transform .2s,box-shadow .2s,border-color .2s; }
.list-item:hover {
  transform:translateY(-2px);
  box-shadow:0 2px 5px rgba(0,0,0,.06),0 10px 30px rgba(0,0,0,.09);
  border-color:rgba(245,158,11,.22);
}
.dark .card, .dark .list-item {
  box-shadow:0 1px 3px rgba(0,0,0,.24),0 5px 20px rgba(0,0,0,.2);
}
.list { display:grid; gap:10px; }
.muted { color:var(--muted); font-size:13px; }
.actions { display:flex; gap:8px; flex-wrap:wrap; }

label { display:grid; gap:7px; color:var(--fg); font-size:13px; font-weight:650; }
input, textarea, select {
  width:100%; border:1px solid var(--border); border-radius:12px; padding:10px 12px;
  background:var(--input); color:var(--fg); outline:none; transition:border-color .15s,box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color:rgba(245,158,11,.65); box-shadow:0 0 0 3px rgba(245,158,11,.12);
}
button, .button {
  border:0; border-radius:11px; padding:10px 14px;
  background:linear-gradient(135deg,#f59e0b,#f97316); color:#fff;
  font-weight:700; cursor:pointer; text-decoration:none;
  display:inline-flex; justify-content:center; align-items:center; gap:6px;
  box-shadow:0 2px 8px rgba(245,158,11,.22);
  transition:transform .16s,box-shadow .16s,opacity .16s;
}
button:hover, .button:hover { transform:translateY(-1px); box-shadow:0 4px 14px rgba(245,158,11,.3); }
.button.secondary, button.secondary {
  background:var(--soft); color:var(--fg); box-shadow:none; border:1px solid var(--border);
}
.button.danger, button.danger { background:#b91c1c; box-shadow:none; }
.status {
  border:1px solid rgba(59,130,246,.22); background:rgba(59,130,246,.08);
  border-radius:12px; padding:11px 13px; color:#1d4ed8; font-size:13px;
}
.dark .status { color:#bfdbfe; }
.error { color:#dc2626; font-size:12px; margin-top:3px; }
hr { border:0; border-top:1px solid var(--border); margin:20px 0; }

.guest-shell { min-height:100vh; display:grid; place-items:center; padding:24px; }
.auth-card { width:min(100%,460px); }

.page-eyebrow {
  margin:0 0 5px; color:var(--amber-dark); font-size:12px; font-weight:800;
  letter-spacing:.14em; text-transform:uppercase;
}
.dashboard-hero { margin-bottom:22px; }
.dashboard-subtitle { margin:6px 0 0; color:var(--muted); font-size:14px; }
.dashboard-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.dashboard-card {
  min-height:132px; display:flex; flex-direction:column; justify-content:space-between;
  padding:18px; border-radius:18px; background:var(--card); border:1px solid var(--border);
  box-shadow:0 1px 3px rgba(0,0,0,.04),0 6px 20px rgba(0,0,0,.05);
  text-decoration:none; transition:transform .2s,box-shadow .2s,border-color .2s;
}
.dashboard-card:hover { transform:translateY(-2px); border-color:rgba(245,158,11,.25); box-shadow:0 10px 28px rgba(0,0,0,.08); }
.dashboard-card-icon {
  width:34px; height:34px; border-radius:12px; display:grid; place-items:center;
  background:rgba(245,158,11,.10); color:var(--amber-dark); font-size:16px; font-weight:800;
}
.dashboard-card strong { font-size:18px; letter-spacing:-.02em; }
.dashboard-card span:last-child { color:var(--muted); font-size:12px; }

.site-status-banner { border-bottom:1px solid #f59e0b; background:#fef3c7; color:#78350f; }
.site-status-banner-inner { max-width:1152px; margin:0 auto; padding:9px 18px; display:flex; align-items:flex-start; gap:9px; font-size:13px; font-weight:650; }
.site-status-dismiss { padding:0; width:24px; height:24px; background:transparent; color:inherit; font-size:20px; line-height:1; border-radius:999px; box-shadow:none; }
.site-status-dismiss:hover { background:rgba(120,53,15,.10); transform:none; box-shadow:none; }
.dark .site-status-banner { border-color:#92400e; background:#451a03; color:#fde68a; }

.mobile-nav { display:none; }

@media (max-width: 820px) {
  .desktop-nav { display:none; }
  .dashboard-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 639px) {
  body { background-attachment:scroll; }
  .topbar { padding:0 12px; }
  .brand > span:last-child { display:none; }
  .app-main { padding:20px 12px calc(92px + env(safe-area-inset-bottom)); }
  .grid-2 { grid-template-columns:1fr; }
  .card { padding:16px; border-radius:16px; }
  .list-item { border-radius:16px; }
  .list-item:hover { transform:none; }
  input, select, textarea { font-size:16px; }
  button, .button { min-height:44px; }
  .dashboard-grid { gap:9px; }
  .dashboard-card { min-height:116px; padding:14px; }
  .mobile-nav {
    position:fixed; inset-inline:0; bottom:0; z-index:50;
    display:grid; grid-template-columns:repeat(5,1fr);
    padding:6px 8px max(6px,env(safe-area-inset-bottom));
    border-top:1px solid var(--border); background:rgba(255,255,255,.95);
    box-shadow:0 -8px 30px rgba(0,0,0,.08); backdrop-filter:blur(20px);
  }
  .dark .mobile-nav { background:rgba(28,28,30,.96); }
  .mobile-nav-item {
    min-height:54px; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:3px; border-radius:12px; color:var(--muted); text-decoration:none; font-size:12px; font-weight:700;
  }
  .mobile-nav-item svg { width:20px; height:20px; }
  .mobile-nav-item.active { color:var(--amber-dark); }
}


/* Legacy-parity collection and want-list surfaces */
.library-page { gap: 20px; }
.library-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; }
.add-card-disclosure { position:relative; flex:0 0 auto; }
.add-card-disclosure > summary { list-style:none; }
.add-card-disclosure > summary::-webkit-details-marker { display:none; }
.add-card-button { border-radius:999px; padding:10px 18px; }
.add-card-panel {
  position:absolute; right:0; top:calc(100% + 10px); z-index:30; width:min(680px,calc(100vw - 28px));
  max-height:75vh; overflow:auto; padding:16px; border:1px solid var(--border); border-radius:18px;
  background:var(--card); box-shadow:0 20px 60px rgba(0,0,0,.18); backdrop-filter:blur(20px);
}
.add-card-tabs { display:grid; gap:10px; }
.add-card-tabs > details { border:1px solid var(--border); border-radius:14px; overflow:hidden; background:var(--input); }
.add-card-tabs > details > summary { cursor:pointer; padding:12px 14px; font-size:13px; font-weight:750; }
.add-card-tab-body { display:grid; gap:14px; padding:14px; border-top:1px solid var(--border); }
.provider-result-list { display:grid; gap:8px; }
.provider-result { display:flex; align-items:center; gap:12px; padding:10px; border:1px solid var(--border); border-radius:12px; background:var(--card); }
.provider-result img { width:38px; height:53px; object-fit:contain; }
.provider-result-copy { flex:1; min-width:0; display:grid; gap:2px; }
.provider-result-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.provider-result-copy span { color:var(--muted); font-size:12px; }

.glass-card-static {
  background:var(--card); border:1px solid var(--border); border-radius:18px;
  box-shadow:0 1px 3px rgba(0,0,0,.04),0 5px 18px rgba(0,0,0,.05);
  backdrop-filter:blur(12px);
}
.library-toolbar { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:13px 16px; }
.toolbar-label { margin:0; color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.12em; }
.toolbar-copy { margin:3px 0 0; font-size:14px; font-weight:700; }
.library-search { min-width:240px; display:grid; grid-template-columns:auto minmax(160px,260px); align-items:center; gap:10px; }
.library-search > span { color:var(--muted); font-size:12px; }
.library-search input { height:38px; padding:8px 11px; }

.empty-state { display:grid; justify-items:center; gap:7px; padding:64px 20px; text-align:center; }
.empty-state-icon { width:64px; height:64px; display:grid; place-items:center; border-radius:18px; background:rgba(245,158,11,.09); font-size:30px; }
.empty-state p { max-width:460px; margin:0; color:var(--muted); font-size:14px; }

.set-groups { display:grid; gap:30px; }
.set-section { display:grid; gap:12px; }
.set-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; padding:0 4px; }
.set-heading h2 { margin:0; font-size:20px; }
.set-heading p { margin:3px 0 0; color:var(--muted); font-size:12px; }
.set-metrics { display:grid; grid-template-columns:repeat(2,minmax(100px,1fr)); gap:18px; text-align:right; }
.set-metrics div { display:grid; gap:1px; }
.set-metrics span { color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; }
.set-metrics strong { font-size:16px; }
.set-metrics small { color:var(--muted); font-size:12px; }

.library-card-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.collection-card {
  overflow:hidden; border:1px solid var(--border); border-radius:18px; background:var(--card);
  box-shadow:0 1px 3px rgba(0,0,0,.04),0 5px 18px rgba(0,0,0,.05);
  transition:transform .2s,box-shadow .2s,border-color .2s;
}
.collection-card:hover { transform:translateY(-2px); border-color:rgba(245,158,11,.24); box-shadow:0 10px 30px rgba(0,0,0,.09); }
.collection-card-main { display:flex; align-items:flex-start; gap:14px; padding:15px; }
.collection-card-image {
  width:58px; height:82px; flex:0 0 auto; display:grid; place-items:center;
  border-radius:9px; overflow:hidden; background:linear-gradient(135deg,rgba(245,158,11,.08),rgba(249,115,22,.06));
  text-decoration:none; box-shadow:0 3px 10px rgba(0,0,0,.08);
}
.collection-card-image img { width:100%; height:100%; object-fit:contain; }
.collection-card-image span { font-size:28px; }
.collection-card-copy { min-width:0; flex:1; }
.collection-card-title { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--fg); font-size:14px; font-weight:750; text-decoration:none; }
.collection-card-title:hover { color:var(--amber-dark); }
.collection-card-number { margin:2px 0 0; color:var(--muted); font-size:12px; }
.price-lines { display:grid; gap:5px; margin-top:12px; }
.price-lines > div { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.price-lines span { color:var(--muted); font-size:12px; font-weight:600; }
.price-lines strong { max-width:145px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; text-align:right; font-variant-numeric:tabular-nums; }
.collection-card-footer {
  min-height:42px; padding:7px 10px 7px 14px; display:flex; align-items:center; justify-content:space-between; gap:8px;
  border-top:1px solid var(--border); background:rgba(0,0,0,.012);
}
.dark .collection-card-footer { background:rgba(255,255,255,.018); }
.alert-pill { padding:3px 8px; border-radius:999px; color:var(--amber-dark); background:rgba(245,158,11,.09); font-size:12px; font-weight:700; }
.card-actions-compact { display:flex; align-items:center; gap:2px; }
.card-actions-compact a, .compact-button {
  width:32px; height:32px; min-height:0; padding:0; border:0; border-radius:9px;
  display:grid; place-items:center; background:transparent; color:var(--muted); text-decoration:none;
  box-shadow:none; font-size:17px; font-weight:500;
}
.card-actions-compact a:hover, .compact-button:hover { transform:none; box-shadow:none; background:var(--soft); color:var(--fg); }
.danger-icon:hover { color:#dc2626; }
.pagination-wrap { overflow-x:auto; padding-top:4px; }

@media (max-width: 900px) {
  .library-card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 639px) {
  .library-heading { align-items:flex-start; }
  .library-heading > div:first-child { min-width:0; }
  .add-card-button { min-height:40px; padding:9px 13px; font-size:12px; white-space:nowrap; }
  .add-card-panel { position:fixed; left:12px; right:12px; top:72px; width:auto; max-height:calc(100dvh - 160px); }
  .library-toolbar { align-items:stretch; flex-direction:column; gap:10px; }
  .library-search { min-width:0; grid-template-columns:1fr; gap:5px; }
  .set-heading { align-items:flex-start; flex-direction:column; }
  .set-metrics { width:100%; text-align:left; }
  .library-card-grid { grid-template-columns:1fr; gap:10px; }
  .collection-card-main { padding:13px; }
}


/* Legacy parity: card/list controls, totals, and collection metrics */
.view-control { display:flex; align-items:center; gap:10px; }
.view-control > span { color:var(--muted); font-size:12px; font-weight:700; }
.segmented-control { display:flex; gap:2px; padding:4px; border:1px solid var(--border); border-radius:12px; background:var(--input); }
.view-mode-button {
  min-height:0; padding:7px 11px; border-radius:8px; background:transparent; color:var(--muted);
  box-shadow:none; font-size:12px; font-weight:750;
}
.view-mode-button:hover { transform:none; box-shadow:none; background:var(--soft); }
.view-mode-button.active { background:var(--fg); color:var(--bg); }

.value-summary {
  display:flex; align-items:center; justify-content:space-between; gap:24px; padding:16px 18px;
}
.value-summary-copy { min-width:210px; display:grid; gap:4px; }
.value-summary-copy > span { color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.11em; }
.value-summary-copy > strong { font-size:14px; }
.value-summary-copy > small { max-width:420px; color:var(--muted); font-size:12px; line-height:1.4; }
.value-summary-metrics, .set-metrics {
  display:grid; grid-template-columns:repeat(2,minmax(110px,1fr)); gap:20px; text-align:right;
}
.value-summary-metrics.collection-metrics, .set-metrics.collection-metrics {
  grid-template-columns:repeat(4,minmax(110px,1fr));
}
.value-summary-metrics > div, .set-metrics > div { display:grid; gap:2px; }
.value-summary-metrics span, .set-metrics span {
  color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.1em;
}
.value-summary-metrics strong { font-size:18px; font-variant-numeric:tabular-nums; }
.value-summary-metrics small, .set-metrics small { color:var(--muted); font-size:12px; }
.set-metrics strong { font-size:15px; font-variant-numeric:tabular-nums; }

.list-view {
  overflow:hidden; border:1px solid var(--border); border-radius:18px; background:var(--card);
}
.legacy-list-row {
  display:grid;
  grid-template-columns:minmax(220px,1fr) 110px 110px 110px auto;
  align-items:center; gap:16px; min-height:72px; padding:10px 14px; border-bottom:1px solid var(--border);
}
.legacy-list-row:last-child { border-bottom:0; }
[data-location="COLLECTION"] .legacy-list-row {
  grid-template-columns:minmax(220px,1fr) 185px 88px 88px 110px 130px 95px auto;
}
.legacy-list-identity { min-width:0; display:flex; align-items:center; gap:11px; }
.legacy-list-image {
  width:40px; height:56px; flex:0 0 auto; display:grid; place-items:center; overflow:hidden;
  background:var(--soft); text-decoration:none; box-shadow:0 2px 6px rgba(0,0,0,.08);
}
.legacy-list-image img { width:100%; height:100%; object-fit:contain; }
.legacy-list-identity > div { min-width:0; display:grid; gap:3px; }
.legacy-list-identity a { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:750; text-decoration:none; }
.legacy-list-identity small { color:var(--muted); font-size:12px; }
.legacy-list-metric { min-width:0; display:grid; gap:2px; text-align:right; }
.legacy-list-metric span { color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.legacy-list-metric strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-variant-numeric:tabular-nums; }
.legacy-list-metric .muted-value { color:var(--muted); font-weight:600; }

@media (max-width:1050px) {
  .value-summary { align-items:stretch; flex-direction:column; }
  .value-summary-metrics { width:100%; text-align:left; }
  .value-summary-metrics.collection-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .set-heading { align-items:stretch; flex-direction:column; }
  .set-metrics { width:100%; text-align:left; }
  .set-metrics.collection-metrics { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .list-view { overflow-x:auto; }
  .legacy-list-row { min-width:760px; }
  [data-location="COLLECTION"] .legacy-list-row { min-width:1120px; }
}
@media (max-width:639px) {
  .library-toolbar { align-items:stretch; flex-direction:column; }
  .view-control { justify-content:space-between; }
  .value-summary-metrics.collection-metrics, .set-metrics.collection-metrics {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .legacy-list-row, [data-location="COLLECTION"] .legacy-list-row {
    min-width:0; grid-template-columns:1fr; gap:8px; padding:12px;
  }
  .legacy-list-metric {
    grid-template-columns:1fr auto; align-items:center; text-align:left;
    padding:5px 8px; border-radius:9px; background:var(--soft);
  }
  .legacy-list-row .card-actions-compact { justify-content:flex-end; }
}


/* Respect JS view toggles even when component classes set display */
[hidden] {
  display: none !important;
}


/* Collection quick-find / sorting / collapsed sets */
.library-quick-controls {
  display:flex;
  align-items:end;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
.quick-filter-control,
.sort-control {
  display:grid;
  gap:5px;
}
.quick-filter-control > span,
.sort-control > span {
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.quick-filter-control input {
  width:min(300px, 42vw);
  height:38px;
}
.sort-control select {
  min-width:190px;
  height:38px;
}
.set-visibility-controls {
  display:flex;
  gap:6px;
  align-items:end;
}
.compact-control {
  min-height:38px;
  padding:8px 11px;
  font-size:12px;
}
.set-title-block {
  display:flex;
  align-items:flex-start;
  gap:8px;
}
.set-collapse-button {
  width:30px;
  height:30px;
  min-height:0;
  padding:0;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--input);
  color:var(--muted);
  box-shadow:none;
  font-size:18px;
  line-height:1;
}
.set-collapse-button:hover {
  transform:none;
  box-shadow:none;
  background:var(--soft);
  color:var(--fg);
}
@media (max-width: 820px) {
  .library-toolbar {
    align-items:stretch;
    flex-direction:column;
  }
  .library-quick-controls {
    justify-content:flex-start;
    align-items:stretch;
  }
  .quick-filter-control,
  .sort-control {
    flex:1 1 220px;
  }
  .quick-filter-control input,
  .sort-control select {
    width:100%;
    min-width:0;
  }
}
@media (max-width: 639px) {
  .library-quick-controls {
    display:grid;
    grid-template-columns:1fr;
  }
  .set-visibility-controls {
    display:grid;
    grid-template-columns:1fr 1fr;
  }
}


/* Legacy-style Add Card modal */
.library-heading-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
.add-card-button {
  border-radius:999px;
  padding:10px 18px;
  white-space:nowrap;
}
.add-card-plus {
  font-size:18px;
  line-height:1;
  margin-right:2px;
}
.checklist-shortcut {
  border-radius:999px;
  padding:10px 18px;
  white-space:nowrap;
}
.modal-open { overflow:hidden; }
.add-card-modal {
  position:fixed;
  inset:0;
  z-index:100;
  display:grid;
  place-items:center;
  padding:8px;
}
.add-card-backdrop {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  min-height:0;
  border:0;
  border-radius:0;
  padding:0;
  background:rgba(0,0,0,.52);
  box-shadow:none;
  backdrop-filter:blur(7px);
}
.add-card-backdrop:hover {
  transform:none;
  box-shadow:none;
  background:rgba(0,0,0,.56);
}
.add-card-dialog {
  position:relative;
  z-index:1;
  width:min(512px,calc(100vw - 16px));
  max-height:calc(100dvh - 16px);
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:24px;
  background:var(--input);
  box-shadow:0 30px 80px rgba(0,0,0,.32);
  display:flex;
  flex-direction:column;
}
.add-card-dialog-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:22px 24px 17px;
  border-bottom:1px solid var(--border);
}
.add-card-dialog-header h2 {
  margin:0;
  font-size:20px;
  letter-spacing:-.03em;
}
.add-card-close {
  width:34px;
  height:34px;
  min-height:0;
  padding:0;
  border-radius:10px;
  background:transparent;
  color:var(--muted);
  box-shadow:none;
  font-size:24px;
  font-weight:400;
}
.add-card-close:hover {
  transform:none;
  box-shadow:none;
  background:var(--soft);
  color:var(--fg);
}
.add-card-dialog-body {
  overflow-y:auto;
  padding:18px 24px 22px;
}
.add-card-tab-list {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:3px;
  padding:4px;
  margin-bottom:14px;
  border-radius:12px;
  background:var(--soft);
}
.add-card-tab {
  min-height:34px;
  padding:7px 10px;
  border-radius:9px;
  background:transparent;
  color:var(--muted);
  box-shadow:none;
  font-size:12px;
  font-weight:750;
}
.add-card-tab:hover {
  transform:none;
  box-shadow:none;
  background:rgba(255,255,255,.35);
}
.dark .add-card-tab:hover { background:rgba(255,255,255,.06); }
.add-card-tab.active {
  background:var(--input);
  color:var(--fg);
  box-shadow:0 1px 4px rgba(0,0,0,.08);
}
.add-card-tab-panel {
  display:grid;
  gap:14px;
}
.add-card-help {
  margin:0;
  color:var(--muted);
  font-size:12px;
}
.add-card-inline-input {
  display:grid;
  grid-template-columns:minmax(0,1fr) 42px;
  gap:8px;
}
.add-card-search-button {
  width:42px;
  height:42px;
  min-height:0;
  padding:0;
  border-radius:11px;
  background:var(--fg);
  color:var(--bg);
  box-shadow:none;
  font-size:18px;
}
.add-card-search-button:hover {
  transform:none;
  box-shadow:none;
  opacity:.92;
}
.add-card-results {
  max-height:320px;
  overflow-y:auto;
}
.add-card-dialog-footer {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding-top:4px;
}
@media (max-width:639px) {
  .library-heading {
    gap:12px;
  }
  .library-heading-actions {
    width:100%;
    justify-content:stretch;
  }
  .library-heading-actions .button {
    flex:1 1 auto;
  }
  .add-card-modal {
    padding:4px;
    align-items:end;
  }
  .add-card-dialog {
    width:100%;
    max-height:calc(100dvh - 4px);
    border-radius:22px 22px 0 0;
  }
  .add-card-dialog-header {
    padding:18px 18px 14px;
  }
  .add-card-dialog-body {
    padding:14px 18px 18px;
  }
  .add-card-dialog-footer {
    flex-direction:column-reverse;
  }
  .add-card-dialog-footer > button {
    width:100%;
  }
}


/* Add Card image identification */
.add-card-tab-list {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.image-drop-button {
  width:100%;
  min-height:150px;
  padding:24px 18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  border:2px dashed var(--border);
  border-radius:18px;
  background:var(--soft);
  color:var(--fg);
  box-shadow:none;
}
.image-drop-button:hover {
  transform:none;
  border-color:rgba(245,158,11,.45);
  background:rgba(245,158,11,.06);
  box-shadow:none;
}
.image-drop-icon {
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  margin-bottom:4px;
  border-radius:13px;
  background:rgba(245,158,11,.12);
  color:var(--amber-dark);
  font-size:22px;
}
.image-drop-button strong {
  font-size:14px;
}
.image-drop-button small {
  color:var(--muted);
  font-size:12px;
  font-weight:500;
}
.image-identify-status {
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--soft);
  font-size:12px;
}
.image-identify-results {
  display:grid;
  gap:12px;
}
.image-result-group {
  display:grid;
  gap:8px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--card);
}
.image-result-heading {
  display:grid;
  gap:2px;
}
.image-result-heading strong {
  font-size:13px;
}
.image-result-heading small,
.image-result-message {
  color:var(--muted);
  font-size:12px;
}
.image-result-message {
  margin:0;
}
.image-candidate {
  background:var(--input);
}
@media (max-width:639px) {
  .image-drop-button {
    min-height:132px;
    padding:20px 14px;
  }
}


/* Legacy Add Card result picker */
.provider-picker-row {
  width:100%;
  min-height:62px;
  padding:9px 11px;
  display:flex;
  align-items:center;
  gap:11px;
  border:0;
  border-bottom:1px solid var(--border);
  border-radius:0;
  background:var(--input);
  color:var(--fg);
  box-shadow:none;
  text-align:left;
}
.provider-picker-row:first-child { border-radius:12px 12px 0 0; }
.provider-picker-row:last-child { border-bottom:0; border-radius:0 0 12px 12px; }
.provider-picker-row:only-child { border-radius:12px; }
.provider-picker-row:hover {
  transform:none;
  box-shadow:none;
  background:var(--soft);
}
.provider-picker-row.selected {
  background:rgba(245,158,11,.09);
}
.provider-picker-row img {
  width:34px;
  height:48px;
  object-fit:contain;
  flex:0 0 auto;
  border-radius:5px;
  box-shadow:0 2px 6px rgba(0,0,0,.10);
}
.provider-picker-row .provider-result-copy {
  flex:1;
  min-width:0;
  display:grid;
  gap:2px;
}
.provider-picker-row .provider-result-copy strong {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
}
.provider-picker-row .provider-result-copy span {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:12px;
}
.provider-price {
  flex:0 0 auto;
  display:grid;
  justify-items:end;
  gap:1px;
}
.provider-price strong {
  font-size:12px;
  font-variant-numeric:tabular-nums;
}
.provider-price small {
  color:var(--muted);
  font-size:12px;
}
.provider-price .selected-label {
  color:var(--amber-dark);
  font-weight:800;
}
.provider-price .no-price {
  padding:2px 6px;
  border:1px solid rgba(245,158,11,.25);
  border-radius:999px;
  background:rgba(245,158,11,.08);
  color:var(--amber-dark);
  font-weight:700;
}
.selected-provider-card {
  display:flex;
  align-items:center;
  gap:13px;
  margin-top:14px;
  padding:13px;
  border:1px solid rgba(245,158,11,.20);
  border-radius:16px;
  background:rgba(245,158,11,.07);
}
.selected-provider-card > img {
  width:48px;
  height:64px;
  object-fit:contain;
  flex:0 0 auto;
  border-radius:7px;
  box-shadow:0 3px 10px rgba(0,0,0,.12);
}
.selected-provider-copy {
  flex:1;
  min-width:0;
  display:grid;
  gap:2px;
}
.selected-provider-copy strong {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:14px;
}
.selected-provider-copy span,
.selected-provider-copy small {
  color:var(--muted);
  font-size:12px;
}
.selected-clear {
  flex:0 0 auto;
  min-height:32px;
  padding:6px 9px;
  font-size:12px;
}
.selection-warning {
  margin-top:14px;
  padding:10px 12px;
  border:1px solid rgba(245,158,11,.24);
  border-radius:12px;
  background:rgba(245,158,11,.08);
  color:var(--amber-dark);
  font-size:12px;
}
.modal-notes {
  margin-top:14px;
}
.add-card-dialog-footer {
  margin-top:14px;
}


/* Searchable TCGdex set picker */
.set-combobox {
  position:relative;
}
.set-combobox-trigger {
  width:100%;
  min-height:42px;
  padding:8px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid var(--border);
  border-radius:11px;
  background:var(--input);
  color:var(--fg);
  box-shadow:none;
  text-align:left;
}
.set-combobox-trigger:hover {
  transform:none;
  box-shadow:none;
  background:var(--soft);
}
.set-combobox-trigger-main {
  min-width:0;
  display:flex;
  align-items:center;
  gap:9px;
}
.set-combobox-trigger-main > span:last-child {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  font-weight:650;
}
.set-combobox-icon-wrap {
  width:28px;
  height:28px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:var(--soft);
  overflow:hidden;
}
.set-combobox-icon-wrap img {
  max-width:22px;
  max-height:22px;
  object-fit:contain;
}
.set-combobox-chevron {
  color:var(--muted);
  font-size:15px;
}
.set-combobox-menu {
  position:absolute;
  z-index:140;
  left:0;
  right:0;
  top:calc(100% + 6px);
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--input);
  box-shadow:0 16px 40px rgba(0,0,0,.18);
}
.set-combobox-search-wrap {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:7px;
  padding:8px;
  border-bottom:1px solid var(--border);
}
.set-combobox-search-wrap > span {
  padding-left:3px;
  color:var(--muted);
  font-size:14px;
}
.set-combobox-search-wrap input {
  min-height:36px;
  border:0;
  background:transparent;
  box-shadow:none;
}
.set-combobox-search-wrap input:focus {
  outline:none;
  box-shadow:none;
}
.set-combobox-options {
  max-height:270px;
  overflow-y:auto;
}
.set-combobox-option {
  width:100%;
  min-height:48px;
  padding:7px 10px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  border:0;
  border-bottom:1px solid var(--border);
  border-radius:0;
  background:transparent;
  color:var(--fg);
  box-shadow:none;
  text-align:left;
}
.set-combobox-option:last-child {
  border-bottom:0;
}
.set-combobox-option:hover,
.set-combobox-option.selected {
  transform:none;
  box-shadow:none;
  background:var(--soft);
}
.set-combobox-option.selected {
  background:rgba(245,158,11,.09);
}
.set-combobox-option-copy {
  min-width:0;
  display:grid;
  gap:1px;
}
.set-combobox-option-copy strong {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
}
.set-combobox-option-copy small {
  color:var(--muted);
  font-size:12px;
}
.set-combobox-empty {
  margin:0;
  padding:12px;
  color:var(--muted);
  font-size:12px;
  text-align:center;
}

.set-combobox-option .set-combobox-icon-wrap {
  margin-left:0;
  margin-right:0;
}
.set-combobox-option-copy {
  justify-items:start;
  text-align:left;
}


/* In-app confirmation dialog (replaces browser confirm/alert UI) */
.app-confirm-modal {
  position:fixed;
  inset:0;
  z-index:300;
  display:grid;
  place-items:center;
  padding:16px;
}
.app-confirm-backdrop {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  min-height:0;
  padding:0;
  border:0;
  border-radius:0;
  background:rgba(0,0,0,.50);
  box-shadow:none;
  backdrop-filter:blur(6px);
}
.app-confirm-backdrop:hover {
  transform:none;
  background:rgba(0,0,0,.54);
  box-shadow:none;
}
.app-confirm-dialog {
  position:relative;
  z-index:1;
  width:min(420px,calc(100vw - 32px));
  padding:22px;
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:14px;
  border:1px solid var(--border);
  border-radius:20px;
  background:var(--input);
  box-shadow:0 28px 70px rgba(0,0,0,.30);
}
.app-confirm-icon {
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:rgba(220,38,38,.10);
  color:#dc2626;
  font-weight:900;
  font-size:20px;
}
.app-confirm-copy {
  min-width:0;
}
.app-confirm-copy h2 {
  margin:0 0 5px;
  font-size:17px;
  letter-spacing:-.02em;
}
.app-confirm-copy p {
  margin:0;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}
.app-confirm-actions {
  grid-column:1 / -1;
  display:flex;
  justify-content:flex-end;
  gap:8px;
  padding-top:4px;
}
@media (max-width:639px) {
  .app-confirm-dialog {
    grid-template-columns:36px minmax(0,1fr);
    padding:18px;
    border-radius:18px;
  }
  .app-confirm-icon {
    width:36px;
    height:36px;
    border-radius:11px;
    font-size:17px;
  }
  .app-confirm-actions {
    display:grid;
    grid-template-columns:1fr 1fr;
  }
}

/* Global fixed toast notifications */
.app-toast-region {
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:2000;
  width:min(380px,calc(100vw - 36px));
  display:grid;
  gap:9px;
  pointer-events:none;
}
.app-toast {
  display:grid;
  grid-template-columns:28px minmax(0,1fr) 28px;
  align-items:center;
  gap:9px;
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.96);
  color:var(--fg);
  box-shadow:0 14px 40px rgba(0,0,0,.16);
  backdrop-filter:blur(16px);
  opacity:0;
  transform:translateY(8px);
  transition:opacity .18s ease,transform .18s ease;
  pointer-events:auto;
}
.dark .app-toast {
  background:rgba(28,28,30,.96);
}
.app-toast.visible {
  opacity:1;
  transform:translateY(0);
}
.app-toast.leaving {
  opacity:0;
  transform:translateY(8px);
}
.app-toast-icon {
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:9px;
  font-size:13px;
  font-weight:900;
}
.app-toast-success .app-toast-icon {
  background:rgba(16,185,129,.12);
  color:#059669;
}
.app-toast-error .app-toast-icon {
  background:rgba(220,38,38,.10);
  color:#dc2626;
}
.app-toast-warning .app-toast-icon {
  background:rgba(245,158,11,.12);
  color:#b45309;
}
.app-toast-info .app-toast-icon {
  background:rgba(59,130,246,.10);
  color:#2563eb;
}
.app-toast-message {
  font-size:12px;
  line-height:1.4;
  font-weight:650;
}
.app-toast-close {
  width:28px;
  height:28px;
  min-height:0;
  padding:0;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--muted);
  box-shadow:none;
  font-size:18px;
}
.app-toast-close:hover {
  transform:none;
  background:var(--soft);
  box-shadow:none;
}
@media (max-width:639px) {
  .app-toast-region {
    right:12px;
    left:12px;
    bottom:calc(76px + env(safe-area-inset-bottom));
    width:auto;
    gap:6px;
  }

  .app-toast {
    grid-template-columns:24px minmax(0,1fr) 28px;
    gap:7px;
    padding:8px 10px;
    border-radius:12px;
    pointer-events:none;
  }

  .app-toast-icon {
    width:24px;
    height:24px;
    border-radius:8px;
    font-size:12px;
  }

  .app-toast-close {
    pointer-events:auto;
  }
}


/* Shared administration navigation */
.admin-nav {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:6px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
}

.admin-nav a {
  min-height:34px;
  padding:7px 11px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  color:var(--muted);
  font-size:12px;
  font-weight:750;
  text-decoration:none;
}

.admin-nav a:hover {
  background:var(--soft);
  color:var(--fg);
}

.admin-nav a.active {
  background:var(--fg);
  color:var(--card);
}


/* Admin provider usage diagnostics */
.admin-usage-table-wrap {
  overflow-x:auto;
}

.admin-usage-table {
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

.admin-usage-table th,
.admin-usage-table td {
  padding:8px;
  border-top:1px solid var(--border);
  text-align:left;
  vertical-align:top;
}

.admin-usage-table thead th {
  border-top:0;
  color:var(--muted);
  font-weight:750;
}

.admin-usage-table .numeric {
  text-align:right;
  font-variant-numeric:tabular-nums;
}

.admin-json-output {
  max-height:360px;
  margin-top:8px;
  padding:12px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--soft);
  font-size:12px;
  line-height:1.45;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}


/* Admin log viewer */
.admin-log-table-wrap {
  max-height:min(62vh,560px);
  overflow:auto;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--input);
}

.admin-log-table {
  width:100%;
  min-width:980px;
  border-collapse:separate;
  border-spacing:0;
  font-size:12px;
}

.admin-log-table-audit {
  width:1540px;
  min-width:1540px;
  table-layout:fixed;
}

.admin-log-table-audit .admin-log-col-time {
  width:170px;
}

.admin-log-table-audit .admin-log-col-action {
  width:220px;
}

.admin-log-table-audit .admin-log-col-user {
  width:210px;
}

.admin-log-table-audit .admin-log-col-request {
  width:260px;
}

.admin-log-table-audit .admin-log-col-status {
  width:90px;
}

.admin-log-table-audit .admin-log-col-metadata {
  width:360px;
}

.admin-log-table-audit .admin-log-col-request-id {
  width:230px;
}

.admin-log-table th,
.admin-log-table td {
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:middle;
}

.admin-log-table th {
  position:sticky;
  top:0;
  z-index:2;
  background:var(--input);
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.admin-log-table tbody tr:last-child td {
  border-bottom:0;
}

.admin-log-table tbody tr:hover td {
  background:var(--soft);
}

.admin-log-nowrap {
  white-space:nowrap;
}

.admin-log-code-cell {
  max-width:360px;
}

.admin-log-code-cell code {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.admin-log-metadata-cell {
  white-space:normal;
  overflow-wrap:anywhere;
}

.admin-log-details {
  position:relative;
}

.admin-log-details summary {
  color:var(--amber-dark);
  cursor:pointer;
  font-weight:750;
  list-style:none;
}

.admin-log-details summary::-webkit-details-marker {
  display:none;
}

.admin-log-details[open] {
  min-width:280px;
}

.admin-log-details pre,
.admin-log-detail-text {
  max-width:460px;
  max-height:180px;
  margin:8px 0 0;
  padding:10px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--soft);
  color:var(--fg);
  font-size:12px;
  line-height:1.4;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.admin-log-pagination {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-top:4px;
}

.admin-log-pagination-controls {
  display:flex;
  align-items:center;
  gap:8px;
}

.admin-log-page-indicator {
  min-width:90px;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  text-align:center;
}

.admin-log-pagination button:disabled {
  opacity:.45;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

@media (max-width:639px) {
  .admin-log-table-wrap {
    max-height:58vh;
  }

  .admin-log-pagination {
    align-items:stretch;
    flex-direction:column;
  }

  .admin-log-pagination-controls {
    display:grid;
    grid-template-columns:1fr auto 1fr;
  }
}


/* System announcements */
.admin-page-heading {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
}

.admin-page-heading h1 {
  margin-top:0;
}

.announcement-summary {
  display:flex;
  align-items:center;
  gap:8px;
}

.announcement-summary > div {
  min-width:96px;
  padding:9px 12px;
  display:grid;
  gap:2px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--card);
  text-align:right;
}

.announcement-summary span {
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.announcement-summary strong {
  font-size:16px;
  font-variant-numeric:tabular-nums;
}

.announcement-admin-grid {
  display:grid;
  grid-template-columns:minmax(300px, 1.5fr) minmax(0,1.45fr);
  gap:16px;
  align-items:start;
}

.announcement-compose-card {
  position:sticky;
  top:76px;
}

.announcement-email-option {
  padding:12px 13px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:start;
  gap:10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--soft);
  cursor:pointer;
}

.announcement-email-option input {
  width:auto;
  margin-top:2px;
}

.announcement-email-option > span {
  display:grid;
  gap:2px;
}

.announcement-email-option small {
  color:var(--muted);
  font-size:12px;
  font-weight:500;
  line-height:1.4;
}

.announcement-history-card {
  min-width:0;
}

.announcement-history-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.announcement-history-list {
  max-height:680px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--input);
}

.announcement-history-item {
  padding:14px;
  display:grid;
  gap:9px;
  border-bottom:1px solid var(--border);
}

.announcement-history-item:last-child {
  border-bottom:0;
}

.announcement-history-item:hover {
  background:var(--soft);
}

.announcement-history-topline {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.announcement-history-title {
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.announcement-history-title > strong {
  overflow-wrap:anywhere;
  font-size:14px;
}

.announcement-badge {
  padding:3px 7px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--soft);
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.announcement-badge-published {
  border-color:rgba(16,185,129,.20);
  background:rgba(16,185,129,.10);
  color:#047857;
}

.dark .announcement-badge-published {
  color:#6ee7b7;
}

.announcement-date {
  flex:0 0 auto;
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}

.announcement-history-message {
  color:var(--fg);
  font-size:13px;
  line-height:1.5;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.announcement-history-meta {
  display:flex;
  gap:6px 12px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}

.announcement-history-actions {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  padding-top:2px;
}

.announcement-history-actions .compact-control {
  min-height:32px;
  padding:6px 9px;
}

.announcement-empty {
  min-height:180px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:4px;
  text-align:center;
}

@media (max-width:900px) {
  .announcement-admin-grid {
    grid-template-columns:1fr;
  }

  .announcement-compose-card {
    position:static;
  }
}

@media (max-width:639px) {
  .admin-page-heading {
    align-items:stretch;
    flex-direction:column;
  }

  .announcement-summary {
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .announcement-summary > div {
    text-align:left;
  }

  .announcement-history-list {
    max-height:60vh;
  }

  .announcement-history-topline {
    flex-direction:column;
    gap:5px;
  }

  .announcement-date {
    white-space:normal;
  }

  .announcement-history-actions {
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .announcement-history-actions .danger {
    grid-column:1 / -1;
  }
}


/* Checklist visual set tracker */
.checklist-page {
  display:grid;
  gap:18px;
}

.checklist-heading {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
}

.checklist-heading h1 {
  margin:0;
}

.checklist-eyebrow {
  margin:0 0 4px;
  color:#b45309;
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.checklist-intro {
  max-width:720px;
  margin:6px 0 0;
}

.checklist-add-set {
  position:relative;
  z-index:20;
  padding:14px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  gap:12px;
}

.checklist-add-set label {
  display:grid;
  gap:6px;
}

.checklist-add-set label > span {
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.checklist-add-set select {
  min-height:42px;
}

.checklist-provider-error {
  margin:-8px 0 0;
}

.checklist-empty {
  min-height:280px;
  padding:36px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:8px;
  text-align:center;
}

.checklist-empty-icon {
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  border-radius:16px;
  background:rgba(245,158,11,.10);
  color:#b45309;
  font-size:24px;
  font-weight:900;
}

.checklist-empty p {
  max-width:460px;
  margin:0;
  color:var(--muted);
  font-size:13px;
}

.checklist-summary {
  position:relative;
  z-index:1;
  padding:14px 16px;
  display:grid;
  grid-template-columns:minmax(220px,320px) minmax(0,1fr);
  align-items:end;
  gap:18px;
}

.checklist-set-picker {
  display:grid;
  gap:6px;
}

.checklist-set-picker > span {
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.checklist-progress {
  display:grid;
  gap:8px;
}

.checklist-progress-copy {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:13px;
}

.checklist-progress-copy span {
  color:#b45309;
  font-weight:900;
  font-variant-numeric:tabular-nums;
}

.checklist-progress-track {
  height:8px;
  overflow:hidden;
  border-radius:999px;
  background:var(--soft);
}

.checklist-progress-fill {
  width:var(--checklist-progress);
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#f59e0b,#f97316);
  transition:width .2s ease;
}

.checklist-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.checklist-filters {
  display:flex;
  gap:4px;
  padding:4px;
  border-radius:12px;
  background:var(--soft);
}

.checklist-filters button {
  min-height:34px;
  padding:7px 10px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--muted);
  box-shadow:none;
  font-size:12px;
}

.checklist-filters button:hover {
  transform:none;
  background:var(--input);
  box-shadow:none;
  color:var(--fg);
}

.checklist-filters button.active {
  background:var(--card);
  color:var(--fg);
  box-shadow:0 1px 4px rgba(0,0,0,.08);
}

.checklist-search {
  min-width:240px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:8px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--input);
}

.checklist-search > span {
  color:var(--muted);
  font-size:17px;
}

.checklist-search input {
  min-height:38px;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
}

.checklist-search input:focus {
  box-shadow:none;
}

.checklist-no-results {
  padding:42px 20px;
  text-align:center;
}

.checklist-no-results p {
  margin:5px 0 0;
}

.checklist-card-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.checklist-card {
  min-width:0;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
  box-shadow:0 1px 3px rgba(0,0,0,.04),0 5px 18px rgba(0,0,0,.04);
}

.checklist-card-owned {
  border-color:rgba(16,185,129,.42);
}

.checklist-card-want {
  border-color:rgba(245,158,11,.48);
}

.checklist-card-image {
  position:relative;
  width:100%;
  aspect-ratio:2.5 / 3.5;
  min-height:0;
  padding:0;
  display:block;
  overflow:hidden;
  border:0;
  border-radius:0;
  background:var(--soft);
  box-shadow:none;
  color:inherit;
  text-decoration:none;
}

.checklist-card-image:hover {
  transform:none;
  box-shadow:none;
}

.checklist-card-image:disabled {
  cursor:default;
  opacity:1;
}

.checklist-card-image img {
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
}

.checklist-card-image-muted {
  opacity:.66;
  filter:grayscale(.25);
}

.checklist-card-image > span:not(.checklist-status-badge):not(.checklist-card-name) {
  height:100%;
  display:grid;
  place-items:center;
  padding:12px;
  color:var(--muted);
  font-size:12px;
}

.checklist-status-badge {
  position:absolute;
  top:7px;
  right:7px;
  width:25px;
  height:25px;
  display:grid;
  place-items:center;
  border-radius:999px;
  color:#fff;
  font-size:12px;
  font-weight:900;
  box-shadow:0 3px 10px rgba(0,0,0,.20);
}

.checklist-status-owned {
  background:#10b981;
}

.checklist-status-want {
  background:#f59e0b;
}

.checklist-card-name {
  position:absolute;
  left:0;
  right:0;
  top:72%;
  transform:translateY(-50%);
  padding:7px 6px;
  overflow:hidden;
  background:rgba(255,255,255,.94);
  color:#1d1d1f;
  font-size:12px;
  font-weight:800;
  line-height:1.2;
  text-align:center;
  text-overflow:ellipsis;
  white-space:nowrap;
  box-shadow:0 -1px 0 rgba(0,0,0,.08),0 1px 0 rgba(0,0,0,.08);
}

.checklist-card-actions {
  padding:7px;
  display:grid;
  gap:5px;
}

.checklist-card-actions button {
  min-height:31px;
  padding:6px 7px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--input);
  box-shadow:none;
  font-size:12px;
  font-weight:800;
  line-height:1.2;
  text-align:center;
  text-decoration:none;
}

.checklist-card-actions button:hover {
  transform:none;
  box-shadow:none;
  background:var(--soft);
}

.checklist-action-want {
  color:#b45309;
}

.checklist-action-owned {
  color:#047857;
}

.dark .checklist-action-owned {
  color:#6ee7b7;
}


.checklist-preview {
  position:fixed;
  inset:0;
  z-index:2100;
  padding:20px;
  display:grid;
  place-items:center;
  background:rgba(0,0,0,.86);
  backdrop-filter:blur(8px);
}

.checklist-preview-close {
  position:absolute;
  top:16px;
  right:16px;
  width:42px;
  height:42px;
  min-height:0;
  padding:0;
  border:1px solid rgba(255,255,255,.18);
  border-radius:999px;
  background:rgba(255,255,255,.10);
  color:#fff;
  box-shadow:none;
  font-size:26px;
  line-height:1;
}

.checklist-preview-close:hover {
  transform:none;
  background:rgba(255,255,255,.18);
  box-shadow:none;
}

.checklist-preview-content {
  max-width:min(760px,92vw);
  max-height:92vh;
  display:grid;
  justify-items:center;
  gap:10px;
}

.checklist-preview-content img {
  max-width:88vw;
  max-height:78vh;
  object-fit:contain;
  box-shadow:0 20px 60px rgba(0,0,0,.45);
}

.checklist-preview-content p {
  margin:0;
  color:rgba(255,255,255,.92);
  font-size:12px;
  font-weight:700;
  text-align:center;
}

@media (min-width:640px) {
  .checklist-card-grid {
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
  }
}

@media (min-width:900px) {
  .checklist-card-grid {
    grid-template-columns:repeat(5,minmax(0,1fr));
  }
}

@media (min-width:1180px) {
  .checklist-card-grid {
    grid-template-columns:repeat(6,minmax(0,1fr));
  }
}

@media (max-width:760px) {
  .checklist-heading {
    align-items:stretch;
    flex-direction:column;
  }

  .checklist-heading > button {
    align-self:flex-start;
  }

  .checklist-add-set,
  .checklist-summary {
    grid-template-columns:1fr;
  }

  .checklist-toolbar {
    align-items:stretch;
    flex-direction:column;
  }

  .checklist-filters {
    overflow-x:auto;
  }

  .checklist-filters button {
    flex:0 0 auto;
  }

  .checklist-search {
    width:100%;
    min-width:0;
  }
}

@media (max-width:480px) {
  .checklist-card-grid {
    gap:7px;
  }

  .checklist-card {
    border-radius:10px;
  }

  .checklist-card-actions {
    padding:5px;
    gap:4px;
  }

  .checklist-card-actions button {
    min-height:32px;
    padding:6px;
    font-size:12px;
  }

  .checklist-card-name {
    font-size:12px;
  }
}


/* Legacy-parity eBay Favorites page */
.favorites-page {
  display:grid;
  gap:24px;
}

.favorites-heading {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
}

.favorites-title-row {
  min-width:0;
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.favorites-title-row h1 {
  margin:0;
}

.favorites-title-row p {
  max-width:720px;
  margin:7px 0 0;
  color:var(--muted);
  font-size:14px;
}

.favorites-heart {
  flex:0 0 auto;
  margin-top:5px;
  color:#e11d48;
  font-size:22px;
  line-height:1;
}

.favorites-empty {
  min-height:280px;
  padding:36px 20px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:8px;
  text-align:center;
}

.favorites-empty-heart {
  color:#c7c7cc;
  font-size:34px;
  line-height:1;
}

.favorites-empty > strong {
  margin-top:2px;
  font-size:16px;
}

.favorites-empty p {
  max-width:440px;
  margin:0;
  color:var(--muted);
  font-size:13px;
}

.favorites-empty-link {
  margin-top:5px;
  color:#2563eb;
  font-size:13px;
  font-weight:800;
  text-decoration:none;
}

.favorites-empty-link:hover {
  color:#1d4ed8;
}

.favorites-groups {
  display:grid;
  gap:30px;
}

.favorite-group {
  min-width:0;
  display:grid;
  gap:12px;
}

.favorite-group-heading {
  padding:0 4px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
}

.favorite-card-link {
  color:var(--fg);
  font-size:20px;
  font-weight:750;
  letter-spacing:-.02em;
  text-decoration:none;
  transition:color .16s ease;
}

.favorite-card-link:hover {
  color:var(--amber-dark);
}

.favorite-group-heading p {
  margin:3px 0 0;
  color:var(--muted);
  font-size:12px;
}

.favorite-group-actions {
  flex:0 0 auto;
  display:grid;
  justify-items:end;
  gap:4px;
}

.favorite-group-actions > span {
  color:var(--muted);
  font-size:12px;
}

.favorite-status-button {
  min-height:0;
  padding:3px 0;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--muted);
  box-shadow:none;
  font-size:12px;
  font-weight:800;
}

.favorite-status-button:hover {
  transform:none;
  background:transparent;
  color:var(--fg);
  box-shadow:none;
}

.favorite-listing-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.favorite-listing-card {
  min-width:0;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--card);
  box-shadow:0 1px 3px rgba(0,0,0,.04),0 5px 18px rgba(0,0,0,.045);
  backdrop-filter:blur(12px);
}

.favorite-listing-card.is-sold {
  opacity:.80;
}

.favorite-listing-card.is-sold .favorite-listing-title {
  text-decoration:line-through;
}

.favorite-listing-main {
  min-width:0;
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:14px;
}

.favorite-listing-image {
  width:96px;
  height:96px;
  flex:0 0 96px;
  display:block;
  border-radius:12px;
  background:var(--soft);
  object-fit:contain;
}

.favorite-listing-image-empty {
  border:1px solid var(--border);
}

.favorite-listing-copy {
  min-width:0;
  flex:1;
}

.favorite-status-line {
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}

.favorite-status {
  display:inline-flex;
  align-items:center;
  padding:3px 7px;
  border:1px solid transparent;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  line-height:1.2;
}

.favorite-status-active {
  border-color:rgba(16,185,129,.22);
  background:rgba(16,185,129,.08);
  color:#047857;
}

.favorite-status-sold {
  border-color:rgba(239,68,68,.22);
  background:rgba(239,68,68,.08);
  color:#b91c1c;
}

.favorite-status-warning {
  border-color:rgba(245,158,11,.24);
  background:rgba(245,158,11,.09);
  color:#b45309;
}

.favorite-status-muted {
  border-color:var(--border);
  background:var(--soft);
  color:var(--muted);
}

.dark .favorite-status-active {
  color:#6ee7b7;
}

.dark .favorite-status-sold {
  color:#fca5a5;
}

.dark .favorite-status-warning {
  color:#fcd34d;
}

.favorite-listing-title {
  margin-top:7px;
  overflow:hidden;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  color:var(--fg);
  font-size:14px;
  line-height:1.35;
  font-weight:750;
}

.favorite-listing-meta {
  margin-top:8px;
  display:flex;
  align-items:center;
  gap:5px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}

.favorite-condition {
  display:inline-flex;
  align-items:center;
  padding:3px 7px;
  border:1px solid rgba(245,158,11,.26);
  border-radius:999px;
  background:rgba(245,158,11,.08);
  color:#b45309;
  font-size:12px;
  font-weight:800;
}

.dark .favorite-condition {
  color:#fcd34d;
}

.favorite-price {
  display:block;
  margin-top:12px;
  color:var(--fg);
  font-size:18px;
  font-weight:850;
  line-height:1.15;
  font-variant-numeric:tabular-nums;
}

.favorite-saved-meta {
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.favorite-listing-footer {
  min-height:48px;
  padding:10px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border-top:1px solid var(--border);
}

.favorite-remove-button,
.favorite-ebay-link {
  min-height:0;
  padding:3px 0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  font-size:12px;
  font-weight:800;
  text-decoration:none;
}

.favorite-remove-button {
  color:#dc2626;
}

.favorite-remove-button:hover {
  transform:none;
  background:transparent;
  color:#b91c1c;
  box-shadow:none;
}

.favorite-ebay-link {
  color:#2563eb;
}

.favorite-ebay-link:hover {
  color:#1d4ed8;
}

@media (max-width:767px) {
  .favorites-page {
    gap:20px;
  }

  .favorites-heading {
    align-items:flex-start;
  }

  .favorites-groups {
    gap:24px;
  }

  .favorite-group-heading {
    align-items:stretch;
    flex-direction:column;
    gap:8px;
  }

  .favorite-group-actions {
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
  }

  .favorite-status-button {
    min-height:44px;
    padding:8px 10px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--soft);
  }

  .favorite-listing-grid {
    grid-template-columns:1fr;
    gap:12px;
  }

  .favorite-listing-card {
    border-radius:16px;
  }

  .favorite-listing-main {
    gap:12px;
    padding:12px;
  }

  .favorite-listing-image {
    width:80px;
    height:80px;
    flex-basis:80px;
  }

  .favorite-listing-footer {
    padding:9px 12px;
  }

  .favorite-remove-button,
  .favorite-ebay-link {
    min-height:44px;
    padding:8px 4px;
  }
}

@media (max-width:480px) {
  .favorites-heading {
    flex-direction:column;
    gap:8px;
  }

  .favorite-listing-main {
    align-items:flex-start;
  }

  .favorite-listing-title {
    font-size:13px;
  }

  .favorite-price {
    font-size:17px;
  }
}


/* Live admin provider refresh trace */
.admin-refresh-panel {
  overflow:hidden;
}

.admin-refresh-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}

.admin-refresh-heading h2 {
  margin-top:0;
}

.admin-refresh-live-badge {
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 9px;
  border:1px solid rgba(37,99,235,.22);
  border-radius:999px;
  background:rgba(37,99,235,.08);
  color:#2563eb;
  font-size:12px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.admin-refresh-live-badge > span {
  width:7px;
  height:7px;
  border-radius:999px;
  background:#2563eb;
  box-shadow:0 0 0 4px rgba(37,99,235,.10);
}

.admin-refresh-start-actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.admin-refresh-job {
  display:grid;
  gap:14px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--soft);
}

.admin-refresh-job-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}

.admin-refresh-job-header > div:first-child {
  min-width:0;
}

.admin-refresh-job-header > div:first-child > strong {
  font-size:15px;
}

.admin-refresh-job-meta {
  margin-top:4px;
  display:flex;
  gap:5px 12px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}

.admin-refresh-stop {
  flex:0 0 auto;
}

.admin-refresh-progress-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}

.admin-refresh-progress-grid > div {
  min-width:0;
  padding:10px 11px;
  display:grid;
  gap:3px;
  border:1px solid var(--border);
  border-radius:11px;
  background:var(--card);
}

.admin-refresh-progress-grid span {
  color:var(--muted);
  font-size:12px;
  font-weight:750;
}

.admin-refresh-progress-grid strong {
  font-size:16px;
  font-variant-numeric:tabular-nums;
}

.admin-refresh-stop-note {
  padding:9px 11px;
  border:1px solid rgba(245,158,11,.24);
  border-radius:10px;
  background:rgba(245,158,11,.08);
  color:#92400e;
  font-size:12px;
  line-height:1.45;
}

.dark .admin-refresh-stop-note {
  color:#fcd34d;
}

.admin-refresh-trace {
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--input);
}

.admin-refresh-trace-heading {
  padding:12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  border-bottom:1px solid var(--border);
}

.admin-refresh-trace-title {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.admin-refresh-trace-title > strong {
  font-size:14px;
}

.admin-refresh-trace-title > span {
  padding:3px 7px;
  border-radius:999px;
  background:rgba(37,99,235,.10);
  color:#2563eb;
  font-size:12px;
  font-weight:850;
  text-transform:uppercase;
}

.admin-refresh-trace-heading p {
  margin:4px 0 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.4;
}

.admin-refresh-trace-heading code {
  overflow-wrap:anywhere;
  color:var(--fg);
  font-size:12px;
}

.admin-refresh-trace-actions {
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.admin-refresh-trace-actions .compact-control {
  min-height:34px;
  padding:6px 9px;
  font-size:12px;
}

.admin-refresh-trace-counters {
  padding:9px 12px;
  display:flex;
  align-items:center;
  gap:7px 14px;
  flex-wrap:wrap;
  border-bottom:1px solid var(--border);
  background:var(--soft);
  color:var(--muted);
  font-size:12px;
}

.admin-refresh-trace-counters span {
  display:inline-flex;
  align-items:center;
  gap:4px;
}

.admin-refresh-trace-counters strong {
  color:var(--fg);
  font-variant-numeric:tabular-nums;
}

.admin-refresh-trace-list {
  max-height:420px;
  overflow:auto;
}

.admin-refresh-trace-row {
  padding:10px 12px;
  display:grid;
  gap:6px;
  border-bottom:1px solid var(--border);
}

.admin-refresh-trace-row:last-child {
  border-bottom:0;
}

.admin-refresh-trace-row-failure {
  background:rgba(220,38,38,.035);
}

.admin-refresh-trace-row-top {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.admin-refresh-trace-row-top > div {
  min-width:0;
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}

.admin-refresh-trace-row-top > div:last-child {
  flex:0 0 auto;
  justify-content:flex-end;
  color:var(--muted);
  font-size:12px;
}

.admin-refresh-provider {
  padding:3px 6px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--soft);
  color:var(--muted);
  font-size:12px;
  font-weight:850;
}

.admin-refresh-trace-row-top strong {
  font-size:12px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
}

.admin-refresh-trace-url {
  display:block;
  color:var(--fg);
  font-size:12px;
  line-height:1.4;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.admin-refresh-trace-error {
  color:#dc2626;
  font-size:12px;
  line-height:1.4;
  overflow-wrap:anywhere;
}

.admin-refresh-trace-empty,
.admin-refresh-trace-truncated {
  padding:18px 12px;
  color:var(--muted);
  font-size:12px;
  text-align:center;
}

.admin-refresh-trace-truncated {
  padding:8px 12px;
  border-top:1px solid var(--border);
  background:var(--soft);
}

@media (max-width:760px) {
  .admin-refresh-heading,
  .admin-refresh-job-header,
  .admin-refresh-trace-heading {
    flex-direction:column;
  }

  .admin-refresh-live-badge {
    align-self:flex-start;
  }

  .admin-refresh-start-actions {
    grid-template-columns:1fr;
  }

  .admin-refresh-stop {
    width:100%;
  }

  .admin-refresh-progress-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .admin-refresh-trace-actions {
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .admin-refresh-trace-actions .compact-control {
    min-height:44px;
  }

  .admin-refresh-trace-row-top {
    flex-direction:column;
    gap:5px;
  }

  .admin-refresh-trace-row-top > div:last-child {
    width:100%;
    justify-content:flex-start;
  }
}

@media (max-width:420px) {
  .admin-refresh-progress-grid {
    grid-template-columns:1fr;
  }

  .admin-refresh-trace-actions {
    grid-template-columns:1fr;
  }
}


/* Global scroll-to-top control. */
.scroll-top-button {
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:45;
  min-height:42px;
  padding:9px 13px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--card);
  color:var(--fg);
  box-shadow:0 8px 24px rgba(0,0,0,.14);
  backdrop-filter:blur(16px);
  font-size:12px;
  font-weight:750;
}

.scroll-top-button:hover {
  background:var(--input);
  color:var(--fg);
}

.scroll-top-button svg {
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

@media (max-width:639px) {
  .scroll-top-button {
    right:12px;
    bottom:calc(82px + env(safe-area-inset-bottom));
    min-height:44px;
  }
}
