:root {
  color-scheme: dark;
  --bg: #0c1016;
  --surface: #121923;
  --surface-2: #151c26;
  --surface-3: #1c2d47;
  --line: #26303d;
  --line-strong: #364457;
  --text: #e7edf6;
  --muted: #96a4b8;
  --accent: #83b1ff;
  --accent-2: #83b1ff;
  --green: #7edbb6;
  --yellow: #e8b95f;
  --red: #f18c98;
  --purple: #b79beb;
  --shadow: none;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 22px;
  letter-spacing: -0.04em;
}
h2 {
  letter-spacing: -0.025em;
}
.muted,
.subtitle {
  color: var(--muted);
}
.subtitle {
  margin-top: 5px;
  font-size: 12px;
}
.shell {
  max-width: 1800px;
  margin: 0 auto;
  padding: 24px 32px 56px 252px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #223653;
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
}
.topbar .brand-mark {
  display: none;
}
.top-actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.connection {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  margin-right: 6px;
}
.dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: var(--yellow);
}
.online .dot {
  background: var(--green);
}
.error .dot {
  background: var(--red);
}
.button {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  transition: background 0.15s;
}
.button:hover {
  background: #1e2836;
  border-color: #5c7391;
}
.button.primary,
.button.success {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a1526;
}
.button.primary:hover {
  background: #a1c3ff;
}
.button.danger {
  background: #2c1b24;
  border-color: #56313f;
  color: #f49eaa;
}
.button.ghost {
  background: transparent;
}
.button.small {
  min-height: 30px;
  padding: 5px 10px;
}
.tabs {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}
.nav-brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 10px 34px;
  font-size: 16px;
  font-weight: 750;
}
.nav-brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 1.7px;
  color: var(--muted);
  margin-top: 4px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--muted);
  padding: 0 14px 8px;
}
.tab {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.tab:hover {
  background: var(--surface-2);
  color: var(--text);
}
.tab.active {
  background: var(--surface-3);
  color: var(--accent);
  font-weight: 750;
}
.nav-icon {
  font-size: 17px;
  width: 20px;
  text-align: center;
}
.nav-footer {
  margin-top: auto;
  padding: 16px 12px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 11px;
  border-top: 1px solid var(--line);
}
.nav-footer strong {
  color: var(--muted);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 23px;
}
.page-heading h2 {
  font-size: 24px;
  font-weight: 700;
}
.page-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 7px;
  line-height: 1.7;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--accent);
  font-weight: 750;
  margin-bottom: 9px;
}
.date-chip {
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.metric {
  border-radius: 9px;
  padding: 18px;
  min-width: 0;
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
}
.metric-value {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -1.3px;
  margin-top: 12px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.metric-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.6;
}
.metric.featured {
  background: var(--surface);
  border-color: #385475;
  box-shadow: inset 0 2px #83b1ff;
}
.metric.featured .metric-value {
  color: var(--accent);
}
.metric.featured .metric-label,
.metric.featured .metric-note {
  color: var(--muted);
}
.secondary-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 0 4px 20px;
  font-size: 12px;
  color: var(--muted);
}
.secondary-metrics b {
  color: var(--text);
  margin-left: 7px;
  font-weight: 700;
}
.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
  margin-bottom: 20px;
}
.panel {
  min-width: 0;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 18px;
}
.layout-2 > .panel {
  margin-bottom: 0;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  font-size: 15px;
  font-weight: 700;
}
.panel-description {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.panel-body {
  padding: 18px;
}
.table-wrap {
  overflow: auto;
  width: 100%;
  max-height: 620px;
  scrollbar-width: thin;
  scrollbar-color: #3b4859 transparent;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
}
th,
td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 12px;
  vertical-align: middle;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #151c26;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #192331;
}
.wrap,
td.wrap {
  max-width: 280px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.65;
}
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.count-strong {
  font-size: 16px;
  font-weight: 750;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.identity {
  display: flex;
  gap: 10px;
  align-items: center;
}
.avatar {
  display: grid;
  place-items: center;
  background: #1e2a3a;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #a9c2e8;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.identity strong {
  display: block;
  font-size: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.identity small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.name-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.name-button:hover {
  color: var(--accent);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 650;
}
.badge.green {
  background: #152e28;
  color: #7edbb6;
}
.badge.gray {
  background: #232b38;
  color: #a5b1c2;
}
.badge.yellow {
  background: #342b1c;
  color: #eed096;
}
.badge.red {
  background: #34212a;
  color: #f4a7b3;
}
.badge.blue {
  background: #1c2f4b;
  color: #a6c8ff;
}
.badge.purple {
  background: #2a243c;
  color: #c7b0f0;
}
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.inventory-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  background: var(--surface-2);
}
.inventory-name {
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.inventory-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}
.bar {
  height: 5px;
  background: #263345;
  border-radius: 6px;
  margin-top: 10px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.toolbar .field {
  width: 260px;
}
.toolbar .compact {
  width: 150px;
}
.filter-group {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.field {
  grid-column: span 3;
  min-width: 0;
}
.field.span-2 {
  grid-column: span 6;
}
.field.full {
  grid-column: 1/-1;
}
label,
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
input,
select {
  height: 38px;
  padding: 0 11px;
}
textarea {
  min-height: 86px;
  padding: 10px;
  resize: vertical;
  line-height: 1.6;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #83b1ff;
  outline-offset: 1px;
}
input:disabled {
  opacity: 0.5;
}
select[multiple] {
  height: 145px;
  padding: 6px;
}
select[multiple] option {
  padding: 6px;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 400;
  margin: 0;
  color: var(--text);
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}
.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.truncated-product-name {
  cursor: help;
  border-bottom: 1px dotted #526681;
}
.mono {
  font-variant-numeric: tabular-nums;
}
.text-green {
  color: var(--green);
}
.text-blue {
  color: var(--accent);
}
.text-yellow {
  color: var(--yellow);
}
.text-red {
  color: var(--red);
}
.empty {
  padding: 36px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
}
.boost-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.boost-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.boost-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.boost-head h3 {
  font-size: 14px;
}
.boost-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.boost-message {
  grid-column: 1/-1;
}
.total-chance {
  font-size: 27px;
  color: var(--accent);
  font-weight: 700;
}
.audit-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  padding: 6px 0;
}
.audit-details pre {
  max-width: 620px;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #0d121a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  font:
    11px/1.6 ui-monospace,
    Consolas,
    monospace;
  color: #bdcadd;
}
.audit-diff {
  min-width: 280px;
  max-width: 600px;
  font-size: 11px;
  white-space: normal;
}
.diff-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.diff-before {
  color: #e5a7b0;
}
.diff-after {
  color: #86dcb6;
}
dialog {
  width: min(800px, calc(100% - 28px));
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 30px 100px #00000080;
  color: var(--text);
  background: var(--surface);
}
dialog::backdrop {
  background: #000000a6;
  backdrop-filter: blur(3px);
}
.dialog-header,
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  background: var(--surface);
  position: sticky;
  z-index: 3;
}
.dialog-header {
  top: 0;
  border-bottom: 1px solid var(--line);
}
.dialog-footer {
  bottom: 0;
  border-top: 1px solid var(--line);
}
.dialog-body {
  padding: 22px;
}
.stock-control {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 5px;
}
.stock-control .button {
  padding: 0;
}
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 20;
  max-width: 440px;
  background: #203b36;
  color: var(--text);
  border-radius: 10px;
  padding: 15px 20px;
  box-shadow: 0 10px 40px #00000066;
  font-size: 13px;
  line-height: 1.7;
}
.toast.error {
  background: #59313c;
}
.banner {
  padding: 12px 16px;
  background: #2b261b;
  color: #e6c78c;
  border: 1px solid #504329;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 12px;
  line-height: 1.7;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  gap: 12px;
}
.pager-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 170px;
  padding: 8px 0 0;
}
.chart-col {
  display: flex;
  flex: 1;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}
.chart-bar {
  width: 100%;
  max-width: 30px;
  background: #3c5d88;
  border-radius: 4px 4px 0 0;
  min-height: 3px;
}
.chart-col:last-child .chart-bar {
  background: var(--accent);
}
.chart-col small {
  font-size: 9px;
  color: var(--muted);
}
.chart-col b {
  font-size: 10px;
  color: #9daec5;
  font-weight: 500;
}
.leaderboard {
  display: grid;
  gap: 16px;
}
.leader-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.leader-row .rank {
  width: 14px;
  color: var(--muted);
  font-size: 11px;
}
.leader-row .leader-count {
  margin-left: auto;
  font-size: 14px;
  font-weight: 750;
  color: var(--accent);
}
.user-summary {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
.user-summary .metric {
  padding: 14px;
  background: var(--surface-2);
}
.user-summary .metric-value {
  font-size: 24px;
}
.advanced {
  grid-column: 1/-1;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 4px 0;
}
.advanced > summary {
  cursor: pointer;
  padding: 14px;
  font-size: 12px;
  font-weight: 650;
}
.advanced > div {
  padding: 16px;
}
.skip-link {
  position: absolute;
  top: -60px;
  background: #223653;
  color: var(--accent);
  padding: 12px;
  z-index: 99;
}
.skip-link:focus {
  top: 8px;
}
.section-note {
  margin: 12px 20px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #83b1ff;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1800px) {
  .tabs {
    left: calc((100vw - 1800px) / 2);
  }
}
@media (max-width: 1200px) {
  .shell {
    padding: 24px 24px 60px 224px;
  }
  .tabs {
    width: 200px;
  }
  .layout-2 {
    grid-template-columns: 1fr;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 16px;
  }
  .topbar {
    align-items: flex-start;
  }
  .top-actions {
    justify-content: flex-end;
  }
  .connection {
    width: 100%;
    justify-content: flex-end;
  }
}
@media (max-width: 800px) {
  .shell {
    width: 100%;
    padding: 18px 16px 40px;
  }
  .tabs {
    position: sticky;
    top: 0;
    inset: auto;
    flex-direction: row;
    width: auto;
    margin: 0 -16px 24px;
    padding: 8px 16px;
    overflow: auto;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #10161ff5;
    border-radius: 0;
  }
  .nav-brand,
  .nav-label,
  .nav-footer {
    display: none;
  }
  .tab {
    padding: 9px 12px;
    font-size: 12px;
  }
  .nav-icon {
    display: none;
  }
  .topbar {
    margin-bottom: 12px;
    padding-bottom: 15px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .topbar .brand-mark {
    display: grid;
  }
  .top-actions {
    justify-content: flex-start;
    width: 100%;
  }
  .connection {
    width: auto;
    justify-content: flex-start;
    margin-right: auto;
  }
  .topbar h1 {
    font-size: 17px;
  }
  .subtitle {
    font-size: 10px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-value {
    font-size: 27px;
  }
  .page-heading h2 {
    font-size: 23px;
  }
  .page-heading {
    align-items: flex-start;
  }
  .date-chip {
    display: none;
  }
  .field,
  .field.span-2 {
    grid-column: 1/-1;
  }
  .boost-grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    align-items: stretch;
    gap: 14px;
  }
  .toolbar .field {
    width: 100%;
  }
  .toolbar .compact {
    width: auto;
    flex: 1;
  }
  .filter-group {
    width: 100%;
  }
  .panel-header {
    padding: 16px;
    flex-wrap: wrap;
  }
  .panel-body {
    padding: 16px;
  }
  .inventory-grid {
    grid-template-columns: 1fr 1fr;
  }
  .table-wrap table {
    min-width: 720px;
  }
  .user-summary {
    grid-template-columns: 1fr 1fr;
  }
  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
  .pager {
    padding: 14px;
    flex-wrap: wrap;
  }
  .chart {
    gap: 5px;
  }
  .secondary-metrics {
    font-size: 11px;
    gap: 8px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.inventory-layout .inventory-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
[data-panel="overview"] #overview-attempts {
  font-size: 12px;
}
@media (max-width: 1200px) {
  .inventory-layout .inventory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .inventory-layout .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
