:root {
    --color-bg: #f5f5f7;
    --color-surface: #ffffff;
    --color-text: #1c1c1e;
    --color-muted: #6b6b70;
    --color-primary: #2f5d8a;
    --color-primary-hover: #244768;
    --color-border: #dcdce0;
    --color-success: #1e7e34;
    --color-error: #b3261e;
    --radius: 8px;

    /* Цвета редкости — docs/equipment.v1.md, «Цветовая гамма редкости предмета» */
    --rarity-common: #3f8f4f;
    --rarity-rare: #2f5d8a;
    --rarity-epic: #6b4a9e;
    --rarity-legendary: #c2703d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
    text-decoration: none;
}

.button {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
}

.button:hover {
    background: var(--color-primary-hover);
}

.logout-form {
    margin: 0;
}

.greeting {
    color: var(--color-muted);
}

.content {
    max-width: 1320px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

@media (max-width: 600px) {
    .site-header {
        padding: 0.75rem 1rem;
    }

    .content {
        margin: 1rem auto;
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 1.45rem;
    }
}

.hero h1 {
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--color-muted);
}

.calculator-stub {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stub-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
}

.stub-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.soon {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.login-form {
    max-width: 360px;
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
}

.login-form form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-form label {
    font-size: 0.9rem;
    color: var(--color-muted);
}

.login-form input {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.login-form .hint {
    margin: -0.25rem 0 0.75rem;
}

.login-form .login-button {
    margin-top: 1rem;
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 6px rgba(47, 93, 138, 0.25);
    transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.login-form .login-button:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(47, 93, 138, 0.3);
    transform: translateY(-1px);
}

.login-form .login-button:disabled {
    background: var(--color-border);
    color: var(--color-muted);
    box-shadow: none;
    cursor: not-allowed;
}

.login-form .login-hint {
    margin: 0.5rem 0 0;
    text-align: center;
}

.flashes {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.flash-success {
    background: #e6f4ea;
    color: var(--color-success);
}

.flash-error {
    background: #fbe9e7;
    color: var(--color-error);
}

.site-version {
    margin-left: 0.5rem;
    padding: 0.05rem 0.45rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--color-muted);
}

.site-footer {
    text-align: center;
    color: var(--color-muted);
    padding: 2rem 1rem;
    font-size: 0.85rem;
}

/* Calculator */

.calculator {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.panel h2 {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
}

.panel-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.panel-heading-row h2 {
    margin: 0;
}

.hint {
    margin: 0.25rem 0 0.75rem;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.hint-small {
    margin: 0;
    font-size: 0.78rem;
}

.hint-list {
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.hint-details {
    margin-top: 0.4rem;
}

.hint-details summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: var(--color-muted);
    font-size: 0.85rem;
    list-style: none;
}

.hint-details summary::-webkit-details-marker {
    display: none;
}

.hint-details summary::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.hint-details[open] summary::before {
    transform: rotate(45deg);
}

.hint-details summary:hover {
    color: var(--color-text);
}

.hint-details .hint-list {
    margin-top: 0.5rem;
}

/* Toolbar: race + level */

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.race-select {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.race-btn {
    padding: 0.45rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    font-size: 0.9rem;
}

.race-btn:hover:not(.active) {
    border-color: var(--color-primary);
}

.race-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.level-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.level-row .points-badge-master {
    margin-left: -0.35rem;
}

.level-row label {
    font-size: 0.88rem;
    color: var(--color-muted);
}

.level-row input[type="number"] {
    width: 4.5rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.rank-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rank-row label {
    font-size: 0.88rem;
    color: var(--color-muted);
}

.rank-row select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: #fff;
}

.rank-row .rank-effects {
    color: #7a5a10;
}

/* Панель «Класс»: тот же ряд «подпись — select — пояснение», что у звания. */
.class-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.class-row label {
    font-size: 0.88rem;
    color: var(--color-muted);
}

.class-row select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: #fff;
}

.class-row select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.totals-table .bonus-rank {
    display: inline-block;
    margin-left: 0.2rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #fff7e0;
    color: #7a5a10;
    font-size: 0.7rem;
    white-space: nowrap;
}

.modal-item .min-level {
    color: var(--color-primary);
}

.premium-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.88rem;
    color: var(--color-muted);
    cursor: pointer;
    user-select: none;
}

.premium-toggle:has(input:checked) {
    border-color: #c99a2e;
    background: #fff7e0;
    color: #7a5a10;
}

.premium-toggle input {
    margin: 0;
}

.points-badge {
    font-size: 0.85rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    white-space: nowrap;
}

.points-badge.depleted {
    color: var(--color-error);
    border-color: var(--color-error);
}

.points-badge-master {
    background: #f2ecfb;
    border-color: #cdb8f0;
    color: #5b3a9e;
}

.points-badge-master.depleted {
    background: var(--color-bg);
    color: var(--color-error);
    border-color: var(--color-error);
}

/* Main fold: portrait + characteristics + totals side by side */

/*
 * Основная сетка (docs/portrait-ui.v1.md §7):
 *   ≥ 1200px — три колонки: портрет | характеристики | итоги, одной высоты;
 *   800–1199px — две: портрет слева на два ряда, характеристики и итоги друг под другом;
 *   < 800px — одна колонка, портрет по центру не шире 440px.
 * minmax(0, 1fr) вместо 1fr — иначе колонка не может ужаться меньше своего min-content
 * и страница уезжает за край экрана.
 */
.main-grid {
    display: grid;
    /* Итогам нужно больше места: в колонке «Бонус» рядом с числом стоят метки клана и звания. */
    grid-template-columns: minmax(300px, 360px) minmax(240px, 0.9fr) minmax(380px, 1.4fr);
    gap: 1rem;
    align-items: stretch;
}

.main-grid > .panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.panel-characteristics .hint-details {
    margin-top: auto;
}

.panel-portrait {
    padding: 0.6rem;
}

@media (max-width: 1199px) {
    .main-grid {
        /* Портрет уже, чем на десктопе: правой колонке нужно место под таблицу итогов. */
        grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    }

    .panel-portrait {
        grid-row: 1 / span 2;
    }
}

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

    .panel-portrait {
        grid-row: auto;
        width: 100%;
        max-width: 440px;
        margin: 0 auto;
    }
}

/* Портрет-инвентарь: картинка + слой рамок слотов (docs/portrait-ui.v1.md) */

.portrait {
    --slot: 13%;
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    container-type: inline-size;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fafafc 0%, #f0f0f3 100%);
    border: 1px solid var(--color-border);
}

.portrait-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.portrait-slots {
    position: absolute;
    inset: 0;
}

.pslot {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--slot);
    aspect-ratio: 1;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10%;
    border: 1.5px dashed var(--color-border);
    background: rgba(43, 43, 46, 0.06);
    color: #b5b5ba;
    cursor: pointer;
    font: inherit;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    --rc: var(--color-muted);
}

/* Редкость: цвет рамки + заливка тем же цветом (--rc-soft) + уголок-метка; одного контура
   на 45-px рамке не хватало, чтобы отличить редкую вещь от обычной. */
.pslot.rarity-common { --rc: var(--rarity-common); --rc-soft: rgba(63, 143, 79, 0.16); --rc-glow: rgba(63, 143, 79, 0.2); }
.pslot.rarity-rare { --rc: var(--rarity-rare); --rc-soft: rgba(47, 93, 138, 0.18); --rc-glow: rgba(47, 93, 138, 0.25); }
.pslot.rarity-epic { --rc: var(--rarity-epic); --rc-soft: rgba(107, 74, 158, 0.2); --rc-glow: rgba(107, 74, 158, 0.3); }
.pslot.rarity-legendary { --rc: var(--rarity-legendary); --rc-soft: rgba(194, 112, 61, 0.24); --rc-glow: rgba(194, 112, 61, 0.4); }

.pslot.is-filled {
    background:
        linear-gradient(160deg, var(--rc-soft) 0%, rgba(255, 255, 255, 0) 70%),
        var(--color-surface);
    border: 2.5px solid var(--rc);
    color: var(--rc);
    box-shadow: 0 0 0 2px var(--rc-glow);
    overflow: visible;
}

/* Уголок-метка редкости в левом верхнем углу: заливка цветом редкости, видна и на растровой
   иконке, которая сама в цвет редкости не красится. */
.pslot.is-filled::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 30%;
    background: linear-gradient(135deg, var(--rc) 0%, var(--rc) 50%, transparent 50%);
    border-top-left-radius: inherit;
    pointer-events: none;
}

.pslot.is-filled.rarity-epic {
    box-shadow: 0 0 0 2px var(--rc-glow), 0 0 10px var(--rc-glow);
}

.pslot.is-filled.rarity-legendary {
    box-shadow: 0 0 0 3px var(--rc-glow), 0 0 14px var(--rc-glow);
}

.pslot.is-unavailable {
    color: #d3d3d8;
    cursor: default;
}

.pslot.is-blocked {
    cursor: not-allowed;
    color: #9a9aa0;
    border-style: solid;
    border-color: #c9c9ce;
    background: repeating-linear-gradient(45deg, rgba(43, 43, 46, 0.05) 0 6%, transparent 6% 12%);
}

.pslot:hover,
.pslot:focus-visible,
.pslot.is-hot {
    border-color: var(--color-primary);
    transform: scale(1.04);
    z-index: 2;
}

.pslot.is-unavailable:hover,
.pslot.is-blocked:hover {
    transform: none;
    border-color: var(--color-border);
}

.pslot:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.pslot-icon {
    width: 56%;
    height: 56%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pslot.is-filled .pslot-icon {
    width: 64%;
    height: 64%;
}

/* Растровые иконки: рисованные PNG крупнее контурных SVG; пустой слот — призрачная копия. */
.pslot-icon.is-raster {
    width: 76%;
    height: 76%;
    object-fit: contain;
    stroke: none;
    user-select: none;
}

.pslot.is-filled .pslot-icon.is-raster {
    width: 80%;
    height: 80%;
    /* Чуть выше центра — под иконкой лежат точки сокетов. */
    transform: translateY(-4%);
}

.pslot-icon.is-raster.is-ghost {
    filter: grayscale(1) brightness(1.35) opacity(0.45);
}

.worn-icon.is-raster {
    width: 1.35em;
    height: 1.35em;
    object-fit: contain;
}

.worn-icon.is-raster.is-ghost {
    filter: grayscale(1) opacity(0.5);
}

.pslot.is-blocked .pslot-icon {
    width: 40%;
    height: 40%;
}

/* Бейдж заточки — за правым верхним углом рамки. Цвет по уровню (docs/portrait-ui.v1.md §4). */
.pslot-badge {
    position: absolute;
    top: -8%;
    right: -8%;
    width: 32%;
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(8px, 1.9cqw, 11px);
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: #6b6b70;
    box-shadow: 0 0 0 2px var(--color-surface);
}

.enchant-low { background: #6b6b70; }
.enchant-mid { background: var(--color-primary); }
.enchant-high { background: var(--rarity-epic); }
.enchant-max { background: #c99a2e; }

.pslot-sockets {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6%;
    display: flex;
    justify-content: center;
    gap: 5%;
}

.pslot-socket {
    display: inline-block;
    width: 12%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1.5px solid #9a9aa0;
    background: transparent;
    box-sizing: border-box;
}

.pslot-socket.is-filled {
    border-color: var(--color-primary);
    background: var(--color-primary);
}

.pslot-tag {
    position: absolute;
    left: 4%;
    bottom: 4%;
    font-size: 1.6cqw;
    font-weight: 700;
    line-height: 1.3;
    padding: 0 0.3em;
    border-radius: 3px;
    background: var(--color-text);
    color: #fff;
}

/* Подпись — до двух строк под рамкой; шаг ряда (PORTRAIT.rowStep) оставляет под них место. */
.pslot-caption {
    position: absolute;
    top: 100%;
    left: -38%;
    right: -38%;
    margin-top: 5%;
    font-size: clamp(9px, 2.6cqw, 12px);
    line-height: 1.15;
    color: var(--color-muted);
    text-align: center;
    overflow: hidden;
    overflow-wrap: anywhere;
    hyphens: auto;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    pointer-events: none;
}

.pslot.is-filled .pslot-caption {
    font-weight: 600;
}

@container (max-width: 280px) {
    .pslot-caption { display: none; }
    .pslot-tag { display: none; }
}

/* Строка «Снято: … — Вернуть» внизу портрета */
.portrait-undo {
    position: absolute;
    left: 50%;
    bottom: 1.5%;
    transform: translateX(-50%);
    max-width: 94%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--color-text);
    color: #fff;
    font-size: 0.8rem;
    z-index: 3;
}

.portrait-undo[hidden] {
    display: none;
}

.portrait-undo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portrait-undo button {
    background: none;
    border: 0;
    padding: 0;
    color: #ffd27a;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    white-space: nowrap;
}

.panel-portrait .equipment-notice {
    margin-top: 0.6rem;
}

/* Кнопка «Заточить на +1» под портретом */
.portrait-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}

.portrait-actions .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Список «Надето» */
.worn-list {
    margin-top: 0.75rem;
}

.worn-list summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.25rem 0;
}

.worn-count {
    color: var(--color-muted);
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 0.25rem;
}

.worn-list ul {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
}

/* «Надетые вещи требуют: 20 lvl · ✊ Сила 25 …» — максимум по требованиям комплекта,
   под списком характеристик, над «Как считаются очки характеристик» */
.equip-requirements {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    margin: 0.6rem 0 0.5rem;
    padding: 0.45rem 0.6rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--color-muted);
    line-height: 1.5;
}

.equip-requirements .equip-req {
    display: inline-block;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-weight: 600;
    white-space: nowrap;
}

.equip-requirements .equip-req-none {
    font-style: italic;
}

.characteristic-info .worn-req-hint {
    color: var(--color-primary);
}

.worn-row {
    display: grid;
    grid-template-columns: 1.25em minmax(5.5rem, auto) 1fr;
    gap: 0.45rem;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 0.25rem 0.4rem;
    border: 0;
    border-radius: 4px;
    background: none;
    font: inherit;
    font-size: 0.84rem;
    color: var(--color-text);
    cursor: pointer;
}

.worn-row:hover,
.worn-row.is-hot,
.worn-row:focus-visible {
    background: var(--color-bg);
}

.worn-row:disabled {
    cursor: default;
}

.worn-icon {
    width: 1.15em;
    height: 1.15em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--color-muted);
}

.worn-slot {
    color: var(--color-muted);
    white-space: nowrap;
}

.worn-value {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.worn-value.muted {
    color: var(--color-muted);
}

.worn-row.is-blocked .worn-value {
    font-style: italic;
}

.worn-enchant {
    color: var(--color-muted);
    font-weight: 600;
}

.worn-sockets {
    display: inline-flex;
    gap: 2px;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ♎ — символ камня хаоса/гармонии (docs/chaos-stones.v1.md): тусклый — пустой сокет,
   акцентный — сокет с назначенным камнем. */
.worn-stone {
    font-size: 0.7rem;
    line-height: 1;
    color: var(--color-muted);
    opacity: 0.45;
}

.worn-stone.is-filled {
    color: var(--color-primary);
    opacity: 1;
}

/* Тултип слота */
.slot-tooltip {
    position: fixed;
    z-index: 60;
    max-width: 290px;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    background: var(--color-text);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.slot-tooltip .tip-title {
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.slot-tooltip .rarity-common { color: #7ed491; }
.slot-tooltip .rarity-rare { color: #8fbdf0; }
.slot-tooltip .rarity-epic { color: #c7a9f5; }
.slot-tooltip .rarity-legendary { color: #f5b07a; }

.tip-enchant {
    font-size: 0.72rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    color: #fff;
}

.slot-tooltip .tip-muted {
    color: #c9c9ce;
    font-size: 0.75rem;
}

.slot-tooltip .tip-bonuses {
    list-style: none;
    margin: 0.4rem 0;
    padding: 0.4rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.slot-tooltip .tip-bonuses .positive { color: #9be3a9; }
.slot-tooltip .tip-bonuses .negative { color: #f3a0a0; }

.slot-tooltip .tip-hint {
    margin-top: 0.35rem;
    color: #9a9aa0;
    font-size: 0.72rem;
}

/* Контекстное меню слота */
.slot-menu {
    position: fixed;
    z-index: 70;
    min-width: 210px;
    padding: 0.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.slot-menu > button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 0;
    border-radius: 4px;
    background: none;
    text-align: left;
    font: inherit;
    font-size: 0.88rem;
    color: var(--color-text);
    cursor: pointer;
}

.slot-menu > button:hover,
.slot-menu > button:focus-visible {
    background: var(--color-bg);
    outline: none;
}

.slot-menu > button:disabled {
    color: var(--color-muted);
    cursor: default;
    background: none;
}

.slot-menu .menu-hint {
    color: var(--color-muted);
    font-size: 0.75rem;
}

.slot-menu .menu-sep {
    border-top: 1px solid var(--color-border);
    margin: 0.25rem 0.4rem;
}

.menu-enchant {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.88rem;
}

.menu-enchant > span:first-child {
    flex: 1;
}

.menu-enchant button {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.menu-enchant button:hover:not(:disabled),
.menu-enchant button:focus-visible {
    border-color: var(--color-primary);
    outline: none;
}

.menu-enchant button:disabled {
    color: var(--color-border);
    cursor: default;
}

.menu-enchant-value {
    min-width: 2.2rem;
    text-align: center;
    font-weight: 700;
    color: #fff;
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
    font-size: 0.8rem;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Characteristics */

.characteristics-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.characteristic-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.45rem 0.6rem;
    background: var(--color-bg);
}

.characteristic-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.characteristic-controls {
    flex: 0 0 auto;
}

.characteristic-info .name {
    font-weight: 600;
    font-size: 0.88rem;
}

.characteristic-info .effects {
    font-size: 0.72rem;
    color: var(--color-muted);
}

.characteristic-row.characteristic-locked {
    opacity: 0.65;
}

.characteristic-info .lock-hint {
    color: var(--color-error);
}

.characteristic-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.characteristic-controls button {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
}

.characteristic-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.characteristic-controls .value {
    min-width: 1.4rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Totals */

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

.totals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.totals-table th,
.totals-table td {
    padding: 0.35rem 0.4rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    white-space: nowrap;
}

.totals-table th:not(:first-child),
.totals-table td:not(:first-child) {
    text-align: right;
}

@media (max-width: 480px) {
    .totals-table {
        font-size: 0.76rem;
    }

    .totals-table th,
    .totals-table td {
        padding: 0.3rem 0.25rem;
    }

    /* Название параметра («👁 Предвидение») может перенестись — колонка не задаёт ширину. */
    .totals-table td:first-child {
        white-space: normal;
    }
}

/* Заголовок «Заточка» шире своих значений; на узком телефоне — «Зат.». */
.totals-table .th-short {
    display: none;
    text-decoration: none;
}

@media (max-width: 400px) {
    .totals-table .th-long {
        display: none;
    }

    .totals-table .th-short {
        display: inline;
    }
}

.totals-table th {
    color: var(--color-muted);
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.totals-table td.total {
    font-weight: 700;
}

/* «Бонус»: число и метки клана/звания могут переноситься на вторую строку, но сами метки
   не рвутся — так колонка не растягивает таблицу и не включает горизонтальный скролл. */
.totals-table td.bonus {
    white-space: normal;
    line-height: 1.35;
}

.totals-table td.bonus.positive {
    color: var(--color-success);
}

.totals-table td.bonus.zero {
    color: var(--color-muted);
}

/* Potions: chips + modal trigger */

.button-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 0.4rem 0.9rem;
    font-size: 0.88rem;
}

.button-secondary:hover {
    background: #eaf2fb;
}

.potion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.potion-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.3rem 0.5rem 0.3rem 0.8rem;
    font-size: 0.82rem;
}

.potion-chip .remove-chip {
    border: none;
    background: none;
    color: var(--color-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.2rem;
}

.potion-chip .remove-chip:hover {
    color: var(--color-error);
}

.no-chips {
    color: var(--color-muted);
    font-size: 0.85rem;
}

/* Публичная страница: карточки предметов, изменяющих свойства */

.consumable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem;
    align-items: start;
}

.consumable-grid .no-chips {
    grid-column: 1 / -1;
}

.consumable-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.3rem;
}

.consumable-head .slot-label {
    margin-bottom: 0.2rem;
}

.consumable-card .remove-chip {
    border: none;
    background: none;
    color: var(--color-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.2rem;
}

.consumable-card .remove-chip:hover {
    color: var(--color-error);
}

.consumable-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.3rem;
}

.consumable-effects {
    list-style: none;
    margin: 0.2rem 0 0;
    padding: 0;
    font-size: 0.8rem;
}

.consumable-effects li {
    padding: 0.1rem 0;
}

.consumable-effects .positive {
    color: var(--color-success);
}

.consumable-effects .negative {
    color: var(--color-error);
}

.consumable-effects .muted {
    color: var(--color-muted);
}

.consumable-duration {
    margin-top: 0.35rem;
    font-size: 0.76rem;
    color: var(--color-muted);
}

.tag {
    display: inline-block;
    margin-left: 0.3rem;
    font-size: 0.65rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-muted);
    border: 1px solid var(--color-border);
    vertical-align: middle;
}

.consumable-tags .tag {
    margin-left: 0;
}

.modal-item-unavailable {
    opacity: 0.55;
    cursor: not-allowed;
}

.modal-item .unavailable-reason {
    color: var(--color-error);
}

.characteristic-info .item-bonus-hint {
    color: var(--color-primary);
}

.modal-hint {
    margin: 0 0 0.5rem;
}

/* Potion modal */

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 20, 0.45);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

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

.modal {
    background: var(--color-surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1rem;
}

.modal-close {
    border: none;
    background: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-search {
    display: block;
    margin: 0.75rem 1.1rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.modal-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.15rem 0.75rem 0.75rem;
    min-height: 120px;
}

.modal-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
}

.modal-item:hover {
    background: var(--color-bg);
}

.modal-item.selected {
    background: #eaf2fb;
    border-color: var(--color-primary);
}

.modal-item input {
    margin-top: 0.2rem;
}

.modal-item .name {
    font-weight: 600;
    font-size: 0.88rem;
}

.modal-item .effect {
    font-size: 0.76rem;
    color: var(--color-muted);
}

.modal-item .demo-tag {
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.65rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #fdf3d8;
    color: #8a6d1c;
}

.modal-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.88rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--color-border);
}

/* Карточка (базовый стиль; экипировка теперь на портрете, карточки — у расходников) */

.equipment-slot {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.55rem 0.65rem;
    background: var(--color-bg);
}

.equipment-slot .slot-label {
    display: block;
    font-size: 0.76rem;
    color: var(--color-muted);
    margin-bottom: 0.3rem;
}

/* Save / load */

.save-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.save-row input[type="text"] {
    flex: 1;
    min-width: 180px;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.save-status {
    min-height: 1.2em;
    font-size: 0.85rem;
    color: var(--color-success);
    margin: 0.25rem 0 0.75rem;
}

.save-status.error {
    color: var(--color-error);
}

.saved-builds {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.saved-builds li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    background: var(--color-bg);
}

.saved-builds .build-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.1rem;
}

.saved-builds .build-name {
    font-weight: 600;
}

.saved-builds .build-meta {
    font-size: 0.78rem;
    color: var(--color-muted);
}

.saved-builds .build-actions {
    display: flex;
    gap: 0.4rem;
}

.saved-builds .build-actions button {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: #fff;
    cursor: pointer;
}

.saved-builds .build-actions button.danger {
    color: var(--color-error);
    border-color: var(--color-error);
}

.no-builds {
    color: var(--color-muted);
    font-size: 0.85rem;
}

/* Редкость предметов */

.rarity-common { color: var(--rarity-common); }
.rarity-rare { color: var(--rarity-rare); }
.rarity-epic { color: var(--rarity-epic); }
.rarity-legendary { color: var(--rarity-legendary); }

.rarity {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 0.72rem;
    white-space: nowrap;
}

/* Приватный раздел: список вещей */

.stub-card-ready {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stub-card-ready:hover {
    border-color: var(--color-primary);
}

.stub-card .ready {
    color: var(--color-primary);
    font-size: 0.85rem;
    margin: 0;
}

.filter-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form input[type="search"] {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.filter-form select {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: #fff;
}

.items-table .item-name-cell {
    white-space: nowrap;
}

/* Сортируемые заголовки: ссылка на ту же колонку с обратным направлением, стрелка у активной. */
.items-table th.sortable a {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.items-table th.sortable a:hover {
    color: var(--color-primary);
}

.items-table th.sortable .sort-arrow {
    display: inline-block;
    width: 0.9em;
    color: var(--color-border);
}

.items-table th.sortable .sort-arrow::after {
    content: "↕";
}

.items-table th.sorted a {
    color: var(--color-primary);
}

.items-table th.sorted .sort-arrow {
    color: var(--color-primary);
}

.items-table th.sorted.asc .sort-arrow::after {
    content: "↑";
}

.items-table th.sorted.desc .sort-arrow::after {
    content: "↓";
}

.items-table .slot-icon {
    display: inline-block;
    width: 1.5em;
    margin-right: 0.25rem;
    text-align: center;
}

.items-table td.bonus-cell {
    white-space: normal;
    min-width: 220px;
    color: var(--color-muted);
    font-size: 0.78rem;
}

.items-table .row-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.items-table .row-actions form {
    margin: 0;
}

.items-table .tag {
    display: inline-block;
    margin-left: 0.3rem;
    font-size: 0.65rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-muted);
}

.items-table .tag-warning {
    color: var(--color-error);
    border-color: var(--color-error);
}

/* Приватный раздел: пользователи */

.greeting .tag {
    margin-left: 0.35rem;
}

.tag-master {
    color: #7a5a10;
    border-color: #c99a2e;
    background: #fff7e0;
}

.user-status {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 0.72rem;
    white-space: nowrap;
}

.user-status-active {
    color: var(--color-success);
}

.user-status-blocked {
    color: var(--color-error);
}

.users-table .user-row-blocked td {
    color: var(--color-muted);
}

.users-table .muted-cell {
    color: var(--color-muted);
    font-size: 0.78rem;
}

.roles-list {
    margin-bottom: 0.75rem;
}

.hero h1 .tag {
    font-size: 0.7rem;
    vertical-align: middle;
}

.greeting-name {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}

.greeting-name:hover {
    color: var(--color-primary);
}

.panel-danger {
    border-color: #f0c2bd;
}

/* Приватный раздел: журнал действий */

.audit-filter input[type="search"] {
    min-width: 160px;
}

.audit-filter .date-field {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.audit-filter input[type="date"] {
    padding: 0.45rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: #fff;
}

.audit-table th:not(:first-child),
.audit-table td:not(:first-child),
.users-table th:not(:first-child),
.users-table td:not(:first-child) {
    text-align: left;
}

.audit-table td {
    vertical-align: top;
}

.audit-table td.audit-details {
    white-space: normal;
    min-width: 220px;
    max-width: 480px;
    color: var(--color-muted);
    font-size: 0.78rem;
}

.audit-table tr.audit-login_failed td,
.audit-table tr.audit-login_blocked td,
.audit-table tr.audit-login_expired td {
    color: var(--color-error);
}

.audit-table tr.audit-user_delete td,
.audit-table tr.audit-item_delete td,
.audit-table tr.audit-consumable_delete td {
    background: #fff5f4;
}

.pager {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

button.danger {
    padding: 0.4rem 0.9rem;
    font-size: 0.88rem;
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-error);
    border: 1px solid var(--color-error);
    cursor: pointer;
}

button.danger:hover {
    background: #fbe9e7;
}

/* Приватный раздел: форма вещи */

.item-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.form-field label {
    font-size: 0.82rem;
    color: var(--color-muted);
}

.form-field input,
.form-field select {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: #fff;
}

.form-field-check {
    justify-content: flex-end;
}

.form-field input:disabled,
.form-field select:disabled {
    background: var(--color-bg);
    color: var(--color-muted);
    cursor: not-allowed;
}

.form-field-disabled label {
    color: var(--color-muted);
}

.form-field-check label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--color-text);
}

.bonus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.5rem;
}

.bonus-row {
    display: grid;
    grid-template-columns: 1fr 5rem auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.45rem;
    border-radius: var(--radius);
    background: var(--color-bg);
}

.bonus-row-noncombat {
    background: #fdf3d8;
}

.bonus-row label {
    font-size: 0.82rem;
}

.bonus-row input[type="number"] {
    width: 100%;
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.percent-toggle {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* Расходники: эффекты на характеристики всегда плоские — вместо чекбокса подпись. */
.bonus-row-characteristic {
    background: #e8f1fb;
}

.percent-toggle-fixed {
    font-size: 0.75rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.import-form {
    margin-bottom: 1rem;
}

.import-form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    background: #fff;
    resize: vertical;
}

/* Приватный раздел: экспорт/импорт базы */

.transfer-panel .hint code {
    font-size: 0.8em;
}

.transfer-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.transfer-form input[type="file"] {
    font-size: 0.9rem;
}

.transfer-modes {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.radio-label {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.92rem;
    cursor: pointer;
}

.hint-inline {
    color: var(--color-muted);
    font-size: 0.85em;
}

.hint-inline.hint-danger {
    color: var(--color-error);
}

/* Публичная страница: карточка расходника */

.equipment-slot .slot-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.equipment-slot .slot-item-name.muted {
    font-weight: 400;
    color: var(--color-muted);
}

/* Публичная страница: небоевые бонусы и отрицательные значения */

.noncombat-block {
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--color-border);
}

.noncombat-block h3 {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.noncombat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.82rem;
}

.noncombat-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.6rem;
    align-items: baseline;
}

.noncombat-list .positive { color: var(--color-success); }
.noncombat-list .negative { color: var(--color-error); }
.noncombat-list .zero { color: var(--color-muted); }

.noncombat-list .noncombat-source {
    font-size: 0.72rem;
    color: var(--color-muted);
}

.noncombat-block .hint {
    margin: 0 0 0.4rem;
}

.totals-table td.bonus.negative {
    color: var(--color-error);
}

/* Публичная страница: навыки клана (docs/clan.v1.md) */

.clan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.5rem;
    align-items: stretch;
}

.clan-summary {
    margin: 0 0 0.6rem;
}

.clan-skill-row.clan-skill-active {
    border-color: #b98bd6;
    background: #faf5fe;
}

.clan-skill-row .clan-now {
    color: #5b3a9e;
    font-weight: 600;
}

.clan-skill-row .clan-level {
    width: 3.2rem;
    padding: 0.2rem 0.3rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #fff;
    -moz-appearance: textfield;
}

.clan-skill-row .clan-level::-webkit-outer-spin-button,
.clan-skill-row .clan-level::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.panel-clan .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.totals-table .bonus-clan {
    display: inline-block;
    margin-left: 0.2rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #f2ecfb;
    color: #5b3a9e;
    font-size: 0.7rem;
    white-space: nowrap;
}

.totals-table .bonus-stone {
    display: inline-block;
    margin-left: 0.2rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #e3f2fd;
    color: #14548c;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* Модалка подбора вещи */

.modal-wide {
    max-width: 560px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.1rem;
}

/* Модалка «Камни хаоса» — по строке на сокет, переиспользует вид строки характеристики */
#stones-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stone-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.stone-controls select {
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: #fff;
    max-width: 12rem;
}

.stone-controls select.stone-level {
    max-width: 10rem;
}

.modal-filters {
    display: flex;
    gap: 0.5rem;
    margin: 0.75rem 1.1rem;
    align-items: center;
    flex-wrap: wrap;
}

.modal-filters .modal-search {
    flex: 1;
    margin: 0;
}

.modal-filter {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: #fff;
}

.modal-item-button {
    width: 100%;
    text-align: left;
    background: none;
    font: inherit;
    color: inherit;
}

.modal-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.modal-item.unmet {
    opacity: 0.75;
}

.modal-item-button:disabled {
    cursor: not-allowed;
}

.modal-item-button:disabled:hover {
    background: none;
}

.equipment-notice {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--color-error);
    background: #fbe9e7;
}

.modal-item .unmet-note {
    color: var(--color-error);
}
