/* ===== Палитра (как у калькулятора крафта) ===== */
:root {
  --bg: #ece9e1; --panel: #f7f4ed; --panel2: #f0ece2; --line: #d9d3c6; --line2: #c8c1b1;
  --ink: #23262e; --ink2: #4a4f5c; --muted: #797f8e;
  --brand: #9a6f2a; --brand-ink: #7a5518; --brand-soft: rgba(154, 111, 42, .12);
  --good: #3a8a4c; --good-soft: rgba(58, 138, 76, .14);
  --warn: #b7791f; --warn-soft: rgba(183, 121, 31, .15);
  --bad: #b4443a; --bad-soft: rgba(180, 68, 58, .13);
  --info: #3f6fb0; --info-soft: rgba(63, 111, 176, .13);
  --g-rare: #3f7fd0; --g-anc: #b0417a;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --radius: 10px;
  --nav-h: 60px;
  --font: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --font-title: "Cinzel", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131519; --panel: #1b1e26; --panel2: #20242e; --line: #2b3039; --line2: #3a414e;
    --ink: #dce0ea; --ink2: #aab0be; --muted: #828a9b;
    --brand: #c99b4c; --brand-ink: #e2b968; --brand-soft: rgba(201, 155, 76, .14);
    --good: #7cc182; --good-soft: rgba(124, 193, 130, .14);
    --warn: #e0a84e; --warn-soft: rgba(224, 168, 78, .15);
    --bad: #e2756b; --bad-soft: rgba(226, 117, 107, .14);
    --info: #7aa7e6; --info-soft: rgba(122, 167, 230, .14);
    --g-rare: #6ea8f0; --g-anc: #e07ab3;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131519; --panel: #1b1e26; --panel2: #20242e; --line: #2b3039; --line2: #3a414e;
  --ink: #dce0ea; --ink2: #aab0be; --muted: #828a9b;
  --brand: #c99b4c; --brand-ink: #e2b968; --brand-soft: rgba(201, 155, 76, .14);
  --good: #7cc182; --good-soft: rgba(124, 193, 130, .14);
  --warn: #e0a84e; --warn-soft: rgba(224, 168, 78, .15);
  --bad: #e2756b; --bad-soft: rgba(226, 117, 107, .14);
  --info: #7aa7e6; --info-soft: rgba(122, 167, 230, .14);
  --g-rare: #6ea8f0; --g-anc: #e07ab3;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}

/* ===== База ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 500 15px/1.4 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h1 { font: 700 22px/1.2 var(--font-title); letter-spacing: .02em; }
h2 { font: 700 17px/1.25 var(--font-title); letter-spacing: .02em; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gold { color: var(--brand-ink); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

/* ===== Загрузка ===== */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 8px; }
.boot-mark { font-size: 40px; color: var(--brand); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ===== Каркас ===== */
.shell { min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 10px; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: var(--panel); display: grid; place-items: center; font-size: 18px; flex: none; }
.brand-name { font: 700 15px/1.15 var(--font-title); }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink2);
  font-weight: 600; font-size: 15px; text-decoration: none !important; position: relative;
}
.nav-link svg { width: 20px; height: 20px; flex: none; }
.nav-link:hover { background: var(--panel2); color: var(--ink); }
.nav-link.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px; display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }

.main { min-width: 0; padding: 20px 28px 40px; max-width: 1280px; width: 100%; }
.topbar { display: none; }
.bottomnav { display: none; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { flex: 1; min-width: 0; }

@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 12px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
  .topbar {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--panel);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  }
  .topbar .brand { padding: 0; flex: 1; min-width: 0; }
  .topbar .brand-mark { width: 30px; height: 30px; font-size: 16px; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--nav-h);
    color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none !important; position: relative;
  }
  .bottomnav a svg { width: 22px; height: 22px; }
  .bottomnav a.active { color: var(--brand-ink); }
  .bottomnav .nav-badge { position: absolute; top: 6px; left: 50%; margin-left: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  h1 { font-size: 19px; }
  .grid { grid-template-columns: 1fr; }
}

/* ===== Карточки ===== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 14px 16px; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { flex: 1; min-width: 0; }
.card-body { padding: 14px 16px; }
.card.clickable { cursor: pointer; transition: border-color .15s; }
.card.clickable:hover { border-color: var(--line2); }
.section-title { font: 700 13px/1 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stats .card { padding: 12px 14px; }

/* ===== Кнопки и поля ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); color: var(--ink);
  font: 600 15px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #16181d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #16181d; } }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 14px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; background: var(--panel2); }
.seg button { border: 0; background: transparent; color: var(--ink2); font: 600 14px/1 var(--font); padding: 8px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--brand-soft); color: var(--brand-ink); }
.seg.yes-no button.on.yes { background: var(--good-soft); color: var(--good); }
.seg.yes-no button.on.maybe { background: var(--warn-soft); color: var(--warn); }
.seg.yes-no button.on.no { background: var(--bad-soft); color: var(--bad); }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; color: var(--ink2); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 38px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line2);
  background: var(--panel2); color: var(--ink); font: 500 15px/1.3 var(--font); outline: none;
}
textarea.input { min-height: 72px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input:disabled { opacity: .4; cursor: not-allowed; }
.input.sm { min-height: 30px; padding: 4px 8px; font-size: 14px; }
.input.qty { width: 84px; text-align: right; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.search { position: relative; }
.search .input { padding-left: 34px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }

/* ===== Табы ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: transparent; color: var(--muted); font: 700 15px/1 var(--font); padding: 10px 12px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
}
.tabs button.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tabs button .count { font-size: 12px; margin-left: 4px; color: var(--muted); }

/* ===== Бейджи ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 700; background: var(--panel2); color: var(--ink2); border: 1px solid var(--line); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.grade { font: 700 12px/1 var(--font-title); color: var(--brand-ink); }
/* Качество — в стиле вики PentaWar: квадратные вкладки, Cinzel, заглавные с разрядкой, золото у активной */
.q-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.q-tab {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; cursor: pointer;
  font: 600 11px/1 var(--font-title); letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); background: var(--panel2); border: 1px solid var(--line2); border-radius: 0;
  transition: color .15s, border-color .15s;
}
.q-tab svg { width: 14px; height: 14px; }
.q-tab:hover { color: var(--brand-ink); border-color: var(--brand); }
.q-tab.on { color: var(--ink); background: var(--brand-soft); border-color: var(--ink2); }
/* цвета качества: редкий — синий, древний — розовый (и в названиях, и в выбранной вкладке) */
.q-rare { color: var(--g-rare) !important; }
.q-anc { color: var(--g-anc) !important; }
.q-tab.q-rare.on { border-color: var(--g-rare); background: color-mix(in srgb, var(--g-rare) 14%, transparent); }
.q-tab.q-anc.on { border-color: var(--g-anc); background: color-mix(in srgb, var(--g-anc) 14%, transparent); }
.q-tab.q-rare:not(.on), .q-tab.q-anc:not(.on) { opacity: .75; }
.legend-sep { width: 1px; height: 14px; background: var(--line2); }
.legend-quality { font-weight: 700; color: var(--ink); }

/* ===== Таблицы ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel); }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--panel2); }
.table th.right, .table td.right { text-align: right; }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--line2); }
.table .sticky-col { position: sticky; left: 0; background: var(--panel); z-index: 1; }

/* ===== Предметы ===== */
.item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.item-icon { width: 32px; height: 32px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); flex: none; object-fit: cover; }
.item-icon.sm { width: 24px; height: 24px; border-radius: 4px; }
.item-icon.lg { width: 42px; height: 42px; }
.item-icon.ph { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.item-name { font-weight: 600; min-width: 0; }

.picker { position: relative; }
.picker-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; max-height: 300px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; box-shadow: var(--shadow);
}
.picker-opt { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; }
.picker-opt:hover, .picker-opt.hl { background: var(--panel2); }

/* ===== Модалки и тосты ===== */
.modal-back { position: fixed; inset: 0; background: rgba(10, 12, 16, .55); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; min-width: 0; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) {
  .modal-back { place-items: end stretch; padding: 0; }
  .modal { max-width: none; border-radius: 14px 14px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
}
@keyframes fade { from { opacity: 0; } }

#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
@media (min-width: 861px) { #toasts { bottom: 24px; } }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); animation: fade .15s; pointer-events: auto; }
.toast.error { background: var(--bad); color: #fff; }

/* ===== Вход ===== */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo .brand-mark { width: 56px; height: 56px; font-size: 28px; border-radius: 14px; margin: 0 auto 10px; }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--info-soft); color: var(--info); font-size: 14px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.good { background: var(--good-soft); color: var(--good); }

/* ===== Экипировка ===== */
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.slot { display: flex; gap: 10px; padding: 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; min-width: 0; text-align: left; font: inherit; color: inherit; }
.slot:hover { border-color: var(--line2); }
/* заполненность СА/АТТ: красный — пусто, оранжевый — частично, зелёный — фул */
.slot.fill-none { border-left: 4px solid var(--bad); background: linear-gradient(90deg, var(--bad-soft), transparent 70%), var(--panel); }
.slot.fill-partial { border-left: 4px solid var(--warn); background: linear-gradient(90deg, var(--warn-soft), transparent 70%), var(--panel); }
.slot.fill-full { border-left: 4px solid var(--good); background: linear-gradient(90deg, var(--good-soft), transparent 70%), var(--panel); }
.fill-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.fill-swatch.fill-none { background: var(--bad); } .fill-swatch.fill-partial { background: var(--warn); } .fill-swatch.fill-full { background: var(--good); }
.slot-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.slot-sa { font-size: 13px; color: var(--ink2); }
.matrix td, .matrix th { font-size: 13px; }
.matrix td.cell { min-width: 150px; max-width: 220px; cursor: pointer; }
.matrix td.cell:hover { background: var(--panel2); }
.matrix td.cell.fill-none { box-shadow: inset 4px 0 0 var(--bad); background: var(--bad-soft); }
.matrix td.cell.fill-partial { box-shadow: inset 4px 0 0 var(--warn); background: var(--warn-soft); }
.matrix td.cell.fill-full { box-shadow: inset 4px 0 0 var(--good); background: var(--good-soft); }

/* СА / АТТ */
.sa-grid { display: grid; grid-template-columns: 56px 1fr 1fr; gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sa-grid:last-of-type { border-bottom: 0; }
.sa-head { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding-top: 0; }
.sa-num { font-weight: 700; color: var(--ink2); padding-top: 6px; font-size: 13px; }
.sa-grid.over { opacity: .55; }
.sa-grid.over .sa-num::after { content: ' *'; color: var(--warn); }
.sa-pick { display: grid; grid-template-columns: 1fr 96px; gap: 6px; }
.sa-mobile-label { display: none; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.c-blue { background: #4a8ee8; } .c-yellow { background: #e3b33c; } .c-red { background: #d9503f; }
@media (max-width: 760px) {
  .sa-grid { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; }
  .sa-head { display: none; }
  .sa-num { padding-top: 0; }
  .sa-mobile-label { display: block; }
}

/* ===== Члены пати ===== */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 16px; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.member { display: flex; gap: 10px; align-items: center; min-width: 0; }

/* ===== События ===== */
.event { display: flex; gap: 12px; }
.event-date { flex: none; width: 54px; text-align: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink); padding: 6px 0; }
.event-date .d { font: 700 20px/1 var(--font-title); }
.event-date .m { font-size: 11px; text-transform: uppercase; font-weight: 700; }
.event-date .t { font-size: 13px; font-weight: 700; margin-top: 2px; }
.event.past { opacity: .75; }
.event.cancelled .event-title { text-decoration: line-through; }

.progress { height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); }
.progress.good > div { background: var(--good); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; background: var(--panel2); }
.stepper button { width: 32px; height: 34px; border: 0; background: transparent; color: var(--ink2); font-size: 18px; cursor: pointer; }
.stepper button:hover { background: var(--line); }
.stepper input { width: 64px; height: 34px; border: 0; border-left: 1px solid var(--line2); border-right: 1px solid var(--line2); background: transparent; color: var(--ink); text-align: center; font: 600 15px var(--font); outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: var(--panel2); }

.sticky-bar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 10; margin-top: 12px; }
@media (min-width: 861px) { .sticky-bar { bottom: 12px; } }
.sticky-bar .card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 14px; background: var(--panel2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; letter-spacing: .04em; }

.table th.center, .table td.center { text-align: center; }
.perm-table td:first-child { min-width: 260px; }

/* переключатель пачек */
.party-switch select { font-weight: 600; }
.sidebar .party-switch { margin-top: -6px; }

/* подпрофессии */
.prof-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.prof-badge {
  display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 9px;
  background: var(--panel2); border: 1px solid var(--line); font-size: 12px; line-height: 1.3; cursor: help;
}
.prof-badge b { font-size: 11px; color: var(--brand-ink); }
.prof-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prof-row:last-child { border-bottom: 0; }
.prof-icon { font-size: 20px; width: 26px; text-align: center; flex: none; }
