:root {
  --bg: #f5f2eb;
  --card: #fff;
  --card-soft: #faf6eb;
  --text: #2a2520;
  --muted: #746b5d;
  --border: #d8cfbd;
  --accent: #9a7020;
  --accent-dark: #745317;
  /* Палитра зон v13.0.48–51 (UI-COLOR-ZONES-01/02/03): канон v13.0.54. */
  --green: #2e7d32;
  --green-bg: #e8f5e9;
  --green-light: #1b5e20;
  --yellow: #f0d600;
  --yellow-bg: #fff7cc;
  --orange: #d85a1a;
  --orange-bg: #ffe7d8;
  --red: #c62828;
  --red-bg: #ffebee;
  --blue: #1565c0;
  --blue-bg: #e8f1fb;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(42, 37, 32, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.15; margin: 0 0 10px; }
a { color: var(--accent-dark); }
button, input { font: inherit; }
.page-shell { width: min(1220px, calc(100% - 24px)); margin: 0 auto; padding: 18px 0 36px; }
.app-header { border-bottom: 3px solid var(--accent); margin-bottom: 16px; padding: 10px 2px 16px; }
.app-header h1 { color: var(--accent); font-size: clamp(1.7rem, 3vw, 2.45rem); }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.prewrap { white-space: pre-wrap; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin: 14px 0; padding: 16px; }
.hero-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(135deg, #fff 0%, #fff8e8 100%); }
.ok-card { border-color: rgba(46, 125, 50, .35); background: var(--green-bg); }
.warn-card { border-color: rgba(212, 91, 0, .28); background: var(--orange-bg); }
.danger-card { border-color: rgba(184, 39, 39, .3); background: var(--red-bg); }
.event-card { border-color: rgba(212, 91, 0, .35); background: var(--orange-bg); }
.discovery-card { border-color: rgba(46, 125, 50, .3); background: #f6fbf3; }

.meta-line { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); }
.button-row, .link-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-soft); color: var(--text); cursor: pointer; text-decoration: none; font-weight: 750; }
.button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-dark); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover:not(:disabled) { color: #fff; background: var(--accent-dark); }
.button-secondary { background: #fff; }
.button-danger { background: var(--red-bg); border-color: rgba(184,39,39,.35); color: var(--red); }

.alert { border-radius: 12px; border: 1px solid var(--border); margin: 12px 0; padding: 12px 14px; font-weight: 650; }
.alert-success { background: var(--green-bg); border-color: rgba(46,125,50,.35); color: #1b5e20; }
.alert-warning { background: var(--yellow-bg); border-color: rgba(147,102,0,.3); color: var(--yellow); }
.alert-error, .alert-danger { background: var(--red-bg); border-color: rgba(184,39,39,.3); color: var(--red); }
.alert-info { background: var(--blue-bg); border-color: rgba(21,101,192,.25); color: var(--blue); }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: .78rem; font-weight: 850; white-space: nowrap; }
.badge-neutral { background: #efe8d8; color: #5b4b31; }
.badge-success { background: var(--green-bg); color: var(--green); }
.badge-warning { background: var(--yellow-bg); color: var(--yellow); }
.badge-info { background: var(--blue-bg); color: var(--blue); }
.zone { border-radius: 999px; padding: 3px 8px; font-weight: 800; }
.zone-green { background: var(--green-bg); color: var(--green); }
.zone-yellow { background: var(--yellow-bg); color: var(--yellow); }
.zone-orange { background: var(--orange-bg); color: var(--orange); }
.zone-red { background: var(--red-bg); color: var(--red); }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.metric-card { background: var(--card-soft); border: 1px solid #eadfcb; border-radius: 12px; padding: 12px; min-width: 0; }
.metric-label { color: var(--muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.metric-value { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 2.7vw, 1.9rem); font-weight: 850; margin-top: 4px; }
.metric-delta { font-weight: 850; margin-top: 3px; }
.delta-pos { color: var(--green); }
.delta-neg { color: var(--red); }
.delta-zero { color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #ece3d2; padding: 9px 8px; text-align: left; vertical-align: top; }
th { background: #fbf5e8; color: #4a3c28; font-weight: 850; }
.plain-list { padding-left: 20px; }
.empty-state { border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); padding: 14px; text-align: center; }

.stepper { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; list-style: none; padding: 0; counter-reset: step; }
.stepper li { background: #f3ecdd; border: 1px solid var(--border); border-radius: 12px; padding: 10px; font-weight: 800; }
.stepper li.active { background: var(--yellow-bg); border-color: rgba(154,112,32,.45); color: var(--accent-dark); }
.stepper li.done { background: var(--green-bg); border-color: rgba(46,125,50,.35); color: var(--green); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.team-card { border: 1px solid #eadfcb; border-radius: 14px; padding: 14px; background: #fffdf8; }
.team-card-head, .role-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.outcome-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }

.cost-grid, .final-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.final-stats > div, .cost-grid > div { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.final-stats span { display: block; color: var(--muted); font-size: .85rem; font-weight: 800; text-transform: uppercase; }
.final-card { border: 2px solid var(--accent); background: #fff9ec; }
.outcome-close { border-color: var(--red); background: var(--red-bg); }
.outcome-reform { border-color: var(--orange); background: var(--orange-bg); }
.outcome-success { border-color: var(--green); background: var(--green-bg); }

.role-section { scroll-margin-top: 12px; }
.action-list { display: grid; gap: 9px; }
.action-card { display: block; border: 2px solid #eadfcb; border-radius: 13px; background: #fffdf8; cursor: pointer; padding: 12px; transition: border-color .12s, background .12s, opacity .12s; }
.action-card input { margin-right: 8px; }
.action-card:hover:not(.disabled) { border-color: rgba(154,112,32,.55); }
.action-card.selected { border-color: var(--accent); background: #fff6de; }
.action-card.disabled { cursor: not-allowed; opacity: .62; }
.action-main { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.action-title { font-weight: 850; font-size: 1.03rem; }
.action-price { color: var(--accent-dark); font-weight: 850; white-space: nowrap; }
.action-desc, .action-effect, .action-note, .block-reason, .field-error { display: block; margin-top: 6px; }
.action-desc, .action-effect, .action-note { color: var(--muted); font-size: .94rem; }
.block-reason, .field-error { color: var(--red); font-weight: 800; font-size: .93rem; }
.submit-button { width: 100%; margin: 8px 0 20px; }

details { background: #fffdf8; border: 1px solid var(--border); border-radius: 12px; margin: 10px 0; overflow: hidden; }
summary { cursor: pointer; font-weight: 850; padding: 11px 13px; color: var(--accent-dark); }
details > :not(summary) { margin: 12px; }
.soft-block { border-top: 1px solid #eadfcb; padding: 10px 0; }

.screen-page .page-shell { width: calc(100% - 24px); max-width: 1920px; padding-top: 4px; }
.screen-page .app-header { display: none; }
/* TASK-SCREEN-40-UX: compact header — one line, no hero block */
.screen-header-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin: 0 0 4px; }
.screen-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.screen-conn { font-size: .72rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.screen-conn-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.screen-conn[data-state="online"] .screen-conn-dot { background: #28c864; }
.screen-conn[data-state="offline"] .screen-conn-dot { background: #e63c3c; }
.screen-conn[data-state="unknown"] .screen-conn-dot { background: #999; }
.screen-conn[data-state="online"]::after { content: ' онлайн'; }
.screen-conn[data-state="offline"]::after { content: ' оффлайн'; }
.screen-conn[data-state="unknown"]::after { content: ''; }
/* TASK-RATING-IMPLEMENT (F-032): compact rating sort control — fits existing header row */
.screen-sort-control { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: .72rem; color: var(--muted); }
.screen-sort-label { white-space: nowrap; }
.screen-sort-toggle { background: #fffdf8; border: 1px solid var(--border); border-radius: 10px; padding: 2px 8px; font-size: .72rem; color: var(--accent-dark); cursor: pointer; line-height: 1.25; white-space: nowrap; }
.screen-sort-toggle:hover { background: #fff6e0; }
.screen-sort-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.screen-final-line { padding: 4px 10px; font-size: .82rem; color: var(--muted); margin: 0 0 4px; }
/* TASK-SCREEN-40-UX: compact table — 1 Team = 1 row, ~40 rows visible */
.screen-table-wrap { margin: 0; overflow-x: auto; }
.screen-table { width: 100%; border-collapse: collapse; font-size: .78rem; table-layout: fixed; }
.screen-table thead th { position: sticky; top: 0; background: #f5f0e0; border-bottom: 2px solid var(--accent); padding: 4px 5px; text-align: left; white-space: nowrap; z-index: 1; font-size: .72rem; }
.screen-table thead th.st-sortable { cursor: pointer; user-select: none; }
.st-sort-mark { font-size: .62rem; color: var(--accent); margin-left: 3px; }
.screen-table tbody tr { border-bottom: 1px solid #e8e0d0; }
.screen-table tbody tr:nth-child(even) { background: rgba(245, 240, 224, .45); }
.screen-table tbody tr:hover { background: rgba(255, 249, 236, .35); }
.screen-table td { padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.st-col-stol { width: 38px; text-align: center; }
.st-col-team { width: 130px; }
.st-col-year { width: 56px; text-align: center; }
.st-col-money { width: 88px; text-align: right; }
.st-col-kpi { width: 56px; text-align: center; }
.st-col-status { width: 130px; font-size: .72rem; }
.st-money { font-weight: 700; }
.st-final-badge { font-size: .68rem; color: var(--muted); }
.st-kpi-val { font-weight: 600; }
/* TASK-SCREEN-40-UX: zone cell backgrounds — well-distinguishable, canonical semantics */
.screen-table .zone-green { background: rgba(40, 200, 100, .22); color: #1a5d2e; }
.screen-table .zone-yellow { background: rgba(255, 210, 50, .28); color: #6b5800; }
.screen-table .zone-orange { background: rgba(255, 150, 50, .28); color: #7a4200; }
.screen-table .zone-red { background: rgba(230, 60, 60, .28); color: #6b1212; }
.screen-table .zone-neutral { background: transparent; color: var(--muted); }
.event-line { color: var(--orange); font-weight: 850; }

@media (max-width: 720px) {
  .page-shell { width: min(100% - 16px, 760px); padding-top: 10px; }
  .hero-card, .team-card-head, .role-head { flex-direction: column; align-items: stretch; }
  .button-row .button, .link-row .button { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screen-grid { grid-template-columns: 1fr; }
  .screen-table { font-size: .7rem; }
  .st-col-team { width: 100px; }
  .st-col-status { width: 100px; }
  th, td { padding: 8px 7px; }
}

/* v0.11.1 reference-style team client */
.play-page .page-shell { max-width: 1240px; }
.play-page .messages { margin-bottom: 10px; }
.play-hdr { text-align: center; padding: 18px 0 12px; border-bottom: 3px solid var(--accent); margin-bottom: 16px; }
.play-hdr h1 { font-size: 2rem; color: var(--accent); letter-spacing: 1px; margin: 0; }
.play-hdr .sub { color: var(--muted); font-size: 1rem; margin-top: 4px; font-weight: 700; }
/* TASK-01a: постоянная идентификация «Стол N · Название» — читается мгновенно. */
.play-hdr .team-identity { color: var(--text); font-size: 1.25rem; margin-top: 6px; }
.play-hdr .team-rename { margin-top: 6px; font-size: .85rem; }
.play-hdr .team-rename summary { cursor: pointer; color: var(--muted); }
.play-hdr .team-rename-form { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.play-hdr .team-rename-form input { max-width: 260px; }
/* TASK-01a: экран первого входа (название команды). */
.register-page main { display: flex; align-items: center; justify-content: center; min-height: 70vh; }
/* TASK-01b2: passive-устройство — явный ненавязчивый баннер (не аварийная страница). */
.passive-banner { background: var(--yellow-bg, #fff7cc); border: 1px solid var(--yellow, #f0d600); border-radius: 10px; padding: 12px 16px; margin: 0 0 12px; font-weight: 700; }
.register-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 40px; max-width: 480px; margin: 0 auto; text-align: center; }
.register-eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 800; margin: 0 0 10px; }
.register-table { font-family: Georgia, "Times New Roman", serif; font-size: 3.2rem; font-weight: 800; color: var(--accent); letter-spacing: 2px; margin: 6px 0 22px; }
.register-form { display: flex; flex-direction: column; gap: 12px; }
.register-label { font-weight: 800; text-align: left; }
.register-form input { padding: 12px 14px; font-size: 1.1rem; }
.register-submit { font-size: 1.1rem; padding: 12px 20px; }
.register-hint { color: var(--muted); font-size: .85rem; margin: 16px 0 0; }
/* TASK-01a: host-переименование в карточке команды. */
.host-rename { margin-top: 8px; font-size: .85rem; }
.host-rename summary { cursor: pointer; color: var(--muted); }
.host-rename-form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.host-rename-form input { padding: 8px 10px; }
/* TASK-01b3a: таблица устройств в карточке команды + кнопка передачи управления. */
.host-devices { margin-top: 8px; font-size: .85rem; }
.host-devices summary { cursor: pointer; color: var(--muted); }
/* PPP-051: вертикальные device rows в карточке команды — всё внутри ширины
   team-card, без горизонтального скролла; никакой принудительной min-width. */
.device-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.device-row { border: 1px solid var(--border, #d5cfc0); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-size: .8rem; min-width: 0; }
.device-row-controller { border-color: var(--accent, #9a7020); background: var(--accentBg, #fdf6e3); }
.device-row-line1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.device-row .mono { font-family: ui-monospace, Consolas, monospace; }
/* PPP-051-F2: полный device ID в device row — моноширинно, переносится
   внутри ширины карточки (без ellipsis/nowrap и без горизонтального скролла). */
.device-id { overflow-wrap: anywhere; min-width: 0; }
.device-conn { font-weight: 700; flex-shrink: 0; }
.device-conn-online { color: #28c864; }
.device-conn-offline { color: #e63c3c; }
.device-row-line2 { display: flex; min-width: 0; }
.device-version { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted, #8a8070); }
.device-row-line3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; min-width: 0; }
.device-role-main { color: var(--accent, #9a7020); font-weight: 800; }
.device-role-spare { color: var(--muted, #8a8070); }
.device-transfer-form { margin: 0; }
.device-transfer-form .button-small { white-space: normal; }
.button-small { padding: 4px 10px; font-size: .78rem; }
/* TASK-01b3b1: recovery-страница запасного планшета + host-панель кода. */
.recovery-title { font-size: 1.35rem; color: var(--accent); margin: 0 0 6px; }
.recovery-page .register-form input[name="code"] { text-align: center; letter-spacing: 8px; font-family: ui-monospace, Consolas, monospace; }
.form-error { color: #b00020; font-weight: 700; margin: 0 0 8px; }
.host-recovery-create { margin-top: 8px; }
.host-recovery { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; }
.host-recovery .recovery-code { font-size: 1.6rem; font-weight: 800; letter-spacing: 4px; color: var(--accent); margin: 4px 0; }
.host-recovery .recovery-qr img { width: 140px; height: 140px; margin-top: 6px; }
/* TASK-01b3b2: replacement wizard в карточке команды. */
.host-recovery-actions { margin-top: 8px; gap: 6px; }
.replace-panel-actions { margin-top: 8px; gap: 6px; }
.replace-device-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .85rem; }
.replace-device-row:last-of-type { border-bottom: none; }
/* TASK-03b1: host rollback UI */
.rollback-panel { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; }
.rollback-preview { margin: 6px 0; }
.rollback-preview p { margin: 2px 0; }
.rollback-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rollback-actions { margin-top: 8px; gap: 6px; }
/* TASK-02b2: индикатор синхронизации черновика (ненавязчивый, без модалок). */
.draft-sync { font-size: .8rem; font-weight: 700; margin: 2px 0 0; color: var(--muted); }
.draft-sync[data-state="saving"], .draft-sync[data-state="reconnecting"] { color: var(--text); }
.draft-sync[data-state="saved"] { color: #2f5f34; }
.draft-sync[data-state="error"], .draft-sync[data-state="conflict"],
.draft-sync[data-state="conflict_kept_local"], .draft-sync[data-state="offline_unprotected"] { color: #b00020; }
.draft-sync[data-state="offline_saved"], .draft-sync[data-state="readonly"] { color: var(--muted); }
/* TASK-03P: постоянный индикатор связи с сервером (отдельно от draft status). */
.conn-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.conn-status .conn-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.conn-status[data-state="online"] { color: #2f5f34; }
.conn-status[data-state="online"] .conn-dot { background: #35a845; }
.conn-status[data-state="offline"] { color: #b00020; }
.conn-status[data-state="offline"] .conn-dot { background: #d93025; }
/* TASK-03P: waiting-карточка на checkpoint (полный отчёт остаётся выше). */
.checkpoint-wait-card { border: 1px dashed var(--border); }
.play-page .top { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 20px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 16px; box-shadow: var(--shadow); }
/* Верхний блок: заголовок, сумма и кредитная задолженность — каждый на своей строке,
   все три выровнены по одному левому краю (колонка, flex-start). */
.play-page .top .bal { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 1.6rem; font-weight: 700; font-family: Georgia, "Times New Roman", serif; }
.play-page .top .bal .bal-label { color: var(--text); }
/* UI-MONEY-ZONES-01 (v13.0.54): денежная плашка использует цветовой код зон индикаторов. */
.play-page .top .bal .money-status { display: inline-block; padding: 2px 9px; border-radius: 8px; border: 1px solid transparent; transition: color .2s, background-color .2s, border-color .2s; }
.play-page .top .bal .money-green { color: #2f5f34; background: #eaf5ec; border-color: #5b9460; }
.play-page .top .bal .money-yellow { color: #6f6200; background: #f8f0a8; border-color: #b5a21b; }
.play-page .top .bal .money-orange { color: #8a430a; background: #f8d0a3; border-color: #d97720; }
.play-page .top .bal .money-red { color: #7f252a; background: #f4c2c4; border-color: #c85055; }
.play-page .top .bal .loanDebt { display: inline-block; font-size: .95rem; font-weight: 700; color: var(--red); background: var(--red-bg); border: 1px solid rgba(198, 40, 40, .28); border-radius: 7px; padding: 2px 8px; }
.play-page .top .bal .loanDebtHint { font-size: .84rem; font-weight: 600; color: var(--muted); }
/* Правый блок всегда двухстрочный: «Год: N из 12» / «остановка после N». */
.play-page .top .yr { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--text2); font-size: 1.15rem; text-align: right; }
.play-page .top .yr strong { color: var(--text); font-size: 1.5rem; }
.play-page .top .yr .yr-stop { font-size: .95rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.play-page .warn { color: var(--red); font-size: 1rem; font-weight: 700; margin-top: 4px; min-height: 1.3em; }
.play-page .params { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.play-page .pc { background: var(--card); border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--border); position: relative; box-shadow: 0 1px 4px rgba(0,0,0,.05); transition: color .2s, background-color .2s, border-color .2s; }
.play-page .pc .nm { font-size: .85rem; color: inherit; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; font-weight: 600; }
.play-page .pc .vl { font-size: 1.8rem; font-weight: 700; font-family: Georgia, "Times New Roman", serif; }
.play-page .pc .tr { position: absolute; top: 14px; right: 14px; font-size: 1.1rem; }
/* UI-INDICATOR-ZONES-01/02/03 (v13.0.52–54): карточка целиком окрашивается по зоне,
   рамка 1px solid, полосы заполнения не возвращаются. */
.play-page .pc.zone-green { color: #2f5f34; background: #eaf5ec; border: 1px solid #5b9460; }
.play-page .pc.zone-yellow { color: #6f6200; background: #f8f0a8; border: 1px solid #b5a21b; }
.play-page .pc.zone-orange { color: #8a430a; background: #f8d0a3; border: 1px solid #d97720; }
.play-page .pc.zone-red { color: #7f252a; background: #f4c2c4; border: 1px solid #c85055; }
.play-page .sum { background: var(--accent-bg, #fdf6e3); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.play-page .sum h3 { font-size: 1.05rem; color: var(--accent); margin-bottom: 8px; }
.play-page .sum .ln { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 1rem; border-bottom: 1px solid var(--border); }
.play-page .sum .tot { font-weight: 700; font-size: 1.15rem; color: var(--accent); border-top: 2px solid var(--accent); margin-top: 5px; padding-top: 6px; }
.play-page .note { font-size: .9rem; color: var(--muted); line-height: 1.4; margin: 8px 0 0; }
.play-page .tabs { display: flex; gap: 4px; margin-bottom: 2px; flex-wrap: wrap; }
.play-page .tab { padding: 10px 16px; border-radius: var(--radius) var(--radius) 0 0; cursor: pointer; font-size: .95rem; font-weight: 700; border: 1px solid transparent; border-bottom: none; color: var(--text3); background: #f0ece3; transition: all .12s; position: relative; }
.play-page .tab:hover { color: var(--text); background: #e8e4d8; }
.play-page .tab.act { color: var(--text); border-color: var(--border); background: var(--card); z-index: 1; }
.play-page .tab.has::after { content: '✓'; position: absolute; top: -5px; right: -5px; background: var(--green); color: #fff; font-size: .7rem; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.play-page .ap { display: none; background: var(--card); border: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 16px; margin-bottom: 16px; min-height: 180px; box-shadow: var(--shadow); }
.play-page .ap.on { display: block; }
.play-page .sk { display: inline-block; padding: 8px 16px; margin-bottom: 10px; border-radius: 8px; border: 2px dashed var(--border); color: var(--muted); cursor: pointer; font-size: 1rem; background: #fff; }
.play-page .sk:hover { border-color: var(--accent); color: var(--text); }
.play-page .sk.act { border-color: var(--accent); background: #fdf6e3; color: var(--accent); font-weight: 700; }
.play-page .ai { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 8px; cursor: pointer; transition: all .12s; margin-bottom: 4px; border: 2px solid transparent; }
.play-page .ai:hover { background: rgba(154,112,32,.06); }
.play-page .ai.sel { border-color: var(--accent); background: #fdf6e3; }
.play-page .ai.lock { opacity: .42; cursor: not-allowed; }
.play-page .ai.done { background: #f7fbf2; border-color: rgba(46,125,50,.35); cursor: default; opacity: 1; }
.play-page .ai .inf { flex: 1; min-width: 0; }
.play-page .ai .an { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.play-page .ai .ac { color: var(--accent); font-weight: 700; font-size: .95rem; margin-top: 3px; }
.play-page .ai .nt { color: var(--muted); font-size: .9rem; margin-top: 5px; line-height: 1.4; }
.play-page .blockText, .play-page .field-error { color: var(--red); font-weight: 800; font-size: .9rem; margin-top: 6px; }
.play-page .doneText { color: var(--green); font-weight: 800; font-size: .9rem; margin-top: 6px; }
.play-page .gl { display: none; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.play-page .ai.sel .gl { display: flex; }
.play-page .gb { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); background: #f0ece3; color: var(--muted); cursor: pointer; font-size: .9rem; transition: all .12s; }
.play-page .gb:hover { border-color: var(--accent); }
.play-page .gb.act { background: #fdf6e3; border-color: var(--accent); color: var(--accent); font-weight: 700; }
.play-page .ctrls { display: flex; gap: 12px; margin-bottom: 16px; }
.play-page .btn { padding: 14px 28px; border-radius: var(--radius); border: none; cursor: pointer; font-size: 1.1rem; font-weight: 700; transition: all .12s; }
.play-page .btn1 { background: var(--accent); color: #fff; }
.play-page .btn1:hover:not(:disabled) { background: var(--accent-dark); }
.play-page .btn1:disabled { opacity: .4; cursor: not-allowed; }
.play-page .btn2 { background: var(--card); color: var(--muted); border: 2px solid var(--border); }
.play-page .btn2:hover { border-color: var(--accent); }
.play-page .compact-choice table th { width: 45%; }

@media (max-width: 768px) {
  .play-page .top { align-items: flex-start; flex-direction: column; }
  .play-page .params { grid-template-columns: repeat(2, 1fr); }
  .play-page .tab { padding: 7px 10px; font-size: .85rem; }
  .play-page .ctrls { flex-direction: column; }
  .play-page .ctrls .btn { width: 100%; }
  .play-page .sum .ln { align-items: flex-start; flex-direction: column; gap: 2px; }
}

/* v0.12: independent cycle host & team state matrix */
.checkpoint-card { border: 2px solid var(--accent, #9a7020); }
/* TASK-HOST-40 (F-006/F-035): top summary dashboard — compact one-line */
.host-summary-card { padding: 8px 14px; }
.host-summary-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .92rem; }
.host-summary-row .hs-item { white-space: nowrap; }
.host-summary-row .hs-item b { font-size: 1.05rem; }
.host-summary-row .hs-dot { font-size: .7rem; }
.host-summary-row .hs-online { color: #28c864; }
.host-summary-row .hs-offline { color: #e63c3c; }
/* TASK-HOST-40-QA: GLOBAL connection dot colors — apply everywhere (summary + card header).
   Root cause fix: previously .hs-online/.hs-offline were scoped to .host-summary-row
   only, so the card header dot never changed color on live update. */
.conn-dot { font-size: .72rem; display: inline-block; }
.conn-online { color: #28c864; }
.conn-offline { color: #e63c3c; }
/* TASK-HOST-40: card sort control */
.host-sort-control { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 12px; }
.host-sort-btn { background: #fffdf8; border: 1px solid var(--border, #d5cfc0); border-radius: 10px; padding: 3px 10px; font-size: .78rem; color: var(--accent-dark, #6a5a20); cursor: pointer; }
.host-sort-btn:hover { background: #fff6e0; }
.host-sort-btn.host-sort-active { background: var(--accent, #9a7020); color: #fff; border-color: var(--accent, #9a7020); }
/* TASK-HOST-40-QA: card structure — header dot, progress, action rows, disclosures */
.team-card { display: flex; flex-direction: column; gap: 6px; }
.team-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.team-card-head .conn-dot { flex-shrink: 0; }
.team-progress { margin: 0; }
.team-event { margin: 0; color: var(--muted, #8a8070); }
.team-final { margin: 0; }
/* TASK-HOST-40-QA §9: shared action button style — all secondary, same height/radius/font */
.host-action-row { display: flex; gap: 6px; flex-wrap: wrap; }
.host-action-btn { flex: 0 0 auto; }
/* TASK-HOST-40-QA §11: two identical disclosures */
.host-disclosure { margin-top: 4px; font-size: .85rem; }
.host-disclosure summary { cursor: pointer; color: var(--muted, #8a8070); padding: 4px 0; }
.host-settings-content { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.host-rollback-section { padding-top: 8px; border-top: 1px solid var(--border, #d5cfc0); }
/* TASK-EVENT-SCENARIO-START-GATE: pre-start HOST setup + TEAM waiting */
.host-setup-card { padding: 10px 14px; }
.host-setup-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.host-setup-form select { padding: 4px 8px; border: 1px solid var(--border, #d5cfc0); border-radius: 8px; font-size: .88rem; }
.host-seed-row { display: inline-flex; gap: 4px; align-items: center; margin-left: 8px; }
.host-seed-row input { padding: 4px 8px; border: 1px solid var(--border, #d5cfc0); border-radius: 8px; font-size: .82rem; width: 140px; }
.pre-start-card { text-align: center; padding: 24px 14px; }
.pre-start-card h2 { margin-bottom: 8px; }
.checkpoint-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 10px 0; }
.checkpoint-key { color: var(--text3, #8a8070); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.checkpoint-val { font-size: 1.05rem; margin-top: 4px; }
.checkpoint-note { background: var(--accentBg, #fdf6e3); border: 1px solid var(--border, #d5cfc0); border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-weight: 600; }
.checkpoint-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.checkpoint-actions select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border, #d5cfc0); background: #fff; font-size: .95rem; }
.checkpoint-wait-card { border: 2px solid var(--accent, #9a7020); background: var(--accentBg, #fdf6e3); }
.checkpoint-wait-card h2 { color: var(--accent, #9a7020); }
.final-card .final-hero { padding: 14px 16px; border-radius: 12px; background: var(--accentBg, #fdf6e3); border: 1px solid var(--border, #d5cfc0); margin-bottom: 12px; }
.final-card .final-hero h3 { font-family: Georgia, "Times New Roman", serif; color: var(--accent, #9a7020); margin-bottom: 6px; }
@media (max-width: 768px) { .checkpoint-grid { grid-template-columns: 1fr; } }

/* v0.12.1: year confirmation modal (reference-style) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.modal { position: fixed; inset: 0; background: rgba(42,37,32,.55); display: none; align-items: flex-start; justify-content: center; z-index: 9999; padding: 24px 20px; overflow-y: auto; }
.modal.on { display: flex; }
.modalBox { background: #fff; border-radius: 16px; border: 2px solid #9a7020; max-width: 760px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modalHead { background: #fdf6e3; padding: 14px 18px; border-bottom: 1px solid #d5cfc0; border-radius: 14px 14px 0 0; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modalHead h3 { font-family: Georgia, "Times New Roman", serif; color: #9a7020; font-size: 1.1rem; margin: 0; }
.modalClose { border: none; background: transparent; font-size: 1.7rem; line-height: 1; cursor: pointer; color: #8a8070; }
.modalBody { padding: 16px 18px; color: #2a2520; }
.modalFoot { padding: 0 18px 16px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-note { font-size: .88rem; color: #8a8070; margin: 10px 0 0; }
.confirm-table { width: 100%; border-collapse: collapse; font-size: .94rem; margin-bottom: 12px; }
.confirm-table th { background: #fdf6e3; color: #2a2520; text-align: left; padding: 7px 8px; border: 1px solid #d5cfc0; font-weight: 700; }
.confirm-table th.col-money, .confirm-table td.col-money { text-align: right; white-space: nowrap; }
.confirm-table td { padding: 6px 8px; border: 1px solid #e8e4d8; vertical-align: top; }
.confirm-table td.col-role { color: #5a5040; font-weight: 600; white-space: nowrap; }
.confirm-table tr.skip td { color: #8a8070; }
.confirm-table tr.skip td.col-money { font-style: italic; }
.confirm-totals { display: flex; flex-direction: column; gap: 4px; border-top: 2px solid #9a7020; padding-top: 10px; }
.confirm-totals div { display: flex; justify-content: space-between; font-size: .98rem; }
.confirm-totals div.balance { font-weight: 700; font-size: 1.08rem; color: #9a7020; border-top: 1px solid #d5cfc0; margin-top: 4px; padding-top: 6px; }
.confirm-totals .neg { color: #c62828; }
.confirm-totals .pos { color: #2e7d32; }
@media (max-width: 600px) { .confirm-table { font-size: .86rem; } .modalFoot { flex-direction: column-reverse; } .modalFoot .btn { width: 100%; } }

/* v0.13 stage 5: play-page design-token alignment with reference (scoped). */
.play-page { --radius: 10px; --text2: #5a5040; --text3: #8a8070; }
.play-page .page-shell { max-width: 1240px; padding-left: 20px; padding-right: 20px; }
.play-page .top { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.play-page .pc { box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.play-page .sum { box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.play-page .ap { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

/* v0.13 stage 1: event modal (separate from year-confirmation modal) */
.play-page .modal.eventNegative .modalBox { border-color: var(--orange, #d45b00); }
.play-page .modal.eventNegative .modalHead { background: var(--orange-bg, #fff0dd); }
.play-page .modal.eventNegative .modalHead h3 { color: var(--orange, #d45b00); }
.play-page .modal.eventPositive .modalBox { border-color: var(--green, #2e7d32); }
.play-page .modal.eventPositive .modalHead { background: var(--green-bg, #e8f5e9); }
.play-page .modal.eventPositive .modalHead h3 { color: var(--green, #2e7d32); }
.play-page .modal .modalBody { max-height: none; overflow-y: visible; }
.play-page .eventStoryBlock { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border, #d8cfbd); background: #fff; }
.play-page .eventStoryBlock h4 { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; color: var(--accent, #9a7020); margin: 0 0 6px; }
.play-page .eventStoryBlock p { margin: 4px 0; color: var(--text, #2a2520); line-height: 1.55; }
.play-page .eventStoryBlock ul { margin: 4px 0; padding-left: 20px; }
.play-page .eventStoryBlock ul li { line-height: 1.5; }
.play-page .eventReadyOk { border-color: rgba(46,125,50,.35); background: var(--green-bg, #e8f5e9); }
.play-page .eventReadyBad { border-color: rgba(184,39,39,.28); background: var(--red-bg, #ffebee); }
.play-page .eventShield { margin-top: 8px; font-weight: 700; color: var(--green, #2e7d32); }
.play-page .modal .modalBody .pos { color: var(--green, #2e7d32); font-weight: 700; }
.play-page .modal .modalBody .neg { color: var(--red, #b82727); font-weight: 700; }
@media (max-width: 768px) { .play-page .modal { padding: 12px; } }

/* v0.13 stage 2: unified team-year report blocks (shared by play inline + /report/) */
.report-page { --radius: 10px; }
.report-page .page-shell { max-width: 1100px; }
.rpt-inline-card { border: 1px solid var(--border); background: var(--card); }
.rpt-inline-title { font-size: 1.25rem; color: var(--accent-dark); margin: 0 0 10px; }
.rpt-next-title { font-size: 1.3rem; color: var(--accent); margin: 18px 0 8px; }
.rpt-divider { border: none; border-top: 3px solid var(--accent); margin: 18px 0 8px; }
.rpt-report-link { margin: 10px 0 0; }
.rpt-root { font-size: .97rem; }
.rpt-year-title { font-family: Georgia, "Times New Roman", serif; color: var(--muted); margin: 0 0 8px; font-size: 1rem; font-weight: 700; }
.rpt-fold { background: #fffdf8; border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; overflow: hidden; }
.rpt-fold > summary { cursor: pointer; list-style: none; padding: 11px 14px; font-weight: 800; color: var(--accent-dark); font-family: Georgia, "Times New Roman", serif; font-size: 1.02rem; }
.rpt-fold > summary::-webkit-details-marker { display: none; }
.rpt-fold > summary::after { content: '▾'; float: right; color: var(--accent); }
.rpt-fold:not([open]) > summary::after { content: '▸'; }
.rpt-fold-body { padding: 6px 14px 12px; }
.rpt-fold[open] > summary { background: #fbf5e8; border-bottom: 1px solid var(--border); }
.rpt-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.rpt-table th { background: #fbf5e8; text-align: left; padding: 7px 8px; border: 1px solid var(--border); font-weight: 700; }
.rpt-table td { padding: 6px 8px; border: 1px solid #ece3d2; vertical-align: top; }
.rpt-table tr.rpt-total td, .rpt-table tr.rpt-total th { font-weight: 800; border-top: 2px solid var(--accent); background: #fff9ec; }
.rpt-event.eventNegative > summary { color: var(--orange); }
.rpt-event.eventPositive > summary { color: var(--green); }
.rpt-event[open] > summary { border-left: 4px solid var(--orange); }
/* v0.13.2 GAP-014: permanent event report block (reference eventReport, always visible, not <details>) */
.eventReport { background: var(--orange-bg); border: 2px solid var(--orange); border-radius: 10px; padding: 14px; margin: 10px 0; }
.eventReport > h4 { font-family: Georgia, "Times New Roman", serif; color: var(--orange); font-size: 1.05rem; margin: 0 0 6px; }
.eventReport.eventPositive { background: var(--green-bg); border-color: var(--green); }
.eventReport.eventPositive > h4 { color: var(--green); }
.rpt-event.eventPositive[open] > summary { border-left-color: var(--green); }
/* v13.0.54: канонические блоки события/насыщения/риска + уведомление о замене карточек. */
.eventStoryBlock { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.eventStoryBlock h4 { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; color: var(--accent-dark); margin: 0 0 6px; }
.eventStoryBlock p { margin: 4px 0; color: var(--text); line-height: 1.55; }
.eventStoryBlock ul { margin: 4px 0; padding-left: 20px; }
.eventNarrative p { margin: 0 0 10px; color: var(--text); line-height: 1.55; }
.eventNarrative p:last-child { margin-bottom: 0; }
.eventMitigationResult { margin-top: 6px; font-weight: 700; }
.cardSwapAlert { background: #fff3cd; border: 4px solid #ff9800; border-radius: 14px; padding: 16px 18px; margin: 0 0 14px; box-shadow: 0 3px 10px rgba(230, 81, 0, .18); color: #5d3500; }
.cardSwapAlertTitle { font-family: Georgia, "Times New Roman", serif; font-size: 1.18rem; font-weight: 900; color: #b33a00; margin-bottom: 6px; letter-spacing: .02em; }
.cardSwapAlertText { font-size: 1.08rem; line-height: 1.45; font-weight: 800; }
.finance-note-row .note { font-size: .9rem; color: var(--muted); line-height: 1.4; }
.rpt-story-block { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.rpt-story-block h4 { font-family: Georgia, "Times New Roman", serif; font-size: .98rem; color: var(--accent-dark); margin: 0 0 5px; }
.rpt-story-block p { margin: 4px 0; line-height: 1.5; }
.rpt-story-block ul { margin: 4px 0; padding-left: 20px; }
.rpt-ready-ok { border-color: rgba(46,125,50,.35); background: var(--green-bg); }
.rpt-ready-bad { border-color: rgba(184,39,39,.28); background: var(--red-bg); }
.rpt-shield { margin-top: 6px; font-weight: 700; color: var(--green); }
.rpt-side { margin-top: 10px; padding: 8px 10px; background: var(--blue-bg); border-radius: 8px; border: 1px solid rgba(21,101,192,.18); }
.rpt-side h4 { margin: 0 0 4px; color: var(--blue); font-size: .92rem; }
.rpt-final-body { padding-top: 4px; }
.rpt-final-hero { padding: 12px 14px; border-radius: 10px; background: var(--accentBg, #fdf6e3); border: 1px solid var(--border); margin-bottom: 10px; }
.rpt-final-hero h4 { font-family: Georgia, "Times New Roman", serif; color: var(--accent); font-size: 1.1rem; margin-bottom: 4px; }
.rpt-history-year { background: #fffdf8; border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; padding: 0; overflow: hidden; }
.rpt-history-year > summary { cursor: pointer; padding: 11px 14px; font-weight: 800; color: var(--accent-dark); font-family: Georgia, "Times New Roman", serif; }
.rpt-history-year[open] > summary { background: #fbf5e8; border-bottom: 1px solid var(--border); }
.rpt-history-year .rpt-root { padding: 12px 14px; }
.rpt-fold-body .delta-pos, .rpt-table .delta-pos, .rpt-fold-body .pos { color: var(--green); font-weight: 700; }
.rpt-fold-body .delta-neg, .rpt-table .delta-neg, .rpt-fold-body .neg { color: var(--red); font-weight: 700; }
.rpt-fold-body .delta-zero { color: var(--muted); }
@media (max-width: 720px) {
  .rpt-table { font-size: .85rem; }
  .report-page .page-shell { width: min(100% - 16px, 760px); }
}

/* v0.13 stage 3: history table + charts (local SVG) */
.hi-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.05); margin: 14px 0; padding: 16px; }
.hi-card > h3 { font-family: Georgia, "Times New Roman", serif; color: var(--accent-dark); font-size: 1.05rem; margin: 0 0 10px; }
.hi-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ht { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 640px; }
.ht th { background: #fbf5e8; color: #4a3c28; text-align: right; padding: 7px 8px; border-bottom: 2px solid var(--border); font-weight: 700; white-space: normal; }
.ht th:first-child, .ht td.n { text-align: left; }
.ht th .hi-th-sub { display: block; font-size: .78em; font-weight: 400; color: var(--muted); }
.ht td { text-align: right; padding: 6px 8px; border-bottom: 1px solid #ece3d2; white-space: nowrap; }
.ht td.n { color: var(--text); font-weight: 700; }
.ht td.pos { color: var(--green); font-weight: 700; }
.ht td.neg { color: var(--red); font-weight: 700; }
.ht td.zero { color: var(--muted); }
.chartControls { display: flex; justify-content: center; margin: 12px 0; }
.chartControls .btn { padding: 10px 18px; }
.chartPanel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 14px 0 4px; }
.chartPanel[hidden] { display: none; }
.chartPanel h3 { font-family: Georgia, "Times New Roman", serif; color: var(--accent-dark); font-size: 1.05rem; margin: 0 0 4px; }
.chartHint { font-size: .88rem; color: var(--muted); margin: 0 0 12px; }
.chartGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.miniChart { border: 1px solid #ece3d2; border-radius: 10px; padding: 12px; background: #fff; min-width: 0; }
.miniChartTitle { font-weight: 700; color: var(--text); font-size: 1rem; margin-bottom: 2px; }
.miniChartSub { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.miniChart svg { width: 100%; height: auto; display: block; }
.miniChart .axis { stroke: #d8d1c1; stroke-width: 1; }
.miniChart .grid { stroke: #eee8dc; stroke-width: 1; }
.miniChart .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.miniChart .dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.miniChart text { font-family: system-ui, -apple-system, sans-serif; fill: var(--muted); font-size: 11px; }
.miniChart .yval { fill: var(--text2, #5a5040); }
.miniChart .lastVal { fill: var(--accent); font-weight: 700; }
.chartEmpty { color: var(--muted); padding: 12px 0; text-align: center; }
@media (max-width: 768px) {
  .chartGrid { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .ht { font-size: .82rem; }
  .miniChart { padding: 10px; }
}

/* v0.13 stage 4: QR panel on play */
.qr-panel { background: #fff; border: 2px solid #6a1b9a; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.06); padding: 18px; margin: 14px 0; }
.qr-panel h3 { font-family: Georgia, "Times New Roman", serif; color: #6a1b9a; font-size: 1.15rem; margin: 0 0 6px; }
.qr-intro { color: var(--muted); font-size: .95rem; line-height: 1.4; margin: 0 0 12px; }
.qr-grid { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 16px; align-items: start; }
.qr-box { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.qr-box img { max-width: 100%; width: 280px; height: auto; }
.qr-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.qr-side .qr-btn, .qr-side .qr-link { min-height: 42px; }
.qr-origin-label { font-size: .85rem; color: var(--muted); font-weight: 700; margin-top: 6px; }
.qr-origin-input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; width: 100%; max-width: 320px; }
.qr-status { font-size: .9rem; color: var(--green); font-weight: 700; min-height: 1.2em; }
.qr-warn { background: var(--orange-bg); border: 1px solid rgba(212,91,0,.35); color: var(--orange); border-radius: 8px; padding: 8px 10px; font-size: .9rem; font-weight: 600; }

/* v0.13 stage 4: mobile read-only report */
.mobile-report-page { background: var(--bg); }
.mobile-report-page .page-shell { max-width: 560px; width: min(100% - 16px, 560px); padding: 12px 0 28px; }
.mbl-hdr { text-align: center; padding: 14px 0 10px; border-bottom: 3px solid var(--accent); margin-bottom: 12px; }
.mbl-hdr h1 { font-size: 1.5rem; color: var(--accent); letter-spacing: 1px; margin: 0; }
.mbl-sub { color: var(--muted); font-size: 1rem; margin-top: 4px; font-weight: 700; }
.mbl-hero { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(135deg,#fff,#fff8e8); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.mbl-hero-card { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mbl-hero-card .mbl-k { grid-column: 1 / -1; }
.mbl-hero-card { }
.mbl-k { color: var(--muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.mbl-v { font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; font-weight: 800; }
.mbl-hero-small { font-size: .9rem; color: var(--muted); }
.mbl-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.mbl-pc { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.mbl-pc-nm { font-size: .8rem; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.mbl-pc-vl { font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; font-weight: 800; }
.mbl-pc-dl { font-size: .95rem; font-weight: 800; margin-top: 2px; }
.mbl-event { border-radius: 12px; padding: 14px; margin-bottom: 12px; border: 2px solid var(--orange); background: var(--orange-bg); }
.mbl-event.eventPositive { border-color: var(--green); background: var(--green-bg); }
.mbl-event h2 { font-size: 1.1rem; margin-bottom: 6px; }
.mbl-event.eventNegative h2 { color: var(--orange); }
.mbl-event.eventPositive h2 { color: var(--green); }
.mbl-ready-ok { color: var(--green); font-weight: 700; }
.mbl-ready-bad { color: var(--red); font-weight: 700; }
.mbl-ev-list { padding-left: 20px; margin: 6px 0; }
.mbl-shield { font-weight: 700; color: var(--green); }
.mbl-errors { background: var(--red-bg); border-radius: 10px; padding: 10px; color: var(--red); margin-bottom: 10px; }
.mbl-fold { background: #fffdf8; border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; overflow: hidden; }
.mbl-fold > summary { cursor: pointer; padding: 12px; font-weight: 800; color: var(--accent-dark); font-family: Georgia, "Times New Roman", serif; min-height: 44px; box-sizing: border-box; list-style: none; }
.mbl-fold > summary::-webkit-details-marker { display: none; }
.mbl-fold > summary::after { content: '▸'; float: right; }
.mbl-fold[open] > summary::after { content: '▾'; }
.mbl-fold > :not(summary) { padding: 4px 12px 12px; }
.mbl-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mbl-table th { text-align: left; padding: 7px 6px; border-bottom: 1px solid #ece3d2; font-weight: 700; background: #fbf5e8; }
.mbl-table td { padding: 6px; border-bottom: 1px solid #ece3d2; vertical-align: top; }
.mbl-table tr.mbl-total td, .mbl-table tr.mbl-total th { font-weight: 800; border-top: 2px solid var(--accent); background: #fff9ec; }
.mbl-table .delta-pos, .mbl-table .pos { color: var(--green); font-weight: 700; }
.mbl-table .delta-neg, .mbl-table .neg { color: var(--red); font-weight: 700; }
.mbl-final { background: var(--accentBg, #fdf6e3); border: 2px solid var(--accent); border-radius: 12px; padding: 16px; margin: 12px 0; }
/* PPP-042B1 (v0.25.17): MOB-001 card-swap alert — canonical participant alert. */
.mobile-report-page .cardSwapAlert { background: #fff3cd; border: 4px solid #ff9800; border-radius: 14px; padding: 16px 18px; margin: 0 0 14px; box-shadow: 0 3px 10px rgba(230, 81, 0, .18); color: #5d3500; }
.mobile-report-page .cardSwapAlertTitle { font-family: Georgia, "Times New Roman", serif; font-size: 1.18rem; font-weight: 900; color: #b33a00; margin-bottom: 6px; letter-spacing: .02em; }
.mobile-report-page .cardSwapAlertText { font-size: 1.08rem; line-height: 1.45; font-weight: 800; }
/* PPP-042B1 (v0.25.17): MOB-002/003 primary status section (canonical mobileSection look). */
.mbl-status { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0, 0, 0, .05); }
.mbl-status h2 { font-size: 1.12rem; color: var(--blue); margin: 0 0 8px; }
.mbl-status-row { padding: 7px 0; border-bottom: 1px solid #ece3d2; }
.mbl-status-row:last-child { border-bottom: none; }
.mbl-status-k { font-weight: 800; font-size: .95rem; }
.mbl-status-v { color: var(--text2, #5a544a); font-size: .95rem; line-height: 1.45; margin-top: 2px; }
/* PPP-042B1 (v0.25.17): MOB-012 money values never break internally. */
.mbl-v, .mbl-money, .mbl-pc-vl, .mbl-pc-dl { white-space: nowrap; }
/* PPP-042B2 (v0.25.18): MOB-005/008/011 unified effects matrix. */
.mbl-matrix { font-size: .84rem; min-width: 480px; }
.mbl-matrix th { font-size: .78rem; vertical-align: bottom; }
.mbl-matrix td { vertical-align: top; }
.mbl-matrix .mbl-src { min-width: 132px; font-weight: 600; }
.mbl-matrix .mbl-total .mbl-src { font-weight: 800; }
.mbl-fs-sub { display: block; font-size: .92em; }
.mbl-matrix .mbl-money { white-space: normal; min-width: 150px; }
.mbl-mx-sub td { color: var(--text2, #5a544a); font-size: .82rem; background: #fbf5e8; }
/* PPP-042B3 (v0.25.19): MOB-014 canonical final panel (reference finalHtml). */
.mbl-final-panel .mbl-final-hero { background: #fff9ec; border: 1px solid rgba(154, 112, 32, .35); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.mbl-final-panel .mbl-final-hero h2 { color: var(--accent); font-size: 1.25rem; margin: 0 0 6px; }
.mbl-final-panel .mbl-final-hero p { margin: 0; font-size: .95rem; line-height: 1.45; }
.mbl-final-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mbl-final-card { flex: 1 1 100px; min-width: 96px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; text-align: center; }
.mbl-fk { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.mbl-fv { font-size: 1.15rem; font-weight: 800; white-space: nowrap; }
.mbl-final-table td { font-size: .9rem; }
.mbl-final-table .mbl-money { font-weight: 700; }
.mbl-zone { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.mbl-zone-green { background: var(--green-bg); color: var(--green-light); }
.mbl-zone-yellow { background: var(--yellow-bg); color: var(--accent-dark); }
.mbl-zone-orange { background: var(--orange-bg); color: var(--orange); }
.mbl-zone-red { background: var(--red-bg); color: var(--red); }
.mbl-final-rules { margin: 12px 0 0; font-size: .85rem; line-height: 1.45; color: var(--text2, #5a544a); }
/* MOB-014 (v0.25.19): narrow screens — the zone column must fit without clipping
   (no table min-width; badges/money shrink instead). Local scroll stays available
   in .table-wrap as a last resort, matching reference mobileScroll semantics. */
@media (max-width: 430px) {
  .mbl-final-table td { font-size: .8rem; padding: 5px 2px; }
  .mbl-final-table th { padding: 6px 2px; }
  .mbl-final-table td.mbl-money { font-size: .72rem; }
  .mbl-final-table .mbl-zone { padding: 2px 5px; font-size: .66rem; }
}
.mbl-final h2 { color: var(--accent); font-size: 1.2rem; margin-bottom: 6px; }
.mbl-readonly { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 16px; }
@media (max-width: 600px) { .qr-grid { grid-template-columns: 1fr; } .qr-box img { width: 260px; } }
@media (max-width: 400px) { .mbl-v { font-size: 1.4rem; } .mbl-pc-vl { font-size: 1.3rem; } }

/* v0.13.2 pass-3: reference-faithful annual report (single blue container + wide effects matrix) */
.calc { background: var(--card); border-radius: 10px; padding: 18px; margin: 14px 0; border: 2px solid var(--blue); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.calc > h3 { font-family: Georgia, "Times New Roman", serif; color: var(--blue); font-size: 1.15rem; margin: 0 0 10px; }
.calc-body > :last-child { margin-bottom: 0; }
.ct { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: 10px; background: #fff; }
.ct th { background: var(--blue-bg); color: var(--text); text-align: right; padding: 7px 8px; border: 1px solid var(--border); font-weight: 700; }
.ct th:first-child, .ct td:first-child { text-align: left; }
.ct td { padding: 6px 8px; border: 1px solid #e8e4d8; text-align: right; vertical-align: top; }
.ct tr.total td, .ct tr.total th { font-weight: 700; border-top: 2px solid var(--blue); background: #f7fbff; }
.ct .delta-pos, .ct .pos { color: var(--green); font-weight: 700; }
.ct .delta-neg, .ct .neg { color: var(--red); font-weight: 700; }
.ct .delta-zero, .ct .zero { color: var(--muted); }
.calcFold { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin: 12px 0; overflow: hidden; }
.calcFold > summary { cursor: pointer; list-style: none; padding: 12px 14px; font-weight: 800; color: var(--blue); font-family: Georgia, "Times New Roman", serif; background: var(--blue-bg); font-size: 1.02rem; }
.calcFold > summary::-webkit-details-marker { display: none; }
.calcFold > summary::after { content: '▾'; float: right; color: var(--blue); font-family: system-ui, sans-serif; }
.calcFold:not([open]) > summary::after { content: '▸'; }
.calcFold .foldBody { padding: 12px 12px 2px; }
.calcFold .foldBody .table-wrap { overflow-x: auto; }
/* PPP-062 (port of accepted reference v14.1.0 .mobileScroll semantics):
   native touch momentum for annual report table scrollers — team inline /
   standalone report .calcFold folds and mobile REPORT .mbl folds.
   History .hi-wrap already carries it; SCREEN .screen-table-wrap untouched. */
.calcFold .foldBody .table-wrap,
.mbl-fold .table-wrap { -webkit-overflow-scrolling: touch; }
.rpt-report-link { margin: 8px 0 0; }
.rpt-report-link .button { font-size: .88rem; padding: 6px 12px; min-height: 36px; }
.dp.doneResearch { background: #f7fbf2; border: 1px solid rgba(46,125,50,.3); border-radius: 10px; padding: 14px 16px; margin: 14px 0; }
.dp.doneResearch > h3 { font-family: Georgia, "Times New Roman", serif; color: var(--green); font-size: 1.05rem; margin: 0 0 8px; }
.dp.doneResearch .doneBlock { padding: 10px 0; border-top: 1px solid rgba(46,125,50,.25); }
.dp.doneResearch .doneBlock:first-of-type { border-top: none; padding-top: 0; }
.dp.doneResearch .doneTitle { font-weight: 700; color: #1b5e20; font-size: .98rem; margin-bottom: 4px; }
.dp.doneResearch .doneText { white-space: pre-wrap; line-height: 1.5; color: var(--text2, #5a5040); }

/* F-040 HOTFIX: ensure [hidden] always hides, even when display is set */
[hidden] { display: none !important; }

/* F-040 HOTFIX TEAM-CALL-HOST UX v2: compact call-host at bottom of TEAM page */
.call-host-bottom { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border, #e0d8c8); }
.call-host-btn {
  font-size: .82rem; padding: 5px 16px; min-height: 34px; border-radius: 8px;
  border: 1px solid var(--border, #ccc); background: var(--bg2, #f5f0e8); color: var(--muted, #888);
  cursor: pointer; font-weight: 600; transition: background .15s, color .15s;
}
.call-host-btn:hover:not(:disabled) { background: var(--accentBg, #fdf6e3); color: var(--accent-dark, #7a5c00); border-color: var(--accent, #d4a72c); }
.call-host-btn:disabled { opacity: .5; cursor: default; }
.call-host-active { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--accent-dark, #7a5c00); }
.call-host-active .call-host-bell { font-size: .95rem; }
.call-host-active .call-host-sub { font-size: .72rem; font-weight: 400; color: var(--muted, #999); }

/* F-040 HOTFIX HOST call zone — separate alerts above team grid */
.host-call-zone { margin-bottom: 16px; }
.host-call-alert {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff3e0; border: 2px solid #ff9800; border-radius: 10px;
  padding: 10px 16px; margin-bottom: 8px; font-weight: 700; font-size: .95rem;
  color: #e65100;
}
.host-call-alert:last-child { margin-bottom: 0; }
.host-call-alert .host-call-info { display: flex; align-items: center; gap: 8px; }
.host-call-alert .host-call-bell { font-size: 1.2rem; }
.host-call-dismiss {
  font-size: .82rem; padding: 4px 14px; min-height: 30px; border-radius: 6px;
  border: 1px solid #e65100; background: #fff; color: #e65100; cursor: pointer; font-weight: 700;
  white-space: nowrap;
}
.host-call-dismiss:hover { background: #e65100; color: #fff; }
