:root {
  --bg: #070b18;
  --panel: #121a33;
  --line: rgba(255, 255, 255, .14);
  --text: #f1f5ff;
  --muted: #a9b5d6;
  --accent: #6aa6ff;
  --accent-2: #7effc4;
  --warn: #ffd36a;
}

[hidden] {
  display: none !important;
}

.winner-ops {
  display: grid;
  gap: 8px;
  min-width: 320px;
}

.winner-ops .inline-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 6px 12px;
}

.winner-ops .stacked-form {
  align-items: stretch;
  display: grid;
  gap: 6px;
}

.winner-ops .inline-field {
  display: grid;
  gap: 4px;
  margin: 0;
}

.winner-ops .inline-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.winner-ops .note-field textarea {
  min-height: 52px;
  resize: vertical;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", "Pretendard", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    linear-gradient(130deg, rgba(106, 166, 255, .16), transparent 32%),
    linear-gradient(310deg, rgba(126, 255, 196, .10), transparent 34%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.portal-language {
  position: fixed;
  right: clamp(18px, 5vw, 56px);
  top: clamp(18px, 5vw, 36px);
  z-index: 10;
}

.language-selector {
  position: relative;
}

.language-selector summary {
  list-style: none;
}

.language-selector summary::-webkit-details-marker {
  display: none;
}

.lang-current,
.lang-option {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.lang-current {
  min-width: 78px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lang-current::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .75;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--line);
  background: rgba(13, 20, 42, .98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .36);
  display: grid;
  gap: 4px;
}

.lang-option {
  color: var(--muted);
  border-radius: 8px;
  display: block;
}

.lang-option.active {
  color: #06101f;
  background: var(--accent-2);
  border-color: transparent;
}

.portal-shell {
  min-height: 100vh;
  padding: clamp(18px, 5vw, 56px);
  display: grid;
  place-items: center;
}

.portal-panel {
  width: min(780px, 100%);
  min-height: 420px;
  padding: clamp(28px, 7vw, 72px);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18, 26, 51, .96), rgba(7, 11, 24, .94));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .38);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(2.2rem, 7vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.action-row {
  margin-top: 30px;
}

.btn {
  min-height: 52px;
  padding: 13px 22px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  color: #06101f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 32px rgba(106, 166, 255, .28);
}

.btn.disabled {
  opacity: .45;
  pointer-events: none;
}

.notice {
  margin: 18px 0 0;
  color: var(--warn);
  line-height: 1.5;
}

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

.dashboard-nav {
  min-height: 68px;
  padding: 16px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(18, 26, 51, .86);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu-group {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-group h2 {
  margin: 0;
  padding: 0 4px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.menu-group-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-link {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  font-size: 14px;
  font-weight: 800;
}

.empty-dashboard {
  padding: clamp(28px, 7vw, 72px);
}

.data-view {
  padding: clamp(22px, 4vw, 44px);
}

.empty-dashboard h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.muted {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.role-list {
  width: min(520px, 100%);
  margin-top: 28px;
  display: grid;
  gap: 10px;
}

.role-item {
  min-height: 48px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.role-item strong {
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.role-item span {
  text-align: right;
}

.implementation-note {
  width: min(720px, 100%);
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.implementation-note h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.implementation-note p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.implementation-note code {
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .94em;
}

.implementation-note.inline-note {
  width: 100%;
  margin-top: 0;
}

.filters {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.filters select,
.filters input:not([type="checkbox"]) {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font: inherit;
}

.filters select,
.settings-form select {
  color-scheme: dark;
  background: #121a33;
  color: var(--text);
}

.filters select option,
.settings-form select option {
  background: #121a33;
  color: var(--text);
}

.showdown-applications-filter {
  grid-template-columns: minmax(130px, 160px) minmax(220px, 320px) minmax(120px, 150px) minmax(220px, 1fr) auto auto;
}

.showdown-applications-filter .inline-check {
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.showdown-applications-filter .inline-check input[type="checkbox"] {
  flex: 0 0 auto;
}

.btn.small {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  color: #06101f;
  background: var(--accent-2);
}

.btn.tiny {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid transparent;
  color: #06101f;
  background: var(--accent-2);
  font-size: 13px;
}

.btn.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

.btn.danger {
  color: #260909;
  background: #ff8f8f;
}

.table-wrap {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  background: rgba(255, 255, 255, .025);
}

.data-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  background: rgba(255, 255, 255, .04);
}

.data-table th a {
  color: var(--muted);
}

.table-link {
  color: var(--accent-2);
  font-weight: 900;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

.data-table td {
  font-size: 14px;
}

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

.data-table .group-row td {
  color: var(--accent-2);
  background: rgba(126, 255, 196, .08);
  font-weight: 900;
}

.data-table .inactive-row td {
  color: var(--muted);
  background: rgba(255, 255, 255, .018);
}

.operator-table {
  min-width: 0;
  table-layout: fixed;
}

.operator-table input,
.operator-table select {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 12, 28, .78);
  color: var(--text);
  font: inherit;
}

.operator-table-panel {
  width: 100%;
}

.operator-table th,
.operator-table td {
  white-space: normal;
}

.operator-table th:nth-child(1),
.operator-table td:nth-child(1) {
  width: 18%;
  overflow-wrap: anywhere;
}

.operator-table th:nth-child(2),
.operator-table td:nth-child(2) {
  width: 15%;
}

.operator-table th:nth-child(3),
.operator-table td:nth-child(3) {
  width: 20%;
}

.operator-table td:nth-child(4) input {
  min-width: 0;
}

.operator-table th:nth-child(4),
.operator-table td:nth-child(4) {
  width: 16%;
}

.operator-table th:nth-child(5),
.operator-table td:nth-child(5) {
  width: 7%;
}

.operator-table th:nth-child(6),
.operator-table td:nth-child(6),
.operator-table th:nth-child(7),
.operator-table td:nth-child(7) {
  width: 10%;
}

.operator-table th:nth-child(8),
.operator-table td:nth-child(8) {
  width: 8%;
}

.operator-table .table-actions {
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .operator-table {
    min-width: 760px;
  }
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.table-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.pagination {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.pager-link {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  display: inline-flex;
  align-items: center;
}

.pager-link.disabled {
  opacity: .45;
}

.settings-form {
  margin-top: 24px;
  display: grid;
  gap: 22px;
}

.settings-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}

.settings-section h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.settings-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.banner-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
}

.banner-preview img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.inline-settings-section {
  background: rgba(255, 255, 255, .03);
  margin: 0;
}

.check-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.form-grid label,
.check-row,
.form-note {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.check-row {
  margin-bottom: 14px;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.settings-section .check-row:last-child {
  margin: 14px 0 0;
}

.mode-toggle-group {
  display: grid;
  gap: 9px;
  margin: 14px 0 16px;
}

.mode-toggle-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.mode-toggle-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-toggle-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.mode-toggle-options input {
  margin: 0;
}

.reward-version-panel {
  display: grid;
  gap: 14px;
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}

.reward-version-fields {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) minmax(120px, .45fr) minmax(220px, 1fr);
  gap: 12px;
}

.reward-version-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.reward-version-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.reward-action-divider {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: var(--line);
}

.btn.emphasis {
  border-color: rgba(96, 165, 250, .42);
  color: #bfdbfe;
}

.btn.danger {
  border-color: rgba(248, 113, 113, .48);
  color: #fecaca;
  background: rgba(127, 29, 29, .18);
}

.btn.danger:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.fixed-value-type {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.simulation-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.simulation-controls label {
  display: grid;
  min-width: 220px;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.simulation-result {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 8px;
  background: rgba(15, 23, 42, .62);
  color: var(--text);
}

.simulation-result-header {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.simulation-result-header strong {
  font-size: 16px;
}

.simulation-result-header span,
.simulation-note,
.simulation-warnings {
  color: var(--muted);
  font-size: 13px;
}

.simulation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.simulation-result h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.simulation-result p {
  margin: 0 0 10px;
  line-height: 1.65;
}

.simulation-result ul {
  margin: 8px 0 12px;
  padding-left: 18px;
  line-height: 1.6;
}

.simulation-note,
.simulation-warnings {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.simulation-warnings strong {
  display: block;
  margin-bottom: 6px;
  color: #fca5a5;
}

.form-note {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.form-note strong {
  color: var(--text);
}

.form-note.wide {
  grid-column: 1 / -1;
}

.timezone-preview-group {
  display: grid;
  gap: 7px;
}

.timezone-preview {
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, .42);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.timezone-preview strong {
  color: var(--text);
  font-weight: 900;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.settings-form input,
.settings-form select,
.settings-form textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font: inherit;
}

.settings-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.settings-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
}

.settings-fieldset legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0 4px;
}

.checkbox-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.inline-check {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.inline-check input[type="checkbox"] {
  min-height: auto;
  width: 16px;
  height: 16px;
}

.settings-form input[type="checkbox"] {
  min-height: auto;
  width: 18px;
  height: 18px;
}

.slot-inputs {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.slot-input-list {
  display: grid;
  gap: 8px;
}

.slot-input-row {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(260px, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.slot-input-row .btn {
  min-height: 42px;
}

.slot-add-button {
  justify-self: start;
}

.image-source-control {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.image-source-control > span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segmented-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented-choices label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  cursor: pointer;
}

.segmented-choices label:has(input:checked) {
  border-color: rgba(126, 255, 196, .72);
  background: rgba(126, 255, 196, .12);
}

.segmented-choices input[type="radio"] {
  min-height: auto;
  width: 16px;
  height: 16px;
}

.image-source-panel[hidden] {
  display: none;
}

.file-upload-field {
  padding: 14px;
  border: 1px dashed rgba(126, 255, 196, .38);
  border-radius: 8px;
  background: rgba(126, 255, 196, .06);
}

.file-upload-field input[type="file"] {
  margin-top: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, .10);
  color: var(--text);
  cursor: pointer;
}

.file-upload-field input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--accent-2);
  color: #08111f;
  font-weight: 900;
  cursor: pointer;
}

.file-upload-field small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.settings-table input {
  min-width: 92px;
}

.settings-table select {
  min-width: 132px;
}

.referral-milestone-table {
  min-width: 1480px;
  table-layout: fixed;
}

.referral-milestone-table th,
.referral-milestone-table td {
  padding: 10px 10px;
  white-space: normal;
  vertical-align: top;
}

.referral-milestone-table th:nth-child(1),
.referral-milestone-table td:nth-child(1) {
  width: 62px;
}

.referral-milestone-table th:nth-child(2),
.referral-milestone-table td:nth-child(2) {
  width: 76px;
}

.referral-milestone-table th:nth-child(3),
.referral-milestone-table td:nth-child(3) {
  width: 150px;
}

.referral-milestone-table th:nth-child(4),
.referral-milestone-table td:nth-child(4) {
  width: 180px;
}

.referral-milestone-table th:nth-child(5),
.referral-milestone-table td:nth-child(5) {
  width: 128px;
}

.referral-milestone-table th:nth-child(6),
.referral-milestone-table td:nth-child(6) {
  width: 230px;
}

.referral-milestone-table th:nth-child(7),
.referral-milestone-table td:nth-child(7) {
  width: 230px;
}

.referral-milestone-table th:nth-child(8),
.referral-milestone-table td:nth-child(8),
.referral-milestone-table th:nth-child(9),
.referral-milestone-table td:nth-child(9) {
  width: 88px;
}

.referral-milestone-table input,
.referral-milestone-table select {
  width: 100%;
  min-width: 0;
}

.referral-milestone-table input[type="checkbox"] {
  width: auto;
  min-width: 0;
}

.referral-reward-inputs {
  min-width: 170px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 8px;
  align-items: start;
}

.referral-reward-inputs small {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.referral-stats-grid {
  margin-bottom: 20px;
}

.summary-card.ok-card {
  border-color: rgba(126, 255, 196, .38);
}

.summary-card.warning-card {
  border-color: rgba(255, 196, 87, .48);
}

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

.compact-table {
  min-width: 0;
}

.compact-table th,
.compact-table td {
  white-space: normal;
}

.category-rate-table input {
  min-width: 110px;
}

.category-rate-table input[type="checkbox"] {
  min-width: auto;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading-row h2 {
  margin: 0;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.summary-grid {
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.summary-card {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.summary-card strong {
  color: var(--text);
  font-size: 26px;
  line-height: 1.1;
}

.summary-card small {
  color: var(--muted);
  line-height: 1.45;
}

.compact-summary {
  margin: 12px 0 18px;
  grid-template-columns: repeat(2, minmax(180px, 280px));
}

.compact-summary .summary-card {
  min-height: 92px;
}

.compact-summary .summary-card strong {
  font-size: 22px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
}

.status-badge.success {
  border-color: rgba(85, 214, 170, .45);
  color: #55d6aa;
  background: rgba(85, 214, 170, .10);
}

.status-badge.muted {
  background: rgba(255, 255, 255, .035);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.pending {
  border-color: rgba(125, 211, 252, .36);
  color: #bfdbfe;
  background: rgba(56, 189, 248, .08);
}

.status-pill.ready {
  border-color: rgba(255, 212, 120, .45);
  color: #ffd478;
  background: rgba(255, 212, 120, .08);
}

.status-pill.success {
  border-color: rgba(85, 214, 170, .45);
  color: #55d6aa;
  background: rgba(85, 214, 170, .10);
}

.status-pill.danger {
  border-color: rgba(255, 120, 120, .45);
  color: #ff9b9b;
  background: rgba(255, 120, 120, .09);
}

.status-pill.muted {
  border-color: var(--line);
  color: var(--muted);
}

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

.showdown-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.auction-control-sidebar {
  position: sticky;
  top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.auction-control-sidebar h3,
.auction-monitor-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.auction-control-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.auction-menu-list {
  margin-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.auction-menu-list .btn {
  width: 100%;
  justify-content: flex-start;
  white-space: normal;
  text-align: left;
}

.auction-menu-list .btn.active {
  border-color: rgba(85, 214, 170, .5);
  color: #55d6aa;
  background: rgba(85, 214, 170, .1);
}

.auction-control-list form {
  margin: 0;
}

.auction-control-list .btn {
  width: 100%;
  justify-content: flex-start;
  white-space: normal;
  text-align: left;
}

.auction-monitor {
  min-width: 0;
}

.auction-summary-grid {
  margin-top: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auction-monitor-section {
  margin-top: 18px;
}

.auction-monitor-section.auction-panel {
  display: none;
  margin-top: 0;
}

.auction-monitor-section.auction-panel.active {
  display: block;
}

.auction-monitor-section .table-wrap {
  margin-top: 12px;
}

.auction-team-table {
  min-width: 760px;
}

.auction-staff-form {
  margin-top: 12px;
  grid-template-columns: minmax(160px, .55fr) minmax(220px, .9fr) minmax(220px, .9fr) minmax(180px, .75fr) auto;
}

.auction-preassign-form {
  margin: 12px 0;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, .75fr) auto;
}

.inline-form {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 0;
}

.inline-form input[type="number"] {
  max-width: 120px;
}

.auction-staff-table {
  min-width: 760px;
}

.auction-staff-table form {
  margin: 0;
}

.auction-draft-table {
  min-width: 820px;
}

.auction-point-table,
.auction-preassign-table {
  min-width: 820px;
}

.auction-log-list {
  width: 100%;
  margin-top: 12px;
}

.match-team-table {
  min-width: 900px;
}

.match-team-table td {
  vertical-align: middle;
}

.match-member-modal {
  width: min(920px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
}

.match-member-modal::backdrop {
  background: rgba(4, 8, 14, .72);
  backdrop-filter: blur(3px);
}

.match-member-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.match-member-modal-head,
.match-member-modal-actions {
  grid-column: 1 / -1;
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.match-member-modal-head {
  border-bottom: 1px solid var(--line);
  margin: -18px -18px 2px;
  padding: 16px 18px;
}

.match-member-modal-head span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 900;
}

.match-member-modal-head strong {
  display: block;
  margin-top: 4px;
}

.match-member-intro {
  grid-column: 1 / -1;
}

.match-member-intro textarea {
  min-height: 120px;
}

.match-member-modal-actions {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  margin: 2px -18px -18px;
  padding: 14px 18px;
}

.full-league-matrix-table {
  min-width: 980px;
}

.full-league-matrix-table th:first-child,
.full-league-matrix-table tbody th {
  min-width: 150px;
  text-align: left;
}

.league-self-cell {
  color: var(--muted);
  text-align: center;
}

.full-league-team-tooltip {
  display: inline-flex;
  max-width: 180px;
  position: relative;
}

.full-league-team-name {
  cursor: default;
  display: block;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-league-team-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  display: none;
  left: 0;
  min-width: 260px;
  padding: 10px 12px;
  position: absolute;
  top: calc(100% + 8px);
  white-space: normal;
  z-index: 30;
}

.full-league-team-tooltip:hover .full-league-team-card {
  display: grid;
  gap: 6px;
}

.full-league-team-card strong {
  color: var(--accent);
  font-size: 14px;
}

.full-league-team-card span {
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.full-league-team-card b {
  color: var(--text);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.league-result-button {
  align-items: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 64px;
  padding: 6px 8px;
}

.league-result-button span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.league-result-button.in_progress {
  border-color: rgba(255, 212, 120, .45);
  background: rgba(255, 212, 120, .08);
}

.league-result-button.confirmed {
  border-color: rgba(85, 214, 170, .45);
  background: rgba(85, 214, 170, .08);
}

.full-league-standings-table {
  min-width: 880px;
}

.spend-event-table {
  min-width: 1120px;
}

.purchase-summary-table {
  min-width: 1540px;
}

.mp-shop-purchases-table {
  min-width: 1500px;
}

.winner-table {
  min-width: 1120px;
}

.winner-detail-grid {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.detail-list div {
  display: grid;
  grid-template-columns: minmax(120px, .35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.detail-list dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.current-image-row {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.current-image-row > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.compact-actions {
  justify-content: flex-start;
  align-items: end;
  flex-wrap: wrap;
  padding-top: 20px;
}

.compact-form {
  margin-top: 0;
}

.match-schedule-slot-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  width: 100%;
}

.match-schedule-table th,
.match-schedule-table td {
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .portal-panel {
    min-height: 360px;
  }

  .btn {
    width: 100%;
  }

  .dashboard-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions,
  .menu-group,
  .menu-group-links,
  .menu-link {
    width: 100%;
  }

  .auction-workspace {
    grid-template-columns: 1fr;
  }

  .auction-control-sidebar {
    position: static;
  }

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

  .stats-columns {
    grid-template-columns: 1fr;
  }

  .auction-staff-form {
    grid-template-columns: 1fr;
  }

  .auction-preassign-form {
    grid-template-columns: 1fr;
  }

  .menu-group {
    align-items: flex-start;
    flex-direction: column;
  }

  .menu-link {
    text-align: center;
  }

  .role-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .role-item span {
    text-align: left;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .showdown-applications-filter {
    grid-template-columns: 1fr;
  }

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

  .pager-link {
    justify-content: center;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .reward-version-fields {
    grid-template-columns: 1fr;
  }

  .reward-action-divider {
    display: none;
  }

  .slot-input-row {
    grid-template-columns: 1fr;
  }

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

  .simulation-grid {
    grid-template-columns: 1fr;
  }

  .winner-detail-grid,
  .detail-list div {
    grid-template-columns: 1fr;
  }
}
