/* Latency Lab - account / API keys */
.lab-page .lab {
  padding-top: 1.25rem;
}

.account-box {
  /* Перебиваем .login-box { max-width: 420px } - профиль не форма входа. */
  width: min(1120px, 100%);
  max-width: min(1120px, 100%);
  text-align: left;
  margin-inline: auto;
}

@media (min-width: 720px) {
  .account-box {
    margin-top: 2rem;
    padding: 1.85rem 2.1rem 2.1rem;
  }
}

.footer a {
  color: inherit;
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent, #00e5a8);
}

/* --- Hero --- */
.account-hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

@media (min-width: 640px) {
  .account-hero {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 1.5rem;
  }

  .account-hero__pills {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: stretch;
    justify-self: end;
  }

  .account-id {
    grid-column: 1;
  }
}

.account-hero__who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  min-width: 0;
}

.account-hero h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  word-break: break-word;
}

.account-role {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.account-role--admin {
  color: var(--accent, #00e5a8);
  border-color: rgba(0, 229, 168, 0.4);
  background: rgba(0, 229, 168, 0.1);
}

.account-role--moderator {
  color: #8eb6ff;
  border-color: rgba(79, 140, 255, 0.4);
  background: rgba(79, 140, 255, 0.1);
}

.account-hero__pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0.65rem;
}

.account-limit {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  min-width: 8.5rem;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.account-balance .account-limit__value {
  color: var(--accent, #00e5a8);
}

.account-limit__value {
  font-family: var(--mono);
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.account-limit__label {
  font-size: 0.78rem;
  color: var(--muted);
}

.account-limit.account-pill--warn {
  border-color: rgba(240, 198, 116, 0.45);
}

.account-limit.account-pill--warn .account-limit__value {
  color: #f0c674;
}

.account-limit.account-pill--danger {
  border-color: rgba(255, 123, 123, 0.5);
  background: rgba(255, 80, 80, 0.1);
}

.account-limit.account-pill--danger .account-limit__value {
  color: #ff7b7b;
  font-size: clamp(0.92rem, 1.9vw, 1.15rem);
  line-height: 1.2;
}

.account-limit.account-pill--danger .account-limit__label {
  color: rgba(255, 160, 160, 0.9);
}

.account-limit--banned {
  min-width: 10rem;
  text-align: center;
}

.account-id {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  width: fit-content;
}

.account-id:hover {
  color: var(--accent, #00e5a8);
}

/* --- Sections --- */
.account-section {
  margin-top: 1.55rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.account-section h2 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
}

.account-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.account-section__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.account-section__hint {
  font-size: 0.8rem;
}

.account-pill {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.account-pill--warn {
  color: #f0c674;
  border-color: rgba(240, 198, 116, 0.45);
}

.account-pill--danger {
  color: #ff7b7b;
  border-color: rgba(255, 123, 123, 0.5);
}

.account-alert {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.account-alert--warn {
  color: #f0c674;
}

.account-alert--danger {
  color: #ff7b7b;
}

.account-inline-link {
  color: var(--accent, #00e5a8);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.88rem;
}

.account-inline-link:hover {
  text-decoration: underline;
}

.account-note {
  font-size: 0.9rem;
  margin: 0.65rem 0 0;
}

/* --- Collapsible section --- */
.account-fold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.account-fold:hover .account-fold__title {
  color: var(--accent, #00e5a8);
}

.account-fold__title {
  font-size: 1.02rem;
  font-weight: 700;
  transition: color 0.15s ease;
}

.account-fold__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.account-fold__chev {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  margin-top: -0.15rem;
}

.account-section--fold:not(.is-collapsed) .account-fold__chev {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.account-section--fold.is-collapsed .account-fold {
  margin-bottom: 0;
}

.account-fold__body {
  margin-top: 0.85rem;
}

/* --- Stat tiles --- */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 720px) {
  .stat-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .stat-tile--span2 {
    grid-column: span 2;
  }
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.stat-tile__n {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.stat-tile__l {
  font-size: 0.78rem;
  color: var(--muted);
}

.stat-ok {
  color: var(--accent, #00e5a8);
  font-weight: 600;
  font-size: 0.85em;
}

/* --- Recent feed --- */
.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.recent-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.14);
  font-size: 0.86rem;
}

.recent-list li:hover {
  border-color: var(--line);
}

.recent-list__kind {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  white-space: nowrap;
}

.recent-list__target {
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-list__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.recent-list__mark {
  display: inline-block;
  min-width: 1.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-align: center;
  font-weight: 700;
}

.recent-list__mark--ok {
  color: var(--accent, #00e5a8);
}

.recent-list__mark--fail {
  color: #ff7b7b;
}

.recent-list__mark--pending {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 560px) {
  .recent-list li {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.35rem 0.55rem;
  }

  .recent-list__meta {
    grid-column: 2;
  }
}

/* --- Servers card --- */
.servers-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.servers-card:hover {
  border-color: rgba(0, 229, 168, 0.35);
  background: rgba(0, 229, 168, 0.06);
}

.servers-card h2 {
  margin-bottom: 0.35rem;
}

.servers-card__count {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
}

.servers-card__links {
  margin: 0;
  font-size: 0.82rem;
}

.servers-card__go {
  font-weight: 700;
  color: var(--accent, #00e5a8);
  white-space: nowrap;
}

.servers-link--on {
  color: var(--accent, #00e5a8);
  font-weight: 600;
}

.servers-link--off {
  color: var(--muted);
}

/* --- Feedback --- */
.feedback-lead {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 46rem;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feedback-input {
  width: 100%;
  min-height: 6.5rem;
  resize: vertical;
  line-height: 1.45;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.feedback-hint {
  font-size: 0.8rem;
}

#feedback-status.account-alert--ok {
  color: var(--accent, #00e5a8);
  border-color: rgba(0, 229, 168, 0.35);
  background: rgba(0, 229, 168, 0.08);
}

/* --- Keys / forms --- */
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.account-input {
  flex: 1 1 12rem;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font: inherit;
}

.account-input:focus {
  outline: 2px solid rgba(0, 229, 168, 0.45);
  outline-offset: 2px;
}

.btn-acc {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-acc:hover {
  border-color: rgba(0, 229, 168, 0.35);
  background: rgba(0, 229, 168, 0.08);
}

.btn-acc--primary {
  border-color: rgba(0, 229, 168, 0.4);
  background: rgba(0, 229, 168, 0.14);
  color: var(--accent);
}

.btn-acc--danger {
  border-color: rgba(255, 107, 138, 0.35);
  color: var(--danger);
}

.btn-acc:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.keys-list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.keys-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.key-main {
  min-width: 0;
}

.key-main strong {
  display: block;
  font-size: 0.95rem;
}

.key-main span {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}

.token-box {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 229, 168, 0.35);
  background: rgba(0, 229, 168, 0.08);
}

.token-box__warn {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
}

.token-box__value {
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  word-break: break-all;
  margin-bottom: 0.7rem;
  color: var(--text);
}

.user-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

/* api.html docs (shared stylesheet) */
#api-docs-link {
  color: var(--accent, #00e5a8);
  font-weight: 600;
  text-decoration: none;
}
#api-docs-link:hover {
  text-decoration: underline;
}

.api-docs {
  width: min(720px, 100%);
}
.api-docs a {
  color: var(--accent, #00e5a8);
  text-decoration: none;
  font-weight: 600;
}
.api-docs a:hover {
  text-decoration: underline;
}
.api-docs__pre {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text, #e8eef5);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  white-space: pre;
}
.api-docs__table-wrap {
  overflow-x: auto;
  margin-bottom: 0.75rem;
}
.api-docs__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.api-docs__table th,
.api-docs__table td {
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.1));
}
.api-docs__table th {
  color: var(--muted, #9aa7b5);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.api-docs__table code,
.api-docs code {
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: 0.82em;
}
.api-docs__meta dd {
  word-break: break-word;
}
