:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-2: #eef1f5;
    --line: #c6ced8;
    --text: #1b232c;
    --muted: #626e7b;
    /* Приглушённый текст для подписей: на светлом фоне нужен темнее,
       чем был на тёмном, иначе цифры в подписях не читаются. */
    --muted-faint: #626c79;
    --hairline: rgba(27, 35, 44, .07);
    --accent: #14713f;
    --accent-hover: #105c33;
    --accent-dim: #e2f3e9;
    --accent-border: #9fd8b8;
    --accent-text: #116037;
    --danger: #b4342a;
    --danger-dim: #fbe9e7;
    --danger-border: #e6b3ae;
    --warn: #8a6100;
    --avatar-host-bg: #dce7f1;
    --avatar-host-text: #2b5878;
    --escaped-bg: #f1faf4;
    /* Шапки карточек: тёмно-серый фон, белый текст. Белый на #3c4653 даёт
       контраст около 9:1, то есть с большим запасом проходит WCAG AA. */
    --head-bg: #3c4653;
    --head-text: #ffffff;
    --head-hint: rgba(255, 255, 255, .8);
    --head-btn-bg: rgba(255, 255, 255, .14);
    --head-btn-bg-hover: rgba(255, 255, 255, .26);
    --head-btn-border: rgba(255, 255, 255, .42);
    --head-btn-border-hover: rgba(255, 255, 255, .7);
    --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; }

.eyebrow {
    font-size: .68rem;
    letter-spacing: .18em;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 600;
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 10px;
    padding: 11px 16px;
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-soft { background: var(--surface-2); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger-dim); border-color: var(--danger-border); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: .85rem; }
.btn-xs { padding: 5px 10px; font-size: .78rem; border-radius: 8px; }
.btn-step { padding: 8px 0; font-size: .82rem; font-family: inherit; font-variant-numeric: tabular-nums; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-wrap { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.auth-wrap-slim { max-width: 420px; grid-template-columns: 1fr; }
.auth-hero h1 { font-size: 3.2rem; line-height: .95; letter-spacing: -.03em; margin: 12px 0 16px; }
.auth-tagline { color: var(--muted); margin-bottom: 24px; }
.auth-points { list-style: none; color: var(--muted); font-size: .9rem; }
.auth-points li { padding-left: 22px; position: relative; margin-bottom: 8px; }
.auth-points li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent); }

.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.auth-card-title { margin: 8px 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.field-hint { font-size: .78rem; color: var(--muted); }

input, select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input::placeholder { color: var(--muted-faint); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg); padding: 5px; border-radius: 12px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 9px; border-radius: 9px; font-weight: 600; font-size: .88rem; font-family: inherit; cursor: pointer; }
.tab.active { background: var(--surface-2); color: var(--text); }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.tab-panel.hidden { display: none; }

.host-link { display: block; text-align: center; margin-top: 18px; font-size: .82rem; color: var(--muted); }

.alert { border-radius: 12px; padding: 12px 14px; font-size: .87rem; margin-bottom: 16px; }
.alert p + p { margin-top: 4px; }
.alert-error { background: var(--danger-dim); border: 1px solid var(--danger-border); color: var(--danger); }
.alert-ok { background: var(--accent-dim); border: 1px solid var(--accent-border); color: var(--accent-text); }

/* ---------- sheet ---------- */
.sheet { padding: 0 0 72px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 1% 2%; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 20; max-width: 720px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.sheet-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* Подпись-значение: «Игрок: Радик», «Профессия: Адвокат». */
.identity-text { display: grid; grid-template-columns: auto auto; gap: 2px 8px; align-items: baseline; min-width: 0; }
.identity-text dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.identity-text dd { margin: 0; font-size: .95rem; font-weight: 600; min-width: 0; }
.identity-text .identity-profession { color: var(--accent); white-space: nowrap; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar-host { background: var(--avatar-host-bg); color: var(--avatar-host-text); }

.sheet-kpis { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.head-kpi { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.head-kpi .kpi-label { font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.head-kpi .kpi-value { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sheet-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; min-width: 0; }
.identity-name { font-size: .98rem; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.identity-profession { font-size: .76rem; color: var(--accent); white-space: nowrap; }

/* Кнопка «Выход» в самом низу бланка. */
.btn-exit { margin-top: 2px; }

.save-pill { position: fixed; top: 12px; right: 12px; z-index: 40; display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .74rem; color: var(--muted); transition: opacity .3s, visibility .3s; }
/* Индикатор живёт только пока идёт обмен с сервером, иначе он висит
   поверх шапки бланка. */
.save-pill.is-hidden { opacity: 0; visibility: hidden; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.save-pill.is-saving .save-dot { background: var(--warn); }
.save-pill.is-error .save-dot { background: var(--danger); }

.escape-banner { background: var(--accent-dim); border-bottom: 1px solid var(--accent-border); color: var(--accent-text); padding: 12px 16px; font-size: .88rem; text-align: center; }
.escape-banner.hidden { display: none; }

.sheet-main { max-width: 720px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }

/* Путь на большой круг: фиксированный внизу бар «пассивный доход / расходы».
   Одна строка, подпись по центру поверх заливки. Когда расходов нет — пусто. */
.sheet-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; max-width: 720px; margin: 0 auto; width: 100%; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); box-sizing: border-box; }
.sheet-foot-track { position: relative; height: 24px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.sheet-foot-fill { position: absolute; top: 0; left: 0; bottom: 0; width: 0; background: #83b99c; border-radius: 999px; transition: width .25s ease; }
.sheet-foot-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .74rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; z-index: 1; }
body[data-escaped="1"] .sheet-foot-track { background: var(--accent-dim); border-color: var(--accent-border); }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.kpi-value { display: block; font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.kpi-note { font-size: .72rem; color: var(--muted-faint); }
.is-positive { color: var(--accent); }
.is-negative { color: var(--danger); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px 16px; }
/* Шапка карточки — тёмная плашка во всю ширину: заголовок раздела и,
   в «Активах» и «Пассивах», знак «+» справа на одной строке. */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -16px 12px; padding: 11px 16px; background: var(--head-bg); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.card-head h2 { font-size: 1rem; font-weight: 600; color: var(--head-text); letter-spacing: .01em; min-width: 0; }
.card-total { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--head-text); margin-left: auto; }
/* Нулевой пункт скрыт: суммы в нём нет, занимать строку незачем. */
.row.is-collapsed { display: none; }
/* Знак «+» на тёмной шапке: светлый, чтобы читался как кнопка. */
.row-add { width: 30px; height: 30px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--head-btn-border); background: var(--head-btn-bg); color: var(--head-text); font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; transition: background .15s, border-color .15s; }
.row-add:hover { background: var(--head-btn-bg-hover); border-color: var(--head-btn-border-hover); }
.row-add:focus-visible { outline: 2px solid var(--head-text); outline-offset: 2px; }
.row-extra, .row-pending { background: var(--surface-2); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
.row-pending { opacity: .72; }
.row-value { width: 116px; flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; font-size: .95rem; font-weight: 600; }
.tag-pending { display: inline-block !important; color: var(--muted-faint) !important; font-style: italic; }
/* Знак «−» в «Пассивах» (погасить долг) стоит рядом с «+», но не вплотную к сумме. */
.row-pay { margin-left: 6px; }
/* Знак «−» в «Активах» (продать актив) — там же, перед «+». */
.row-sell { margin-left: 6px; }
#payOffCost { color: var(--text); }

/* Строка недвижимости: название слева, суммы справа, цифры крупнее обычных.
   Объектов может быть много, поэтому всё помещается в одну строку. */
.re-row .row-label { align-self: center; }
.re-values { display: inline-flex; align-items: baseline; gap: 14px; flex-shrink: 0; margin-left: 8px; white-space: nowrap; }
.re-value { display: inline-flex; align-items: baseline; gap: 5px; }
.re-value .re-caption { font-size: .72rem; color: var(--muted); }
.re-value strong { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.re-income { font-size: 1.05rem; }
.card-danger { border-color: var(--danger-border); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--hairline); }
.row:last-child { border-bottom: 0; }
.row-label { font-size: .88rem; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-label em { display: block; font-size: .7rem; color: var(--muted-faint); font-style: normal; overflow: hidden; text-overflow: ellipsis; margin: 0 1%; vertical-align: middle;}
.tag-passive { display: inline-block !important; color: var(--accent) !important; }
.num { width: 116px; flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; font-size: .95rem; padding: 9px 11px; }
.num:focus { text-align: right; }

/* ---------- host ---------- */
.host-alert { max-width: 1600px; margin: 16px auto 0; }
.host-main { max-width: 1600px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.host-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.player-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.player-card.is-escaped { border-color: var(--accent-border); background: linear-gradient(180deg, var(--escaped-bg), var(--surface)); }
.player-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.player-head h2 { font-size: 1.1rem; }
.player-head p { font-size: .78rem; color: var(--muted); }
.badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; background: var(--accent-dim); color: var(--accent); }
.player-dream { font-size: .78rem; color: var(--muted); margin-top: 8px; }

.player-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 14px 0; }
.player-stats div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--hairline); padding-bottom: 5px; }
.player-stats dt { font-size: .76rem; color: var(--muted); }
.player-stats dd { font-size: .85rem; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Выдача денег игроку: подпись, поле и кнопка в одну строку. */
.player-cash { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.player-cash-label { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.player-cash-input { flex: 0 0 88px; width: 88px; padding: 8px 10px; font-size: .85rem; font-variant-numeric: tabular-nums; text-align: right; }
.player-cash-comment { flex: 1 1 auto; min-width: 0; padding: 8px 10px; font-size: .85rem; text-align: left; }

.player-progress-bar { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.player-progress-bar span { display: block; height: 100%; background: var(--accent); }
.player-progress p { font-size: .7rem; color: var(--muted-faint); margin-top: 5px; }
.player-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: .7rem; color: var(--muted-faint); }

.empty-card { text-align: center; padding: 40px 20px; }
.empty-card p { color: var(--muted); margin-top: 8px; }
.host-tools { display: flex; flex-direction: column; gap: 10px; }
.tool-form { margin: 0; }

/* Общие действия ведущего (дробление акций/бизнеса): свёрнутые секции. */
.tool-details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.tool-details > summary { cursor: pointer; list-style: none; padding: 11px 12px; font-size: .85rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.tool-details > summary::-webkit-details-marker { display: none; }
.tool-details > summary::before { content: "+"; width: 14px; text-align: center; color: var(--accent); font-weight: 700; }
.tool-details[open] > summary::before { content: "–"; }
.tool-details .tool-form { padding: 0 12px 12px; }
.tool-details .tool-form input,
.tool-details .tool-form select { padding: 9px 12px; font-size: .95rem; }
.tool-note { margin: 0; padding: 0 12px 12px; font-size: .78rem; color: var(--muted); }
.tool-details .tool-form.tool-split { display: flex; flex-direction: row; align-items: flex-end; flex-wrap: nowrap; gap: 12px; }
.tool-split .field { flex: 1 1 160px; }
.tool-split .btn { width: 15%; }/*flex: 0 0 auto; */
.tool-split .btn::after  { content: "\2714"; }
.split-ratio-wrap { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.split-ratio { display: flex; align-items: center; gap: 6px; }
.split-ratio input { width: 60px; min-width: 0; text-align: center; }
.split-colon { color: var(--muted); font-weight: 700; }

/* ---------- install ---------- */
.install { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.install-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; max-width: 560px; width: 100%; }
.install-eyebrow { font-size: .7rem; letter-spacing: .16em; color: var(--accent); font-weight: 700; }
.install-card h1 { margin: 8px 0 20px; }
.install-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.install-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; }
.install-list li.ok > span { color: var(--accent); }
.install-list li.fail > span { color: var(--danger); }
.install-list strong { display: block; font-weight: 550; }
.install-list em { display: block; font-size: .78rem; color: var(--danger); font-style: normal; }
.install-hint { margin-top: 18px; font-size: .84rem; color: var(--muted); }
.install-hint code { background: var(--bg); padding: 2px 6px; border-radius: 5px; font-size: .9em; }

.kpi-worth .kpi-value.is-positive { color: var(--accent); }
.badge-escaped { background: var(--accent-dim); color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-border) inset; }

/* «Чистый капитал» рядом с блоком про детей — на одной строке. */
.kpi-pair { display: flex; gap: 14px; }
.kpi-pair .kpi { flex: 1; min-width: 0; }

/* Заметки игрока внизу бланка: большое поле с автосохранением. */
.notes-card .notes-status { font-size: .72rem; color: var(--head-hint); font-variant-numeric: tabular-nums; font-weight: 500; }
.notes-card .notes-status.is-error { color: #ffd9d5; }
.notes-area { width: 100%; min-height: 150px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: .92rem; line-height: 1.5; resize: vertical; }
.notes-area:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); }

/* Журнал действий — список в карточке заметок и у ведущего. Видно ~4 строки,
   остальное прокручивается; строка не переносится, чтобы не ломать колонки. */
.notes-log { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.notes-log-title { margin: 0 0 8px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-faint); }
.notes-log-empty { margin: 0; font-size: .8rem; color: var(--muted-faint); }
.notes-log-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 9.4em; overflow-y: auto; padding-right: 2px; }
.notes-log-item { display: flex; align-items: baseline; gap: 8px; font-size: .82rem; line-height: 1.4; }
.notes-log-time { font-size: .72rem; color: var(--muted-faint); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.notes-log-tag { flex-shrink: 0; font-size: .7rem; font-weight: 700; color: var(--muted); }
.notes-log-tag.tag-log-purchase, .notes-log-tag.tag-log-transfer { color: var(--accent); }
.notes-log-tag.tag-log-sale, .notes-log-tag.tag-log-loan, .notes-log-tag.tag-log-gift, .notes-log-tag.tag-log-split { color: var(--accent); }
.notes-log-tag.tag-log-edit { color: var(--muted); }
.notes-log-tag.tag-log-pay { color: var(--danger); }
.notes-log-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.notes-log-amount { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.notes-log-more { margin: 6px 0 0; font-size: .72rem; color: var(--muted-faint); }

/* Блок про детей рядом с «Чистым капиталом»: плата за одного ребёнка
   и редактируемое количество детей. Пересчитывается в «Расходах (в месяц)». */
.kpi-kids { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kids-cost { min-width: 0; }
.kids-cost .kpi-value { font-size: 1.15rem; margin: 4px 0 0; }
.kids-count { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; }
.kids-count .kpi-label { margin: 0; }
.kids-input { width: 76px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; font-size: .95rem; font-variant-numeric: tabular-nums; text-align: right; }
.kids-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Модальное окно заявки ведущему на новый пункт бланка. */
.modal { border: 0; padding: 0; background: transparent; max-width: 420px; width: calc(100% - 32px); color: var(--text); position: fixed; inset: 0; margin: auto; max-height: calc(100% - 32px); overflow-y: auto; }
.modal::backdrop { background: rgba(16, 20, 24, .5); }
.modal-body { background: var(--surface); border-radius: 14px; padding: 20px; box-shadow: 0 18px 48px rgba(16, 20, 24, .22); display: flex; flex-direction: column; gap: 10px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 1.06rem; }
.modal-close { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-note { font-size: .8rem; color: var(--muted); line-height: 1.45; margin: 0; }
.modal-label { font-size: .74rem; color: var(--muted-faint); }
.modal-fields { display: flex; flex-direction: column; gap: 8px; }
.modal-fields:empty { display: none; }
.modal-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .88rem; }
.modal-input { flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; }
.modal-input[data-transfer-comment] { flex: 1 1 auto; min-width: 0; text-align: left; }
.modal-sum { width: 132px; flex-shrink: 0; text-align: right; font-size: 1.02rem; font-variant-numeric: tabular-nums; color: var(--text); }
/* Выбор типа недвижимости в заявке: подпись сверху, список на всю ширину. */
.modal-variant { display: block; }
.modal-variant .modal-caption { display: block; font-size: .88rem; }
.modal-select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; font-size: .88rem; }
.modal-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.modal-error { font-size: .8rem; color: var(--danger); margin: 0; }
.modal-error[hidden] { display: none; }
.modal-foot { display: flex; gap: 10px; margin-top: 4px; }
.modal-foot .btn { flex: 1; }
.modal-foot .btn:disabled { opacity: .6; cursor: default; }

/* Заявки и выданные пункты в карточке игрока у ведущего. */
.host-requests, .host-items { margin-top: 12px; padding: 11px 13px; border-radius: 10px; background: var(--surface-2); }
.host-requests-title { font-size: .72rem; color: var(--muted-faint); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 7px; }
.host-request { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--hairline); }
.host-request:last-child, .host-item:last-child { border-bottom: 0; }
.host-request-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.host-request-body strong { font-size: .88rem; font-weight: 600; }
.host-request-body span { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.host-request-actions { display: flex; gap: 6px; margin: 0; }
.host-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--hairline); font-size: .84rem; font-variant-numeric: tabular-nums; }

/* «Выдано»: в блоке видно два пункта, остальные прокручиваются; заголовок
   при прокрутке остаётся на месте. */
.host-items { max-height: 6.1rem; overflow-y: auto; }
.host-items .host-requests-title { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }

/* ---------- большой круг (fast track) ---------- */

/* Баннер большого круга: тёмная плашка вместо зелёной «свободы». */
.escape-banner.is-fast { background: var(--head-bg); border-bottom-color: var(--head-bg); color: var(--head-text); }

.badge-fast { background: #dce7f1; color: #2b5878; }
.badge-won { background: #f6e6b8; color: #7a5a00; box-shadow: 0 0 0 1px #e6cf86 inset; }

/* Раздел «Я купил свою мечту» на большом круге. */
.dream-card { border: 1px solid var(--accent-border); background: var(--escaped-bg); }
.dream-text { font-size: .92rem; font-weight: 600; color: var(--text); margin: 0 0 12px; }
.dream-status { font-size: .86rem; color: var(--muted); margin: 0; }
.dream-status.is-granted { color: var(--accent-text); font-weight: 600; }

/* Модальное окно поздравления: выход на большой круг / победа. */
.notice-modal .modal-body { text-align: center; }
.notice-modal .modal-head { justify-content: center; }
.notice-modal .notice-text { font-size: .95rem; line-height: 1.55; color: var(--text); margin: 0; }

/* Заявка на мечту в панели ведущего. */
.host-dream { border: 1px solid var(--accent-border); background: var(--escaped-bg); }

/* Ведущий: на ноутбуке/планшете четыре игрока в одну строку.
   На телефоне (≤760px) карточки складываются в столбик. */
@media (min-width: 761px) {
    .host .sheet-head { max-width: 1600px; }
    .host-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .auth-wrap { grid-template-columns: 1fr; gap: 28px; }
    .auth-hero h1 { font-size: 2.4rem; }
    .auth-points { display: none; }
    .row { flex-wrap: nowrap; }
    .row-label em { display: none; }
    .sheet-tools { gap: 2px; }
    .head-kpi { gap: 6px; }
    .head-kpi .kpi-label { font-size: .54rem; }
    .head-kpi .kpi-value { font-size: .88rem; }
    .identity-name { font-size: .9rem; }
    .identity-profession { font-size: .7rem; }
    .kpi-pair { flex-direction: column; }
    .modal-field { flex-wrap: wrap; }
    .modal-input { width: 100%; }
}

/* Комнаты: код для игроков и ключ ведущего */
.identity-room { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.room-keys { margin: 16px 0; display: grid; gap: 12px; }
.room-keys dt { font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.room-keys dd { margin: 0; }
.room-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.25rem; letter-spacing: .12em; color: var(--text); word-break: break-all; }
.room-code-inline { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; }

/* Нижняя строка бланка: название комнаты и кнопка выхода в одну строку */
.exit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.exit-room { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.exit-row .btn-exit { width: auto; flex: 0 0 auto; margin: 0; }

/* Комнаты без ведущего: имя и профессия в строку, строка аудитора, блок выбора */
.identity-line { display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.auditor-row { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); white-space: nowrap; }
.auditor-row .btn { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.auditor-card[hidden] { display: none; }
.auditor-form { padding: 0 12px 12px; display: grid; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .88rem; margin: 6px 0 12px; cursor: pointer; }
.check input { width: auto; margin: 0; }
[hidden] { display: none !important; }
/* Action link inside a row (e.g. salary request) */
.link-btn { background: none; border: 0; padding: 0 0 0 6px; font: inherit; font-size: .74rem; color: var(--accent); text-decoration: underline; cursor: pointer; white-space: nowrap; }
.link-btn:disabled { opacity: .5; cursor: default; }

/* Head colors by section: income/asset green, expense/liability red, requests olive */
.card[data-section="income"] > .card-head, .card[data-section="asset"] > .card-head { background: #066200; }
.card[data-section="expense"] > .card-head, .card[data-section="liability"] > .card-head { background: #600000; }
#ownRequests > .card-head { background: #768d00; }

/* Editable asset rows (stocks, business): name is clickable */
.row-editable > .row-label { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
