/* Стили обычных страниц панели поверх vendor/tabler.min.css.
   Сначала общая тема, затем компоненты и их адаптация под узкий экран.
   Порядок правил сохраняет каскад: поздние уточнения важнее ранних.
   Серверный просмотр инвентаря использует отдельный server-inventory.css. */
@font-face {
    font-family: Roboto;
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('vendor/fonts/roboto/roboto-variable-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: Roboto;
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('vendor/fonts/roboto/roboto-variable-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root, [data-bs-theme="dark"] {
    --panel-bg: #212121;
    --panel-surface: #2d3436;
    --panel-border: #484848;
    --panel-text: #e0e0e0;
    --panel-muted: #aaa;
    --tblr-primary: #a8a8a8;
    --tblr-primary-rgb: 168, 168, 168;
    --tblr-body-bg: #212121;
    --tblr-body-color: #e0e0e0;
    --tblr-bg-surface: #2d3436;
    --tblr-bg-surface-secondary: #252b2d;
    --tblr-border-color: #484848;
    --tblr-secondary-color: #aaa;
    --tblr-muted: #aaa;
    --tblr-font-sans-serif: Roboto, Arial, sans-serif;
    --tblr-border-radius: 2px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--panel-bg);
    color: var(--panel-text);
    font-family: var(--tblr-font-sans-serif);
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: #dedede;
    text-decoration: none;
}

a:hover {
    color: #fff;
}

button, input, select, textarea {
    font: inherit;
}

button, a, input, select, textarea {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 2px solid #d4d4d4;
    outline-offset: 3px;
}

.icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
    width: 20px;
    height: 20px;
}

.text-secondary {
    color: var(--panel-muted) !important;
}

/* Верхняя навигация остаётся общей для всех страниц. */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 51px;
    padding: 0 24px;
    background: #424242;
    border-bottom: 1px solid #4b4b4b;
}

.brand {
    color: #f0f0f0;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.top-nav {
    align-self: stretch;
    display: flex;
    gap: 0;
    margin-left: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 20px;
    min-height: 50px;
    color: #fff;
    font-family: var(--tblr-font-sans-serif);
    font-size: 16px;
    font-weight: 400;
    line-height: 20px;
    border-bottom: 3px solid transparent;
}

.top-nav.has-owner-tabs {
    min-width: 0;
    flex-wrap: wrap;
}

.nav-item:hover {
    background: #484848;
    color: #fff;
}

.nav-item.active {
    color: #fff;
    border-bottom-color: #d4d4d4;
}

.nav-item.nav-item-disabled, .nav-item.nav-item-disabled:hover {
    background: transparent;
    color: #999;
    cursor: default;
}

.admin-area {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    white-space: nowrap;
    font-size: 16px;
}

.admin-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-button {
    color: #ededed;
    border: 0;
    padding: 4px 0;
    background: transparent;
    cursor: pointer;
}

.logout-button:hover {
    color: #fff;
    text-decoration: underline;
}

/* Отступы и действия повторяют простую компоновку выбранного примера. */
.main-content {
    flex: 1;
    width: 100%;
    padding: 88px 24px 36px;
}

/* Общий подвал находится после содержимого и не перекрывает рабочие окна. */
.panel-footer {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 4px;
    padding: 14px 24px;
    border-top: 1px solid #4b4b4b;
    background: #424242;
    color: #eee;
}
.panel-footer-copy {
    align-self: center;
    max-width: calc(100% - 320px);
    text-align: center;
}
.panel-footer-authors {
    position: absolute;
    right: 24px;
    bottom: 14px;
    white-space: nowrap;
}
@media (max-width: 700px) {
    .panel-footer-copy { max-width: 100%; }
    .panel-footer-authors { position: static; align-self: flex-end; }
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0 0 38px;
}

.page-heading > .btn {
    margin-left: auto;
}

.refresh-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #aaa;
}

.refresh-link .icon {
    width: 20px;
    height: 20px;
}

.refresh-link:hover {
    color: #eee;
}

h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 300;
    letter-spacing: 0;
    color: #888;
}

.page-description {
    margin: 10px 0 0;
    font-size: 13px;
    color: #aaa;
}

.action-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 0 26px;
}

.heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.heading-actions > .btn {
    width: 280px;
}

.search-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.search-controls > .form-control {
    width: 340px;
    min-width: 0;
}

.search-field {
    position: relative;
    width: 330px;
    min-width: 160px;
}

.search-field > .icon {
    position: absolute;
    width: 17px;
    height: 17px;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

.search-field .form-control {
    padding-left: 36px;
}

.btn {
    min-height: 37px;
    padding: 8px 14px;
    border-radius: 2px;
    background: #424242;
    border: 1px solid #484848;
    color: #dedede;
    font-size: 14px;
    font-weight: 500;
    line-height: 19px;
    text-transform: uppercase;
    gap: 7px;
    white-space: nowrap;
    box-shadow: 0 2px 3px #0003;
}

.btn .icon {
    width: 17px;
    height: 17px;
    margin: 0;
}

.btn:hover, .btn:active, .btn:first-child:active {
    background: #505050;
    color: #fff;
    border-color: #696969;
}

.btn-primary {
    color: #dedede;
    background: #424242;
    border-color: #484848;
}

.btn-primary:hover, .btn-primary:active, .btn-primary:first-child:active {
    color: #fff;
    background: #505050;
    border-color: #696969;
}

.btn-danger {
    color: #eed2d0;
    background: #4b3f3e;
    border-color: #6d5553;
}

.btn-danger:hover {
    color: #ffe5e2;
    background: #624846;
    border-color: #94716c;
}

.reset-link {
    padding: 6px 0;
    color: #bcbcbc;
    font-size: 12px;
    white-space: nowrap;
}

.reset-link:hover {
    text-decoration: underline;
}

/* Обычная таблица без дополнительных карточек и декоративных статусов. */
.data-panel {
    overflow: hidden;
    border: 1px solid #484848;
    border-radius: 0;
    background: #2d3436;
}

.table-scroll {
    /* Скрытые подписи строк остаются внутри прокрутки и не растягивают страницу. */
    position: relative;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #858585 #292929;
}

.manager-table {
    width: 100%;
    margin: 0;
    color: #e0e0e0;
    font-size: 13px;
    white-space: nowrap;
    --tblr-table-border-color: #515656;
    --tblr-table-hover-bg: #353d3f;
}

.manager-table > thead > tr > th {
    background: #212121;
    border-bottom: 1px solid #484848;
    padding: 13px 15px;
    color: #bbb;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.manager-table > tbody > tr > td {
    height: 47px;
    padding: 9px 15px;
    background: #2d3436;
    color: #e7e7e7;
    border-bottom: 1px solid #515656;
    vertical-align: middle;
}

.manager-table > tbody > tr:nth-child(even) > td {
    background: #252b2d;
}

.manager-table > tbody > tr:hover > td {
    background: #363e40;
}

.manager-table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.manager-table .id-column {
    width: 70px;
    padding-left: 20px;
}

.manager-table .id-cell {
    color: #b5b5b5;
    padding-left: 20px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.account-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #40484b;
    border: 1px solid #606769;
    color: #d3d3d3;
    border-radius: 2px;
    font-size: 10px;
}

.account-login {
    font-size: 13px;
    font-weight: 400;
}

.proxy-address {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.note-cell {
    display: block;
    min-width: 50px;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.date-cell {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.column-detail {
    font-size: 9px;
    font-weight: 400;
    margin-left: 3px;
    color: #999;
}

.actions-column {
    width: 100px;
    text-align: right;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}

.icon-button, .disabled-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 29px;
    height: 29px;
    padding: 5px;
    background: #383e40;
    border: 1px solid #555a5c;
    color: #c2c2c2;
    border-radius: 2px;
}

.icon-button {
    cursor: pointer;
}

.icon-button .icon, .disabled-action .icon {
    width: 15px;
    height: 15px;
}

.icon-button:hover {
    color: #fff;
    background: #494e50;
    border-color: #8d8d8d;
}

.delete-button:hover {
    color: #f1c9c5;
    background: #51413f;
    border-color: #96736e;
}

.disabled-action {
    position: relative;
    opacity: .4;
    cursor: not-allowed;
}

.manager-table .steam-control-column {
    width: 94px;
    text-align: center;
}

.steam-control-cell {
    text-align: center;
}

/* Ограничения аккаунта отделены от кнопок трейда и ограничений предметов.
   Цвет только помогает чтению: смысл всегда явно указан текстом и подсказкой. */
.manager-table .steam-restriction-column {
    width: 104px;
    text-align: center;
}

.manager-table .steam-restriction-cell {
    min-width: 88px;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
    font-size: 12px;
    cursor: help;
}

.manager-table .steam-restriction-cell.is-unknown {
    color: #aaa;
}

.manager-table .steam-restriction-cell.is-notice {
    color: #d9c695;
}

.manager-table .steam-restriction-cell.is-blocked {
    color: #e0b3ae;
}

.manager-table .steam-restriction-cell.is-stale {
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

/* Баланс кошелька Steam, независимо от стоимости инвентаря. */
.account-table .steam-wallet-column { width: 94px; text-align: center; }
.account-table .steam-wallet-cell {
    min-width: 74px;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    cursor: help;
}
.account-table .steam-wallet-cell.is-unknown { color: #aaa; }
.account-table .steam-wallet-limited { width: 20px; height: 20px; vertical-align: middle; }
.account-table .steam-wallet-pending { display: block; margin-top: 3px; color: #e7c65a; font-size: 10px; font-weight: 400; }

.trade-link-button.is-ready {
    color: #a9d6ad;
    border-color: #5c805f;
    background: #354c39;
}

.trade-link-button.is-ready:hover {
    color: #cfefd1;
    border-color: #8fb694;
    background: #445f48;
}

.trade-link-button:disabled {
    opacity: .6;
    cursor: wait;
}

.trade-link-button[aria-busy="true"] .icon {
    animation: steam-loading 1.5s linear infinite;
}

.steam-auto-toggle {
    appearance: none;
    display: inline-block;
    position: relative;
    vertical-align: middle;
    width: 32px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 1px solid #707677;
    border-radius: 10px;
    background: #414749;
    cursor: pointer;
    transition: background .12s ease;
}

.steam-auto-toggle::before {
    content: "";
    display: block;
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #bebebe;
    transition: transform .12s ease;
}

.steam-auto-toggle:checked {
    background: #45634a;
    border-color: #8aaf91;
}

.steam-auto-toggle:checked::before {
    transform: translateX(14px);
    background: #d3e8d7;
}

.steam-auto-toggle:disabled {
    opacity: .5;
    cursor: wait;
}

.steam-row-error {
    max-width: 290px;
    margin: 4px 0 0;
    color: #e0b3ae;
    font-size: 11px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
}

.steam-notice {
    margin: -12px 0 16px;
    color: #c5d6c8;
    font-size: 12px;
}

.steam-notice.is-error {
    color: #e6bdb7;
}

.steam-notice[hidden], .steam-row-error[hidden] {
    display: none;
}

@keyframes steam-loading {
    to {
        transform: rotate(360deg);
    }
}

.assignment, .availability {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #e0e0e0;
}

.assignment .icon {
    width: 15px;
    height: 15px;
    color: #aaa;
}

.proxy-row-icon {
    display: inline-flex;
    color: #bbb;
}

.proxy-row-icon .icon {
    width: 17px;
    height: 17px;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 46px;
    padding: 13px 20px;
    color: #a7a7a7;
    font-size: 14px;
    border-top: 1px solid #484848;
    background: #2d3436;
}

.table-footer strong {
    color: #d0d0d0;
    font-weight: 400;
}

.users-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    margin-left: 64px;
    background: #626262;
}

.users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 26px;
}

.users-toolbar .btn {
    min-width: 280px;
    white-space: normal;
}

.users-table {
    min-width: 900px;
}

.users-table > thead > .users-filter-row > th {
    padding: 6px 12px;
}

.users-filter-row .form-control, .users-filter-row .form-select {
    min-height: 29px;
    height: 29px;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 12px;
}

.users-table tr[hidden], #users-filter-count[hidden] {
    display: none;
}

.users-status {
    text-align: center;
}

.user-self-label {
    margin-left: 7px;
    color: #aaa;
    font-size: 11px;
}

.users-table > tbody > tr > td.users-empty {
    padding: 28px;
    text-align: center;
    color: #aaa;
}

#user-editor-error[hidden] {
    display: none;
}

@media (max-width: 640px) {
    .users-heading::after {
        margin-left: 0;
        min-width: 24px;
    }
    .users-toolbar .btn {
        min-width: 0;
        width: 100%;
    }
}

.table-footer > span:last-child {
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-footer .icon {
    width: 13px;
    height: 13px;
}

.context-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin: 16px 0 0;
    font-size: 12px;
    color: #aaa;
}

.context-hint .icon {
    width: 15px;
    height: 15px;
}

.context-hint a {
    text-decoration: underline;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 235px;
    padding: 38px 24px;
    text-align: center;
}

.empty-icon {
    color: #aab0b2;
    margin-bottom: 16px;
}

.empty-icon .icon {
    width: 32px;
    height: 32px;
}

.empty-state h3 {
    font-size: 17px;
    font-weight: 400;
    margin: 0 0 9px;
}

.empty-state p {
    font-size: 13px;
    color: #aaa;
    max-width: 410px;
    margin: 0 0 21px;
}

/* Формы и окна. Скрытые пароли не подставляются в поля. */
.form-control, .form-select {
    min-height: 37px;
    padding: 8px 11px;
    color: #e5e5e5;
    font-size: 14px;
    background-color: #292d2f;
    border-color: #626262;
    border-radius: 2px;
    box-shadow: inset 0 1px 2px #0002;
}

.form-control::placeholder {
    color: #aaa;
    opacity: 1;
}

#steam-profile-name:disabled {
    background-color: #262a2c;
    color: #999;
    border-color: #505657;
}

.form-control:focus, .form-select:focus {
    color: #f0f0f0;
    background-color: #303638;
    border-color: #b9b9b9;
    box-shadow: 0 0 0 3px #ddd1;
}

.form-select {
    padding-right: 34px;
}

.form-select option {
    background: #2d3436;
    color: #e5e5e5;
}

.form-label {
    margin-bottom: 7px;
    color: #d8d8d8;
    font-size: 13px;
    font-weight: 400;
}

.form-hint {
    color: #aaa;
    font-size: 12px;
    line-height: 1.55;
    margin-top: 7px;
}

.required-mark {
    color: #c5c5c5;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 19px 16px;
}

.full-width {
    grid-column: 1 / -1;
}

.form-section-label {
    padding-top: 17px;
    border-top: 1px solid #484848;
    margin-top: 2px;
    margin-bottom: -6px;
    color: #cecece;
    font-size: 12px;
    font-weight: 500;
}

.form-section-label span {
    margin-left: 7px;
    color: #aaa;
    font-size: 11px;
    font-weight: 400;
}

.form-check {
    min-height: 17px;
    padding-left: 23px;
}

.form-check-input {
    width: 15px;
    height: 15px;
    margin-left: -23px;
    margin-top: 2px;
    background-color: #252b2d;
    border-color: #808080;
}

.form-check-input:checked {
    background-color: #767676;
    border-color: #b5b5b5;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px #ddd2;
    border-color: #d3d3d3;
}

.form-check-label {
    color: #b5b5b5;
    font-size: 11px;
    line-height: 1.4;
}

textarea.form-control {
    resize: vertical;
    min-height: 66px;
}

.modal-content {
    background: #2b2f31;
    color: #e0e0e0;
    border: 1px solid #656565;
    border-radius: 3px;
    box-shadow: 0 20px 65px #0007;
}

.modal-dialog {
    max-width: 610px;
}

.modal-dialog.modal-sm {
    max-width: 420px;
}

.modal-header {
    padding: 21px 24px;
    background: #383838;
    border-bottom: 1px solid #484848;
}

.modal-title {
    font-size: 24px;
    font-weight: 300;
    line-height: 1.3;
}

.modal-subtitle {
    color: #b5b5b5;
    font-size: 12px;
    margin: 6px 0 0;
}

.modal-header > .icon-button {
    margin-left: 15px;
    align-self: flex-start;
    background: transparent;
    border-color: transparent;
}

.modal-header > .icon-button:hover {
    background: #505050;
    border-color: #737373;
}

.modal-body {
    padding: 22px 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    background: #292929;
    border-top: 1px solid #484848;
}

.modal-footer > * {
    margin: 0;
}

/* The editor's form must shrink inside the scrollable dialog. Otherwise its
   full permission list is clipped by .modal-content and hides the footer. */
#user-editor-modal {
    --tblr-modal-margin: 14px;
}

#user-editor-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#user-editor-form > .modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

#user-editor-form > .modal-footer {
    flex-shrink: 0;
}

.modal-backdrop {
    background: #000;
}

.modal-backdrop.show {
    opacity: .65;
}

.delete-object {
    font-size: 15px;
    color: #ededed;
    word-break: break-word;
}

.panel-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 15px;
    font-size: 13px;
    border-radius: 2px;
}

.panel-alert .icon {
    width: 17px;
    height: 17px;
    margin-top: 1px;
}

.alert-success {
    background: #303a33;
    border-color: #55675b;
    color: #d0ded4;
}

.alert-danger {
    background: #443635;
    border-color: #755a56;
    color: #edd2cd;
}

.standalone-form {
    max-width: 680px;
}

.standalone-form-body {
    padding: 24px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 24px;
    background: #383838;
    border-bottom: 1px solid #484848;
}

.panel-heading h2 {
    font-size: 16px;
    font-weight: 400;
    margin: 0;
}

.error-state {
    max-width: 640px;
    margin: auto;
    padding: 60px 20px;
    text-align: center;
}

.error-code {
    font-size: 60px;
    line-height: 1;
    color: #bbb;
    font-weight: 400;
}

.error-state h1 {
    font-size: 24px;
}

.error-state > p:not(.error-code) {
    color: #aaa;
    margin: 20px 0 26px;
}

/* Вход использует ту же спокойную серую гамму. */
.guest-content {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 30px 20px;
    background: #212121;
}

.login-layout {
    width: 100%;
    max-width: 420px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    font-size: 21px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    color: #bbb;
}

.brand-mark .icon {
    width: 25px;
    height: 25px;
}

.brand small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 9px;
    letter-spacing: 1px;
}

.login-card {
    padding: 32px;
    background: #2d3032;
    border: 1px solid #484848;
    border-radius: 3px;
    box-shadow: 0 8px 30px #0003;
}

.login-symbol {
    display: inline-flex;
    color: #bcbcbc;
    margin-bottom: 20px;
}

.login-symbol .icon {
    width: 27px;
    height: 27px;
}

.login-card h1 {
    font-size: 25px;
    color: #d6d6d6;
    margin-bottom: 25px;
}

.login-description {
    margin: 10px 0 27px;
    color: #aaa;
    font-size: 13px;
}

.eyebrow {
    display: none;
}

.login-form {
    display: grid;
    gap: 20px;
}

.login-form .form-control {
    height: 42px;
    padding: 10px 12px;
}

.login-form .form-label {
    margin-bottom: 8px;
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 42px;
    margin-top: 3px;
    font-size: 14px;
}

.login-footnote {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 27px;
    padding-top: 22px;
    border-top: 1px solid #484848;
    color: #aaa;
    font-size: 11px;
}

.login-footnote .icon {
    width: 14px;
    height: 14px;
}

.login-copyright {
    text-align: center;
    margin: 22px 0 0;
    color: #999;
    font-size: 11px;
}

.setup-message {
    display: flex;
    gap: 10px;
    padding: 14px;
    border: 1px solid #595959;
    background: #35393a;
    border-radius: 2px;
    color: #c7c7c7;
    font-size: 13px;
}

.setup-message > .icon {
    width: 17px;
    height: 17px;
    margin-top: 2px;
}

.setup-message strong {
    color: #dedede;
    font-size: 13px;
    font-weight: 500;
}

.setup-message p {
    font-size: 12px;
    margin: 7px 0 10px;
}

.setup-message code {
    display: block;
    padding: 8px;
    background: #25292b;
    border: 1px solid #565656;
    color: #d8d8d8;
    font-size: 11px;
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .topbar {
        gap: 17px;
    }
    .nav-item {
        padding-left: 12px;
        padding-right: 12px;
    }
    .top-nav {
        gap: 0;
    }
    .search-field {
        width: 280px;
    }
    .search-controls > .form-control {
        width: 280px;
    }
    .heading-actions > .btn {
        width: 230px;
    }
    .action-toolbar {
        gap: 18px;
    }
}

@media (max-width: 980px) {
    .topbar {
        flex-wrap: wrap;
        padding: 0 17px;
        gap: 0 16px;
    }
    .topbar > .brand {
        min-height: 50px;
        display: flex;
        align-items: center;
        font-size: 18px;
    }
    .admin-area {
        margin-left: auto;
        font-size: 12px;
        order: 1;
    }
    .admin-name {
        max-width: 110px;
    }
    .top-nav {
        order: 2;
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }
    .nav-item {
        min-height: 44px;
    }
}

@media (max-width: 760px) {
    .main-content {
        padding: 42px 17px 28px;
    }
    .page-heading {
        margin-bottom: 27px;
        gap: 18px;
        flex-wrap: wrap;
    }
    h1 {
        font-size: 23px;
    }
    .action-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 17px;
        margin-bottom: 22px;
    }
    .heading-actions > .btn {
        width: 100%;
    }
    .search-controls {
        width: 100%;
        gap: 8px;
        flex-wrap: wrap;
    }
    .search-controls > .form-control {
        flex: 1;
        width: auto;
    }
    .search-field {
        width: auto;
        flex: 1;
    }
    .table-footer {
        padding: 12px 14px;
        font-size: 11px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .table-footer .icon {
        display: none;
    }
    .context-hint {
        font-size: 11px;
        align-items: flex-start;
    }
    .empty-state {
        min-height: 245px;
        padding: 30px 18px;
    }
    .modal-dialog {
        margin: 14px;
        max-width: calc(100% - 28px);
    }
    .modal-header, .modal-body {
        padding: 20px;
    }
    .modal-footer {
        padding: 15px 20px;
    }
    .modal-subtitle {
        max-width: 310px;
    }
    .form-grid {
        gap: 17px 12px;
    }
    .form-check-label {
        font-size: 10px;
    }
    .standalone-form-body {
        padding: 20px;
    }
    .login-card {
        padding: 27px;
    }
    .guest-content {
        padding: 25px 18px;
    }
}

@media (max-width: 420px) {
    .topbar > .brand {
        font-size: 16px;
    }
    .admin-name {
        max-width: 90px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-grid .full-width {
        grid-column: auto;
    }
    .modal-title {
        font-size: 21px;
    }
    .modal-footer .btn {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .trade-link-button[aria-busy="true"] .icon {
        animation: none !important;
    }
}

/* Контекстное меню аккаунта находится вне прокручиваемой таблицы. */
.account-context-menu {
    position: fixed;
    z-index: 1030;
    width: 274px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    background: #2d3436;
    border: 1px solid #484848;
    border-radius: 3px;
    box-shadow: 0 5px 16px #0005;
}

.account-context-menu[hidden] {
    display: none !important;
}

/* Каждый уровень привязан к viewport, поэтому прокрутка родителя не обрезает
   подменю. JS разворачивает его влево, если справа не хватает места. */
.account-context-submenu {
    width: 294px;
    z-index: 1031;
}

.account-context-submenu .account-context-submenu {
    z-index: 1032;
}

.account-context-arrow {
    width: 6px;
    height: 6px;
    margin-left: auto;
    flex-shrink: 0;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
    transform: rotate(45deg);
}

.account-context-item[aria-expanded="true"] {
    background: #3d484b;
}

.account-context-back {
    border-bottom: 1px solid #484848;
    border-radius: 0;
    margin-bottom: 4px;
}

.account-context-back[hidden] {
    display: none !important;
}

.account-context-divider {
    height: 1px;
    margin: 4px 6px;
    background: #484848;
}

.account-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 34px;
    padding: 8px 10px;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.account-context-item .icon {
    width: 16px;
    height: 16px;
}

.account-context-item:hover:not(:disabled):not([aria-disabled="true"]), .account-context-item:focus-visible:not(:disabled):not([aria-disabled="true"]) {
    background: #3d484b;
    color: #fff;
}

.account-context-item:focus-visible {
    outline: 1px solid #aaa;
    outline-offset: -1px;
}

.account-context-item:disabled, .account-context-item[aria-disabled="true"] {
    color: #858b8e;
    cursor: default;
}

.account-table > tbody > tr.account-context-target > td {
    background: #374144;
}

/* Инвентарь выбранного аккаунта. Остальные таблицы и формы используют свои стили. */
.account-table-scroll {
    max-height: 420px;
}

.account-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.account-table [data-steam-account] {
    cursor: pointer;
}

.account-table > tbody > tr.inventory-selected > td {
    background: #3d484b;
}

.account-table > tbody > tr.inventory-selected > td:first-child {
    box-shadow: inset 3px 0 #a8b2b4;
}

.inventory-account-button {
    display: inline;
    padding: 0;
    color: inherit;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.inventory-account-button:hover, .inventory-account-button[aria-pressed="true"] {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.account-inventory {
    margin-top: 36px;
    scroll-margin-top: 22px;
}

.inventory-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.inventory-heading-name {
    display: flex;
    align-items: baseline;
    gap: 15px;
    flex-wrap: wrap;
}

.inventory-heading h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 300;
    line-height: 1.2;
    color: #888;
}

#inventory-account-name {
    color: #dedede;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.inventory-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 13px;
}

#inventory-game {
    width: 185px;
    font-size: 13px;
}

#inventory-refresh {
    width: 33px;
    height: 33px;
}

#inventory-refresh:disabled {
    opacity: .5;
    cursor: default;
}

/* Индикатор занятого запроса продолжает вращаться даже при reduced-motion.
   Это только отображение состояния; частотой запросов управляет inventory.js. */
#inventory-refresh[aria-busy="true"] .icon {
    animation: steam-loading 2s linear infinite !important;
}

.inventory-image-switch {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    color: #c0c0c0;
    font-size: 12px;
    cursor: pointer;
}

#inventory-images {
    appearance: none;
    position: relative;
    width: 32px;
    height: 18px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    background: #303638;
    border: 1px solid #727a7c;
    border-radius: 10px;
    cursor: pointer;
}

#inventory-images::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #a7adaf;
    transition: transform .12s ease;
}

#inventory-images:checked {
    background: #4a5558;
    border-color: #929b9e;
}

#inventory-images:checked::before {
    transform: translateX(14px);
    background: #d1d6d8;
}

#inventory-images:disabled {
    opacity: .45;
    cursor: default;
}

.inventory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

#inventory-search {
    width: 355px;
    max-width: 100%;
}

.inventory-progress {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    font-size: 12px;
    color: #c2c2c2;
}

#inventory-updated {
    color: #aaa;
}

.inventory-error {
    padding: 11px 14px;
    margin-bottom: 15px;
    background: #443635;
    border: 1px solid #755a56;
    color: #e7c4bf;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.inventory-warning {
    padding: 0 0 12px;
    color: #c8bca4;
    font-size: 12px;
}

.inventory-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: 25px;
    color: #aaa;
    font-size: 14px;
    text-align: center;
}

.account-inventory [hidden] {
    display: none !important;
}

.inventory-table > tbody > tr > td {
    height: 43px;
}

.inventory-panel #inventory-table-wrap {
    max-height: 430px;
}

.inventory-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.inventory-table > thead > tr > th {
    padding-top: 12px;
    padding-bottom: 12px;
}

.inventory-table .inventory-name-cell {
    min-width: 200px;
    max-width: 450px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.inventory-table .inventory-type-cell {
    max-width: 280px;
    white-space: normal;
    color: #bcbcbc;
    font-size: 12px;
}

.inventory-table .inventory-image-cell {
    width: 65px;
    padding: 5px 12px;
    text-align: center;
}

.inventory-item-image {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin: auto;
}

.inventory-image-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #949b9d;
    font-size: 13px;
}

.inventory-images-off .inventory-image-cell {
    display: none;
}

.inventory-table .inventory-amount-cell {
    width: 110px;
    text-align: center;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.inventory-table .inventory-flag-cell {
    width: 95px;
    text-align: center;
    font-size: 12px;
}

.inventory-table .inventory-restriction-cell {
    max-width: 290px;
    white-space: normal;
    color: #c5c5c5;
    font-size: 12px;
}

.inventory-footer {
    min-height: 51px;
}

.inventory-pagination {
    display: flex;
    align-items: center;
    gap: 7px;
}

#inventory-page-info {
    margin-right: 8px;
    color: #b5b5b5;
    font-size: 12px;
    white-space: nowrap;
}

.inventory-pagination .icon-button {
    height: 27px;
    width: 27px;
    font-size: 20px;
    line-height: 1;
}

.inventory-pagination .icon-button:disabled {
    opacity: .4;
    cursor: default;
}

@media (max-width: 980px) {
    .inventory-heading {
        align-items: flex-start;
    }
    .inventory-heading-name {
        flex-direction: column;
        gap: 7px;
    }
    .inventory-progress {
        flex-wrap: wrap;
        gap: 4px 12px;
    }
}

@media (max-width: 760px) {
    .account-inventory {
        margin-top: 29px;
    }
    .inventory-heading {
        flex-direction: column;
        gap: 18px;
    }
    .inventory-heading h2 {
        font-size: 22px;
    }
    .inventory-heading-name {
        flex-direction: row;
        gap: 10px;
    }
    .inventory-controls {
        justify-content: flex-start;
        width: 100%;
        gap: 11px;
    }
    #inventory-game {
        flex: 1;
        max-width: 210px;
        min-width: 0;
    }
    .inventory-image-switch {
        font-size: 11px;
    }
    .inventory-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
    }
    #inventory-search {
        width: 100%;
    }
    .inventory-progress {
        justify-content: flex-start;
        font-size: 11px;
    }
    .inventory-footer {
        align-items: flex-start;
        gap: 10px;
    }
    .inventory-pagination {
        margin-left: auto;
    }
    #inventory-summary, #inventory-page-info {
        font-size: 11px;
    }
}

/* Сортировка использует ту же цену за штуку, что серверная оценка инвентаря. */
.inventory-toolbar {
    flex-wrap: wrap;
}

#inventory-sort {
    width: auto;
    max-width: 100%;
    flex: 0 0 auto;
}

.inventory-progress {
    margin-left: auto;
}

@media (max-width: 760px) {
    #inventory-sort {
        align-self: flex-start;
    }
    .inventory-progress {
        margin-left: 0;
    }
}

/* Добавление и проверка прокси. */
#proxy-add-modal .modal-header > .icon-button {
    margin-left: auto;
}

.proxy-add-tabs {
    display: flex;
    gap: 24px;
    padding: 0 24px;
    border-bottom: 1px solid #484848;
    background: #2e3133;
}

.proxy-add-tab {
    padding: 15px 0 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
}

.proxy-add-tab.active {
    color: #eee;
    border-bottom-color: #c7c7c7;
}

.proxy-add-tab:hover {
    color: #eee;
}

.proxy-add-tab:disabled {
    opacity: .6;
    cursor: wait;
}

.proxy-bulk-text {
    min-height: 165px;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 12px;
    line-height: 1.8;
}

.proxy-bulk-feedback {
    margin-top: 14px;
    font-size: 12px;
    color: #b8cbbb;
}

.proxy-bulk-feedback.is-error {
    color: #e3b8b3;
}

.proxy-bulk-feedback p {
    margin: 0;
}

.proxy-bulk-feedback ul {
    max-height: 150px;
    overflow: auto;
    margin: 7px 0 0;
    padding-left: 20px;
}

.proxy-bulk-feedback li {
    margin: 3px 0;
    overflow-wrap: anywhere;
}

.proxy-notice {
    margin: -12px 0 16px;
    font-size: 12px;
    color: #b8cbbb;
}

.proxy-notice.is-error {
    color: #e3b8b3;
}

.proxy-bulk-feedback[hidden], .proxy-bulk-feedback ul[hidden], .proxy-notice[hidden] {
    display: none;
}

.proxy-table .actions-column {
    width: 124px;
}

.proxy-address-and-result {
    display: flex;
    align-items: center;
    gap: 15px;
}

.proxy-check-result {
    display: inline-block;
    width: 165px;
    max-width: 165px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #aaa;
    font-size: 11px;
}

.proxy-check-result.is-success {
    color: #b5d5bc;
}

.proxy-check-result.is-error {
    color: #e1b5b1;
}

.proxy-check-button.is-success {
    color: #b5d5bc;
    border-color: #6d8973;
}

.proxy-check-button.is-error {
    color: #e1b5b1;
    border-color: #896663;
}

.proxy-check-button:disabled {
    opacity: .55;
    cursor: wait;
}

@media (max-width: 760px) {
    .proxy-add-tabs {
        padding: 0 20px;
        gap: 20px;
    }
    .proxy-add-tab {
        font-size: 12px;
    }
}

/* Открытие страницы инвентаря Steam. */
.inventory-launch-account {
    margin: 0 0 14px;
    color: #dedede;
    overflow-wrap: anywhere;
}

.inventory-launch-status {
    margin: 0;
    color: #aaa;
}

.inventory-launch .inventory-error {
    margin: 16px 0 0;
}

.inventory-launch .btn {
    margin-top: 18px;
}

.inventory-launch [hidden] {
    display: none !important;
}

/* Разделители на всю ширину; компактные поля слева оставляют место для новых настроек. */
.settings-page {
    width: 100%;
}

.settings-section + .settings-section {
    margin-top: 44px;
}

.settings-section-heading {
    display: flex;
    align-items: center;
    gap: 36px;
    margin-bottom: 28px;
}

.settings-section-heading h1, .settings-section-heading h2 {
    flex: 0 1 360px;
    margin: 0;
    color: #888;
    font-size: 24px;
    font-weight: 300;
    line-height: 1.3;
}

.settings-section-heading::after {
    content: '';
    flex: 1 1 80px;
    min-width: 32px;
    height: 1px;
    background: #626262;
}

.settings-grid {
    display: grid;
    width: 100%;
    max-width: 960px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
    row-gap: 24px;
}

.settings-field, .settings-note {
    min-width: 0;
}

.settings-form {
    width: 100%;
}

.settings-form .settings-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 80px;
    align-items: start;
    gap: 20px;
    margin-bottom: 16px;
}

.settings-form .settings-description {
    min-width: 0;
}

.settings-form .settings-label {
    display: block;
    margin: 5px 0 0;
    color: #aaa;
    font-size: 14px;
    line-height: 1.5;
}

.settings-form .settings-warning {
    margin: 8px 0 0;
    color: #ff5555;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.settings-form .settings-number {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 5px 6px;
    border: 0;
    border-bottom: 1px solid #888;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #e5e5e5;
    font-size: 14px;
    text-align: center;
}

.settings-form .settings-number:focus {
    border-bottom-color: #ddd;
    background: transparent;
    box-shadow: none;
}

.settings-form .settings-number[aria-invalid="true"] {
    border-bottom-color: #f08080;
}

.settings-page .settings-help {
    margin: 10px 0 0;
    color: #999;
    font-size: 12px;
    line-height: 1.6;
}

.settings-session-reset {
    min-width: 0;
}

.settings-switch {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #aaa;
    font-size: 14px;
    line-height: 1.6;
    cursor: pointer;
}

.settings-switch input {
    appearance: none;
    flex: 0 0 34px;
    width: 34px;
    height: 18px;
    margin: 3px 0 0;
    border: 1px solid #6b7374;
    border-radius: 10px;
    background: #42494b;
    cursor: pointer;
}

.settings-switch input::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    margin: 2px;
    border-radius: 50%;
    background: #b6bcbd;
}

.settings-switch input:checked {
    background: #3e654a;
    border-color: #8cb397;
}

.settings-switch input:checked::before {
    transform: translateX(16px);
    background: #d1e6d5;
}

.settings-switch input:focus-visible {
    outline: 2px solid #d3d3d3;
    outline-offset: 3px;
}

.settings-session-reset .settings-help {
    margin: 16px 0 0 44px;
}

.settings-page .form-label {
    color: #aaa;
    font-weight: 400;
}

.settings-page .form-control {
    border: 0;
    border-bottom: 1px solid #6b6b6b;
    border-radius: 0;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
    box-shadow: none;
}

.settings-page .form-control:focus {
    border-bottom-color: #dedede;
    box-shadow: 0 1px 0 #dedede;
}

.settings-page .form-control::placeholder {
    color: #777;
}

.settings-page .settings-number {
    padding-left: 6px;
    padding-right: 6px;
}

.settings-note {
    display: flex;
    align-items: center;
}

.settings-page .settings-note .settings-help {
    margin: 0;
}

.settings-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 24px;
}

.settings-actions .btn {
    width: auto;
    min-width: 220px;
    max-width: 100%;
    padding-left: 22px;
    padding-right: 22px;
    white-space: normal;
}

.telegram-clear-token {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
    font-size: 12px;
    color: #aaa;
}

.telegram-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    color: #bbb;
}

.telegram-events {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 32px;
    max-width: 960px;
    margin-top: 8px;
}

.telegram-test-form {
    margin-top: 12px;
}

.telegram-history {
    margin-top: 26px;
    max-width: 1160px;
}

.telegram-history h3 {
    color: #aaa;
    font-size: 16px;
    font-weight: 400;
}

.telegram-history .btn {
    min-height: 29px;
    padding: 3px 10px;
    font-size: 12px;
}

.telegram-delivery-error {
    max-width: 350px;
    white-space: normal;
}

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

@media (max-width: 900px) {
    .settings-grid {
        max-width: 460px;
        grid-template-columns: minmax(0, 1fr);
    }
    .settings-section-heading {
        gap: 24px;
        margin-bottom: 26px;
    }
    .settings-section-heading h1, .settings-section-heading h2 {
        flex-basis: auto;
    }
    .settings-section + .settings-section {
        margin-top: 40px;
    }
}

@media (max-width: 480px) {
    .settings-form .settings-row {
        grid-template-columns: minmax(0, 1fr) 64px;
        gap: 16px;
    }
    .settings-form .settings-label {
        font-size: 12px;
    }
    .settings-section-heading {
        gap: 16px;
    }
    .settings-section-heading h1, .settings-section-heading h2 {
        font-size: 21px;
    }
    .settings-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

/* Стоимость аккаунтов, цены инвентаря и ключи площадок. */
.account-table .account-price-column {
    min-width: 145px;
    text-align: center;
}

.account-table .account-price-cell {
    min-width: 145px;
    padding-top: 5px;
    padding-bottom: 5px;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.account-price-value {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #dedede;
    font: inherit;
    font-size: 12px;
    line-height: 18px;
    cursor: help;
}

.account-price-value:focus-visible {
    outline: 1px solid #aaa;
    outline-offset: 3px;
}

.account-price-amount {
    color: #dedede;
}

.account-price-date {
    display: block;
    color: #dedede;
    font-size: 12px;
    line-height: 16px;
}

.account-price-date[hidden], .account-price-tooltip[hidden] {
    display: none;
}

.account-price-tooltip {
    position: fixed;
    z-index: 1040;
    width: max-content;
    min-width: 132px;
    max-width: min(250px, calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    overflow: auto;
    padding: 10px;
    background: #20292e;
    color: #f0f0f0;
    box-shadow: 0 3px 10px #0004;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    line-height: 19px;
    font-variant-numeric: tabular-nums;
    text-align: left;
}

.account-price-tooltip-game {
    white-space: nowrap;
}

.inventory-valuation.pricing-incomplete {
    color: #c8bca4;
}

.inventory-table .inventory-price-cell {
    min-width: 93px;
    text-align: right;
    white-space: nowrap;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.inventory-table td.inventory-price-cell {
    cursor: help;
}

.inventory-table .pricing-stale {
    color: #c8bca4;
}

.inventory-footer {
    flex-wrap: wrap;
}

.inventory-valuation {
    color: #dedede;
    font-variant-numeric: tabular-nums;
    cursor: help;
}

.steam-session-buttons {
    display: flex;
    justify-content: center;
    gap: 7px;
}

#steam-cookies-modal [hidden] {
    display: none !important;
}

#steam-cookies-modal .modal-header {
    justify-content: space-between;
    gap: 16px;
}

#steam-cookies-value {
    min-height: 150px;
    font-family: monospace;
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#steam-cookies-status:empty {
    display: none;
}

.pricing-settings-help {
    margin: 0 0 17px;
    color: #aaa;
    font-size: 12px;
    line-height: 1.6;
}

.pricing-source-status {
    display: grid;
    width: 100%;
    max-width: 960px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px 24px;
    margin: 8px 0 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #484848;
    color: #dedede;
    font-size: 13px;
}

.pricing-source-status small {
    display: block;
    margin-top: 4px;
    color: #aaa;
    font-size: 10px;
}

.pricing-settings-form {
    width: 100%;
    max-width: 960px;
}

.pricing-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 32px;
    margin-bottom: 20px;
}

.pricing-key-group {
    min-width: 0;
}

.pricing-dmarket-group {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 32px;
}

.pricing-dmarket-group > .pricing-clear-key {
    grid-column: 1 / -1;
}

.pricing-clear-key {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 11px;
    color: #aaa;
    font-size: 12px;
}

@media (max-width: 1000px) {
    .pricing-settings-form, .pricing-source-status {
        max-width: 640px;
    }
    .pricing-fields-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .pricing-dmarket-group {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .pricing-source-status {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .pricing-dmarket-group {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }
    .pricing-dmarket-group > .pricing-clear-key {
        margin-top: -13px;
    }
}

/* Профиль Steam: отдельные настройки приватности и подтверждение очистки. */
#steam-profile-modal [hidden] {
    display: none !important;
}

#steam-profile-modal .profile-tabs {
    display: flex;
    gap: 24px;
    padding: 0 24px;
    border-bottom: 1px solid #484848;
    background: #2e3133;
}

#steam-profile-modal .profile-tab {
    padding: 15px 0 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
}

#steam-profile-modal .profile-tab.active {
    color: #eee;
    border-bottom-color: #c7c7c7;
}

#steam-profile-modal .profile-tab:hover {
    color: #eee;
}

#steam-profile-modal .profile-tab:disabled {
    opacity: .6;
    cursor: wait;
}

#steam-profile-modal .profile-clear {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #484848;
}

#steam-profile-modal .profile-clear-review {
    color: #ded0cb;
    font-size: 13px;
    line-height: 1.6;
}

#steam-profile-modal .profile-clear-review p {
    margin: 0 0 12px;
}

#steam-profile-modal .profile-clear-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

#steam-profile-modal .profile-privacy-fields {
    display: grid;
    gap: 18px;
}

#steam-profile-modal .profile-privacy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    align-items: center;
    gap: 16px;
}

#steam-profile-modal .profile-privacy-row .form-label {
    margin: 0;
}

#steam-profile-modal .profile-privacy-row .form-select {
    min-width: 0;
    width: 100%;
}

#steam-profile-modal .profile-privacy-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -7px 0 2px;
    color: #bdbdbd;
    font-size: 12px;
    line-height: 1.5;
}

#steam-profile-modal .profile-privacy-check .steam-auto-toggle {
    flex-shrink: 0;
}

#steam-profile-modal .profile-privacy-limit {
    margin: -5px 0 0;
}

#steam-profile-modal .modal-footer .btn {
    white-space: normal;
}

@media (max-width: 760px) {
    #steam-profile-modal .profile-tabs {
        padding: 0 20px;
    }
}

@media (max-width: 420px) {
    #steam-profile-modal .profile-privacy-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }
}
/* История и подтверждения: компактные карточки, предметы до отправки действия. */
.trade-state-ribbon { padding: 8px 12px; border-left: 4px solid #d9af4c; background: rgba(217,175,76,.08); }
.trade-state-ribbon[data-state="3"] { border-color: #72ad76; background: rgba(114,173,118,.12); color: #a4d6a7; }
.trade-dialog-toolbar, .trade-dialog-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.trade-dialog-toolbar { justify-content: space-between; margin-bottom: 16px; }
.trade-dialog-toolbar p { margin: 0; }
.trade-dialog-list { display: grid; gap: 12px; max-height: 60vh; overflow: auto; }
.trade-card, .trade-review { padding: 16px; border: 1px solid #4a4f50; background: #292e30; }
.trade-card h3 { font-size: 15px; margin: 0 0 8px; }
.trade-items-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 10px 0; }
.trade-items { display: grid; align-content: start; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.trade-items ul { margin: 0; padding-left: 18px; }
.trade-review { margin-bottom: 16px; border-color: #83999e; }
@media (max-width: 600px) { .trade-items-columns { grid-template-columns: 1fr; gap: 10px; } }

/* Массовый импорт: короткая форма и прокручиваемый отчёт без секретных полей. */
#account-add-modal [hidden] { display: none !important; }
#account-add-modal.is-bulk .modal-dialog { max-width: 920px; }
#account-add-modal .account-add-tabs {
    display: flex;
    padding: 0 24px;
    gap: 28px;
    border-bottom: 1px solid #484848;
    background: #353737;
}
#account-add-modal .account-add-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
}
#account-add-modal .account-add-tab.active { color: #eee; border-bottom-color: #c7c7c7; }
#account-add-modal .account-add-tab:hover { color: #eee; }
#account-add-modal .account-add-tab:disabled { opacity: .6; cursor: wait; }
#account-add-modal .account-add-tab .icon { width: 16px; height: 16px; }
#account-add-modal .account-import-body { display: grid; gap: 18px; }
#account-add-modal .account-import-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
#account-add-modal .account-import-label .form-label,
#account-add-modal .account-import-label .form-hint { margin: 0; }
#account-add-modal .account-import-textarea { min-height: 94px; resize: vertical; font-family: inherit; }
#account-add-modal .account-import-options { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
#account-add-modal .account-import-body .form-hint { margin-bottom: 0; }
#account-add-modal .account-import-body code { color: inherit; font-size: inherit; overflow-wrap: anywhere; }
#account-add-modal .account-import-status { color: #ddd; }
#account-add-modal .account-import-results { max-height: 230px; border: 1px solid #484848; }
#account-add-modal .account-import-results .table { margin: 0; }
#account-add-modal .account-import-results th,
#account-add-modal .account-import-results td { padding: 10px 12px; }
#account-add-modal .account-import-results th { position: sticky; top: 0; background: #222; z-index: 1; }
#account-add-modal .account-import-results td { overflow-wrap: anywhere; }
#account-add-modal .account-import-row-error { color: #edb2ac; }
#account-add-modal .account-import-actions { flex-wrap: wrap; }
#account-add-modal .account-import-actions .btn { white-space: normal; }
@media (max-width: 640px) {
    #account-add-modal .account-add-tabs { gap: 22px; padding: 0 20px; }
    #account-add-modal .account-import-options { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    #account-add-modal .account-import-results th,
    #account-add-modal .account-import-results td { min-width: 80px; }
}

/* Срок прокси: компактное поле рядом со списком, без растягивания формы. */
.proxy-lifetime-field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}
.proxy-lifetime-field .form-label,
.proxy-lifetime-field .form-hint { margin: 0; }
.proxy-lifetime-field .form-control { width: 110px; flex: 0 0 110px; }
.proxy-bulk-lifetime-field { margin-top: 18px; }
.proxy-table .proxy-lifetime-cell { white-space: nowrap; }
.proxy-note-cell { min-width: 160px; max-width: 260px; }
.proxy-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.proxy-lifetime-status { display: block; margin-top: 3px; color: #aaa; font-size: 11px; }
.proxy-lifetime-status.is-expiring { color: #d6bd88; }
.proxy-lifetime-status.is-expired,
#proxy-lifetime-modal .proxy-lifetime-error { color: #edb2ac; }
#proxy-lifetime-modal [hidden] { display: none !important; }
#steam-password-modal [hidden] { display: none !important; }
#steam-password-modal .modal-footer { flex-wrap: wrap; }
#steam-password-modal .modal-footer .btn { white-space: normal; }
#proxy-lifetime-modal .proxy-lifetime-address { margin: 0 0 8px; overflow-wrap: anywhere; }
#proxy-lifetime-modal #proxy-lifetime-current { margin: 0 0 18px; }
#proxy-lifetime-modal #proxy-lifetime-days { width: 110px; }
#proxy-lifetime-modal #proxy-lifetime-hint { margin: 10px 0 0; line-height: 1.5; }
#proxy-lifetime-modal .proxy-lifetime-error { margin: 12px 0 0; }
#account-add-modal .account-import-proxy-label { justify-content: flex-start; flex-wrap: wrap; }
#account-add-modal .account-import-proxy-label .proxy-lifetime-field { margin-left: auto; }
@media (max-width: 560px) {
    #account-add-modal .account-import-proxy-label .proxy-lifetime-field { flex-basis: 100%; margin-left: 0; }
}

.account-steam-avatar { overflow: hidden; }
.account-steam-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.account-steam-avatar [hidden] { display: none !important; }
.account-nickname-column { min-width: 130px; }
.account-nickname-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
