:root {
  --bg: #070b1a;
  --bg-soft: #0b1126;
  --surface: #101a35;
  --surface-2: #142140;
  --text: #f7faff;
  --muted: #9eaccb;
  --line: rgba(154, 181, 238, 0.17);
  --blue: #41a9ff;
  --violet: #9f6cff;
  --cyan: #61e7ff;
  --green: #5ee6a8;
  --red: #ff788a;
  --gold: #f3c45f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 0, rgba(85, 74, 255, 0.16), transparent 32rem),
    radial-gradient(circle at 5% 35%, rgba(36, 174, 255, 0.1), transparent 26rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
code { font-family: "SFMono-Regular", Consolas, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 900; letter-spacing: .14em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--cyan); border: 1px solid rgba(97,231,255,.48); background: rgba(65,169,255,.1); box-shadow: 0 0 26px rgba(65,169,255,.2); transform: rotate(45deg); }
.eyebrow { margin: 0 0 12px; color: var(--cyan); font-size: .72rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.eyebrow > span { display: inline-block; width: 24px; height: 1px; margin-right: 9px; vertical-align: middle; background: linear-gradient(90deg, var(--cyan), transparent); }

.primary-button, .secondary-button, .text-button, .danger-button, .small-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 11px;
  font-weight: 850;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.primary-button { border: 0; background: linear-gradient(135deg, var(--blue), var(--violet)); box-shadow: 0 12px 30px rgba(72,101,255,.27); }
.secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.text-button { min-height: 40px; border: 1px solid var(--line); color: var(--muted); }
.danger-button { border: 1px solid rgba(255,120,138,.35); background: rgba(255,120,138,.08); color: #ffacb7; }
.small-button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); background: rgba(255,255,255,.04); font-size: .82rem; }
.primary-button:hover, .secondary-button:hover, .text-button:hover, .danger-button:hover, .small-button:hover { transform: translateY(-1px); }
.wide { width: 100%; }

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(151,177,230,.2);
  border-radius: 10px;
  outline: 0;
  background: rgba(6,11,27,.72);
}
input, select { min-height: 46px; padding: 0 13px; }
textarea { min-height: 110px; padding: 12px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(97,231,255,.64); box-shadow: 0 0 0 3px rgba(65,169,255,.1); }
label > span { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 800; color: #dce6fb; }
label small { display: block; margin-top: 6px; color: var(--muted); font-size: .72rem; }

.notice { margin: 0 0 20px; padding: 14px 16px; border: 1px solid rgba(94,230,168,.3); border-radius: 12px; background: rgba(94,230,168,.08); color: #c7ffe2; }
.notice.error { border-color: rgba(255,120,138,.32); background: rgba(255,120,138,.08); color: #ffd0d6; }
.notice.warning { border-color: rgba(243,196,95,.32); background: rgba(243,196,95,.08); color: #ffe4a8; }
.notice ul { margin: 8px 0 0; padding-left: 20px; }

/* Public catalog */
.catalog-header, .catalog-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.catalog-header { min-height: 82px; }
.catalog-header nav { display: flex; align-items: center; gap: 26px; color: var(--muted); font-size: .88rem; font-weight: 750; }
.catalog-header nav a:hover { color: var(--text); }
.server-copy { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03); }
.catalog-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 90px; }
.catalog-hero { min-height: 330px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 65px 0 48px; }
.catalog-hero > div:first-child { max-width: 780px; }
.catalog-hero h1 { margin-bottom: 18px; font-size: clamp(3rem, 7vw, 6.2rem); line-height: .94; letter-spacing: -.06em; }
.catalog-hero p:last-child { max-width: 650px; color: var(--muted); font-size: 1.05rem; }
.catalog-orbit { width: 180px; aspect-ratio: 1; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(97,231,255,.22); border-radius: 50%; color: var(--cyan); font-size: 4rem; background: radial-gradient(circle, rgba(65,169,255,.2), transparent 64%); box-shadow: 0 0 80px rgba(65,109,255,.2); }
.catalog-filters { display: grid; grid-template-columns: minmax(280px, 1fr) 180px 180px auto auto; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(16,27,56,.78); box-shadow: var(--shadow); }
.catalog-search { min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 0 13px; border: 1px solid rgba(151,177,230,.2); border-radius: 10px; background: rgba(6,11,27,.72); }
.catalog-search > span:first-child { color: var(--cyan); font-size: 1.35rem; }
.catalog-search input { min-height: auto; padding: 0; border: 0; background: transparent; box-shadow: none; }
.clear-filter { padding: 8px; color: var(--muted); font-size: .8rem; font-weight: 800; text-align: center; }
.catalog-summary { min-height: 78px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.catalog-summary p { margin: 0; }
.catalog-summary strong { color: var(--text); }
.catalog-pagination { margin-top: 28px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; background: rgba(16,27,56,.78); }
.pagination-pages { display: flex; justify-content: center; align-items: center; gap: 7px; flex-wrap: wrap; }
.pagination-number, .pagination-arrow, .pagination-ellipsis { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; color: #cbd8ef; background: rgba(255,255,255,.025); font-size: .8rem; font-weight: 800; }
.pagination-arrow { padding: 0 13px; white-space: nowrap; }
.pagination-number:hover, .pagination-arrow:hover { border-color: rgba(97,231,255,.45); color: var(--text); }
.pagination-number.active { border-color: transparent; color: #061226; background: linear-gradient(135deg,var(--cyan),var(--violet)); }
.pagination-arrow.disabled { pointer-events: none; opacity: .42; }
.pagination-ellipsis { min-width: 24px; border-color: transparent; background: transparent; }
.pagination-label { display: none; color: var(--muted); font-size: .8rem; text-align: center; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.catalog-card { min-height: 470px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(150deg, rgba(21,35,69,.94), rgba(10,17,37,.95)); box-shadow: 0 18px 50px rgba(0,0,0,.18); transition: transform .2s ease, border-color .2s ease; }
.catalog-card:hover { transform: translateY(-4px); border-color: rgba(97,231,255,.42); }
.item-art { height: 265px; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle, rgba(79,115,255,.19), transparent 63%), rgba(4,9,24,.5); border-bottom: 1px solid var(--line); }
.item-art img { max-width: 94%; max-height: 220px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 24px 30px rgba(0,0,0,.48)); }
.item-art > span { color: var(--cyan); font-size: 4rem; opacity: .65; }
.item-card-copy { padding: 22px; }
.item-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: .71rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.rarity { color: var(--cyan); }
.rarity-legendary, .rarity-limited { color: var(--gold); }
.rarity-mythical { color: #d798ff; }
.rarity-epic { color: #b78cff; }
.rarity-rare { color: #66c3ff; }
.rarity-uncommon { color: #72e5a7; }
.catalog-card h2 { margin-bottom: 8px; font-size: 1.4rem; }
.catalog-card p { min-height: 50px; margin-bottom: 18px; color: var(--muted); font-size: .88rem; }
.view-item { font-size: .82rem; font-weight: 850; }
.catalog-empty { min-height: 370px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed rgba(151,177,230,.25); border-radius: 20px; background: rgba(14,24,50,.5); }
.catalog-empty > div { margin-bottom: 10px; color: var(--cyan); font-size: 3.4rem; }
.catalog-empty h1, .catalog-empty h2 { margin-bottom: 8px; }
.catalog-empty p { color: var(--muted); }
.catalog-empty .primary-button { margin-top: 10px; }
.catalog-footer { min-height: 120px; border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); font-size: .78rem; }
.catalog-footer p { margin: 0; }

/* Detail page */
.breadcrumbs { display: flex; align-items: center; gap: 10px; padding: 28px 0; color: var(--muted); font-size: .8rem; }
.breadcrumbs a:hover { color: var(--text); }
.item-detail { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(0, 1.18fr); gap: 48px; align-items: start; padding: 24px 0 90px; }
.detail-art-column { position: sticky; top: 24px; }
.detail-art { min-height: 480px; display: grid; place-items: center; padding: 38px; border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(circle, rgba(75,119,255,.22), transparent 62%), linear-gradient(145deg, #111e3d, #090f22); box-shadow: var(--shadow); }
.detail-art img { max-height: 380px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 28px 34px rgba(0,0,0,.48)); }
.detail-art > span { color: var(--cyan); font-size: 6rem; }
.detail-id { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: .75rem; }
.detail-id code { color: var(--cyan); }
.detail-copy { padding-top: 15px; }
.detail-copy h1 { margin-bottom: 18px; font-size: clamp(3rem, 6vw, 5.6rem); line-height: .95; letter-spacing: -.055em; }
.detail-description { max-width: 720px; color: #bac8e4; font-size: 1.08rem; }
.detail-section { margin-top: 30px; padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: rgba(16,27,55,.68); }
.detail-section h2 { margin-bottom: 14px; font-size: 1.12rem; }
.detail-section p { margin-bottom: 0; color: var(--muted); }
.lore-section { border-color: rgba(159,108,255,.28); background: rgba(102,70,178,.08); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 0; }
.stat-grid > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 13px; border-radius: 9px; background: rgba(5,10,25,.52); }
.stat-grid dt { color: var(--muted); }
.stat-grid dd { margin: 0; font-weight: 850; color: var(--cyan); text-align: right; }
.detail-copy > .secondary-button { margin-top: 28px; }

/* Login and setup */
.login-page, .setup-page { display: grid; place-items: center; padding: 30px 20px; }
.login-shell, .setup-shell { width: 100%; display: grid; place-items: center; }
.login-card, .setup-card { width: min(470px, 100%); padding: 38px; border: 1px solid rgba(151,177,230,.2); border-radius: 22px; background: linear-gradient(150deg, rgba(20,34,68,.98), rgba(8,14,31,.98)); box-shadow: var(--shadow); }
.setup-card { width: min(860px, 100%); }
.login-heading { margin: 45px 0 28px; }
.login-heading h1, .setup-card h1 { margin-bottom: 12px; font-size: clamp(2.3rem, 7vw, 3.6rem); line-height: 1; letter-spacing: -.05em; }
.login-heading p:last-child, .setup-intro, .setup-card > p { color: var(--muted); }
.stack-form { display: grid; gap: 16px; }
.stack-form .primary-button { margin-top: 4px; }
.back-link { display: block; margin-top: 23px; color: var(--muted); font-size: .78rem; font-weight: 750; text-align: center; }
.login-switch { margin: 18px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.login-switch a { color: var(--cyan); font-weight: 850; }
.registration-card { width: min(520px, 100%); }
.registration-success { margin-bottom: 30px; }
.registration-success .setup-icon { margin-bottom: 22px; }
.registration-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.setup-card > .eyebrow { margin-top: 42px; }
.setup-form { display: grid; gap: 22px; margin-top: 30px; }
.setup-form fieldset { margin: 0; padding: 21px; border: 1px solid var(--line); border-radius: 14px; }
.setup-form legend { padding: 0 8px; font-weight: 850; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.span-two { grid-column: 1 / -1; }
.setup-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 26px; border-radius: 50%; color: #08172a; background: var(--green); font-size: 1.8rem; font-weight: 900; box-shadow: 0 0 45px rgba(94,230,168,.28); }
.success-card { text-align: left; }
.setup-warning { margin: 24px 0; padding: 15px; border: 1px solid rgba(243,196,95,.3); border-radius: 11px; background: rgba(243,196,95,.08); color: #ffe2a1; }

/* Admin */
.admin-page { padding-left: 250px; background: #080d1d; }
.admin-sidebar { width: 250px; position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; overflow-y: auto; padding: 27px 20px 20px; border-right: 1px solid var(--line); background: linear-gradient(180deg, #0d1730, #080d1d); }
.admin-kicker { margin: 7px 0 28px 44px; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .13em; }
.admin-nav { display: grid; gap: 5px; }
.admin-nav a { min-height: 43px; position: relative; display: flex; align-items: center; gap: 11px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-size: .83rem; font-weight: 760; }
.admin-nav a > span { width: 20px; color: var(--cyan); text-align: center; }
.admin-nav a:hover, .admin-nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(65,169,255,.14), rgba(159,108,255,.08)); }
.nav-badge { min-width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: auto; padding: 0 5px; border-radius: 999px; color: #08101f; background: var(--gold); font-size: .65rem; }
.admin-account { display: grid; gap: 4px; margin-top: auto; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.admin-account > span { color: var(--muted); font-size: .66rem; }
.admin-account strong { font-size: .84rem; }
.admin-account > small { color: var(--cyan); font-size: .65rem; font-weight: 800; }
.admin-account a, .admin-account button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: .7rem; text-align: left; }
.admin-account a { margin-top: 8px; }
.admin-main { width: min(1300px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 80px; }
.narrow-main { max-width: 800px; margin-left: 42px; }
.admin-topbar { min-height: 125px; display: flex; align-items: flex-start; justify-content: space-between; gap: 26px; }
.admin-topbar h1 { margin-bottom: 8px; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1; letter-spacing: -.045em; }
.admin-topbar p:last-child { margin-bottom: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 18px; }
.metric-grid article { min-height: 148px; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(19,32,64,.94), rgba(11,18,39,.94)); }
.metric-grid span { color: var(--muted); font-size: .76rem; font-weight: 760; }
.metric-grid strong { margin: 10px 0 2px; font-size: 2.4rem; line-height: 1; letter-spacing: -.05em; }
.metric-grid small { margin-top: auto; color: #7282a5; }
.admin-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(14,24,50,.82); }
.panel-heading { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin-bottom: 3px; font-size: 1.05rem; }
.panel-heading p { margin: 0; color: var(--muted); font-size: .74rem; }
.admin-filter { display: flex; gap: 8px; }
.admin-filter input { width: 210px; }
.admin-filter select { width: 145px; }
.admin-filter button { padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.045); }
.item-table-wrap { overflow-x: auto; }
.item-table { width: 100%; border-collapse: collapse; font-size: .79rem; }
.item-table th { padding: 12px 16px; color: #7484a7; font-size: .66rem; letter-spacing: .1em; text-align: left; text-transform: uppercase; background: rgba(4,9,23,.36); }
.item-table td { padding: 13px 16px; border-top: 1px solid rgba(151,177,230,.1); color: #c5d0e8; }
.table-item { min-width: 220px; display: flex; align-items: center; gap: 12px; }
.table-thumb { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; background: radial-gradient(circle, rgba(65,169,255,.16), transparent); }
.table-thumb img { max-width: 42px; max-height: 42px; image-rendering: pixelated; }
.table-thumb span { color: var(--cyan); font-size: 1.4rem; }
.table-item strong, .table-item small { display: block; }
.table-item strong { color: var(--text); font-size: .84rem; }
.table-item small { max-width: 190px; overflow: hidden; color: #7484a7; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: .65rem; font-weight: 850; }
.status-badge.published { color: #bff8dc; background: rgba(94,230,168,.12); }
.status-badge.draft { color: #d5dcf0; background: rgba(159,174,209,.1); }
.status-badge.approved { color: #bff8dc; background: rgba(94,230,168,.12); }
.status-badge.pending { color: #ffe3a4; background: rgba(243,196,95,.12); }
.status-badge.rejected { color: #ffc2ca; background: rgba(255,120,138,.12); }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions a { margin-left: 12px; color: var(--cyan); font-weight: 800; }
.admin-empty { min-height: 340px; display: grid; place-items: center; align-content: center; padding: 35px; text-align: center; }
.empty-gem { margin-bottom: 8px; color: var(--cyan); font-size: 3.2rem; }
.admin-empty h3 { margin-bottom: 7px; }
.admin-empty p { max-width: 480px; color: var(--muted); }
.admin-empty .primary-button { margin-top: 8px; }

/* Plan statistics: the embedded application is isolated from the admin session. */
.statistics-main { width: min(1600px, calc(100% - 48px)); }
.statistics-topbar { min-height: 132px; }
.statistics-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.statistics-context { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; background: linear-gradient(110deg,#122641,#221c40); }
.statistics-context > div { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.statistics-context strong { font-size: .86rem; }
.statistics-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
.statistics-powered { color: var(--muted); font-size: .73rem; }
.statistics-frame-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 0 0 16px 16px; background: #0b1428; }
.statistics-frame { display: block; width: 100%; height: max(760px, calc(100vh - 250px)); border: 0; background: #0b1428; }
.statistics-notes { display: flex; justify-content: space-between; align-items: start; gap: 30px; margin-top: 15px; color: var(--muted); font-size: .75rem; }
.statistics-notes > p { max-width: 650px; }
.statistics-notes details { max-width: 440px; }
.statistics-notes summary { cursor: pointer; color: #b9cae8; }
.statistics-notes details p { margin-top: 8px; }
@media (max-width: 760px) {
  .statistics-main { width: calc(100% - 20px); }
  .statistics-topbar { padding-bottom: 20px; }
  .statistics-context { align-items: flex-start; flex-direction: column; }
  .statistics-frame { height: 900px; }
  .statistics-notes { flex-direction: column; gap: 4px; }
}

/* Item editor */
.item-editor-topbar { min-height: 145px; }
.item-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.editor-main { display: grid; gap: 18px; }
.form-panel { padding-bottom: 22px; }
.form-panel > .form-grid, .form-panel > .stack-form { padding: 20px; }
.form-panel > label { display: block; margin: 18px 20px 0; }
.slug-input { display: flex; align-items: center; overflow: hidden; border: 1px solid rgba(151,177,230,.2); border-radius: 10px; background: rgba(6,11,27,.72); }
.slug-input > span { padding-left: 13px; color: #7181a4; font-size: .78rem; white-space: nowrap; }
.slug-input input { border: 0; background: transparent; }
.stat-list { display: grid; gap: 9px; padding: 20px; }
.stat-row { display: grid; grid-template-columns: .75fr 1fr 40px; gap: 9px; }
.stat-row button { border: 1px solid rgba(255,120,138,.22); border-radius: 9px; background: rgba(255,120,138,.07); color: #ff9bab; font-size: 1.3rem; }
.sticky-panel { position: sticky; top: 20px; }
.upload-box { display: block; cursor: pointer; }
.upload-box > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-preview { min-height: 235px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 20px; border: 1px dashed rgba(97,231,255,.32); border-radius: 13px; text-align: center; background: radial-gradient(circle, rgba(65,169,255,.12), transparent 65%); }
.upload-preview img { max-height: 190px; object-fit: contain; image-rendering: pixelated; }
.upload-preview small { margin: 0; }
.upload-gem { color: var(--cyan); font-size: 3.2rem; }
.check-row { display: flex !important; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; }
.check-row input { width: 16px; min-height: 16px; }
.editor-sidebar .wide { margin: 11px 20px 0; width: calc(100% - 40px); }
#delete-item-form { display: none; }
.permission-note { margin: 18px 20px 0; padding: 13px; border: 1px solid rgba(243,196,95,.24); border-radius: 10px; background: rgba(243,196,95,.07); }
.permission-note strong, .permission-note span { display: block; }
.permission-note strong { color: #ffe2a1; font-size: .78rem; }
.permission-note span { margin-top: 3px; color: var(--muted); font-size: .7rem; }

/* Staff access */
.permission-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.permission-grid article { min-height: 122px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, rgba(19,32,64,.9), rgba(11,18,39,.9)); }
.permission-grid strong { color: var(--cyan); font-size: .8rem; }
.permission-grid p { margin: 8px 0 0; color: var(--muted); font-size: .72rem; }
.staff-list { display: grid; }
.staff-row { display: grid; grid-template-columns: minmax(250px, 1.4fr) 150px 150px 125px auto; align-items: end; gap: 12px; padding: 18px 20px; border-top: 1px solid rgba(151,177,230,.11); }
.staff-row:first-child { border-top: 0; }
.staff-row.pending-row { background: rgba(243,196,95,.035); }
.staff-identity { display: flex; align-items: center; gap: 12px; align-self: center; min-width: 0; }
.staff-avatar { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(97,231,255,.25); border-radius: 11px; color: var(--cyan); background: rgba(65,169,255,.08); font-weight: 900; }
.staff-identity strong, .staff-identity span, .staff-identity small { display: block; }
.staff-identity strong { font-size: .86rem; }
.staff-identity span { max-width: 280px; overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.staff-identity small { margin-top: 3px; color: #697a9f; font-size: .64rem; }
.staff-row label > span { margin-bottom: 5px; font-size: .68rem; }
.staff-row select { min-height: 40px; font-size: .75rem; }
.active-toggle { min-height: 40px; display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.active-toggle input { width: 16px; min-height: 16px; }
.active-toggle > span { margin: 0; color: var(--muted); white-space: nowrap; }
.staff-row .small-button { min-height: 40px; }
.owner-lock { grid-column: 2 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; align-self: center; color: var(--muted); }
.owner-lock strong { color: var(--text); font-size: .78rem; }
.owner-lock small { font-size: .68rem; }

@media (max-width: 1050px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .catalog-filters { grid-template-columns: 1fr 1fr 1fr; }
  .catalog-search { grid-column: 1 / -1; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .permission-grid { grid-template-columns: repeat(2, 1fr); }
  .staff-row { grid-template-columns: minmax(240px, 1fr) 140px 140px; }
  .staff-row .active-toggle, .staff-row .small-button { grid-column: auto; }
  .owner-lock { grid-column: 2 / -1; }
  .item-editor { grid-template-columns: 1fr; }
  .editor-sidebar { grid-row: 1; }
  .sticky-panel { position: static; }
}

@media (max-width: 760px) {
  .catalog-header { min-height: 72px; }
  .catalog-header nav a:not(:last-of-type):not(.nav-bans) { display: none; }
  .catalog-header .server-copy { display: none; }
  .catalog-orbit { display: none; }
  .catalog-hero { min-height: 290px; }
  .catalog-filters { grid-template-columns: 1fr; }
  .catalog-search { grid-column: auto; }
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-pagination { grid-template-columns: 1fr 1fr; }
  .catalog-pagination .pagination-pages { grid-column: 1 / -1; grid-row: 1; }
  .catalog-pagination .pagination-label { display: block; grid-column: 1 / -1; grid-row: 2; }
  .catalog-pagination .pagination-arrow { grid-row: 3; }
  .catalog-pagination .pagination-arrow:last-child { justify-self: end; }
  .catalog-footer { padding: 28px 0; flex-direction: column; text-align: center; }
  .item-detail { grid-template-columns: 1fr; gap: 25px; }
  .detail-art-column { position: static; }
  .detail-art { min-height: 340px; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .setup-form .form-grid > span:empty { display: none; }
  .admin-page { padding-left: 0; padding-bottom: 72px; }
  .admin-sidebar { width: 100%; height: 64px; inset: auto 0 0; flex-direction: row; align-items: center; padding: 8px; border-top: 1px solid var(--line); border-right: 0; }
  .admin-sidebar > .brand, .admin-kicker, .admin-account { display: none; }
  .admin-nav { width: 100%; display: flex; overflow-x: auto; gap: 3px; }
  .admin-nav a { flex: 1 0 44px; min-height: 48px; justify-content: center; padding: 0; font-size: 0; }
  .admin-nav a > span { font-size: 1.15rem; }
  .admin-nav .nav-badge { position: absolute; margin: -22px 0 0 22px; font-size: .58rem; }
  .admin-main, .narrow-main { width: min(100% - 24px, 680px); margin: 0 auto; padding-top: 20px; }
  .admin-topbar { min-height: 150px; flex-direction: column; justify-content: center; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .admin-filter { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .admin-filter input { width: auto; grid-column: 1 / -1; }
  .admin-filter select { width: auto; }
  .item-table .column-category, .item-table .column-rarity, .item-table .column-updated { display: none; }
  .item-editor { display: block; }
  .editor-main { margin-top: 18px; }
  .stat-row { grid-template-columns: 1fr 40px; }
  .stat-row input:first-child { grid-column: 1 / -1; }
  .permission-grid { grid-template-columns: 1fr; }
  .staff-row { grid-template-columns: 1fr 1fr; align-items: end; }
  .staff-identity { grid-column: 1 / -1; }
  .owner-lock { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 480px) {
  .catalog-header, .catalog-footer, .catalog-main { width: min(100% - 24px, 1180px); }
  .catalog-header nav a:not(.nav-bans) { display: none !important; }
  .catalog-hero h1 { font-size: 3.25rem; }
  .item-art { height: 230px; }
  .login-card, .setup-card { padding: 25px; }
  .setup-form fieldset { padding: 15px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-grid article { min-height: 125px; padding: 15px; }
  .metric-grid strong { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
