:root {
  --bg: oklch(0.075 0 0);
  --bg-raised: oklch(0.105 0 0);
  --surface: oklch(0.14 0.01 28);
  --surface-2: oklch(0.18 0.012 28);
  --surface-3: oklch(0.22 0.014 28);
  --line: oklch(0.29 0.018 28);
  --line-soft: oklch(0.24 0.014 28);
  --ink: oklch(0.94 0.012 80);
  --ink-soft: oklch(0.82 0.012 72);
  --muted: oklch(0.67 0.016 68);
  --muted-2: oklch(0.52 0.014 50);
  --primary: oklch(0.54 0.17 28);
  --primary-strong: oklch(0.62 0.2 28);
  --accent: oklch(0.9 0.18 96);
  --accent-soft: oklch(0.74 0.14 96);
  --success: oklch(0.77 0.14 148);
  --warning: oklch(0.78 0.15 72);
  --danger: oklch(0.7 0.18 28);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --z-dropdown: 20;
  --z-sticky: 30;
  --z-modal: 50;
  --z-toast: 60;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; background: var(--bg); }

.topbar {
  align-items: center;
  background: oklch(0.12 0.005 28 / 96%);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 28px;
  height: 68px;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(16px);
}

.brand { align-items: center; display: inline-flex; flex: 0 0 auto; gap: 10px; min-width: 182px; }
.brand-mark { align-items: center; background: var(--primary); border: 1px solid var(--primary-strong); border-radius: 9px; color: var(--ink); display: inline-flex; font-size: 19px; font-weight: 900; height: 36px; justify-content: center; letter-spacing: -0.08em; width: 36px; }
.brand-lockup { display: grid; gap: 1px; }
.brand-name { color: var(--ink); font-size: 13px; font-weight: 900; letter-spacing: 0.17em; line-height: 1; }
.brand-product { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 0.25em; line-height: 1; }

.primary-nav { align-items: center; display: flex; gap: 5px; height: 100%; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.primary-nav::-webkit-scrollbar { display: none; }
.nav-link { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.02em; padding: 23px 11px 21px; position: relative; white-space: nowrap; }
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after { background: var(--accent); bottom: -1px; content: ""; height: 3px; left: 11px; position: absolute; right: 11px; }

.topbar-actions { align-items: center; display: flex; flex: 0 0 auto; gap: 14px; }
.icon-button, .quiet-icon-button { align-items: center; background: transparent; border: 0; color: var(--muted); display: inline-flex; justify-content: center; position: relative; }
.icon-button { font-size: 24px; height: 36px; width: 30px; }
.icon-button:hover, .quiet-icon-button:hover { color: var(--ink); }
.notification-dot { background: var(--accent); border: 2px solid var(--surface); border-radius: 50%; height: 7px; position: absolute; right: 1px; top: 5px; width: 7px; }
.account-chip { align-items: center; background: transparent; border: 0; display: flex; gap: 9px; padding: 2px 0; text-align: left; }
.account-avatar { align-items: center; background: var(--surface-3); border: 1px solid var(--line); border-radius: 50%; color: var(--accent); display: inline-flex; font-size: 10px; font-weight: 900; height: 30px; justify-content: center; letter-spacing: 0.03em; width: 30px; }
.account-copy { display: grid; gap: 0; }
.account-copy strong { font-size: 12px; }
.account-copy small, .chevron { color: var(--muted); font-size: 11px; }
.account-chip:hover .account-copy strong { color: var(--accent); }
.account-chip .chevron { font-size: 15px; margin-left: 2px; }

.app-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { background: oklch(0.095 0.003 28); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: calc(100vh - 68px); position: sticky; top: 68px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 20px 14px 24px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.rail-switcher { align-items: center; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-md); display: flex; gap: 10px; margin-bottom: 28px; padding: 11px 12px; }
.rail-icon { align-items: center; background: var(--primary); border-radius: 7px; color: var(--ink); display: inline-flex; font-size: 17px; font-weight: 900; height: 29px; justify-content: center; width: 29px; }
.rail-switcher span:nth-child(2) { display: grid; flex: 1; gap: 1px; }
.rail-switcher strong { font-size: 12px; }
.rail-switcher small { color: var(--muted); font-size: 10px; }
.rail-switcher .chevron { font-size: 17px; }
.rail-group { display: grid; gap: 3px; margin-bottom: 27px; }
.rail-group-last { margin-bottom: 20px; }
.rail-label { color: var(--muted-2); font-size: 10px; font-weight: 900; letter-spacing: 0.14em; margin: 0 10px 7px; text-transform: uppercase; }
.rail-link { align-items: center; background: transparent; border: 0; border-radius: 8px; color: var(--muted); display: flex; gap: 10px; min-height: 37px; padding: 0 10px; text-align: left; width: 100%; }
.rail-link:hover, .rail-link.is-active { background: var(--surface); color: var(--ink); }
.rail-link.is-active { box-shadow: inset 2px 0 0 var(--accent); }
.rail-symbol { color: var(--muted-2); font-size: 15px; line-height: 1; text-align: center; width: 16px; }
.rail-link.is-active .rail-symbol, .rail-link:hover .rail-symbol { color: var(--accent); }
.rail-count { color: var(--muted-2); font-size: 11px; margin-left: auto; }
.status-pip { background: var(--success); border-radius: 50%; box-shadow: 0 0 0 3px oklch(0.77 0.14 148 / 12%); height: 6px; margin-left: auto; width: 6px; }
.sync-mini-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); margin: 34px 2px 0; padding: 14px; }
.sync-mini-topline { align-items: center; color: var(--muted); display: flex; font-size: 10px; font-weight: 800; gap: 7px; letter-spacing: 0.08em; text-transform: uppercase; }
.live-tag { color: var(--success); font-size: 9px; margin-left: auto; }
.signal-dot { background: var(--muted-2); border-radius: 50%; display: inline-block; height: 7px; width: 7px; }
.signal-dot.is-live { background: var(--success); box-shadow: 0 0 0 3px oklch(0.77 0.14 148 / 12%); }
.sync-mini-card > strong { display: block; font-size: 13px; margin-top: 14px; }
.sync-mini-card p { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 4px 0 12px; }
.text-button, .panel-link { background: transparent; border: 0; color: var(--accent); font-size: 11px; font-weight: 800; padding: 0; }
.text-button:hover, .panel-link:hover { color: var(--ink); }
.text-button span, .panel-link span { font-size: 15px; margin-left: 3px; }
.sidebar-footer { border-top: 1px solid var(--line-soft); color: var(--muted-2); display: flex; flex-wrap: wrap; font-size: 10px; gap: 7px; justify-content: space-between; padding: 14px 16px 18px; }
.footer-links { display: flex; gap: 8px; }
.footer-links button { background: transparent; border: 0; color: inherit; padding: 0; }
.footer-links button:hover { color: var(--ink); }

.main-content { min-width: 0; position: relative; }
.main-content::before { background: oklch(0.45 0.14 28 / 5%); border-radius: 50%; content: ""; filter: blur(80px); height: 260px; pointer-events: none; position: absolute; right: 7%; top: 0; width: 260px; }
.content-inner { margin: 0 auto; max-width: 1440px; padding: 56px 48px 72px; position: relative; }
.page-heading { align-items: end; display: flex; gap: 24px; justify-content: space-between; margin-bottom: 34px; }
.page-kicker, .panel-kicker { align-items: center; color: var(--accent-soft); display: flex; font-size: 10px; font-weight: 900; letter-spacing: 0.16em; margin: 0 0 12px; text-transform: uppercase; }
.kicker-dot { background: var(--primary-strong); border-radius: 50%; box-shadow: 0 0 0 4px oklch(0.62 0.2 28 / 12%); height: 6px; margin-right: 8px; width: 6px; }
h1, h2, h3, p { text-wrap: balance; }
h1 { font-size: 3.5rem; letter-spacing: -0.045em; line-height: 0.98; margin: 0; }
.heading-period { color: var(--primary-strong); }
.page-subtitle { color: var(--muted); font-size: 14px; margin: 12px 0 0; max-width: 560px; }
.heading-actions { align-items: center; display: flex; gap: 10px; }
.ghost-button, .primary-button, .outline-button { align-items: center; border-radius: var(--radius-sm); display: inline-flex; font-size: 12px; font-weight: 900; gap: 8px; justify-content: center; min-height: 39px; padding: 0 14px; white-space: nowrap; }
.ghost-button { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.ghost-button:hover { border-color: var(--accent-soft); color: var(--accent); }
.primary-button { background: var(--accent); border: 1px solid var(--accent); color: oklch(0.14 0 0); }
.primary-button:hover { background: oklch(0.96 0.14 96); border-color: oklch(0.96 0.14 96); }
.primary-button:disabled { cursor: wait; opacity: 0.6; }
.button-orbit { border: 2px solid currentColor; border-left-color: transparent; border-radius: 50%; height: 12px; width: 12px; }
.primary-button.is-loading .button-orbit { animation: spin 0.7s linear infinite; }
.outline-button { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.outline-button:hover { background: var(--surface); border-color: var(--accent-soft); color: var(--accent); }

.stat-strip { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 28px; }
.stat-cell { min-height: 126px; padding: 19px 18px 16px; position: relative; }
.stat-cell + .stat-cell { border-left: 1px solid var(--line-soft); }
.stat-highlight::before { background: var(--primary); content: ""; height: 3px; left: 18px; position: absolute; right: 18px; top: -1px; }
.stat-label { color: var(--muted); display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.stat-cell strong { display: block; font-size: 29px; letter-spacing: -0.04em; line-height: 1.1; margin-top: 14px; }
.stat-cell strong em { color: var(--muted-2); font-size: 14px; font-style: normal; font-weight: 700; letter-spacing: 0; margin-left: 3px; }
.stat-trend { align-items: center; color: var(--muted-2); display: flex; font-size: 10px; gap: 6px; margin-top: 7px; }
.stat-highlight .stat-trend { color: var(--success); }
.stat-sync-cell strong { font-size: 20px; margin-top: 18px; }

.command-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.9fr); margin-bottom: 54px; }
.sync-hero, .activity-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); min-width: 0; }
.sync-hero { padding: 27px 28px 22px; }
.activity-panel { display: flex; flex-direction: column; padding: 25px 22px 20px; }
.panel-heading { align-items: flex-start; display: flex; gap: 20px; justify-content: space-between; }
.panel-kicker { color: var(--muted-2); font-size: 9px; letter-spacing: 0.2em; margin-bottom: 8px; }
.panel-heading h2, .section-heading h2, .connection-note h2 { font-size: 21px; letter-spacing: -0.03em; line-height: 1.08; margin: 0; }
.sync-status-badge { align-items: center; background: oklch(0.77 0.14 148 / 9%); border: 1px solid oklch(0.77 0.14 148 / 22%); border-radius: 99px; color: var(--success); display: inline-flex; font-size: 10px; font-weight: 900; gap: 7px; padding: 6px 9px; }
.sync-copy { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 17px 0 23px; max-width: 690px; }
.sync-route { align-items: center; display: grid; grid-template-columns: minmax(150px, 1fr) 80px minmax(150px, 1fr); gap: 10px; margin: 0 0 21px; }
.route-node { align-items: center; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-md); display: flex; gap: 10px; min-height: 58px; padding: 9px 11px; }
.route-node > span:last-child { display: grid; gap: 2px; }
.route-node small { color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.route-node strong { font-size: 12px; }
.route-glyph { align-items: center; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 8px; color: var(--accent); display: inline-flex; font-size: 16px; font-weight: 900; height: 32px; justify-content: center; width: 32px; }
.route-destination .route-glyph { background: var(--primary); border-color: var(--primary-strong); color: var(--ink); }
.route-line { align-items: center; display: flex; gap: 6px; justify-content: center; }
.route-line::before { background: var(--line); content: ""; height: 1px; position: absolute; width: 63px; }
.route-line span { background: var(--accent); border-radius: 50%; height: 4px; position: relative; width: 4px; }
.route-line span:nth-child(2) { box-shadow: 0 0 0 4px oklch(0.9 0.18 96 / 8%); }
.sync-progress-wrap { margin-top: 4px; }
.sync-progress-label { color: var(--muted); display: flex; font-size: 10px; font-weight: 800; justify-content: space-between; margin-bottom: 8px; }
.sync-progress-label span:last-child { color: var(--accent); }
.progress-track { background: var(--surface-3); border-radius: 99px; height: 5px; overflow: hidden; }
.progress-track > span { background: var(--accent); border-radius: inherit; display: block; height: 100%; transition: width 220ms ease-out; }
.sync-footer { align-items: center; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; margin-top: 22px; padding-top: 18px; }
.switch-label { align-items: center; cursor: pointer; display: inline-flex; gap: 9px; }
.switch-label > span:last-child { display: grid; gap: 1px; }
.switch-label strong { font-size: 11px; }
.switch-label small { color: var(--muted-2); font-size: 10px; }
.toggle { display: inline-flex; }
.toggle input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.toggle > span { background: var(--surface-3); border: 1px solid var(--line); border-radius: 99px; display: block; height: 20px; padding: 2px; transition: background 160ms ease-out; width: 35px; }
.toggle > span::after { background: var(--muted); border-radius: 50%; content: ""; display: block; height: 14px; transition: transform 160ms ease-out, background 160ms ease-out; width: 14px; }
.toggle input:checked + span { background: var(--primary); border-color: var(--primary-strong); }
.toggle input:checked + span::after { background: var(--ink); transform: translateX(15px); }

.compact-heading { align-items: center; }
.quiet-icon-button { border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 11px; height: 22px; width: 22px; }
.activity-list { display: grid; gap: 17px; margin: 24px 0 20px; }
.activity-item { align-items: flex-start; display: grid; gap: 9px; grid-template-columns: 24px minmax(0, 1fr) auto; }
.activity-icon { align-items: center; border-radius: 7px; display: inline-flex; font-size: 11px; height: 24px; justify-content: center; width: 24px; }
.activity-icon.is-good { background: oklch(0.77 0.14 148 / 12%); color: var(--success); }
.activity-icon.is-new { background: oklch(0.9 0.18 96 / 12%); color: var(--accent); }
.activity-icon.is-neutral { background: var(--surface-3); color: var(--muted); }
.activity-item div { display: grid; gap: 2px; min-width: 0; }
.activity-item strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-item small { color: var(--muted-2); font-size: 10px; }
.activity-time { color: var(--muted-2); font-size: 10px; padding-top: 2px; }
.panel-link { border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; margin-top: auto; padding-top: 16px; text-align: left; width: 100%; }

.collection-section { scroll-margin-top: 94px; }
.section-heading { align-items: end; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 20px; }
.section-title-row { align-items: center; display: flex; gap: 10px; }
.section-marker { color: var(--accent); font-size: 16px; }
.section-heading p { color: var(--muted); font-size: 12px; margin: 7px 0 0; }
.section-count { color: var(--muted-2); font-size: 10px; font-weight: 800; margin-left: 2px; }
.filter-toolbar { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; padding: 8px; }
.search-field { align-items: center; background: var(--bg-raised); border: 1px solid var(--line-soft); border-radius: 8px; display: flex; gap: 7px; min-height: 35px; min-width: 188px; padding: 0 9px; }
.search-field > span { color: var(--muted); font-size: 19px; line-height: 1; }
.search-field input { background: transparent; border: 0; color: var(--ink); min-width: 0; outline: 0; width: 100%; }
.search-field input::placeholder { color: var(--muted-2); }
.search-field kbd { border: 1px solid var(--line); border-radius: 4px; color: var(--muted-2); font-size: 10px; padding: 2px 5px; }
.filter-set { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-button { background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--muted); font-size: 11px; font-weight: 800; min-height: 35px; padding: 0 9px; }
.filter-button span { color: var(--muted-2); font-size: 10px; margin-left: 4px; }
.filter-button:hover { color: var(--ink); }
.filter-button.is-active { background: var(--surface-3); border-color: var(--line); color: var(--ink); }
.filter-button.is-active span { color: var(--accent); }
.select-field { align-items: center; background: var(--bg-raised); border: 1px solid var(--line-soft); border-radius: 8px; display: flex; gap: 6px; min-height: 35px; padding: 0 8px; }
.select-field span { color: var(--muted); font-size: 10px; font-weight: 800; }
.select-field select { background: transparent; border: 0; color: var(--ink); font-size: 11px; font-weight: 800; outline: 0; }
.select-field option { background: var(--surface); }
.check-field { align-items: center; color: var(--muted); display: inline-flex; font-size: 11px; gap: 6px; min-height: 35px; margin-left: auto; padding: 0 6px; }
.check-field input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.custom-check { align-items: center; border: 1px solid var(--line); border-radius: 4px; color: transparent; display: inline-flex; font-size: 10px; height: 16px; justify-content: center; width: 16px; }
.check-field input:checked + .custom-check { background: var(--accent); border-color: var(--accent); color: oklch(0.14 0 0); }

.sprite-grid { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sprite-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); min-width: 0; overflow: hidden; position: relative; transition: border-color 160ms ease-out, transform 160ms ease-out, background 160ms ease-out; }
.sprite-card:hover { background: var(--surface-2); border-color: var(--accent-soft); transform: translateY(-2px); }
.sprite-card.is-owned { border-color: oklch(0.77 0.14 148 / 38%); }
.sprite-card.is-owned:hover { border-color: var(--success); }
.sprite-art { aspect-ratio: 1.1; display: grid; isolation: isolate; overflow: hidden; place-items: center; position: relative; }
.sprite-art::before { border: 1px solid oklch(1 0 0 / 22%); border-radius: 50%; content: ""; height: 68%; position: absolute; width: 68%; }
.sprite-art::after { background: oklch(0.05 0 0 / 28%); border-radius: 50%; bottom: -13%; content: ""; filter: blur(12px); height: 25%; position: absolute; width: 58%; }
.sprite-glyph { align-items: center; border: 2px solid oklch(1 0 0 / 50%); border-radius: 50% 44% 48% 46%; color: oklch(1 0 0 / 88%); display: inline-flex; font-size: clamp(24px, 3vw, 42px); font-weight: 900; height: 44%; justify-content: center; letter-spacing: -0.08em; position: relative; transform: rotate(-7deg); width: 42%; z-index: 1; }
.sprite-glyph::before, .sprite-glyph::after { background: oklch(1 0 0 / 74%); border-radius: 50%; content: ""; height: 10%; position: absolute; top: 31%; width: 10%; }
.sprite-glyph::before { left: 24%; }
.sprite-glyph::after { right: 24%; }
.art-red { background: oklch(0.45 0.16 28); }
.art-red .sprite-glyph { background: oklch(0.68 0.16 28); }
.art-yellow { background: oklch(0.58 0.15 78); }
.art-yellow .sprite-glyph { background: oklch(0.82 0.14 92); color: oklch(0.18 0.03 80); }
.art-purple { background: oklch(0.42 0.14 320); }
.art-purple .sprite-glyph { background: oklch(0.66 0.16 305); }
.art-blue { background: oklch(0.4 0.12 245); }
.art-blue .sprite-glyph { background: oklch(0.7 0.12 235); }
.art-green { background: oklch(0.45 0.13 151); }
.art-green .sprite-glyph { background: oklch(0.7 0.14 153); }
.art-orange { background: oklch(0.55 0.16 56); }
.art-orange .sprite-glyph { background: oklch(0.76 0.16 54); }
.sprite-meta { padding: 11px 11px 12px; }
.sprite-topline { align-items: center; display: flex; gap: 6px; justify-content: space-between; margin-bottom: 8px; }
.rarity { border-radius: 4px; font-size: 9px; font-weight: 900; letter-spacing: 0.05em; padding: 3px 5px; text-transform: uppercase; }
.rarity-rare { background: oklch(0.7 0.12 235 / 15%); color: oklch(0.8 0.13 235); }
.rarity-epic { background: oklch(0.66 0.16 305 / 17%); color: oklch(0.78 0.15 305); }
.rarity-mythic { background: oklch(0.68 0.16 28 / 16%); color: oklch(0.83 0.14 28); }
.rarity-special { background: oklch(0.9 0.18 96 / 12%); color: var(--accent); }
.owned-mark { color: var(--muted-2); font-size: 12px; }
.sprite-card.is-owned .owned-mark { color: var(--success); }
.sprite-card h3 { font-size: 13px; letter-spacing: -0.02em; line-height: 1.1; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sprite-variant { color: var(--muted); display: block; font-size: 10px; margin-top: 4px; }
.sprite-bottomline { align-items: center; display: flex; justify-content: space-between; margin-top: 12px; }
.sprite-progress { background: var(--surface-3); border-radius: 99px; height: 4px; overflow: hidden; width: 48px; }
.sprite-progress span { background: var(--accent-soft); border-radius: inherit; display: block; height: 100%; }
.sprite-card.is-owned .sprite-progress span { background: var(--success); }
.sprite-percent { color: var(--muted-2); font-size: 10px; }
.sprite-action { background: transparent; border: 0; border-radius: 4px; bottom: 9px; color: var(--muted-2); font-size: 10px; opacity: 0; padding: 2px 3px; position: absolute; right: 8px; transition: opacity 140ms ease-out; }
.sprite-card:hover .sprite-action, .sprite-card:focus-within .sprite-action { opacity: 1; }
.sprite-action:hover { color: var(--accent); }
.empty-state { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 52px 20px; text-align: center; }
.empty-glyph { color: var(--accent); font-size: 32px; }
.empty-state h3 { font-size: 17px; margin: 11px 0 5px; }
.empty-state p { color: var(--muted); font-size: 12px; margin: 0 0 18px; }
.load-more-row { align-items: center; color: var(--muted-2); display: flex; font-size: 10px; justify-content: space-between; padding-top: 18px; }
.load-more-row > span { align-items: center; display: inline-flex; gap: 7px; }
.load-dot { background: var(--primary-strong); border-radius: 50%; height: 5px; width: 5px; }
.load-more-row button { background: transparent; border: 0; color: var(--muted); font-size: 10px; font-weight: 800; padding: 0; }
.load-more-row button:hover { color: var(--accent); }

.connection-note { align-items: center; background: oklch(0.14 0.02 28); border: 1px solid oklch(0.54 0.17 28 / 36%); border-radius: var(--radius-lg); display: flex; gap: 16px; justify-content: space-between; margin-top: 54px; padding: 20px 24px; scroll-margin-top: 94px; }
.connection-mark { align-items: center; background: var(--primary); border-radius: 10px; color: var(--ink); display: inline-flex; flex: 0 0 auto; font-size: 22px; height: 42px; justify-content: center; width: 42px; }
.connection-note > div:nth-child(2) { flex: 1; }
.connection-note .panel-kicker { margin-bottom: 5px; }
.connection-note h2 { font-size: 17px; }
.connection-note p:last-child { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 6px 0 0; max-width: 720px; }

.mobile-nav { display: none; }
.toast { align-items: center; background: var(--ink); border-radius: 9px; bottom: 22px; color: oklch(0.14 0 0); display: flex; font-size: 12px; font-weight: 800; gap: 8px; opacity: 0; padding: 11px 14px; pointer-events: none; position: fixed; right: 22px; transform: translateY(8px); transition: opacity 180ms ease-out, transform 180ms ease-out; z-index: var(--z-toast); }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-mark { align-items: center; background: var(--success); border-radius: 50%; display: inline-flex; font-size: 9px; height: 17px; justify-content: center; width: 17px; }

.connect-dialog { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); max-width: 450px; padding: 26px; width: calc(100% - 32px); }
.connect-dialog::backdrop { background: oklch(0.03 0 0 / 72%); }
.dialog-topline { align-items: center; display: flex; justify-content: space-between; }
.dialog-mark { align-items: center; background: var(--primary); border-radius: 12px; color: var(--ink); display: flex; font-size: 26px; height: 52px; justify-content: center; margin: 26px 0 19px; width: 52px; }
.connect-dialog h2 { font-size: 26px; letter-spacing: -0.04em; margin: 0; }
.connect-dialog > p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 11px 0 22px; }
.dialog-checks { border-bottom: 1px solid var(--line-soft); border-top: 1px solid var(--line-soft); display: grid; gap: 11px; padding: 16px 0; }
.dialog-checks span { color: var(--ink-soft); font-size: 12px; }
.dialog-checks b { color: var(--accent); font-size: 10px; margin-right: 9px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 23px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.5; } }

@media (max-width: 1200px) {
  .primary-nav { justify-content: flex-start; }
  .content-inner { padding-left: 32px; padding-right: 32px; }
  .sprite-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .topbar { gap: 16px; padding: 0 18px; }
  .brand { min-width: 150px; }
  .brand-product { letter-spacing: 0.17em; }
  .primary-nav { flex: 1; }
  .account-copy { display: none; }
  .app-layout { display: block; }
  .sidebar { display: none; }
  .content-inner { padding: 44px 24px 94px; }
  .command-grid { grid-template-columns: 1fr; }
  .activity-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .activity-time { display: none; }
  .panel-link { margin-top: 4px; }
  .mobile-nav { align-items: stretch; background: oklch(0.11 0 0 / 97%); border-top: 1px solid var(--line); bottom: 0; display: flex; justify-content: space-around; padding: 7px 12px calc(7px + env(safe-area-inset-bottom)); position: fixed; width: 100%; z-index: var(--z-sticky); backdrop-filter: blur(16px); }
  .mobile-nav-link { align-items: center; background: transparent; border: 0; color: var(--muted); display: grid; gap: 3px; justify-items: center; min-width: 64px; padding: 4px 8px; }
  .mobile-nav-link span { font-size: 17px; line-height: 1; }
  .mobile-nav-link small { font-size: 10px; font-weight: 800; }
  .mobile-nav-link.is-active { color: var(--accent); }
}

@media (max-width: 640px) {
  .topbar { height: 60px; padding: 0 14px; }
  .brand { min-width: 0; }
  .brand-mark { height: 32px; width: 32px; }
  .brand-name { font-size: 12px; }
  .brand-product { font-size: 8px; }
  .primary-nav { display: none; }
  .topbar-actions { margin-left: auto; }
  .content-inner { padding: 35px 14px 95px; }
  .page-heading { align-items: flex-start; display: grid; gap: 22px; }
  h1 { font-size: 2.7rem; }
  .page-subtitle { font-size: 13px; max-width: 340px; }
  .heading-actions { width: 100%; }
  .heading-actions > * { flex: 1; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-cell { min-height: 108px; padding: 15px 13px; }
  .stat-cell + .stat-cell { border-left: 1px solid var(--line-soft); }
  .stat-cell:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .stat-cell:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .stat-highlight::before { left: 13px; right: 13px; }
  .stat-cell strong { font-size: 24px; margin-top: 11px; }
  .stat-sync-cell strong { font-size: 17px; margin-top: 16px; }
  .sync-hero, .activity-panel { border-radius: var(--radius-md); padding: 19px 16px; }
  .sync-route { grid-template-columns: 1fr; }
  .route-line { height: 22px; transform: rotate(90deg); }
  .sync-footer { align-items: flex-start; flex-direction: column; gap: 14px; }
  .activity-list { grid-template-columns: 1fr; margin: 20px 0; }
  .activity-time { display: block; }
  .filter-toolbar { align-items: stretch; display: grid; grid-template-columns: 1fr; }
  .search-field { min-width: 0; }
  .filter-set { overflow-x: auto; flex-wrap: nowrap; }
  .filter-button { flex: 0 0 auto; }
  .check-field { margin-left: 0; }
  .section-heading { align-items: flex-start; display: grid; }
  .section-heading > .outline-button { justify-self: start; }
  .sprite-grid { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sprite-art { aspect-ratio: 1.14; }
  .sprite-meta { padding: 10px 9px; }
  .sprite-card h3 { font-size: 12px; }
  .sprite-action { opacity: 1; }
  .load-more-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .connection-note { align-items: flex-start; display: grid; grid-template-columns: auto minmax(0, 1fr); padding: 18px 16px; }
  .connection-note .primary-button { grid-column: 1 / -1; width: 100%; }
  .connection-note h2 { font-size: 16px; }
  .toast { bottom: 82px; left: 14px; right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* Auth + account dialogs */
.auth-tabs { border-bottom: 1px solid var(--line-soft); display: flex; gap: 4px; margin-bottom: 18px; }
.auth-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.02em; padding: 8px 10px; }
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active { border-bottom-color: var(--primary-strong); color: var(--ink); }
.auth-form { display: grid; gap: 13px; }
.auth-form .primary-button { justify-self: end; margin-top: 4px; }
.form-field { display: grid; gap: 6px; }
.form-field span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.form-field input { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; padding: 10px 12px; width: 100%; }
.form-field input:focus-visible { border-color: var(--primary-strong); outline: 2px solid oklch(0.62 0.2 28 / 35%); outline-offset: 1px; }
.form-error { background: oklch(0.7 0.18 28 / 12%); border: 1px solid oklch(0.7 0.18 28 / 40%); border-radius: var(--radius-sm); color: var(--danger); font-size: 12px; line-height: 1.5; margin: 0; padding: 9px 11px; }
.referral-block { border-top: 1px solid var(--line-soft); margin-top: 22px; padding-top: 16px; }
.referral-block > p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 8px 0 12px; }
.referral-list { display: grid; gap: 7px; list-style: none; margin: 0 0 18px; padding: 0; }
.referral-item { align-items: center; background: var(--bg-raised); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); display: flex; gap: 10px; justify-content: space-between; padding: 9px 12px; }
.referral-item code { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }
.referral-item.is-used { opacity: 0.55; }
.referral-item.is-used code { color: var(--muted); text-decoration: line-through; }
.referral-state { color: var(--muted); font-size: 11px; font-weight: 700; }
#account-epic-status { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 11px 0 4px; }
#account-dialog .dialog-actions { justify-content: flex-start; }
#account-dialog > .text-button { margin-top: 18px; }

/* Auth gate */
.auth-gate { align-items: center; background: radial-gradient(1200px 600px at 50% -10%, oklch(0.16 0.05 28), var(--bg) 60%); display: flex; inset: 0; justify-content: center; overflow-y: auto; padding: 24px; position: fixed; z-index: 80; }
.auth-gate.is-hidden { display: none; }
.auth-gate-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); max-width: 420px; padding: 30px 28px; width: 100%; }
.gate-brand { align-items: center; display: flex; gap: 10px; margin-bottom: 22px; }
.auth-gate-panel h1 { font-size: 30px; letter-spacing: -0.04em; margin: 0; }
.gate-copy { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 10px 0 20px; }
.gate-status { background: oklch(0.78 0.15 72 / 12%); border: 1px solid oklch(0.78 0.15 72 / 40%); border-radius: var(--radius-sm); color: var(--warning); font-size: 12px; line-height: 1.5; margin: 14px 0 0; padding: 9px 11px; }
.gate-footnote { color: var(--muted-2, var(--muted)); font-size: 11px; margin: 14px 0 0; }
.app-shell.is-locked { filter: blur(6px); pointer-events: none; user-select: none; }

/* Type tabs */
.type-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.type-tab { background: var(--bg-raised); border: 1px solid var(--line-soft); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 800; padding: 7px 14px; }
.type-tab:hover { border-color: var(--line); color: var(--ink); }
.type-tab.is-active { background: var(--primary); border-color: var(--primary-strong); color: var(--ink); }

/* Catalog states */
.catalog-state { align-items: center; border: 1px dashed var(--line); border-radius: var(--radius-md); color: var(--muted); display: flex; font-size: 13px; gap: 10px; justify-content: center; margin: 18px 0; padding: 26px; }
.catalog-state.is-error { border-color: oklch(0.7 0.18 28 / 45%); color: var(--danger); flex-direction: column; }
.catalog-state.is-error p { margin: 0; }

/* Item grid (fortnite.gg-style density) */
.item-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); margin-top: 6px; }
.item-card { aspect-ratio: 1; border: 1px solid oklch(1 0 0 / 8%); border-radius: var(--radius-sm); cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; position: relative; transition: transform 0.12s ease, border-color 0.12s ease; }
.item-card:hover { border-color: oklch(1 0 0 / 35%); transform: translateY(-2px); z-index: 1; }
.item-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item-img { height: 100%; left: 0; object-fit: contain; position: absolute; top: 0; width: 100%; }
.item-img-fallback { align-items: center; color: oklch(1 0 0 / 55%); display: flex; font-size: 34px; font-weight: 900; justify-content: center; }
.item-name { background: linear-gradient(transparent, oklch(0 0 0 / 78%) 36%); color: var(--ink); font-size: 10.5px; font-weight: 800; letter-spacing: 0.01em; overflow: hidden; padding: 14px 6px 6px; position: relative; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.owned-badge { align-items: center; background: var(--success); border-radius: 999px; color: oklch(0.15 0 0); display: none; font-size: 11px; font-weight: 900; height: 18px; justify-content: center; left: 5px; position: absolute; top: 5px; width: 18px; }
.item-card.is-owned { border-color: oklch(0.77 0.14 148 / 75%); }
.item-card.is-owned .owned-badge { display: flex; }
.item-card:not(.is-owned) .item-img { filter: grayscale(0.35) brightness(0.82); }
.wish-toggle { background: oklch(0 0 0 / 45%); border: 0; border-radius: 999px; color: oklch(1 0 0 / 75%); font-size: 13px; height: 22px; line-height: 1; opacity: 0; position: absolute; right: 4px; top: 4px; transition: opacity 0.12s ease; width: 22px; z-index: 2; }
.item-card:hover .wish-toggle, .wish-toggle:focus-visible, .wish-toggle.is-wished { opacity: 1; }
.wish-toggle.is-wished { color: var(--accent); }

/* Rarity + series backgrounds */
.rar-common { background: radial-gradient(circle at 50% 30%, #8a8a8a, #3d3d3d 75%); }
.rar-uncommon { background: radial-gradient(circle at 50% 30%, #4ec96a, #14512a 75%); }
.rar-rare { background: radial-gradient(circle at 50% 30%, #45a8ff, #103a6b 75%); }
.rar-epic { background: radial-gradient(circle at 50% 30%, #b76bff, #45177c 75%); }
.rar-legendary { background: radial-gradient(circle at 50% 30%, #ff9e45, #79370e 75%); }
.rar-mythic, .rar-transcendent { background: radial-gradient(circle at 50% 30%, #ecd35a, #6e5a12 75%); }
.rar-exotic { background: radial-gradient(circle at 50% 30%, #4ad9d9, #0f5a5a 75%); }
.ser-icon { background: radial-gradient(circle at 50% 30%, #43c6dd, #14476b 75%); }
.ser-marvel { background: radial-gradient(circle at 50% 30%, #f04f4f, #6b1212 75%); }
.ser-dc { background: radial-gradient(circle at 50% 30%, #5578e8, #16255f 75%); }
.ser-starwars { background: radial-gradient(circle at 50% 30%, #40507c, #10142b 75%); }
.ser-gaming { background: radial-gradient(circle at 50% 30%, #8f6bff, #2b1a6b 75%); }
.ser-lava { background: radial-gradient(circle at 50% 30%, #ff7a45, #5f1408 75%); }
.ser-frozen { background: radial-gradient(circle at 50% 30%, #9fd6f5, #1d4a6b 75%); }
.ser-slurp { background: radial-gradient(circle at 50% 30%, #38dcc8, #0e4f46 75%); }
.ser-shadow { background: radial-gradient(circle at 50% 30%, #6f6f6f, #1a1a1a 75%); }
.ser-dark { background: radial-gradient(circle at 50% 30%, #d84fe8, #3c0f5f 75%); }

@media (max-width: 640px) {
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}

/* The hidden attribute must always win, even over display rules above. */
[hidden] { display: none !important; }

/* Keep autofilled fields on-theme instead of iOS/Chrome yellow. */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-raised) inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}

/* Creator panel */
.connect-dialog { max-height: min(92vh, 860px); overflow-y: auto; }
.member-info { display: grid; gap: 2px; min-width: 0; }
.member-info .referral-state { font-weight: 500; }
.member-actions { display: flex; flex-shrink: 0; gap: 12px; }

/* Member locker viewing banner */
.viewing-banner { align-items: center; background: oklch(0.9 0.18 96 / 10%); border: 1px solid oklch(0.9 0.18 96 / 40%); border-radius: var(--radius-md); color: var(--accent); display: flex; font-size: 13px; font-weight: 700; gap: 10px; margin: 4px 0 12px; padding: 10px 14px; }
.viewing-banner .text-button { margin-left: auto; }
