.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 15px;
  border-radius: 9px;
  background: var(--text);
  color: var(--inv);
  font-weight: 550;
  font-size: 13.5px;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), opacity 0.18s, background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  opacity: 0.86;
}

.btn:active {
  transform: scale(0.96);
}

.btn .ico {
  width: 16px;
  height: 16px;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line2);
}

.btn.ghost:hover {
  opacity: 1;
  background: var(--hover);
}

.btn.big {
  height: 42px;
  padding: 0 20px;
  border-radius: 10px;
}

.btn.block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.btn.busy {
  pointer-events: none;
}

.btn.busy::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

.ibtn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--mute);
  transition: background 0.18s, color 0.18s, transform 0.18s var(--ease);
}

.ibtn:hover {
  background: var(--hover);
  color: var(--text);
}

.ibtn:active {
  transform: scale(0.9);
}

.ibtn .ico {
  width: 17px;
  height: 17px;
}

.ibtn.danger:hover {
  background: var(--text);
  color: var(--inv);
}

.ico {
  display: inline-block;
  flex: none;
}

.ico svg {
  width: 100%;
  height: 100%;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--mute);
}

.input,
.select {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.3s;
}

.input::placeholder {
  color: var(--dim);
}

.input:hover,
.select:hover {
  border-color: var(--dim);
}

.input:focus,
.select:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 12%, transparent);
}

.select {
  appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e8e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px;
}

.select option {
  background: var(--surface);
  color: var(--text);
}

.search {
  position: relative;
  min-width: 260px;
}

.search .ico {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 16px;
  height: 16px;
  color: var(--dim);
  pointer-events: none;
}

.search .input {
  padding-left: 37px;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color 0.25s var(--ease), transform 0.35s var(--ease), background 0.3s;
}

.card.lift:hover {
  border-color: var(--line2);
  transform: translateY(-3px);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}

.card-head p {
  margin-top: 2px;
  color: var(--mute);
  font-size: 12.5px;
}

.card-body {
  padding: 18px 22px 22px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
}

.tag .ico {
  width: 13px;
  height: 13px;
  margin-left: -2px;
}

.tag.unused i {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--mute);
}

.tag.unused,
.tag.expired,
.tag.paused {
  color: var(--mute);
}

.tag.expired i,
.tag.paused i {
  background: var(--dim);
}

.tag.banned {
  background: var(--text);
  border-color: var(--text);
  color: var(--inv);
}

.tag.banned i {
  background: var(--inv);
}

.tag.live i {
  animation: pulse 1.6s ease-in-out infinite;
}

.seg {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.seg button {
  position: relative;
  z-index: 1;
  height: 30px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mute);
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}

.seg button:hover {
  color: var(--text);
}

.seg button.on {
  color: var(--inv);
}

.seg button small {
  margin-left: 6px;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.seg .thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: 8px;
  background: var(--text);
  transition: transform 0.4s var(--ease), width 0.4s var(--ease);
}

.tbl-wrap {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
}

.tbl th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--mute);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.tbl td {
  height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl tbody tr {
  transition: background 0.15s;
  animation: rise 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

.tbl tbody tr:hover {
  background: var(--hover);
}

.tbl tbody tr:last-child td {
  border-bottom: 0;
}

.tbl .end {
  text-align: right;
}

.tbl .acts {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0.55;
  transition: opacity 0.2s;
}

.tbl tr:hover .acts {
  opacity: 1;
}

.tbl .cell-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tbl .cell-key .ibtn {
  width: 26px;
  height: 26px;
  opacity: 0;
}

.tbl tr:hover .cell-key .ibtn {
  opacity: 1;
}

.check {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
}

.check input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.check span {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--line2);
  border-radius: 5px;
  background: var(--bg);
  transition: background 0.18s, border-color 0.18s, transform 0.18s var(--ease);
}

.check span::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--inv);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s var(--ease);
}

.check input:checked + span {
  background: var(--text);
  border-color: var(--text);
}

.check input:checked + span::after {
  transform: rotate(45deg) scale(1);
}

.check input:active + span {
  transform: scale(0.88);
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  display: inline-block;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line2);
  transition: background 0.25s var(--ease);
}

.switch span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.3s var(--ease), background 0.25s;
}

.switch input:checked + span {
  background: var(--text);
}

.switch input:checked + span::after {
  transform: translateX(16px);
  background: var(--inv);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 12.5px;
}

.pager .btns {
  display: flex;
  gap: 6px;
}

.pager button {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  color: var(--text);
  font-size: 12.5px;
  transition: background 0.18s, transform 0.18s var(--ease);
}

.pager button:hover:not([disabled]) {
  background: var(--hover);
}

.pager button:active:not([disabled]) {
  transform: scale(0.94);
}

.pager button[disabled] {
  opacity: 0.35;
  cursor: default;
}

.empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 64px 20px;
  text-align: center;
  color: var(--mute);
}

.empty .ico {
  width: 40px;
  height: 40px;
  color: var(--dim);
}

.empty b {
  color: var(--text);
  font-weight: 600;
}

.skel {
  height: 54px;
  margin: 0 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.skel i {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: var(--line2);
  animation: pulse 1.3s ease-in-out infinite;
}

.bulk {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 0;
  padding: 0 18px;
  overflow: hidden;
  opacity: 0;
  background: var(--text);
  color: var(--inv);
  font-weight: 500;
  transition: height 0.35s var(--ease), opacity 0.25s;
}

.bulk.show {
  height: 48px;
  opacity: 1;
}

.bulk .btn {
  height: 30px;
  background: var(--inv);
  color: var(--text);
}

.bulk .x {
  margin-left: auto;
  color: var(--inv);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  animation: fade 0.22s both;
}

.overlay.leave {
  opacity: 0;
  transition: opacity 0.2s;
}

.dialog {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 18px;
  animation: pop 0.32s var(--ease) both;
}

.overlay.leave .dialog {
  transform: scale(0.97);
  transition: transform 0.2s;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 0;
}

.dialog-head p {
  margin-top: 3px;
  color: var(--mute);
  font-size: 13px;
}

.dialog-body {
  padding: 20px 24px 6px;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 22px;
}

.keys {
  max-height: 220px;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--bg);
  line-height: 1.9;
}

#toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 240px;
  padding: 12px 16px 12px 13px;
  background: var(--text);
  color: var(--inv);
  border-radius: 12px;
  font-weight: 500;
  font-size: 13.5px;
  animation: pop 0.38s var(--ease) both;
}

.toast.leave {
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.3s, transform 0.3s var(--ease);
}

.toast .ico {
  width: 18px;
  height: 18px;
}

.dd {
  position: relative;
}

.hint {
  font-size: 12px;
  color: var(--mute);
}

.shake {
  animation: shake 0.45s var(--ease);
}

.st-development {
  --c: #3b82f6;
}

.st-updating {
  --c: #eab308;
}

.st-undetected {
  --c: #22c55e;
}

.st-detected {
  --c: #ef4444;
}

.sdot,
.spill i,
.smenu i {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--c);
}

.sdot {
  display: inline-block;
  margin-right: 9px;
}

.state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 13px;
}

.statepick {
  position: relative;
}

.spill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px 0 12px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line2));
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.18s, border-color 0.18s, transform 0.18s var(--ease);
}

.spill:hover {
  background: var(--hover);
}

.spill:active {
  transform: scale(0.96);
}

.spill .ico {
  width: 14px;
  height: 14px;
  color: var(--mute);
  transition: transform 0.3s var(--ease);
}

.statepick.open .spill .ico {
  transform: rotate(180deg);
}

.smenu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 176px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 12px;
  animation: pop 0.22s var(--ease) both;
  z-index: 30;
}

.smenu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--mute);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.smenu button:hover,
.smenu button.on {
  background: var(--hover);
  color: var(--text);
}

.smenu .tick {
  margin-left: auto;
  width: 14px;
  height: 14px;
  opacity: 0;
}

.smenu button.on .tick {
  opacity: 1;
}

.app {
  position: relative;
}

.app:has(.statepick.open) {
  z-index: 5;
}
