/* Содержимое вкладок «Анкета», «Умения», «На мне» (ui/blocks/character.js, sheet_gear.js).
   Стили сайдбара и полосы вкладок — в style.css (их ведёт каркас). Все классы с префиксом cs-,
   чтобы не пересекаться с прежними (.card, .stat, .skill, .slots живут в style.css). */

.cs {
  --tap: 44px;
  --alarm-ink: #8a1f14;
  --green-ink: #1f4a15;
  --bar-edge: #6b604f;
  font-size: 15px;
  line-height: 1.4;
}
.cs h2.cs-title { margin: 0 0 10px; font: 24px var(--font-sign); }
.cs p { margin: 0; }
.cs a { color: var(--crimson); }
.cs :focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--focus); }
.cs button { margin: 0; min-height: var(--tap); }

.cs-stack { display: grid; gap: 14px; }
.cs-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cs-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 899px) { .cs-two, .cs-top { grid-template-columns: minmax(0, 1fr); } }
.cs-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; }
.cs .cs-card > h2, .cs .cs-card > h3 { margin: 0 0 8px; font: 15px var(--font-sign); letter-spacing: .04em; text-transform: uppercase;
  border: 0; padding: 0; color: var(--ink); }
.cs-foot { margin-top: 8px; font-size: 14px; color: var(--muted); }
.cs-foot a { display: inline-flex; align-items: center; min-height: var(--tap); }
.cs-muted { color: var(--muted); }

/* Что сделать: один закрываемый блок */
.cs-notice:empty { display: none; }
.cs-todo { display: flex; align-items: center; gap: 12px; padding: 4px 6px 4px 14px; margin-bottom: 12px;
  background: #f6e6a8; border: 1px solid #b89a2a; border-left: 6px solid var(--gold); border-radius: 4px; min-height: var(--tap); }
.cs-todo.hurt { background: #f3d2cc; border-color: var(--alarm); border-left-color: var(--alarm-ink); color: #5a120a; padding: 8px 14px; }
.cs-todo p { flex: 1; }
.cs-todo b { font-family: var(--font-sign); font-weight: 400; letter-spacing: .03em; margin-right: 4px; }
.cs-todo a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; }
.cs-todo .cs-x { flex: none; width: var(--tap); height: var(--tap); padding: 0; border: 0; background: transparent;
  font-size: 22px; border-radius: 4px; color: inherit; }
.cs-todo .cs-x:hover { background: rgba(0, 0, 0, .08); }

/* Паспорт */
.cs-passport { padding: 0; overflow: hidden; }
.cs-pp-head { background: var(--ink); color: var(--gold-soft); font: 13px var(--font-sign); letter-spacing: .14em;
  text-transform: uppercase; padding: 6px 14px; display: flex; justify-content: space-between; gap: 8px; }
.cs-pp-body { padding: 12px 14px; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
.cs-photo { margin: 0; }
.cs-photo svg { display: block; width: 100%; height: auto; border: 2px solid var(--ink); background: #cfc2a3; }
.cs-photo figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.25; }
.cs-nick { font: 24px/1.1 var(--font-sign); overflow-wrap: anywhere; }
.cs-pp-rows { margin: 8px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; font-size: 14px; }
.cs-pp-rows dt { color: var(--muted); }
.cs-pp-rows dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.cs-pp-rows dd.bad { color: var(--alarm-ink); }
.cs-stamp { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); font: 13px var(--font-mono); color: var(--crimson);
  text-transform: uppercase; letter-spacing: .04em; }
.cs-newbie { margin-top: 8px; }
.cs-newbie details { margin-top: 4px; font-size: 14px; }
.cs-newbie summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; color: var(--muted); }
.cs-pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.cs-pill.info { background: #e6dcb8; color: #4a3b08; border: 1px solid #b89a2a; text-decoration: none; }
.cs-pill.ok { background: #d4e6c4; color: #1f4a15; }
.cs-pill.later { background: transparent; color: var(--muted); border: 1px dashed var(--muted); font-weight: 400; }

/* Характеристики: название + вложено + «+1» + подсказка по клику */
.cs-stats { list-style: none; margin: 0; padding: 0; }
.cs-stat { border-bottom: 1px solid var(--line); }
.cs-stat:last-child { border-bottom: 0; }
.cs-stat-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 0 12px; min-height: 48px; }
.cs-stat-name { display: flex; flex-direction: column; min-width: 0; }
.cs-eff { font-size: 13px; color: var(--muted); margin-top: -6px; padding-bottom: 4px; }
.cs-invested { font-size: 14px; color: var(--muted); white-space: nowrap; }
.cs .cs-tip-btn, .cs .cs-tip-btn:hover:not(:disabled) { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  background: transparent; border: 0; padding: 0 6px 0 0; font-weight: 700; text-align: left; color: var(--ink); border-radius: 4px;
  font-size: 15px; }
.cs-tip-btn::after { content: "?"; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--muted);
  color: var(--muted); font: 700 13px/18px var(--font-text); text-align: center; }
.cs-tip-btn[aria-expanded="true"]::after { background: var(--ink); color: var(--gold-soft); border-color: var(--ink); }
.cs .cs-tip-btn:hover:not(:disabled) { color: var(--crimson); }
.cs .cs-plus { min-width: var(--tap); min-height: var(--tap); border: 2px solid var(--crimson); background: transparent;
  color: var(--crimson); font: 700 18px var(--font-text); border-radius: 4px; padding: 0 8px; }
.cs .cs-plus:hover:not(:disabled) { background: var(--crimson); color: var(--crimson-ink); }
.cs-tip { margin: 0 0 10px; padding: 10px 14px; background: #fffbea; border: 1px solid var(--ink); border-left: 6px solid var(--gold);
  border-radius: 4px; font-size: 15px; }
.cs-tip h4 { margin: 0 0 4px; font: 15px var(--font-sign); letter-spacing: .03em; }
.cs-tip ul { margin: 4px 0 8px; padding-left: 20px; }
.cs-tip .cs-now { margin: 0 0 4px; font-weight: 700; }
.cs-tip a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; }

/* Уровни */
.cs-lvl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 2px 0 6px; border-bottom: 1px solid var(--line); }
.cs-lvl:last-child { border-bottom: 0; }
.cs-lvl a { color: var(--ink); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; min-height: var(--tap); }
.cs-lvl a:hover { color: var(--crimson); text-decoration: underline; }
.cs-lvl .cs-n { font: 20px var(--font-sign); text-align: right; align-self: center; }
.cs-lvl .cs-bar { grid-column: 1 / -1; height: 10px; }
.cs-lvl .cs-note { grid-column: 1 / -1; font-size: 14px; color: var(--muted); margin-top: 2px; }

/* Полосы */
.cs-bar { display: block; height: 8px; background: #d6cbb2; border: 1px solid var(--bar-edge); border-radius: 3px; overflow: hidden; }
.cs-bar > i { display: block; height: 100%; background: var(--gold); }
.cs-bar.hp > i { background: var(--green); }
.cs-bar.low > i { background: var(--alarm); }
.cs-bar.crim > i { background: var(--crimson); }

.cs-points { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cs .cs-btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 16px; border-radius: 4px;
  background: var(--crimson); color: var(--crimson-ink); border: 1px solid #5c1010; font-weight: 700; text-decoration: none; font-size: 15px; }
.cs .cs-btn:hover:not(:disabled) { background: #b5223c; }
.cs .cs-btn:disabled { background: var(--paper-2); color: var(--muted); border: 1px dashed var(--muted); }
.cs button.cs-btn.ghost, .cs .cs-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.cs .cs-btn.ghost:hover:not(:disabled) { background: var(--paper); border-color: var(--ink); }
.cs-reset-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.cs-exit { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Умения */
.cs-skill { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cs-skill:last-child { border-bottom: 0; }
.cs-skill-name { font-weight: 700; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.cs-skill-name a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: var(--tap); }
.cs-skill-name a:hover { color: var(--crimson); text-decoration: underline; }
.cs-skill .cs-lv { font: 20px var(--font-sign); text-align: right; }
.cs-skill .cs-bar { grid-column: 1 / -1; }
.cs-skill .cs-note { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.cs-skill.zero .cs-skill-name a { color: var(--muted); }

/* На мне */
.cs-alert { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; padding: 6px 14px; border-radius: 4px;
  background: #f3d2cc; border: 1px solid var(--alarm); border-left: 6px solid var(--alarm-ink); color: #5a120a; }
.cs-gearwrap { container-type: inline-size; }
.cs-gear { display: grid; gap: 14px; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  grid-template-areas: "doll card" "totals card" "belt card" "bag card"; grid-template-rows: auto auto auto 1fr; align-items: start; }
.cs-g-doll { grid-area: doll; } .cs-g-card { grid-area: card; position: sticky; top: 12px; scroll-margin-top: 80px; }
.cs-g-totals { grid-area: totals; } .cs-g-belt { grid-area: belt; } .cs-g-bag { grid-area: bag; }
@container (max-width: 640px) {
  .cs-gear { grid-template-columns: minmax(0, 1fr); grid-template-areas: "doll" "card" "totals" "belt" "bag"; grid-template-rows: none; }
  .cs-g-card { position: static; }
}

.cs-doll { max-width: 440px; margin: 0 auto; position: relative; background: #14100c; border: 2px solid var(--ink);
  border-radius: 4px; padding: 12px 30px; isolation: isolate; }
.cs-doll::before, .cs-doll::after { content: ""; position: absolute; top: 6px; bottom: 6px; width: 10px;
  background: repeating-linear-gradient(to bottom, var(--paper) 0 10px, transparent 10px 22px); opacity: .85; border-radius: 1px; }
.cs-doll::before { left: 10px; } .cs-doll::after { right: 10px; }
.cs-doll :focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: none; }
.cs-doll-fig { position: absolute; inset: 8px 28px; width: calc(100% - 56px); height: calc(100% - 16px); z-index: -1; pointer-events: none; }
.cs-doll-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cs .cs-dslot { position: relative; aspect-ratio: 1 / 1; min-width: 0; min-height: 76px; padding: 4px 3px 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2px;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 4px; text-align: center; }
.cs .cs-dslot:hover { background: #fff7e2; }
.cs-dslot .lb { font-size: 13px; line-height: 1.1; color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.cs-dslot svg { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 56px; }
.cs-dslot .du { font: 700 13px/1.2 var(--font-mono); }
.cs .cs-dslot.empty { background: rgba(239, 230, 210, .07); border: 2px dashed var(--bar-edge); color: var(--side-muted); }
.cs .cs-dslot.empty:hover { background: rgba(239, 230, 210, .16); border-color: var(--side-muted); }
.cs-dslot.empty .lb { color: var(--side-muted); }
.cs-dslot.empty .du { font-family: var(--font-text); font-weight: 400; font-size: 12px; }
.cs .cs-dslot.broken { border-color: var(--alarm); box-shadow: inset 0 0 0 2px var(--alarm); background: #f7ddd7; }
.cs-dslot.broken .du, .cs-dslot.low .du { color: var(--alarm-ink); }
.cs .cs-dslot[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--gold-soft); border-color: var(--gold-soft); }
.cs .cs-dslot[aria-pressed="true"].broken { box-shadow: 0 0 0 3px var(--gold-soft), inset 0 0 0 2px var(--alarm); }
.cs-ic-fill { fill: rgba(42, 36, 28, .18); stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.cs-ic-line { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cs-ic-hole { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
.cs-dslot.empty .cs-ic-fill, .cs-dslot.empty .cs-ic-line { stroke: var(--bar-edge); fill: none; }

.cs-sum { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; margin: 0; }
.cs-sum dt { color: var(--muted); min-height: 36px; display: flex; align-items: center; }
.cs-sum dd { margin: 0; font-weight: 700; text-align: right; min-height: 36px; display: flex; align-items: center;
  justify-content: flex-end; flex-wrap: wrap; gap: 0 8px; }
.cs-sum dd.bad, .cs-sum .brk { color: var(--alarm-ink); }
.cs-cells { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.cs-cells.belt { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs .cs-cell { min-height: 84px; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; text-align: center; font-size: 13px; line-height: 1.15; color: var(--ink); }
.cs .cs-cell:hover { background: #fff7e2; }
.cs-cell svg { width: 34px; height: 34px; flex: none; }
.cs-cell .nm { overflow-wrap: anywhere; }
.cs-cell .du { font: 700 12px/1.2 var(--font-mono); }
.cs .cs-cell.empty { background: transparent; border: 2px dashed var(--line); color: var(--muted); justify-content: center; }
.cs .cs-cell.broken { border-color: var(--alarm); background: #f7ddd7; }
.cs .cs-cell[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--crimson); }
.cs-cell.cantuse { border-color: var(--alarm-ink); }

/* Карточка вещи */
.cs-g-card dl { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; margin: 0; }
.cs-g-card dt { color: var(--muted); min-height: 30px; display: flex; align-items: center; }
.cs-g-card dd { margin: 0; text-align: right; font-weight: 700; min-height: 30px; display: flex; align-items: center; justify-content: flex-end; }
.cs-g-card .head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.cs-g-card .head svg { flex: none; width: 56px; height: 56px; border: 2px solid var(--ink); background: #cfc2a3; padding: 4px; border-radius: 3px; }
.cs .cs-g-card .head h3 { font: 20px var(--font-sign); margin: 0; border: 0; padding: 0; text-transform: none; letter-spacing: .02em; }
.cs-g-card .kind { font-size: 14px; color: var(--muted); }
.cs-g-card .req { margin: 8px 0 0; padding: 0; list-style: none; font-size: 15px; }
.cs-g-card .req li::before { content: "✓ "; color: var(--green-ink); font-weight: 700; }
.cs-g-card .req li.no { color: var(--alarm-ink); font-weight: 700; }
.cs-g-card .req li.no::before { content: "✕ "; }
.cs-g-card .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cs-g-card .why { margin-top: 6px; font-size: 14px; color: var(--muted); }
.cs-g-card .itemlink { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; }
.cs-g-card .cs-bar { height: 10px; }
.cs-g-card .res { margin-top: 8px; padding: 6px 10px; background: #fffbea; border-left: 6px solid var(--gold); }
.cs-g-card .res.bad { background: #f3d2cc; border-color: var(--alarm-ink); color: #5a120a; }
.cs .cs-sell { color: var(--crimson); }

@media (pointer: coarse) { .cs button, .cs a.cs-btn { min-height: 48px; } }
@media (max-width: 760px) {
  .cs-pp-body { grid-template-columns: 80px minmax(0, 1fr); gap: 10px; }
  .cs-doll { padding: 12px 26px; }
}
@media (prefers-reduced-motion: reduce) { .cs * { transition: none !important; } }
