:root {
  --bg: #0c141f;
  --card: rgba(13, 25, 38, 0.72);
  --card-border: rgba(142, 181, 221, 0.22);
  --text: #e7f1fd;
  --muted: #a8bfd8;
  --brand: #2cc7aa;
  --brand-hover: #1db397;
  --danger: #e16068;
  --danger-hover: #c94c53;
  --border: rgba(165, 197, 230, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at 15% 20%, #163252 0%, #0c141f 45%, #070c14 100%);
  color: var(--text);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
}
.bg-orb-a {
  width: 400px;
  height: 400px;
  background: #2cc7aa;
  top: -150px;
  right: -100px;
}
.bg-orb-b {
  width: 500px;
  height: 500px;
  background: #1d79d1;
  left: -200px;
  bottom: -200px;
}

.shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(18px, 2.4vw, 36px) clamp(16px, 3.5vw, 64px) 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  padding: 24px;
}

.header,
.tabs,
.tab-pane,
.tab-pane > section,
.card,
.table-wrapper {
  width: 100%;
  max-width: none;
}

.table-wrapper {
  overflow-x: auto;
}

.list-head {
  width: 100%;
}

.header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}
h1 {
  margin: 0;
  font-size: 28px;
}
h2 {
  margin: 0 0 16px;
  font-size: 18px;
}
.muted {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: rgba(44, 199, 170, 0.15);
  color: var(--brand);
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.tab-pane.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Forms */
.add-form, .config-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.config-category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.config-cat-btn {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.08);
  color: #cce0f5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.config-cat-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.config-cat-btn.active {
  background: rgba(44, 199, 170, 0.16);
  color: #6ff2d7;
  border-color: rgba(77, 226, 196, 0.4);
}

.config-cat-pane {
  display: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  gap: 12px;
  flex-direction: column;
}

.config-cat-pane.active {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-inline-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.config-inline-row .inline-item {
  min-width: 0;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #cce0f5;
}

.help {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.input-text {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.input-text:focus {
  outline: none;
  border-color: var(--brand);
}

.proxy-pool-input {
  min-height: 104px;
  line-height: 1.45;
  resize: vertical;
}

textarea#tokenInput {
  width: 100%;
  height: 80px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  resize: vertical;
}

textarea#refreshBundleInput {
  width: 100%;
  min-height: 140px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  resize: vertical;
}

#refreshBundleFile {
  color: var(--muted);
}

.refresh-status {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: #a8bfd8;
  font-size: 12px;
  line-height: 1.5;
}

.refresh-status .table-wrapper {
  margin-top: 6px;
}

.refresh-profiles-table {
  font-size: 12px;
}

.refresh-profiles-table th,
.refresh-profiles-table td {
  padding: 8px;
}

.dialog-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 16, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 950;
  padding: 20px;
}

.dialog-modal.open {
  display: flex;
}

.dialog-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #0d1926;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.api-key-dialog {
  width: min(520px, 100%);
}

.api-key-proxy-dialog {
  width: min(660px, 100%);
  padding: 22px;
}

.api-key-proxy-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.api-key-proxy-dialog-head h2 {
  margin: 0;
}

.api-key-proxy-context {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.api-key-proxy-dialog .form-group {
  gap: 8px;
}

.api-key-proxy-dialog .input-select {
  min-height: 46px;
  font-size: 15px;
}

.api-key-proxy-dialog .api-key-proxy-pool {
  min-height: 220px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.55;
}

.api-key-proxy-dialog .api-key-proxy-pool:disabled {
  min-height: 150px;
}

.api-key-proxy-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.api-key-proxy-actions .msg {
  margin-right: auto;
}

.api-key-dialog-actions {
  margin-top: 4px;
}

.api-key-heading-help {
  margin-top: 6px;
}

.api-key-table {
  min-width: 1480px;
}

.proxy-health-heading-help {
  margin-top: 6px;
}

.proxy-health-table {
  min-width: 900px;
}

.proxy-health-table th:nth-child(2),
.proxy-health-table td:nth-child(2) {
  min-width: 210px;
}

.proxy-health-table th:nth-child(3),
.proxy-health-table td:nth-child(3) {
  min-width: 150px;
}

.proxy-health-table th:first-child,
.proxy-health-table td:first-child {
  min-width: 58px;
}

.proxy-health-table th:nth-child(6),
.proxy-health-table td:nth-child(6) {
  min-width: 56px;
}

.proxy-health-table th:last-child,
.proxy-health-table td:last-child {
  min-width: 64px;
}

.proxy-health-check-btn {
  white-space: nowrap;
}

.proxy-endpoint,
.proxy-exit-ip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.proxy-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.proxy-source {
  display: inline-flex;
  padding: 3px 6px;
  border: 1px solid rgba(142, 181, 221, 0.24);
  border-radius: 4px;
  color: #b9d1e9;
  background: rgba(142, 181, 221, 0.08);
  font-size: 12px;
}

.proxy-health-error {
  display: block;
  margin-top: 6px;
  color: #ffb4bc;
  font-size: 12px;
  line-height: 1.35;
}

.proxy-health-load-error {
  color: #ffb4bc;
}

.api-key-table th:first-child,
.api-key-table td:first-child {
  min-width: 180px;
}

.api-key-table th:nth-child(2),
.api-key-table td:nth-child(2) {
  min-width: 220px;
}

.api-key-table th:nth-child(4),
.api-key-table td:nth-child(4) {
  min-width: 190px;
}

.api-key-table th:nth-child(5),
.api-key-table td:nth-child(5) {
  min-width: 220px;
}

.api-key-table th:nth-child(6),
.api-key-table td:nth-child(6) {
  min-width: 220px;
}

.api-key-table th:nth-child(8),
.api-key-table td:nth-child(8) {
  min-width: 220px;
}

.api-key-table .input-text,
.api-key-table .input-select {
  min-width: 0;
}

.api-key-quality-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 8px;
  min-width: 0;
}

.api-key-quality-bound {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.api-key-quality-bound > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.api-key-quality-range-create {
  max-width: 360px;
}

.api-key-route-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.api-key-route-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.api-key-route-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.api-key-route-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.api-key-proxy-settings-btn {
  min-width: 82px;
  min-height: 36px;
  white-space: nowrap;
}

.api-key-fallback-settings-btn {
  min-width: 82px;
  min-height: 36px;
  white-space: nowrap;
}

.api-key-fallback-dialog .input-text {
  min-height: 46px;
  font-size: 15px;
}

.api-key-proxy-pool {
  min-height: 82px;
  resize: vertical;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.4;
}

.api-key-proxy-pool:disabled {
  min-height: 42px;
  resize: none;
  opacity: 0.5;
}

.api-key-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.api-key-value .token-val {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.api-key-copy-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 1px solid rgba(142, 181, 221, 0.28);
  border-radius: 6px;
  background: rgba(142, 181, 221, 0.08);
  color: #a9c9ea;
}

.api-key-copy-btn:hover:not(:disabled) {
  border-color: rgba(77, 226, 196, 0.58);
  background: rgba(77, 226, 196, 0.12);
  color: var(--brand);
}

.api-key-copy-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.api-key-copy-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.api-key-copy-btn.copied {
  border-color: rgba(77, 226, 196, 0.7);
  background: rgba(77, 226, 196, 0.18);
  color: var(--brand);
}

.copy-icon {
  position: relative;
  width: 14px;
  height: 14px;
}

.copy-icon::before,
.copy-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.copy-icon::before {
  top: 1px;
  left: 1px;
}

.copy-icon::after {
  top: 4px;
  left: 4px;
  background: #112033;
}

.api-key-copy-btn:hover:not(:disabled) .copy-icon::after,
.api-key-copy-btn.copied .copy-icon::after {
  background: #12352f;
}

.api-key-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 132px;
}

.api-key-row-actions button {
  white-space: nowrap;
}

.api-key-secret-warning {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 202, 88, 0.35);
  border-radius: 8px;
  background: rgba(225, 163, 44, 0.1);
  color: #ffd77d;
  font-size: 13px;
  line-height: 1.5;
}

.api-key-secret-box {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(142, 181, 221, 0.28);
  border-radius: 8px;
  background: #08111c;
}

.api-key-secret-box code {
  display: block;
  color: #cce0f5;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  user-select: all;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Actions */
.actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

button {
  background: var(--brand);
  color: #051410;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
button:hover {
  background: var(--brand-hover);
}

button.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
button.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 6px 12px;
  font-size: 12px;
}
button.danger:hover {
  background: var(--danger);
  color: #fff;
}

button.small {
  padding: 6px 12px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
button.small:hover {
  background: rgba(255, 255, 255, 0.2);
}

.msg {
  font-size: 14px;
}

/* Table */
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.list-head h2 {
  margin: 0;
}

.token-list-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.token-list-card .list-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.token-list-card .token-list-actions {
  width: 100%;
  align-items: flex-start;
}

.token-list-card .token-list-actions .actions {
  flex-wrap: wrap;
  gap: 8px;
}

.token-list-card .token-list-actions button {
  flex: 0 0 auto;
  padding-inline: 12px;
  white-space: nowrap;
}

.token-auto-refresh-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.token-auto-refresh-control .input-select {
  min-width: 72px;
  padding: 7px 28px 7px 9px;
}

.token-credits-summary {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.token-credits-summary strong {
  color: #e7f1fd;
  font-size: 15px;
}

.health-check-options {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 8px;
  color: var(--muted);
  font-size: 12px;
}

.health-check-options .input-select {
  min-width: 150px;
}

.health-probe-settings {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(220px, 2fr) repeat(2, minmax(130px, 1fr));
  gap: 10px;
  margin: -2px 0 18px;
  padding: 12px;
  border: 1px solid rgba(142, 181, 221, 0.18);
  border-radius: 6px;
  background: rgba(7, 17, 28, 0.36);
}

.health-proxy-settings {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
  gap: 12px;
  margin: -2px 0 22px;
}

.health-proxy-pool {
  min-height: 76px;
  resize: vertical;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.4;
}

.health-proxy-pool:disabled {
  resize: none;
  opacity: 0.5;
}

.health-probe-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.health-probe-field .input-select {
  width: 100%;
  min-width: 0;
}

.input-select {
  min-width: 120px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.input-select:focus {
  outline: none;
  border-color: var(--brand);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.stat-card-rate {
  border-color: rgba(77, 226, 196, 0.32);
  background: rgba(77, 226, 196, 0.07);
}

.stat-card-live {
  border-color: rgba(77, 226, 196, 0.4);
  background: rgba(77, 226, 196, 0.08);
}

.stat-card-live .stat-value,
.stat-card-rate .stat-value {
  color: var(--brand);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.stat-value {
  color: #e7f1fd;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 700;
}

.table-wrapper {
  overflow-x: auto;
}

.token-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.token-summary strong {
  color: #e7f1fd;
  font-size: 16px;
}

.token-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(140px, 0.9fr) repeat(2, minmax(120px, 0.8fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.token-filter-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.token-filter-field .input-select,
.token-filter-field .input-text {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 7px 9px;
}

.search-input-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

.search-input-wrap .input-text {
  padding-right: 38px;
}

.search-clear-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  transform: translateY(-50%);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.search-clear-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.logs-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(125px, 0.7fr)) minmax(220px, 1.3fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.logs-filter-bar .input-text {
  height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.logs-filter-bar .input-select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 7px 9px;
}

.logs-filter-bar > button {
  min-height: 36px;
}

.token-filter-bar > button {
  min-height: 36px;
}

.token-filter-msg {
  display: none;
  grid-column: 1 / -1;
  color: #ffb4bc;
  font-size: 12px;
}

.token-filter-msg.visible {
  display: block;
}

.status-reason {
  display: block;
  margin-top: 4px;
  color: #ffca58;
  font-size: 11px;
  white-space: nowrap;
}
.status-reason .health-meta {
  white-space: normal;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#logsTable,
#runningLogsTable {
  table-layout: auto;
}

#logsTable th:nth-child(1),
#logsTable td:nth-child(1),
#runningLogsTable th:nth-child(1),
#runningLogsTable td:nth-child(1) {
  width: 70px;
}

#logsTable th:nth-child(2),
#logsTable td:nth-child(2),
#runningLogsTable th:nth-child(2),
#runningLogsTable td:nth-child(2),
#logsTable th:nth-child(4),
#logsTable td:nth-child(4),
#runningLogsTable th:nth-child(4),
#runningLogsTable td:nth-child(4),
#logsTable th:nth-child(8),
#logsTable td:nth-child(8),
#runningLogsTable th:nth-child(8),
#runningLogsTable td:nth-child(8) {
  width: auto;
  white-space: nowrap;
}

#logsTable th:nth-child(3),
#logsTable td:nth-child(3),
#runningLogsTable th:nth-child(3),
#runningLogsTable td:nth-child(3) {
  width: 62px;
  white-space: nowrap;
}

#logsTable th:nth-child(5),
#logsTable td:nth-child(5),
#runningLogsTable th:nth-child(5),
#runningLogsTable td:nth-child(5) {
  width: 500px;
}

#logsTable th:nth-child(6),
#logsTable td:nth-child(6),
#runningLogsTable th:nth-child(6),
#runningLogsTable td:nth-child(6) {
  width: 190px;
}

#logsTable th:nth-child(7),
#logsTable td:nth-child(7),
#runningLogsTable th:nth-child(7),
#runningLogsTable td:nth-child(7) {
  min-width: 220px;
  width: 35%;
}

#logsTable td,
#runningLogsTable td {
  padding: 10px 8px;
  vertical-align: top;
}

.log-account-cell {
  display: block;
  color: #a8bfd8;
  line-height: 1.35;
}

.log-time-cell {
  color: #a8bfd8;
  line-height: 1.2;
  white-space: normal;
}

.log-time-cell .date {
  display: block;
}

.log-time-cell .time {
  display: block;
  color: #7f96ad;
}

.log-account-email {
  color: #7f96ad;
  word-break: break-all;
}

.log-model-cell {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: #8fb0d3;
  word-break: break-word;
}

.log-classification {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  font-family: "Manrope", sans-serif;
}

.log-meta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid rgba(142, 181, 221, 0.22);
  border-radius: 4px;
  background: rgba(142, 181, 221, 0.08);
  color: #a8bfd8;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.log-meta-badge.generation {
  border-color: rgba(77, 226, 196, 0.3);
  background: rgba(44, 199, 170, 0.1);
  color: #6ff2d7;
}

.log-meta-badge.api {
  border-color: rgba(89, 166, 255, 0.32);
  background: rgba(65, 132, 210, 0.12);
  color: #9bc8ff;
}

.log-meta-badge.reference {
  border-color: rgba(151, 164, 181, 0.3);
  background: rgba(151, 164, 181, 0.1);
  color: #c2cfdd;
}

.log-meta-badge.banana {
  border-color: rgba(255, 202, 88, 0.35);
  background: rgba(255, 202, 88, 0.1);
  color: #ffda7d;
}

.log-prompt-cell {
  color: #a8bfd8;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

th {
  text-align: left;
  padding: 12px;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 600;
}

td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.token-val {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: #a0c3e8;
  word-break: break-all;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-active { background: rgba(44, 199, 170, 0.2); color: #4de2c4; }
.status-exhausted { background: rgba(225, 163, 44, 0.2); color: #ffca58; }
.status-invalid { background: rgba(225, 96, 104, 0.2); color: #ffb4bc; }
.status-error { background: rgba(225, 96, 104, 0.2); color: #ffb4bc; }
.status-unhealthy { background: rgba(225, 163, 44, 0.2); color: #ffca58; }
.status-disabled { background: rgba(255, 255, 255, 0.1); color: #aaa; }

.log-status-2xx { background: rgba(44, 199, 170, 0.2); color: #4de2c4; }
.log-status-4xx { background: rgba(225, 163, 44, 0.2); color: #ffca58; }
.log-status-5xx { background: rgba(225, 96, 104, 0.2); color: #ffb4bc; }

.log-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.log-state.running {
  color: #63d4ff;
  background: rgba(48, 170, 255, 0.16);
}

.log-state.success {
  color: #4de2c4;
  background: rgba(44, 199, 170, 0.16);
}

.log-state.failed {
  color: #ffb4bc;
  background: rgba(225, 96, 104, 0.16);
}

.log-state-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.log-state-btn.failed {
  border: 1px solid rgba(255, 180, 188, 0.55);
  background: rgba(255, 180, 188, 0.12);
}

.log-state-btn.failed:hover {
  background: rgba(255, 180, 188, 0.22);
}

.icon-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.icon-check,
.icon-error {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  font-size: 11px;
  line-height: 1;
}

.log-row-running {
  background: rgba(48, 170, 255, 0.06);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.action-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  min-width: 120px;
}

th input[type="checkbox"],
td input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.action-btns button {
  width: 100%;
  padding: 3px 5px;
  font-size: 10px;
  border-radius: 4px;
}

.switch-btn {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  background: #2b3948;
  vertical-align: middle;
}

.switch-btn.on {
  background: rgba(44, 199, 170, 0.35);
  border-color: rgba(77, 226, 196, 0.55);
}

.switch-btn.off {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.switch-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.switch-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(0);
  transition: transform 0.15s ease;
}

.switch-btn.on .switch-knob {
  transform: translateX(18px);
}

.switch-text {
  margin-left: 8px;
  font-size: 12px;
  color: #a8bfd8;
}

.empty-state {
  text-align: center;
  padding: 40px !important;
  color: var(--muted);
}

.logs-pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-edge {
  min-width: 36px;
  padding-inline: 8px;
  font-size: 18px;
  line-height: 1;
}

.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pagination-input {
  width: 58px;
  min-width: 58px;
  height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: rgba(4, 12, 21, 0.72);
  color: var(--text);
  font: inherit;
  text-align: center;
}

.pagination-input:focus {
  outline: 2px solid rgba(40, 201, 174, 0.34);
  outline-offset: 1px;
  border-color: var(--brand);
}

.pagination-input::-webkit-inner-spin-button,
.pagination-input::-webkit-outer-spin-button {
  margin: 0;
}

.pagination-label strong {
  color: var(--text);
  font-weight: 700;
}

.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 16, 0.86);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.preview-modal.open {
  display: flex;
}

.preview-modal-dialog {
  width: min(1100px, 100%);
  max-height: calc(100vh - 40px);
  background: #0d1926;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-close {
  align-self: flex-end;
  padding: 6px 12px;
  font-size: 12px;
}

.preview-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 220px;
  max-height: calc(100vh - 130px);
}

.preview-stage {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-height: 220px;
}

.preview-nav {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 6px;
  font-size: 24px;
  line-height: 1;
}

.preview-nav[hidden] {
  visibility: hidden;
  display: block;
}

.preview-content img,
.preview-content video {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  border-radius: 8px;
  background: #08111c;
}

.preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-counter {
  min-width: 64px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.preview-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.preview-download:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 640px) {
  .health-probe-settings {
    grid-template-columns: minmax(0, 1fr);
  }

  .health-proxy-settings {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-modal {
    padding: 10px;
  }

  .preview-modal-dialog {
    padding: 12px;
  }

  .preview-stage {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 6px;
  }

  .preview-nav {
    width: 38px;
    height: 38px;
  }
}

.error-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.error-detail-head h3 {
  margin: 0;
  font-size: 16px;
  color: #e9f4ff;
}

.error-detail-content {
  border: 1px solid rgba(142, 181, 221, 0.25);
  border-radius: 8px;
  background: #091321;
  padding: 12px;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.error-detail-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cfe3f8;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(12, 20, 31, 0.92);
  color: #dbe9f8;
  border: 1px solid rgba(142, 181, 221, 0.28);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  line-height: 1.4;
  z-index: 1200;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  border-color: rgba(77, 226, 196, 0.45);
}

.toast.error {
  border-color: rgba(255, 180, 188, 0.45);
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .list-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .list-head .actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .token-list-actions {
    width: 100%;
    align-items: flex-start;
  }

  .token-credits-summary {
    text-align: left;
  }

  .token-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logs-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .tabs {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .api-key-dialog-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .dialog-modal {
    padding: 10px;
  }

  .api-key-proxy-dialog {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .api-key-proxy-dialog-head {
    gap: 12px;
    margin-bottom: 18px;
  }

  .api-key-proxy-dialog .api-key-proxy-pool {
    min-height: 180px;
  }

  .api-key-proxy-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
  }

  .api-key-proxy-actions .msg {
    grid-column: 1 / -1;
    margin-right: 0;
  }

  .api-key-proxy-actions button {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-category-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .config-inline-row {
    grid-template-columns: 1fr;
  }

  .input-select {
    width: 100%;
  }

  .token-summary {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .token-filter-bar {
    grid-template-columns: 1fr;
  }

  .logs-filter-bar {
    grid-template-columns: 1fr;
  }

  .logs-pagination {
    justify-content: center;
    gap: 7px;
  }

  .pagination-jump {
    order: 2;
  }

  .logs-pagination button:nth-of-type(2) {
    order: 1;
  }

  .logs-pagination button:nth-of-type(3) {
    order: 3;
  }

  .logs-pagination button:nth-of-type(4) {
    order: 4;
  }

  .logs-pagination button:nth-of-type(5) {
    order: 5;
  }
}

@media (max-width: 360px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Request diagnostics workspace */
.logs-toolbar-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  margin: -4px 0 12px;
}

.query-state {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.query-state.error {
  color: #ffca58;
}

.logs-filter-bar {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: rgba(5, 12, 20, 0.42);
}

.logs-filter-bar .token-filter-field:first-child {
  grid-column: span 2;
}

#logsTable {
  min-width: 1060px;
  table-layout: fixed;
}

#logsTable th,
#logsTable td {
  border-bottom-color: rgba(165, 197, 230, 0.12);
}

#logsTable th:nth-child(1) { width: 125px; }
#logsTable th:nth-child(2) { width: 98px; }
#logsTable th:nth-child(3) { width: 205px; }
#logsTable th:nth-child(4) { width: 145px; }
#logsTable th:nth-child(5) { width: 150px; }
#logsTable th:nth-child(6) { width: 82px; }
#logsTable th:nth-child(7) { width: 220px; }
#logsTable th:nth-child(8) { width: 150px; }
#logsTable td:nth-child(1) { width: 125px; }
#logsTable td:nth-child(2) { width: 98px; }
#logsTable td:nth-child(3) { width: 205px; }
#logsTable td:nth-child(4) { width: 145px; }
#logsTable td:nth-child(5) { width: 150px; }
#logsTable td:nth-child(6) { width: 82px; }
#logsTable td:nth-child(7) { width: 220px; }
#logsTable td:nth-child(8) { width: 150px; }

#logsTable tbody tr[data-request-id] {
  cursor: pointer;
  transition: background-color 0.16s ease;
}

#logsTable tbody tr[data-request-id]:hover {
  background: rgba(44, 199, 170, 0.07);
}

.log-request-id,
.log-open-btn {
  font: inherit;
}

.log-request-id {
  display: block;
  max-width: 100px;
  margin-top: 7px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #6f91b2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-request-id:hover {
  color: var(--brand);
}

.log-subline {
  display: block;
  margin-top: 4px;
  color: #7089a4;
  font-size: 11px;
  line-height: 1.25;
}

.log-protocol-cell {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px;
}

.log-meta-badge.error-category {
  border-color: rgba(255, 202, 88, 0.35);
  background: rgba(255, 202, 88, 0.08);
  color: #ffda7d;
}

.log-duration-cell {
  color: #b4c9dc;
  white-space: nowrap;
}

.log-prompt-cell {
  display: -webkit-box;
  max-height: 50px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.log-actions-cell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.log-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  background: rgba(2, 7, 13, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.log-detail-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.log-detail-drawer {
  width: min(540px, 100vw);
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--card-border);
  background: #0c1826;
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.34);
  transform: translateX(24px);
  transition: transform 0.2s ease;
}

.log-detail-modal.open .log-detail-drawer {
  transform: translateX(0);
}

.log-detail-header,
.log-detail-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.log-detail-header h3 {
  margin: 3px 0 4px;
  font-size: 20px;
}

.eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.log-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0;
}

.log-detail-kv,
.log-detail-prompt {
  padding: 11px 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.log-detail-kv span,
.log-detail-prompt > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.log-detail-kv strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.log-detail-state.success { color: var(--brand); }
.log-detail-state.failed { color: #ffb4bc; }
.log-detail-state.in_progress { color: #63d4ff; }

.log-detail-prompt {
  grid-column: 1 / -1;
}

.log-detail-prompt p {
  margin: 6px 0 0;
  color: #c4d5e6;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.log-detail-section {
  margin-top: 16px;
}

.log-detail-section h4 {
  margin: 0;
  font-size: 14px;
}

.log-attempt-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.log-attempt {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.log-attempt.failed { border-color: rgba(225, 96, 104, 0.32); }
.log-attempt-marker {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(142, 181, 221, 0.13);
  color: #a8bfd8;
  font-size: 11px;
  font-weight: 800;
}

.log-attempt-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #cbdced;
  font-size: 12px;
}

.log-attempt-head span,
.log-attempt-meta {
  color: #7892ac;
  font-size: 11px;
}

.log-attempt-meta { margin-top: 5px; }
.log-attempt p { margin: 7px 0 0; color: #ffb4bc; font-size: 12px; line-height: 1.4; }
.log-detail-error { margin-top: 14px; color: #ffb4bc; font-size: 12px; }

@media (max-width: 560px) {
  .logs-toolbar-note { align-items: flex-start; flex-direction: column; }
  .logs-filter-bar .token-filter-field:first-child { grid-column: auto; }
  .log-detail-drawer { padding: 18px; }
  .log-detail-summary { grid-template-columns: 1fr; }
  .log-detail-prompt { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .log-detail-modal,
  .log-detail-drawer,
  #logsTable tbody tr[data-request-id] { transition: none; }
}

.logs-filter-bar {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.logs-filter-bar .token-filter-field:first-child {
  grid-column: span 3;
}

@media (max-width: 1280px) {
  .logs-filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .logs-filter-bar .token-filter-field:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .shell {
    padding-inline: 12px;
  }

  .card {
    padding: 16px;
  }

  .logs-filter-bar,
  .logs-filter-bar .token-filter-field:first-child {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
}

/* Account routing workspace */
.account-groups-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.section-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.account-groups-list { display: grid; gap: 8px; }
.account-group-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  text-align: left;
}
.account-group-row:hover, .account-group-row:focus-visible { border-color: rgba(44,199,170,.65); background: rgba(44,199,170,.08); }
.account-group-row span { min-width: 0; display: grid; gap: 4px; }
.account-group-row strong, .account-group-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-group-row small, .table-subline { color: var(--muted); font-size: 11px; }
.account-group-row b { color: var(--brand); white-space: nowrap; font-size: 12px; }
.api-key-groups-cell { display: inline-block; max-width: 180px; color: #c9f8ec; line-height: 1.4; }
.toggle-row { display: flex; align-items: center; gap: 10px; color: #d8e8f8; }
.account-policy-dialog { width: min(560px, 100%); max-height: min(760px, calc(100vh - 32px)); overflow: auto; }
.error-text { color: #ffb4bc; }

@media (max-width: 900px) {
  .account-groups-grid { grid-template-columns: 1fr; }
}

/* Account actions and stable wide-table layout */
.form-label {
  color: #cce0f5;
  font-size: 13px;
  font-weight: 600;
}

.account-groups-workspace .account-groups-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.account-group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.account-group-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.account-groups-footnote {
  margin-top: 14px;
}

#accountGroupsPagination {
  margin-top: 16px;
}

#accountGroupsPagination[hidden] {
  display: none;
}

.group-scope-all,
.group-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  cursor: pointer;
}

.group-scope-all {
  padding: 9px 11px;
  border: 1px solid rgba(44, 199, 170, 0.32);
  border-radius: 7px;
  background: rgba(44, 199, 170, 0.08);
}

.group-checklist {
  display: grid;
  gap: 6px;
  max-height: min(320px, 42vh);
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 12, 20, 0.42);
}

.group-checklist.disabled {
  opacity: 0.48;
}

.group-check-row {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
}

.group-check-row:hover {
  background: rgba(142, 181, 221, 0.08);
}

.group-check-row > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.group-check-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-check-row input,
.group-scope-all input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.protocol-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.protocol-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(89, 166, 255, 0.36);
  border-radius: 5px;
  background: rgba(65, 132, 210, 0.12);
  color: #9bc8ff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

#tokenTable {
  min-width: 1760px;
}

#tokenTable th:nth-child(2),
#tokenTable td:nth-child(2) { min-width: 230px; }
#tokenTable th:nth-child(4),
#tokenTable td:nth-child(4) { min-width: 220px; }
#tokenTable th:nth-child(5),
#tokenTable td:nth-child(5) { min-width: 190px; }
#tokenTable th:last-child,
#tokenTable td:last-child { min-width: 190px; }

.token-routing-cell {
  display: grid;
  gap: 7px;
}

.token-routing-cell .table-subline {
  display: block;
  max-width: 240px;
  overflow: hidden;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-table {
  min-width: 2120px;
}

.api-key-table th,
.api-key-table td {
  word-break: normal;
}

.api-key-table th:nth-child(3),
.api-key-table td:nth-child(3) { min-width: 110px; }
.api-key-table th:nth-child(7),
.api-key-table td:nth-child(7) { min-width: 220px; }
.api-key-table th:nth-child(8),
.api-key-table td:nth-child(8) { min-width: 130px; }
.api-key-table th:nth-child(9),
.api-key-table td:nth-child(9) { min-width: 230px; }
.api-key-table th:nth-child(10),
.api-key-table td:nth-child(10) { min-width: 150px; }
.api-key-table th:nth-child(11),
.api-key-table td:nth-child(11) { min-width: 150px; }

.api-key-table th,
.api-key-table td:nth-child(3),
.api-key-table td:nth-child(7),
.api-key-table td:nth-child(8),
.api-key-table td:nth-child(10),
.api-key-table td:nth-child(11) {
  white-space: nowrap;
}

#logsTable td {
  display: table-cell;
}

.log-actions-cell {
  display: table-cell;
  min-width: 150px;
}

.log-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.log-account-cell {
  min-width: 0;
  max-width: 100%;
}

.log-account-cell strong,
.log-account-cell .log-subline {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .tabs {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .tab-btn {
    flex: 0 0 auto;
  }

  .account-groups-workspace .account-groups-list {
    grid-template-columns: 1fr;
  }

  .account-group-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .account-group-actions {
    grid-column: 1 / -1;
  }
}
