:root {
  color-scheme: light;
  --bg: #cfd7df;
  --panel: #dfe6ee;
  --panel-strong: #f4f7fa;
  --ink: #131820;
  --muted: #53606e;
  --line: #7f8b99;
  --accent: #d93434;
  --accent-dark: #8e1f25;
  --mint: #1f9d72;
  --blue: #275fbd;
  --gold: #e4a82c;
  --shell: #242a33;
  --shell-dark: #11151b;
  --highlight: rgba(255, 255, 255, .72);
  --shadow: 0 18px 40px rgba(17, 21, 27, .24);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(17, 21, 27, .08) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(17, 21, 27, .07) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(135deg, rgba(39, 95, 189, .08), rgba(217, 52, 52, .06)),
    var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .74;
}

.app-shell {
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  padding: 12px clamp(16px, 4vw, 42px);
  border-bottom: 3px solid var(--shell-dark);
  background: linear-gradient(#303743, var(--shell));
  color: #f5f7fa;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .16), 0 8px 22px rgba(17, 21, 27, .24);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-logo-wrap {
  display: grid;
  width: clamp(220px, 24vw, 320px);
  height: 68px;
  place-items: center;
  overflow: visible;
}

.brand-logo {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.brand-copy {
  display: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: #c8d3de;
  font-size: .78rem;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.topbar-dashboard {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  margin: 0 0 4px;
  color: #f5f7fa;
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .38);
  white-space: nowrap;
}

.topbar-title .dashboard-label {
  margin: 0;
  color: #ffb5c8;
  font-size: .66rem;
}

.topbar-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 118px));
  gap: 8px;
}

.topbar-chip {
  min-height: 46px;
  padding: 6px 9px;
  border: 2px solid #11151b;
  border-radius: var(--radius);
  background: linear-gradient(#f6f8fa, #dfe6ee);
  color: var(--ink);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .78), inset -2px -2px 0 rgba(17, 21, 27, .16), 0 3px 0 #11151b;
}

.topbar-metrics > .topbar-metric {
  position: relative;
}

.topbar-metric > span {
  display: block;
  font-size: .98rem;
  font-weight: 950;
  line-height: 1;
}

.topbar-metric > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
}

.topbar-metric > small span {
  display: block;
}

.value-metric {
  cursor: default;
}

.value-chart-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 35;
  width: 340px;
  padding: 12px;
  border: 3px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#f6f8fa, #dfe6ee);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .78), inset -3px -3px 0 rgba(17, 21, 27, .14), var(--shadow);
}

.value-metric:hover .value-chart-popover,
.value-metric:focus-within .value-chart-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.value-chart-popover > strong {
  display: block;
  margin-bottom: 10px;
  font-size: .86rem;
  line-height: 1;
}

.value-chart-body {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.value-pie {
  position: relative;
  display: grid;
  width: 102px;
  height: 102px;
  place-items: center;
  border: 3px solid #171c23;
  border-radius: 50%;
  background: conic-gradient(#c6d0dc 0deg 360deg);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .38), 0 3px 0 #171c23;
}

.value-pie::after {
  position: absolute;
  inset: 18px;
  content: "";
  border: 2px solid rgba(17, 21, 27, .35);
  border-radius: 50%;
  background: linear-gradient(#f8fafc, #dfe6ee);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .8), inset -2px -2px 0 rgba(17, 21, 27, .12);
}

.value-pie span {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 62px;
  justify-items: center;
  line-height: 1;
  text-align: center;
}

.value-pie strong {
  color: var(--ink);
  font-size: .72rem;
}

.value-pie small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .56rem;
  font-weight: 950;
  text-transform: uppercase;
}

.value-chart-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.value-chart-total {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 2px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#fff, #e7edf3);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .9), inset -2px -2px 0 rgba(17, 21, 27, .08);
}

.value-chart-total span,
.value-chart-total small {
  color: var(--muted);
  font-size: .66rem;
  font-weight: 900;
}

.value-chart-total strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
}

.value-chart-list p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 850;
}

.value-chart-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) minmax(62px, auto);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 850;
}

.value-chart-row span:nth-child(2),
.value-chart-row span:nth-child(2) strong,
.value-chart-row span:nth-child(2) small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.value-chart-row span:nth-child(2) strong {
  color: var(--ink);
  font-size: .76rem;
}

.value-chart-row span:nth-child(2) small {
  color: var(--muted);
  font-size: .64rem;
}

.value-chart-row strong {
  margin: 0;
  color: var(--ink);
  font-size: .74rem;
  text-align: right;
}

.value-dot {
  width: 10px;
  height: 10px;
  border: 1px solid #171c23;
  border-radius: 3px;
}

.top-heart-wallet {
  position: relative;
  display: flex;
  min-width: 116px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-color: #11151b;
  background: linear-gradient(#ffe8ef, #ffcbd8);
  color: #c8245f;
}

.top-heart-wallet strong {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #c8245f;
  line-height: 1;
}

.heart-tooltip {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 35;
  width: 250px;
  padding: 12px;
  border: 3px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#fff2f6, #ffd2df);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .78), inset -3px -3px 0 rgba(17, 21, 27, .14), var(--shadow);
}

.top-heart-wallet:hover .heart-tooltip,
.top-heart-wallet:focus-within .heart-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.heart-tooltip strong {
  display: block;
  margin-bottom: 7px;
  color: #c8245f;
  font-size: .86rem;
}

.heart-tooltip p {
  margin: 0;
  color: #5e3340;
  font-size: .78rem;
  font-weight: 850;
  line-height: 1.35;
}

.ghost-button,
.primary-button,
.icon-button,
.segmented button,
.user-menu-button,
.user-menu-list button {
  border: 2px solid #11151b;
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: inset 2px 2px 0 var(--highlight), inset -3px -3px 0 rgba(17, 21, 27, .18), 0 3px 0 #11151b;
}

.ghost-button,
.primary-button {
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  border-color: #11151b;
  background: linear-gradient(#f45a4f, var(--accent));
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .24), inset -3px -3px 0 rgba(0, 0, 0, .24), 0 4px 0 #11151b;
}

.primary-button:hover {
  background: linear-gradient(#ea4844, var(--accent-dark));
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  font-weight: 900;
}

.icon-button.danger {
  color: #9d2018;
}

.user-menu {
  position: relative;
}

.mod-users {
  position: relative;
}

.user-menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 116px;
  padding: 5px 12px;
  font-weight: 800;
}

.user-menu.mod-account .user-menu-button,
.mod-users-button {
  border-color: #ff5a64;
  background: linear-gradient(#fff1f3, #ffd0d7);
  color: #9d2018;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .85), inset -3px -3px 0 rgba(157, 32, 24, .16), 0 3px 0 #11151b, 0 0 14px rgba(217, 52, 52, .55);
}

.mod-users-button {
  min-width: 84px;
  font-weight: 950;
}

.mod-status {
  display: inline-grid;
  min-height: 18px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid #9d2018;
  border-radius: 999px;
  background: #c82436;
  color: #fff;
  font-size: .58rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 0 8px rgba(200, 36, 54, .6);
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid #0c4f3a;
  background: linear-gradient(#29bd88, var(--mint));
  color: #fff;
}

.user-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: none;
  min-width: 190px;
  padding: 8px;
  border: 2px solid #11151b;
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.mod-users-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 36;
  display: none;
  width: 270px;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 2px solid #ff5a64;
  border-radius: var(--radius);
  background: linear-gradient(#fff6f7, #e8eef4);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .85), inset -3px -3px 0 rgba(157, 32, 24, .12), var(--shadow), 0 0 18px rgba(217, 52, 52, .42);
}

.mod-users-button[aria-expanded="true"] + .mod-users-list,
.mod-users:hover .mod-users-list,
.mod-users:focus-within .mod-users-list {
  display: grid;
  gap: 8px;
}

.mod-user-row {
  display: grid;
  gap: 8px;
  padding: 7px;
  border: 2px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#f8fafc, #e1e8ef);
  color: var(--ink);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .8), inset -2px -2px 0 rgba(17, 21, 27, .12), 0 2px 0 #171c23;
}

.mod-user-row.selected {
  border-color: #ff5a64;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .8), inset -2px -2px 0 rgba(157, 32, 24, .12), 0 2px 0 #171c23, 0 0 12px rgba(217, 52, 52, .35);
}

.mod-user-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.mod-user-row strong,
.mod-user-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mod-user-row strong {
  color: var(--ink);
  font-size: .86rem;
}

.mod-user-row small,
.mod-user-empty {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 850;
}

.mod-user-empty {
  margin: 0;
  padding: 8px;
}

.mod-user-detail {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(17, 21, 27, .22);
}

.mod-user-detail dl {
  display: grid;
  gap: 5px;
  margin: 0;
}

.mod-user-detail dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.mod-user-detail dt,
.mod-user-detail dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mod-user-detail dt {
  color: var(--muted);
  font-size: .66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.mod-user-detail dd {
  color: var(--ink);
  font-size: .76rem;
  font-weight: 900;
}

.mod-user-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mod-user-controls label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.mod-user-controls input,
.mod-user-controls select {
  min-height: 30px;
  padding: 0 7px;
  border: 2px solid #171c23;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 900;
}

.mod-user-controls .mod-user-remove {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: var(--ink);
  text-transform: none;
}

.mod-user-remove input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.mod-user-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mod-user-actions button {
  min-height: 32px;
  padding: 0 8px;
  font-size: .72rem;
}

.mod-user-flags {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.mod-user-role,
.mod-user-ban {
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 950;
  line-height: 1;
}

.mod-user-role {
  background: #c82436;
  color: #fff;
}

.mod-user-ban {
  background: #171c23;
  color: #fff;
}

.user-menu-button[aria-expanded="true"] + .user-menu-list,
.user-menu:hover .user-menu-list,
.user-menu:focus-within .user-menu-list {
  display: grid;
  gap: 6px;
}

.user-menu-list button {
  min-height: 38px;
  padding: 0 10px;
  text-align: left;
}

.edit-button,
.heart-button {
  border: 2px solid #11151b;
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 950;
  box-shadow: inset 2px 2px 0 var(--highlight), inset -3px -3px 0 rgba(17, 21, 27, .18), 0 3px 0 #11151b;
}

.edit-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: .68rem;
}

.auth-view,
.dashboard {
  padding: clamp(22px, 5vw, 52px);
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: center;
  max-width: 1160px;
  min-height: calc(100vh - 180px);
  margin: 0 auto;
}

.auth-copy {
  max-width: 730px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 920px;
  margin-bottom: 16px;
  font-size: clamp(2.3rem, 6vw, 5.4rem);
  line-height: .95;
  letter-spacing: 0;
}

.auth-copy p:not(.eyebrow) {
  max-width: 630px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.55;
}

.auth-card,
.add-panel,
.collection-panel,
.settings-dialog form,
.edit-dialog form {
  border: 3px solid #171c23;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: inset 3px 3px 0 var(--highlight), inset -4px -4px 0 rgba(17, 21, 27, .18), var(--shadow);
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(29, 38, 50, .05);
}

.segmented.single {
  grid-template-columns: 1fr;
}

.segmented button {
  min-height: 38px;
  font-weight: 900;
}

.segmented button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 2px solid #667382;
  border-radius: var(--radius);
  background: #f8fbfd;
  color: var(--ink);
  outline: none;
  box-shadow: inset 2px 2px 0 rgba(17, 21, 27, .08), inset -2px -2px 0 rgba(255, 255, 255, .8);
}

input,
select {
  height: 42px;
  padding: 0 11px;
}

textarea {
  min-height: 76px;
  padding: 10px 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 107, 207, .16);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--mint);
  font-size: .88rem;
  font-weight: 800;
}

.private-note {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(215, 79, 42, .28);
  border-radius: var(--radius);
  background: rgba(215, 79, 42, .08);
  color: var(--accent-dark);
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.35;
}

.form-message.error {
  color: #a62b22;
}

.dashboard {
  max-width: 1500px;
  margin: 0 auto;
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.dashboard-head h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, .55);
}

.dashboard-label {
  margin-bottom: 0;
}

.head-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(118px, 1fr));
  gap: 10px;
}

.head-metrics div {
  min-height: 76px;
  padding: 12px;
  border: 2px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#f6f8fa, #dfe6ee);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .8), inset -3px -3px 0 rgba(17, 21, 27, .12), 0 3px 0 #171c23;
}

.head-metrics span {
  display: block;
  font-size: 1.3rem;
  font-weight: 950;
}

.head-metrics small {
  color: var(--muted);
  font-weight: 800;
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(210px, 240px) minmax(0, 1fr) minmax(220px, 260px);
  gap: 18px;
  align-items: start;
}

.add-panel {
  position: absolute;
  top: 70px;
  left: 14px;
  right: 14px;
  z-index: 12;
  max-width: 760px;
  padding: 18px;
  background: linear-gradient(#eaf0f6, #cbd5df);
}

.add-panel form {
  display: grid;
  gap: 14px;
}

.form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.form-head h2,
.dialog-head h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.file-input input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-input span {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 11px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: #f8fbfd;
  color: var(--ink);
}

.file-input small {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.collection-panel {
  position: relative;
  min-height: 620px;
  padding: 14px;
  background: linear-gradient(#e7edf3, #d3dce6);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(320px, auto);
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(17, 21, 27, .22);
}

.toolbar-add-button {
  width: 100%;
}

.toolbar-add-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-status {
  min-width: 76px;
  color: #08724f;
  font-size: .92rem;
  font-weight: 950;
}

.toolbar-filters {
  display: grid;
  grid-template-columns: 150px 150px 140px;
  gap: 10px;
  justify-content: end;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-height: 846px;
  overflow-y: auto;
  padding: 0 6px 4px 0;
  scrollbar-gutter: stable;
}

.collection-grid::-webkit-scrollbar {
  width: 10px;
}

.collection-grid::-webkit-scrollbar-track {
  border: 2px solid #171c23;
  border-radius: 999px;
  background: #c6d0dc;
}

.collection-grid::-webkit-scrollbar-thumb {
  border: 2px solid #171c23;
  border-radius: 999px;
  background: linear-gradient(#9fb0c0, #667382);
}

.item-card {
  display: grid;
  grid-template-rows: auto 104px 1fr;
  min-height: 204px;
  overflow: hidden;
  border: 2px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#f8fafc, #e1e8ef);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .8), inset -3px -3px 0 rgba(17, 21, 27, .13), 0 4px 0 #171c23;
}

.item-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  background: linear-gradient(#f8fafc, #e8eef4);
  border-bottom: 2px solid #171c23;
}

.item-image {
  position: relative;
  min-height: 0;
  border-bottom: 2px solid #171c23;
  background: #1b222b;
}

.image-button {
  display: block;
  width: 100%;
  padding: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  cursor: zoom-in;
}

.item-image img {
  display: block;
  width: 100%;
  height: 100%;
  image-orientation: from-image;
  object-fit: contain;
}

.placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 120px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #fff;
}

.placeholder span {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, .82);
  border-radius: 8px;
  font-weight: 950;
}

.placeholder small {
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.placeholder-game {
  background: linear-gradient(135deg, #2f6f9f, #d74f2a);
}

.placeholder-card {
  background: linear-gradient(135deg, #7f3f98, #d49b25);
}

.placeholder-console {
  background: linear-gradient(135deg, #263238, #1f9d83);
}

.placeholder-accessory {
  background: linear-gradient(135deg, #8b3f2f, #316bcf);
}

.placeholder-other {
  background: linear-gradient(135deg, #5b6068, #c05d35);
}

.item-body {
  display: grid;
  gap: 7px;
  padding: 8px;
}

.item-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.item-title-row > div {
  min-width: 0;
  width: 100%;
}

.item-title-row h3 {
  margin: 0;
  font-size: .9rem;
  line-height: 1.2;
}

.recent-panel {
  display: grid;
  gap: 12px;
  align-self: start;
  padding: 14px;
  border: 3px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#e7edf3, #cbd5df);
  box-shadow: inset 3px 3px 0 var(--highlight), inset -4px -4px 0 rgba(17, 21, 27, .18), var(--shadow);
}

.liked-panel {
  background: linear-gradient(#e9edf2, #d0d9e3);
}

.recent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.upload-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: min(100%, 190px);
  margin: 0 auto 2px;
  padding: 3px;
  border: 2px solid #171c23;
  border-radius: var(--radius);
  background: #c6d0dc;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .6), inset -2px -2px 0 rgba(17, 21, 27, .14);
}

.upload-mode-switch button {
  min-width: 0;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.upload-mode-switch button.active {
  background: linear-gradient(#ffe8ef, #ffcbd8);
  color: #c8245f;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .8), 0 2px 0 #171c23;
}

.recent-head h2 {
  margin-bottom: 3px;
  font-size: 1.08rem;
}

.recent-head p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
}

.recent-head-centered {
  justify-content: center;
  text-align: center;
}

.heart-wallet {
  display: grid;
  min-width: 82px;
  justify-items: center;
  padding: 7px 8px;
  border: 2px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#ffe6e3, #f8c6c1);
  color: #8f211a;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .75), inset -2px -2px 0 rgba(17, 21, 27, .13), 0 3px 0 #171c23;
}

.heart-wallet strong {
  font-size: 1.15rem;
  line-height: 1;
}

.heart-wallet > span {
  font-size: .68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.top-heart-wallet strong span {
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
}

.top-heart-wallet > span {
  color: #c8245f;
}

.heart-wallet.top-heart-wallet {
  display: flex;
  min-width: 116px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 2px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#f8fafc, #e1e8ef);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .8), inset -2px -2px 0 rgba(17, 21, 27, .12), 0 3px 0 #171c23;
}

.heart-button {
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 3px 5px;
  color: var(--muted);
}

.heart-button span {
  color: #8f211a;
  line-height: 1;
}

.heart-button strong {
  font-size: .72rem;
}

.heart-button.liked {
  background: linear-gradient(#ffe6e3, #f8c6c1);
  color: #8f211a;
}

.mod-mode .heart-button {
  border-color: #ff5a64;
  background: linear-gradient(#fff1f3, #ffd1d8);
  color: #9d2018;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .85), inset -3px -3px 0 rgba(157, 32, 24, .16), 0 3px 0 #11151b, 0 0 14px rgba(217, 52, 52, .5);
}

.mod-mode .heart-button span {
  color: #c8245f;
}

.mod-mode .heart-button.liked {
  background: linear-gradient(#ffdbe5, #ffb5c5);
  color: #8f211a;
}

.heart-button.spent {
  opacity: .54;
  cursor: not-allowed;
}

.recent-image {
  position: relative;
  height: 82px;
  overflow: hidden;
  border: 2px solid #171c23;
  border-radius: 6px;
  background: #1b222b;
}

.recent-image img,
.recent-image .placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.recent-image img {
  display: block;
  image-orientation: from-image;
  object-fit: contain;
}

.recent-hover-info {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 2px;
  padding: 8px;
  background: linear-gradient(rgba(17, 21, 27, .08), rgba(17, 21, 27, .9));
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease;
}

.recent-image:hover .recent-hover-info,
.recent-image:focus-visible .recent-hover-info {
  opacity: 1;
  transform: translateY(0);
}

.recent-hover-info strong,
.recent-hover-info span,
.recent-hover-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-hover-info strong {
  color: #fff;
  font-size: .82rem;
  line-height: 1.1;
}

.recent-hover-info span,
.recent-hover-info small {
  color: rgba(255, 255, 255, .82);
  font-size: .68rem;
  font-weight: 850;
}

.recent-image .placeholder span {
  width: 28px;
  height: 28px;
  border-width: 2px;
  font-size: .74rem;
}

.recent-image .placeholder small {
  display: none;
}

.recent-item > strong,
.recent-item > span,
.recent-item > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item > strong {
  font-size: .9rem;
  line-height: 1.2;
}

.recent-item > span,
.recent-item > small,
.recent-empty {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 850;
}

.item-set {
  min-height: 24px;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid rgba(17, 21, 27, .32);
  border-radius: 999px;
  background: rgba(49, 57, 69, .13);
  color: #303743;
  font-size: .78rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(17, 21, 27, .32);
  background: rgba(31, 157, 131, .16);
  color: #0d5f46;
  font-size: .72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.category-game {
  background: rgba(47, 111, 159, .16);
  color: #224f76;
}

.category-card {
  background: rgba(127, 63, 152, .16);
  color: #67347b;
}

.category-console {
  background: rgba(31, 157, 131, .16);
  color: #0d5f46;
}

.category-accessory {
  background: rgba(207, 96, 49, .16);
  color: #8b3f2f;
}

.category-other {
  background: rgba(91, 96, 104, .18);
  color: #404650;
}

.image-pill {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 1;
  background: rgba(245, 248, 250, .92);
  box-shadow: 0 3px 0 rgba(17, 21, 27, .34);
}

.item-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.item-meta span {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #303743;
  font-size: .78rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-hearts {
  color: #8f211a;
  text-align: center;
}

.visibility-chip {
  justify-self: start;
  padding: 3px 7px;
  border: 1px solid rgba(17, 21, 27, .24);
  border-radius: 999px;
  background: rgba(17, 21, 27, .08);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.privacy-toggle span {
  display: grid;
  gap: 2px;
}

.privacy-toggle small {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.item-card input,
.item-card select {
  height: 38px;
}

.item-card input,
.item-card select,
.item-card textarea {
  border-width: 2px;
  background: #f8fbfd;
}

.empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.settings-dialog,
.edit-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  background: transparent;
}

.settings-dialog::backdrop,
.edit-dialog::backdrop {
  background: rgba(24, 28, 34, .46);
}

.settings-dialog form,
.edit-dialog form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.edit-dialog {
  width: min(560px, calc(100vw - 28px));
}

.edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.edit-file-input {
  gap: 7px;
}

.detail-overlay {
  position: fixed;
  inset: 72px 18px 18px;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(17, 21, 27, .46);
}

.detail-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 420px) minmax(240px, 360px);
  gap: 16px;
  width: min(860px, 100%);
  max-height: min(620px, calc(100vh - 130px));
  overflow: auto;
  padding: 16px;
  border: 3px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#e7edf3, #cbd5df);
  box-shadow: inset 3px 3px 0 var(--highlight), inset -4px -4px 0 rgba(17, 21, 27, .18), var(--shadow);
}

.detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}

.detail-image {
  display: grid;
  min-height: 300px;
  place-items: center;
  overflow: hidden;
  border: 3px solid #171c23;
  border-radius: var(--radius);
  background: #1b222b;
}

.detail-image img,
.detail-image .placeholder {
  width: 100%;
  height: 100%;
  min-height: 300px;
  image-orientation: from-image;
  object-fit: contain;
}

.detail-copy {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 30px;
}

.detail-copy h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  line-height: 1;
}

.detail-copy p {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.45;
}

.detail-copy ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-copy li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 2px solid #667382;
  border-radius: var(--radius);
  background: #f8fbfd;
  box-shadow: inset 2px 2px 0 rgba(17, 21, 27, .08), inset -2px -2px 0 rgba(255, 255, 255, .8);
}

.detail-copy li span {
  color: var(--muted);
  font-weight: 850;
}

.detail-copy li strong {
  text-align: right;
}

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

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

.toggle-row input {
  width: 20px;
  height: 20px;
}

.settings-tools {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#f6f8fa, #dfe6ee);
}

.mod-tools {
  max-height: 420px;
  overflow: auto;
}

.mod-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.report-list {
  display: grid;
  gap: 10px;
}

.report-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 2px solid #171c23;
  border-radius: var(--radius);
  background: linear-gradient(#f8fafc, #e1e8ef);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .8), inset -2px -2px 0 rgba(17, 21, 27, .12), 0 3px 0 #171c23;
}

.report-card strong,
.report-card span,
.report-card small {
  display: block;
}

.report-card span,
.report-card small {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 850;
}

.report-card p {
  margin: 7px 0;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.35;
}

.report-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.report-actions button {
  min-height: 34px;
  padding: 0 8px;
  font-size: .74rem;
}

.settings-tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.import-button {
  display: grid;
  position: relative;
  min-height: 42px;
  place-items: center;
  border: 2px solid #11151b;
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 900;
  box-shadow: inset 2px 2px 0 var(--highlight), inset -3px -3px 0 rgba(17, 21, 27, .18), 0 3px 0 #11151b;
}

.import-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.danger-zone {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(157, 32, 24, .28);
  border-radius: var(--radius);
  background: rgba(157, 32, 24, .06);
}

.danger-zone strong {
  color: #8f211a;
}

.danger-zone p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
}

.danger-button {
  min-height: 40px;
  border: 1px solid #9d2018;
  border-radius: var(--radius);
  background: #9d2018;
  color: #fff;
  font-weight: 900;
}

.moderator-remove,
.report-upload-button {
  justify-self: start;
  padding: 0 12px;
}

menu {
  display: flex;
  justify-content: end;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .top-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar-dashboard {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .auth-panel,
  .dashboard-workspace {
    grid-template-columns: 1fr;
  }

  .recent-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .collection-panel {
    order: 1;
  }

  .liked-panel {
    order: 2;
  }

  .recent-panel:not(.liked-panel) {
    order: 3;
  }

  .auth-panel {
    min-height: auto;
  }

  .dashboard-head {
    align-items: stretch;
    flex-direction: column;
  }

  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 64px;
    gap: 10px;
  }

  .topbar-dashboard {
    grid-template-columns: 1fr;
  }

  .topbar-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .value-chart-popover {
    right: auto;
    left: 0;
    width: min(340px, calc(100vw - 32px));
  }

  .heart-tooltip {
    right: auto;
    left: 0;
    width: min(250px, calc(100vw - 32px));
  }

  .top-heart-wallet {
    min-width: 84px;
    padding: 5px 7px;
  }

  .user-menu-button {
    min-width: 84px;
  }

  .mod-users-button {
    min-width: 74px;
  }

  .mod-users-list {
    right: 0;
    width: min(270px, calc(100vw - 32px));
  }

  .top-heart-wallet > span {
    font-size: .58rem;
  }

  .brand small {
    display: none;
  }

  .brand-logo-wrap {
    width: 164px;
    height: 48px;
  }

  .auth-view,
  .dashboard {
    padding: 18px 12px 28px;
  }

  h1 {
    font-size: 2.4rem;
  }

  .head-metrics,
  .toolbar,
  .toolbar-filters,
  .toolbar-add-wrap,
  .field-row,
  .item-fields,
  .form-head {
    grid-template-columns: 1fr;
  }

  .form-head {
    display: grid;
  }


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

  .detail-overlay {
    inset: 64px 8px 8px;
    padding: 8px;
  }

  .detail-panel {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 86px);
  }

  .detail-image,
  .detail-image img,
  .detail-image .placeholder {
    min-height: 220px;
  }

  .detail-copy {
    padding-right: 0;
  }

  .edit-actions,
  .settings-tool-row {
    grid-template-columns: 1fr;
  }
}

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