/* Разделы аккаунта (account.js) и общие элементы core.js: таблицы, бейджи, диалоги, формы.
   Палитра и размеры — как у prototype.css (дизайн консоли Codex). */
.account-screen .mono, .nx-dialog .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.nx-muted { color: #9a9ca3; }
.nx-muted.small, .small { font-size: 12px; line-height: 1.5; }
.nx-lead { margin: -14px 0 24px; font-size: 13px; line-height: 1.6; max-width: 720px; }
.nx-gap { margin-top: 28px; }
.nx-loading { padding: 60px 0; text-align: center; color: #9a9ca3; font-size: 13px; }
.nx-error { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border: 1px solid #5a3a3a; border-radius: 7px; background: #1a1112; color: #f0d6d6; font-size: 13px; }
.nx-error svg { width: 18px; flex: none; color: #f08b8b; }
.nx-error span { flex: 1; }
.nx-link { display: inline-flex; align-items: center; gap: 6px; color: #d9d9de; font-size: 12px; text-decoration: none; }
.nx-link:hover { color: #fff; text-decoration: underline; }
.nx-link svg { width: 14px; height: 14px; }
.nx-ok-line { display: flex; align-items: center; gap: 8px; color: #7fd6a3; font-size: 12px; margin: 12px 0; }
.nx-ok-line svg { width: 16px; }

/* Обзор */
.proto-stats > div { position: relative; }
.proto-stats .nx-link { margin-top: auto; }
.nx-delta { margin-left: 6px; font-style: normal; font-size: 11px; font-family: ui-monospace, monospace; }
.nx-delta.up { color: #7fd6a3; }
.nx-delta.down { color: #9a9ca3; }
.nx-bars { display: flex; align-items: flex-end; gap: 3px; height: 48px; margin-top: 6px; }
.nx-bars span { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: rgba(255, 255, 255, .16); }
.nx-bars span:hover { background: #fff; }
.nx-stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 8px; }
.nx-list { border-top: 1px solid #2c2d30; margin-top: 14px; }
.proto-columns > *, .proto-billing > *, .proto-stats > * { min-width: 0; }
.nx-list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(72px, auto); align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #292b2e; color: #d9d9de; text-decoration: none; font-size: 13px; }
.nx-list-row > span:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nx-list-row > span:first-child .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-list-row small { color: #9698a0; font-size: 11px; }
.nx-list-row.tx { grid-template-columns: auto minmax(0, 1fr) auto; }
.nx-list-row.tx > span:first-child { flex-direction: row; }
a.nx-list-row:hover { background: rgba(255, 255, 255, .02); }
.nx-shares { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.nx-shares > div { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 12px; color: #d9d9de; }
.nx-shares > div > span:last-of-type { color: #9a9ca3; }
.nx-shares i { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: #e9e9ec; }
.nx-telegram { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #292b2e; }

/* Код и вкладки */
.nx-tabs { display: inline-flex; gap: 4px; margin: 14px 0 10px; padding: 3px; border: 1px solid #2f3134; border-radius: 6px; }
.nx-tabs button { padding: 5px 11px; border: 0; border-radius: 4px; background: transparent; color: #a4a6ad; font: inherit; font-size: 12px; cursor: pointer; }
.nx-tabs button[aria-selected="true"] { background: #eee; color: #111; }
.nx-code { position: relative; border: 1px solid #2b2d30; border-radius: 7px; background: #0b0c0d; }
.nx-code pre { margin: 0; padding: 16px 44px 16px 16px; overflow-x: auto; color: #d7d8dc; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.nx-code .icon-button { position: absolute; top: 8px; right: 8px; }

/* Таблицы */
.nx-table-wrap { border: 1px solid #2b2d30; border-radius: 7px; overflow-x: auto; }
.nx-table { width: 100%; border-collapse: collapse; font-size: 13px; color: #d9d9de; }
.nx-table th { padding: 13px 14px; border-bottom: 1px solid #292b2e; color: #9b9ca3; font-size: 11px; font-weight: 500; text-align: left; white-space: nowrap; }
.nx-table td { padding: 13px 14px; border-bottom: 1px solid #222427; vertical-align: middle; white-space: nowrap; }
.nx-table td.wrap, .nx-table tr.details td { white-space: normal; }
.nx-table tr:last-child td { border-bottom: 0; }
.nx-table td strong { color: #f1f1f2; font-weight: 600; }
.nx-table td small { display: block; margin-top: 4px; color: #8f9198; }
.nx-table .num { text-align: right; white-space: nowrap; }
.nx-table .actions { text-align: right; white-space: nowrap; }
.nx-table .actions .icon-button { margin-left: 4px; }
.nx-table tr.revoked td { opacity: .5; }
.nx-table tr.clickable { cursor: pointer; }
.nx-table tr.clickable:hover td, .nx-table tr.clickable:focus-visible td { background: rgba(255, 255, 255, .025); outline: none; }
.nx-table tr.details td { background: #0b0c0d; padding: 4px 16px 18px; }
.nx-restrictions { color: #c9b47a !important; }
.icon-button.danger:hover { color: #f08b8b; }

/* Бейджи */
.nx-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid #3a3c40; border-radius: 5px; color: #c9cacf; font-size: 11px; white-space: nowrap; }
.nx-badge svg { width: 12px; height: 12px; }
.nx-badge.ok { border-color: #2e5a43; background: rgba(46, 160, 100, .1); color: #8fe0b0; }
.nx-badge.warn { border-color: #5c4e2a; background: rgba(200, 160, 60, .1); color: #e7cd85; }
.nx-badge.err { border-color: #5c2e2e; background: rgba(210, 80, 80, .1); color: #f0a0a0; }
.nx-badge.info { border-color: #2e4a5c; background: rgba(70, 140, 200, .1); color: #9cc8ec; }
.nx-tx { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #c9cacf; white-space: nowrap; }
.nx-tx svg { width: 14px; }
.nx-tx.ok { color: #8fe0b0; }
.nx-tx.warn { color: #e7cd85; }
.nx-tx-desc { color: #a9abb1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-list-row .num { text-align: right; white-space: nowrap; }
.nx-list-row .num.plus { color: #8fe0b0; }

/* Детали запроса и свойства */
.nx-props { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 18px; margin: 12px 0 0; font-size: 12px; }
.nx-props dt { color: #9698a0; }
.nx-props dd { margin: 0; color: #e1e1e5; overflow-wrap: anywhere; }
.nx-props .icon-button { width: 26px; height: 26px; vertical-align: middle; }
.nx-prompt { white-space: pre-wrap; max-height: 180px; overflow: auto; }

/* Пагинация */
.nx-pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; color: #9a9ca3; font-size: 12px; }
.nx-pager .proto-button:disabled { opacity: .4; cursor: default; }

/* Тарифы */
.nx-price-group { margin-bottom: 28px; }
.nx-price-group h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; color: #f1f1f2; font-size: 15px; }
.nx-price-group h3 small { color: #8f9198; font-size: 12px; font-weight: 400; }
.nx-price small { color: #9698a0; }
.nx-options, .nx-llm-prices { display: flex; flex-direction: column; gap: 6px; }
.nx-options span, .nx-llm-prices span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.nx-options small, .nx-llm-prices span small { min-width: 150px; color: #9698a0; }
.nx-options em { flex-basis: 100%; color: #8f9198; font-size: 11px; font-style: normal; }

/* Диалоги (core.js) */
.nx-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100vh - 48px); box-sizing: border-box; padding: 0; border: 1px solid #404247; border-radius: 8px; background: #101112; color: #eee; overflow: auto; }
.nx-dialog.wide { width: min(760px, calc(100% - 32px)); }
.nx-dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(5px); }
.nx-dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid #26282b; background: #101112; }
.nx-dialog-head h2 { margin: 0; font-size: 17px; }
.nx-dialog-body { padding: 20px 22px 22px; }
.nx-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.primary-button.danger { border-color: #b94a4a; background: #b94a4a; color: #fff; }
.nx-warning { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid #55504a; border-radius: 5px; color: #ded6c9; font-size: 12px; }
.nx-warning svg { width: 16px; flex: none; }
.nx-secret { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding: 10px 12px; border: 1px solid #383a3e; border-radius: 6px; background: #0b0c0d; }
.nx-secret code { flex: 1; overflow-x: auto; color: #f1f1f2; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }

/* Формы */
.nx-input, .proto-topup input, .proto-topup select { width: 100%; min-height: 42px; box-sizing: border-box; padding: 8px 12px; border: 1px solid #383a3e; border-radius: 6px; background: #0b0c0d; color: #eee; font: inherit; font-size: 13px; }
textarea.nx-input { resize: vertical; font-family: ui-monospace, monospace; }
.nx-input.narrow { width: 140px; }
.nx-input:focus, .proto-topup input:focus, .proto-topup select:focus { outline: 2px solid rgba(255, 255, 255, .25); outline-offset: 1px; }
.nx-limits fieldset { margin: 0 0 16px; padding: 14px 16px; border: 1px solid #2b2d30; border-radius: 7px; }
.nx-toggle { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; cursor: pointer; }
.nx-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; max-height: 280px; overflow: auto; }
.nx-models label { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: #d0d1d6; font-size: 12px; cursor: pointer; }
.nx-models .micro-label { margin: 0 0 6px; }

@media (max-width: 900px) {
  .nx-stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-tx-desc { display: none; }
  .nx-list-row.tx { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 600px) {
  .nx-stats-4 { grid-template-columns: 1fr; }
  .nx-table th, .nx-table td { padding: 11px 10px; }
  .nx-props { grid-template-columns: 1fr; gap: 2px; }
  .nx-props dd { margin-bottom: 8px; }
  .nx-telegram { flex-direction: column; align-items: flex-start; }
}

/* Подписи внутри ячеек тарифов — в строку (общее правило .nx-table td small делает их блоками). */
.nx-table td .nx-price small { display: inline; margin: 0; }
.nx-table td .nx-options small, .nx-table td .nx-llm-prices span small { display: inline-block; margin: 0; min-width: 150px; }
.nx-table td .nx-llm-prices > small { display: block; margin-top: 2px; }
.nx-code .icon-button { background: #0b0c0d; }
.nx-table td.wrap { min-width: 140px; max-width: 280px; }
