:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #24262c;
  background: #f5f6f8;
  font-synthesis: none;
  --muted: #777e8a;
  --line: #e5e7eb;
  --accent: #197657;
  --danger: #bd3548;
  --side: 222px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #80c5ad;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.8;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 650;
}
h2 {
  font-size: 15px;
  font-weight: 600;
}
h3 {
  font-size: 15px;
  font-weight: 550;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 28px 16px 20px;
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 43px;
  font-size: 18px;
  font-weight: 650;
  white-space: nowrap;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  background: #f5e3e8;
  color: #a54264;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.brand-mark svg {
  width: 23px;
  height: 23px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav-item {
  border: 0;
  background: none;
  text-align: left;
  padding: 11px 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #656b76;
  font-weight: 500;
  min-height: 44px;
}
.nav-item:hover {
  background: #f5f6f8;
}
.nav-item.active {
  background: #eaf3ef;
  color: #196b51;
}
.nav-count {
  margin-left: auto;
  font-size: 12px;
  background: #dcece4;
  padding: 0 6px;
  border-radius: 4px;
}
.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 18px 8px 0;
}
.status-dot {
  background: #288465;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.version {
  margin-left: auto;
  font-size: 11px;
  color: #9a9fa8;
}
main {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: 73px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.breadcrumb {
  font-size: 12px;
  color: #89909a;
  display: flex;
  gap: 13px;
}
.breadcrumb > span:last-child {
  color: #535b67;
}
.identity {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #606774;
}
.identity > svg {
  color: #7e8590;
  width: 20px;
  height: 20px;
}
.content {
  padding: 28px 38px 40px;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.notice {
  padding: 11px 14px;
  background: #edf4f1;
  border: 1px solid #d8e8e0;
  border-radius: 6px;
  color: #426b59;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 27px;
}
.notice strong {
  white-space: nowrap;
  font-weight: 600;
}
.notice.warning {
  background: #fff7e7;
  color: #86651b;
  border-color: #efdfb6;
}
.notice span {
  min-width: 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 29px 0;
}
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  color: #8b909a;
  margin-bottom: 6px;
}
.heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  min-height: 39px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}
.button.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.button.primary:hover {
  background: #125d44;
}
.button.secondary {
  background: #fff;
  border-color: #dadde2;
  color: #525a65;
}
.button.secondary:hover {
  background: #f4f5f7;
}
.button.danger {
  background: var(--danger);
  color: #fff;
}
.icon-button {
  background: transparent;
  color: #7a828d;
  width: 33px;
  height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 5px;
  position: relative;
}
.icon-button:hover {
  color: #2b5547;
  background: #eef2f0;
  border-color: #e1e6e3;
}
.icon-button.destructive:hover {
  color: var(--danger);
  background: #fff0f1;
  border-color: #f5d9df;
}
.metrics {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 22px 0;
  margin-bottom: 31px;
}
.metrics > div {
  padding: 0 25px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.metrics > div:last-child {
  border: 0;
}
.metrics span {
  font-size: 12px;
  color: var(--muted);
}
.metrics strong {
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
}
.metrics small {
  font-size: 12px;
  font-weight: 400;
  color: #969ca6;
  margin-left: 8px;
}
.metrics .reset-metric strong {
  font-size: 22px;
}
.metrics .reset-metric small {
  display: block;
  font-size: 10px;
  margin: 4px 0 0;
}
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 15px;
  min-height: 28px;
}
.section-bar h2 span {
  font-size: 11px;
  color: #8c949f;
  margin-left: 8px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  text-align: left;
  font-size: 12px;
}
thead {
  background: #fafbfc;
  color: #7a818c;
}
th {
  font-weight: 450;
  height: 42px;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}
th,
td {
  padding: 13px 18px;
}
td {
  height: 84px;
  border-bottom: 1px solid #eef0f3;
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fdfefe;
}
.account-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #6e5690;
  background: #f0ebf5;
}
.account-cell strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secondary-text {
  display: block;
  font-size: 11px;
  color: #989fa9;
  margin-top: 3px;
  line-height: 1.4;
}
.schedule-time {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 11px;
  background: #f0f1f4;
  color: #7e8591;
}
.badge:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ready,
.badge.succeeded,
.badge.already_claimed {
  background: #edf5ef;
  color: #3a8261;
}
.badge.awaiting_validation,
.badge.queued,
.badge.retrying,
.badge.running {
  background: #edf0f9;
  color: #5c70ad;
}
.badge.review,
.badge.uncertain {
  background: #fff5df;
  color: #9a7628;
}
.badge.blocked,
.badge.failed {
  background: #fdf0f2;
  color: #bb5c6b;
}
.empty {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border-radius: 0 0 6px 6px;
  color: #898f99;
}
.empty > svg {
  width: 30px;
  height: 30px;
  color: #a4abb4;
}
.empty h3 {
  margin-bottom: 3px;
}
.filter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #7b828d;
}
.filter select {
  padding: 5px 28px 5px 10px;
  background: #fff;
}
.text-link {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #55786a;
  font-size: 12px;
}
.text-link svg {
  width: 13px;
  height: 13px;
}
.footer {
  padding: 15px 38px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  color: #a0a6b0;
}
.footer > span:first-child {
  display: flex;
  gap: 6px;
  align-items: center;
}
.footer svg {
  width: 13px;
  height: 13px;
}
.login-view {
  margin: 90px auto;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 24px;
}
.login-view > svg {
  width: 32px;
  height: 32px;
  color: #197657;
}
.login-view h1 {
  font-size: 24px;
}
dialog {
  width: min(480px, calc(100% - 28px));
  max-height: calc(100dvh - 36px);
  padding: 0;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  color: #353b44;
  box-shadow: 0 16px 60px #1f29352e;
}
dialog::backdrop {
  background: #20283155;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 23px;
  border-bottom: 1px solid var(--line);
  gap: 14px;
}
.dialog-heading h2 {
  font-size: 17px;
}
.dialog-body {
  padding: 23px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dialog-footer {
  padding: 15px 23px;
  background: #fbfbfc;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.dialog-body label:not(.switch-row):not(.checkbox-row):not(.file-field) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #646c77;
}
input:not([type="checkbox"]):not([type="file"]),
select,
textarea {
  border: 1px solid #dce0e5;
  padding: 10px 12px;
  border-radius: 5px;
  background: #fff;
  color: #37404c;
  min-width: 0;
  max-width: 100%;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #6ba98d;
  box-shadow: 0 0 0 2px #e3f0e9;
}
input::placeholder {
  color: #a8adb5;
}
textarea {
  resize: none;
  font-family: Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
  background: #f0f2f5;
  border-radius: 6px;
}
.segmented button {
  border: 0;
  background: none;
  padding: 7px 3px;
  border-radius: 4px;
  color: #7c828e;
  font-size: 12px;
  min-height: 32px;
}
.segmented button.active {
  background: #fff;
  box-shadow: 0 1px 3px #24314612;
  color: #2e654f;
}
.file-field {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  border: 1px dashed #d4dbe3;
  padding: 23px;
  border-radius: 6px;
  cursor: pointer;
  color: #7b8390;
  font-size: 12px;
}
.file-field svg {
  width: 26px;
  height: 26px;
}
.file-field input {
  max-width: 100%;
  font-size: 11px;
}
.field-hint {
  color: #989fa9;
  font-size: 10px;
  margin-top: 8px;
}
.demo-preview {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px;
  background: #f7f8fa;
  border-radius: 6px;
}
.demo-preview strong {
  font-size: 13px;
  font-weight: 500;
}
.demo-preview p {
  font-size: 11px;
  margin-top: 5px;
  color: #9198a3;
}
.demo-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #7b6299;
  background: #ede7f4;
  border-radius: 7px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 15px;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
}
.switch-row input {
  appearance: none;
  width: 33px;
  height: 19px;
  border-radius: 10px;
  background: #d3d7de;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: none;
}
.switch-row input:before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  background: #fff;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transition: transform 0.15s;
}
.switch-row input:checked {
  background: #278864;
}
.switch-row input:checked:before {
  transform: translateX(14px);
}
#game-session-bar .switch-row { gap: 12px; flex-shrink: 0; }
#game-session-bar p { margin: 0; }
#game-session-bar .field-hint { margin-top: 4px; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  min-height: 33px;
}
.checkbox-row input {
  accent-color: #197657;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.checkbox-row code {
  font-size: 10px;
  margin-left: auto;
  color: #8a94a0;
}
.account-caption {
  font-size: 12px;
  color: #9299a4;
  overflow-wrap: anywhere;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  font-size: 12px;
  color: #6d7480;
  margin-bottom: 10px;
}
.inline-error {
  background: #fef1f1;
  color: #ae4855;
  border: 1px solid #f4d6da;
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
#confirm-message {
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  bottom: 27px;
  left: calc(50% + 70px);
  transform: translateX(-50%);
  padding: 11px 18px;
  border: 1px solid #dfe7e1;
  background: #fff;
  color: #3f6952;
  font-size: 12px;
  border-radius: 6px;
  box-shadow: 0 3px 16px #1f29351c;
  max-width: calc(100% - 32px);
  z-index: 10;
}
body.busy {
  cursor: progress;
}
@media (min-width: 1550px) {
  .content {
    padding-top: 40px;
  }
}
@media (max-width: 1100px) {
  :root {
    --side: 190px;
  }
  .brand {
    font-size: 16px;
    margin-left: 1px;
  }
  .topbar,
  .footer {
    padding-left: 25px;
    padding-right: 25px;
  }
  .content {
    padding-left: 25px;
    padding-right: 25px;
  }
  .metrics > div {
    padding: 0 16px;
  }
  .metrics strong {
    font-size: 25px;
  }
}
@media (max-width: 760px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    margin: 0 0 17px;
    font-size: 17px;
  }
  .brand small {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    gap: 5px;
  }
  .nav-item {
    flex: 1;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    padding: 11px 4px;
    border-radius: 5px 5px 0 0;
    min-width: 0;
  }
  .nav-count {
    margin-left: 0;
  }
  .sidebar-footer {
    display: none;
  }
  .topbar {
    height: 53px;
    padding: 0 18px;
  }
  .identity {
    font-size: 11px;
  }
  .identity > svg {
    width: 17px;
    height: 17px;
  }
  .breadcrumb {
    font-size: 11px;
    gap: 8px;
  }
  .content {
    padding: 20px 17px 26px;
  }
  .notice {
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 23px;
    font-size: 11px;
  }
  .notice span {
    flex: 1 1 190px;
  }
  .notice svg {
    width: 15px;
    height: 15px;
  }
  .page-heading {
    margin: 23px 0 24px;
    gap: 10px;
  }
  h1 {
    font-size: 24px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .heading-actions {
    gap: 5px;
  }
  .button {
    padding: 9px 11px;
    font-size: 12px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
    margin-bottom: 27px;
  }
  .metrics > div {
    padding: 18px;
    border-bottom: 1px solid var(--line);
    gap: 8px;
  }
  .metrics > div:nth-child(2) {
    border-right: 0;
  }
  .metrics > div:nth-child(n + 3) {
    border-bottom: 0;
  }
  .metrics strong {
    font-size: 25px;
  }
  .metrics .reset-metric strong {
    font-size: 20px;
  }
  .section-bar {
    margin-bottom: 12px;
    gap: 8px;
  }
  .section-bar .muted {
    font-size: 10px;
  }
  .footer {
    padding: 15px 18px;
    font-size: 9px;
  }
  .footer > span:last-child {
    font-size: 9px;
  }
  #toast {
    left: 50%;
    bottom: 18px;
  }
  .dialog-body {
    padding: 20px;
  }
  .dialog-heading,
  .dialog-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .checkbox-row {
    font-size: 11px;
  }
  .checkbox-row code {
    font-size: 9px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .empty {
    min-height: 220px;
  }
  .text-link {
    font-size: 11px;
  }
  .table-wrap {
    overscroll-behavior-x: contain;
  }
  .filter {
    font-size: 11px;
  }
  .filter select {
    max-width: 120px;
  }
  #tokens-view table {
    min-width: 660px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
