:root {
  color-scheme: dark;
  --text: #f0f5f3;
  --subtle: #c3d2cd;
  --muted: #a0b3ac;
  --surface: #111a19;
  --canvas: #0a1211;
  --line: #263632;
  --line-strong: #354942;
  --accent: #46ce94;
  --accent-dark: #a1efd0;
  --accent-soft: #15372c;
  --accent-line: #28604a;
  --green: #6be3ad;
  --green-soft: #17382d;
  --amber: #ffc46a;
  --amber-soft: #362d1c;
  --office-hover: #1a2824;
  --office-field: #101a17;
  --radius: 12px;
  --sidebar: 226px;
  --header: 59px;
}
input, select, textarea { background-color: var(--office-field); }
input:hover, select:hover, textarea:hover { border-color: var(--accent-line); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.sidebar {
  background: #0d1714;
  padding: 15px 13px;
  gap: 12px;
  overflow-y: auto;
}
.sidebar .brand { margin: 0 0 4px 4px; }
.brand-symbol {
  width: 36px; height: 36px; border-radius: 9px;
  color: #d4ffe9; background: linear-gradient(145deg, #236c52, #153128);
  border: 1px solid #31825f; box-shadow: none;
}
.brand-symbol svg { width: 30px; height: 30px; }
.brand strong { letter-spacing: .025em; }
.brand small { letter-spacing: .18em; }
.sidebar nav[aria-label="Основные разделы"] { gap: 3px; }
.nav-item { min-height: 43px; border-radius: 8px; }
.nav-item.active { outline: 1px solid #20543e; outline-offset: -1px; }
.sidebar-access { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.sidebar-access .button { justify-content: start; width: 100%; }
.scope-picker {
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 9px;
  position: relative; min-width: 0;
}
.scope-picker > summary {
  min-height: 39px; padding: 7px 9px;
  display: flex; align-items: center; gap: 7px;
  color: var(--text); font-weight: 650; font-size: .85rem; list-style: none;
}
.scope-picker > summary::-webkit-details-marker { display: none; }
.scope-picker > summary span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-picker > summary svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--accent); }
.scope-options {
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 5px; max-height: 54vh; overflow-y: auto;
  display: grid; gap: 3px;
}
.scope-family { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; display: grid; gap: 2px; }
.scope-heading { padding: 4px 6px 0; color: var(--muted); }
.button.scope-option { width: 100%; min-height: 34px; text-align: left; justify-content: start; padding: 5px 7px; white-space: normal; border-radius: 6px; color: var(--text); background: transparent; font-size: .81rem; }
.button.scope-option:hover, .button.scope-option.is-current { background: var(--accent-soft); color: var(--accent-dark); }
.button.scope-member { padding-left: 18px; }
.button.scope-settings { margin-top: 4px; border-top: 1px solid var(--line); }
.topbar { background: #0d1714; padding-inline: clamp(15px, 2.1vw, 33px); }
.top-context { display: flex; min-width: 0; align-items: center; gap: 10px; color: var(--text); }
.top-context span { color: var(--muted); }
.readonly-tag { border: 1px solid var(--line-strong); border-radius: 30px; padding: 2px 9px; color: var(--accent-dark); white-space: nowrap; }
.page { max-width: 1800px; padding: 22px clamp(15px, 2.1vw, 33px) 68px; }
.page-intro { margin-bottom: 13px; }
.page-intro h1 { font-size: clamp(1.6rem, 2.25vw, 2.15rem); letter-spacing: -.035em; }
.panel { box-shadow: none; margin-bottom: 12px; }
.panel-heading { min-height: 50px; padding: 10px 14px; }
.panel-heading h2 { font-size: 1.05rem; }
.panel-empty { padding: 0 14px 14px; color: var(--muted); font-size: .875rem; }
.notice, .notice-text, .next-step { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.dialog-heading, dialog, .mobile-nav, .device-switch, .auth-card, .locked-card { background: var(--surface); color: var(--text); }
dialog { border-color: var(--line-strong); }
.dialog-heading .icon-button:hover, .icon-button:hover, .row-button:hover, .operations-table tbody tr:hover { background: var(--office-hover); }
th, .dropzone { background: var(--office-field); }
.dropzone { border-color: var(--accent-line); }
.dropzone.dragover { background: var(--accent-soft); }
.text-button, .link-button, a { color: var(--accent-dark); }
.warning-text, .form-error { color: var(--amber); }
.button.primary { background: #14643e; color: #f5fffb; border-color: #2b8e62; }
.button.primary:hover { background: #1c7049; }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.button.quiet { color: var(--subtle); }
.button.quiet:hover { color: var(--accent-dark); background: var(--office-hover); }
.tag-review { background: var(--amber-soft); color: var(--amber); }
.tag-npd, .credit { background: var(--green-soft); color: var(--green); }
.bar-track, .coverage-track { background: #24352f; }
.capital-metrics { display: grid; grid-template-columns: 1.45fr repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.capital-metric {
  display: flex; align-items: flex-start; gap: 9px; width: 100%; min-width: 0; min-height: 85px;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--text); text-align: left;
}
.capital-metric:hover { border-color: var(--accent-line); background: var(--office-hover); }
.capital-metric.capital-primary {
  background: radial-gradient(ellipse at 95% 110%, #206047, transparent 66%), linear-gradient(150deg, #153a2e, #10241d 70%);
  border-color: #2d7355;
}
.capital-value { display: grid; gap: 3px; min-width: 0; font-variant-numeric: tabular-nums; }
.capital-value > span { color: var(--muted); font-size: .86rem; }
.capital-value > strong { font-size: clamp(.94rem, 1.36vw, 1.47rem); line-height: 1.15; font-weight: 690; overflow-wrap: anywhere; }
.capital-primary .capital-value > strong { font-size: clamp(1.15rem, 1.75vw, 1.85rem); }
.capital-value small { color: var(--accent-dark); font-size: .72rem; }
.capital-icon { width: 31px; height: 31px; border-radius: 9px; flex: 0 0 31px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); }
.capital-icon svg { width: 19px; height: 19px; }
.capital-tabs, .capital-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.capital-tabs { margin: 0 0 12px; }
.capital-tools { padding: 0 14px 10px; }
.capital-tools select, .capital-currency { width: auto; min-width: 90px; max-width: 100%; }
.office-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 224px); gap: 12px; align-items: start; }
.office-content, .office-aside { min-width: 0; }
.office-aside:empty { display: none; }
.office-dashboard:not(:has(.office-aside > *)) { grid-template-columns: minmax(0, 1fr); }
.office-split { gap: 10px; grid-template-columns: 1.08fr 1fr; }
.office-bottom { grid-template-columns: 1.25fr 1fr; }
.office-actions { display: grid; gap: 6px; padding: 0 11px 11px; }
.office-actions .button { justify-content: flex-start; text-align: left; padding: 6px 8px; border: 1px solid var(--line); background: #15201c; }
.flow-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 0 11px 11px; }
.flow-metrics .metric, .office-actions .metric { padding: 7px 8px; min-height: 0; box-shadow: none; border-radius: 8px; }
.flow-metrics .metric-top, .office-actions .metric-top { display: none; }
.flow-metrics .metric strong, .office-actions .metric strong { font-size: .96rem; }
.flow-metrics .metric-title, .office-actions .metric-title { font-size: .79rem; }
.capital-allocation { display: grid; grid-template-columns: minmax(68px, 114px) minmax(0, 1fr); gap: 12px; align-items: center; padding: 0 13px 13px; }
.capital-donut { border-radius: 50%; aspect-ratio: 1; background: conic-gradient(var(--segments)); display: grid; place-items: center; }
.capital-donut span { border-radius: 50%; background: var(--surface); width: 70%; height: 70%; display: grid; place-items: center; color: var(--muted); }
.capital-donut svg { width: 27px; height: 27px; }
.capital-legend { display: grid; }
.capital-legend button { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; gap: 6px; align-items: center; text-align: start; border: 0; background: transparent; padding: 5px 3px; border-radius: 6px; font-size: .78rem; }
.capital-legend button:hover { background: var(--office-hover); }
.capital-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--series); }
.capital-legend small { color: var(--muted); }
.capital-legend strong { font-variant-numeric: tabular-nums; text-align: end; }
.capital-members { display: grid; gap: 6px; padding: 0 12px 12px; }
.capital-member, .capital-ledger-row, .office-recent button {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 9px; align-items: center; text-align: start;
  min-width: 0; width: 100%; border: 0; border-radius: 8px; padding: 8px; background: #17221e;
}
.capital-member:hover, .capital-ledger-row:hover, .office-recent button:hover { background: var(--office-hover); }
.capital-member small, .capital-ledger-row small, .office-recent small, .key-asset small { display: block; color: var(--muted); font-size: .76rem; }
.capital-member > svg, .capital-ledger-row > svg { width: 14px; height: 14px; color: var(--muted); }
.capital-member b, .capital-ledger-row > strong { font-variant-numeric: tabular-nums; text-align: right; }
.key-assets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
.key-asset { min-width: 0; overflow: hidden; padding: 0; display: grid; text-align: start; border-radius: 9px; border: 1px solid var(--line); background: #141f1c; }
.key-asset:hover { border-color: var(--accent-line); }
.key-asset .capital-icon { margin: 9px 9px 0; }
.key-asset img { display: block; width: 100%; height: 68px; object-fit: cover; }
.key-asset > span:last-child { padding: 7px 9px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.office-recent { padding: 0 10px 10px; }
.office-recent button { grid-template-columns: 39px auto minmax(0, 1fr) auto; background: transparent; min-height: 38px; padding-block: 4px; }
.office-recent button + button { border-top: 1px solid var(--line); border-radius: 0; }
.office-recent .row-symbol { width: 25px; height: 25px; }
.office-recent .row-symbol svg { width: 15px; height: 15px; }
.office-recent strong, .office-recent b { font-size: .83rem; overflow-wrap: anywhere; }
.capital-ledger-group { padding: 0 13px 10px; }
.capital-ledger-group header { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 3px; border-bottom: 1px solid var(--line); }
.capital-ledger-group h3 { font-size: .94rem; margin: 0; }
.capital-ledger-row { min-height: 48px; background: transparent; }
.capital-ledger-row + .capital-ledger-row { border-top: 1px solid var(--line); border-radius: 0; }
.scope-mobile { display: none; }
@container finance (max-width: 1260px) {
  .office-dashboard { grid-template-columns: minmax(0, 1fr); }
  .office-aside { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
}
@container finance (max-width: 1040px) { .capital-metric .capital-icon { display: none; } }
@container finance (max-width: 870px) {
  .capital-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capital-primary { grid-column: 1 / -1; }
  .capital-metric { min-height: 65px; }
  .office-split, .office-bottom, .office-aside { grid-template-columns: minmax(0, 1fr); }
}
@container finance (max-width: 720px) {
  .scope-mobile, body[data-local-preview] .mobile-brand { display: block; }
  .mobile-brand { flex: 1 1 0; min-width: 0; }
  .top-actions { flex: 0 0 auto; }
  .scope-picker > summary { min-height: 35px; }
  .scope-mobile .scope-options { position: absolute; top: 100%; left: 0; width: min(78vw, 276px); border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: 0 10px 25px #0007; }
  .topbar { padding-inline: 10px; gap: 8px; }
  body[data-local-preview] .topbar { margin-top: 41px; padding-left: 10px; justify-content: space-between; }
  .page { padding: 14px 11px calc(112px + env(safe-area-inset-bottom)); }
  .page-intro { flex-wrap: wrap; }
  .page-intro .actions { flex-shrink: 1; }
  .key-assets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .office-recent button { gap: 6px; }
}
@container finance (max-width: 380px) {
  .scope-picker > summary { font-size: .77rem; padding-inline: 5px; gap: 3px; }
  .top-actions .period-button { max-width: 115px; }
  .capital-allocation { grid-template-columns: 64px minmax(0, 1fr); }
}

.capital-filter-total { margin: 0 13px 7px; padding-block: 6px; color: var(--muted); }
.capital-filter-total strong { margin-left: 8px; color: var(--text); }

.capital-record-photo { margin: 0 0 12px; overflow: hidden; border-radius: 10px; }
.capital-record-photo img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: var(--office-field); }
.metric { background: var(--surface); color: var(--text); }
.metric:hover { border-color: var(--accent-line); }
.chip:not(.tag-npd, .tag-personal, .tag-business, .tag-split, .tag-review, .tag-refund),
.tab:not(.active) span { background: var(--office-hover); color: var(--subtle); }
.notice-icon { background: var(--accent-soft); }
.bar-track span, .coverage-track > div { background: #53b688; }
.expense-bar:nth-child(2) .bar-track span { background: #66a8db; }
.expense-bar:nth-child(3) .bar-track span { background: #c7ae73; }
.expense-bar:nth-child(n+4) .bar-track span { background: #9c90ce; }

.capital-member > span:nth-child(2) { min-width: 0; }
.capital-member > span:nth-child(2) strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.top-actions .year-picker { width: 83px; min-width: 70px; padding: 5px 22px 5px 8px; background-position: right 6px center; }
@container finance (max-width: 480px) {
  .top-actions .period-button { width: 32px; }
  .top-actions .period-button span { display: none; }
  .mobile-nav .nav-item { font-size: .62rem; }
}

.capital-ledger-group summary { display:flex; justify-content:space-between; cursor:pointer; font-size:.95rem; font-weight:650; color:var(--text); padding:10px 3px; border-bottom:1px solid var(--line); gap:10px; }
.capital-ledger-group summary small { margin-left:8px; color:var(--muted); }
@container finance (max-width: 350px) { .mobile-nav .nav-item { font-size:.59rem; } }

.asset-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.asset-lookup { margin-top: 8px; }
.asset-value { grid-template-columns: minmax(0, 1fr) minmax(75px, 115px); }
.asset-import { position: relative; cursor: pointer; }
.asset-import:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.asset-import input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.asset-disclosure summary small {
  display: inline-block;
  margin-inline-start: 8px;
  color: var(--muted);
  font-weight: 400;
}
[data-asset-egrn-status] { display: block; padding-top: 4px; }
[data-asset-egrn-status]:empty, [data-asset-share-status]:empty, [data-asset-vehicle-status]:empty { display: none; }

.transfer-route { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-block: 4px; }
