/* Object totals: explicit scope, receipts remain a separate non-additive note. */
.object-debt-summary h3 { margin: 0 0 16px; font-size: 18px; }
.object-debt-lines { margin: 0; max-width: 760px; }
.object-debt-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.object-debt-line dt { min-width: 0; overflow-wrap: anywhere; }
.object-debt-line dd { margin: 0; flex-shrink: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.object-debt-line.total { font-weight: 650; border-bottom: 0; }
.object-debt-review { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.object-debt-review strong { color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.object-debt-review p { margin: 6px 0 0; max-width: 78ch; color: var(--muted); line-height: 1.6; }
.object-debt-secondary, .obj-tenant-review { color: var(--muted); font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.obj-tenant-review { margin-top: 10px; }
.obj-tenant.moved { opacity: 1; }
.object-grid .object-owed .muted { white-space: normal; overflow: visible; text-overflow: clip; }
.obj-tenant-foot { flex-wrap: wrap; }
.obj-tenant-foot .pill { white-space: normal; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
  .object-debt-line { flex-wrap: wrap; gap: 4px 12px; }
  .object-debt-line dd { margin-left: auto; }
  .object-debt-review { padding: 12px; }
}

/* Shared workspace finish. Local assets, semantic money colours, quiet motion. */
:root, :root[data-theme="light"] {
  --bg: #f3f2ee;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --surface-3: #ecebe6;
  --line: #d9d8d1;
  --line-soft: #e9e8e2;
  --text: #24282d;
  --muted: #62686f;
  --accent: #84601e;
  --on-accent: #ffffff;
  --accent-soft: #f3ecde;
  --accent-line: #cdb788;
  --glass: #f3f2ee;
  --glass-strong: #ffffff;
  --shadow: 0 1px 3px rgb(28 31 35 / .04);
  --shadow-lift: 0 6px 18px rgb(28 31 35 / .08);
  --radius: 14px;
  --radius-sm: 8px;
  --t-body: 14px;
  --t-small: 12px;
  --t-base: 15px;
  --glow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101315;
    --surface: #191d21;
    --surface-2: #20252b;
    --surface-3: #2b3139;
    --line: #3a414a;
    --line-soft: #2a3037;
    --text: #f1f0eb;
    --muted: #a9b1ba;
    --accent: #d2b072;
    --on-accent: #1b1710;
    --accent-soft: #302a20;
    --accent-line: #786443;
    --glass: #101315;
    --glass-strong: #191d21;
    --shadow: 0 1px 3px rgb(0 0 0 / .12);
    --shadow-lift: 0 8px 22px rgb(0 0 0 / .18);
    --glow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #101315;
  --surface: #191d21;
  --surface-2: #20252b;
  --surface-3: #2b3139;
  --line: #3a414a;
  --line-soft: #2a3037;
  --text: #f1f0eb;
  --muted: #a9b1ba;
  --accent: #d2b072;
  --on-accent: #1b1710;
  --accent-soft: #302a20;
  --accent-line: #786443;
  --glass: #101315;
  --glass-strong: #191d21;
  --shadow: 0 1px 3px rgb(0 0 0 / .12);
  --shadow-lift: 0 8px 22px rgb(0 0 0 / .18);
  --glow: none;
}
body { background: var(--bg); }
body.lease-builder-page, body.link-page { padding-left: 0; }
body.link-page .savebar, body.link-page .progress { left: 0; }
body.link-page .toast { left: 50%; }
.topbar { background: var(--bg); border-bottom-color: var(--line-soft); box-shadow: none; }
.page-context { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.page-title, .dash-hero-title, .tenant-hero h2, .an-card h3,
.calc-overview-intro h2, .documents-overview-intro h2 {
  font-family: inherit;
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.2;
}
.page-title { font-size: clamp(22px, 2vw, 29px); }
.page-hint { line-height: 1.45; margin-top: 5px; font-size: 13px; }
/* Meter deadlines belong to the operational screens, not every work area.
   Document-specific blockers and debt verification labels remain in their panels. */
body[data-view="analytics"] .topbar .steps,
body[data-view="analytics"] .topbar .deadlines,
body[data-view="analytics"] .topbar .warnings,
body[data-view="premises"] .topbar .steps,
body[data-view="premises"] .topbar .deadlines,
body[data-view="premises"] .topbar .warnings,
body[data-view="matrix"] .topbar .warnings,
body[data-view="primary"] .topbar .deadlines,
body[data-view="primary"] .topbar .warnings { display: none; }
.dash-hero-title { font-size: 28px; }
.tenant-hero h2 { font-size: clamp(24px, 2.4vw, 34px); }
.obj-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.an-card h3 { font-size: 19px; }
.calc-overview-intro h2, .documents-overview-intro h2 { font-size: 22px; }
.hero-stat .cap, .tenant-kpi .cap, .an-kpi .cap, .topay-tile .cap,
.prem-tile .cap, .calc-overview-metric .cap, .documents-overview-metric .cap {
  font-size: 11px;
  letter-spacing: .055em;
  line-height: 1.35;
}
.hero-stat .note, .tenant-kpi .note, .an-kpi .note, .prem-tile .note,
.calc-overview-metric .note, .documents-overview-metric .note { font-size: 12px; line-height: 1.5; }
.hero-stat .val, .tenant-kpi .val, .an-kpi .val, .topay-tile .val,
.prem-tile .val { font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.rail {
  --text: #f1f0eb;
  --muted: #b1b8c0;
  --surface: #191d21;
  --surface-2: #242a31;
  --line: #3a414a;
  --line-soft: #2d333b;
  --accent: #d2b072;
  --accent-soft: #2c2820;
  --on-accent: #1b1710;
  background: #14181c;
  border-right-color: #2a3037;
}
.rail .brand-name { color: var(--text); }
.rail .brand-sub { color: var(--accent); }
.rail button { color: var(--muted); font-weight: 500; }
.rail button.active { color: var(--text); background: var(--surface-2); box-shadow: none; }
.rail button.active::before { background: var(--accent); }
.rail-label { color: #939da8; }
.rail-tool { border-color: var(--line) !important; }
.rail-badge { color: #1b1710; }
.toolbar, .segmented, .card, .sheet-card, .object-card, .board-group,
.tenant-block, .obj-block, .doc-group, .topay-card, .tariff-card, .an-card,
.calc-steps, .total-card, .dash-card, .dash-cycle { box-shadow: var(--shadow); }
.toolbar { padding: 8px; gap: 8px; border-color: var(--line-soft); }
.toolbar input[type="search"] { min-height: 40px; border-color: var(--line); background: var(--surface); }
.toolbar select, .toolbar button, .toolbar .button-link { min-height: 40px; }
input, select, textarea { border-color: var(--line); border-radius: 8px; }
button, .button-link { transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
button.primary, .button-link.primary { box-shadow: none; font-weight: 650; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.segmented { border: 1px solid var(--line-soft); box-shadow: none; }
.segmented button.active, .tenant-nav button.active { box-shadow: none; }
.chip.active { box-shadow: none; }
.doc-main { flex: 1 1 auto; }
.doc-side { flex: 0 0 auto; }
.doc, .issued-row { padding-top: 14px; padding-bottom: 14px; }
.doc-meta, .doc-fact { line-height: 1.5; }
.board-group-head { font-size: 13px; letter-spacing: .03em; text-transform: none; }
.board-row { padding-top: 15px; padding-bottom: 15px; }
.board-name { font-weight: 650; }
.board-meta, .board-sub { line-height: 1.45; }
.board-reasons span { border-radius: 5px; line-height: 1.5; }
.board-money { min-width: 0; }
.board-money .trust { white-space: normal; text-align: right; line-height: 1.45; max-width: 340px; }
.board-row:hover, .file-row:hover, .doc:hover, .issued-row:hover { transform: none; box-shadow: none; background: var(--surface-2); }
.dash-hero-intro { min-height: 105px; padding: 18px 22px; }
.hero-stat { min-height: 120px; padding: 18px; }
.dash-cycle-mark { width: 32px; height: 32px; border-width: 1px; }
.dash-cycle-step:hover .dash-cycle-mark { transform: none; }
.dash-cycle-copy b { font-size: 12px; }
.dash-cycle-copy small { font-size: 11px; }
.tenant-hero .hero-kicker, .obj-kicker { font-size: 11px; letter-spacing: .1em; }
.tenant-hero .trust { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.tenant-hero .hero-actions > button, .tenant-hero .hero-actions .button-link { min-height: 42px; }
.sheet-head { background: var(--surface); border-bottom: 1px solid var(--line-soft); padding: 20px; }
.sheet-head .name { font-size: 20px; letter-spacing: -.025em; }
.sheet-head .where { line-height: 1.5; }
.sheet-close { min-width: 40px; min-height: 40px; }
.sheet-block { border-color: var(--line-soft); }
.access-tabs { padding: 4px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-2); gap: 4px; }
.access-tabs button { min-height: 44px; padding: 8px; color: var(--muted); background: transparent; border-radius: 7px; }
.access-tabs button.active { color: var(--on-accent); background: var(--accent); }
.access-user { flex-wrap: wrap; }
.file-row .filename, .doc-title, .issued-row .filename { overflow-wrap: anywhere; line-height: 1.45; }
.topay-title { line-height: 1.4; }
.topay-sum, .sheet-money { font-variant-numeric: tabular-nums; }
.an-row { align-items: start; gap: 16px; }
.an-row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.an-row > :last-child { flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; }
.view:not([hidden]) { animation: workspace-fade .16s ease-out both; }
@keyframes workspace-fade { from { opacity: .5; } to { opacity: 1; } }
@media (min-width: 900px) {
  .topbar-row { min-height: 92px; padding-top: 16px; padding-bottom: 16px; }
  .rail button { min-height: 44px; }
  .page-head { min-width: 0; }
}
@media (max-width: 899px) {
  .topbar-row .icon-btn, .topbar-row .search-btn, .topbar-row .avatar { width: 40px; min-width: 40px; height: 40px; }
  .topbar-row .search-btn span, .topbar-row .search-btn kbd { display: none; }
  .tabbar { background: var(--surface); box-shadow: 0 -1px 0 var(--line-soft); backdrop-filter: none; }
  .tabbar button { min-height: 52px; }
  .page-title { font-size: 22px; }
}
@media (min-width: 641px) and (max-width: 1180px) {
  .obj-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .obj-kpis .tenant-kpi:nth-child(-n + 3) { grid-column: span 2; }
  .obj-kpis .tenant-kpi:nth-child(n + 4) { grid-column: span 3; }
}
@media (max-width: 640px) {
  .builder-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder-steps button, .builder-steps button.is-current { font-size: 12px; }
  .toolbar { padding: 8px; border-radius: 12px; }
  .toolbar input, .toolbar select, .toolbar button, .toolbar .button-link { min-height: 44px; }
  .chips { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; gap: 6px; }
  .chips .chip { flex: 1 1 auto; min-height: 40px; padding: 7px 10px; font-size: 12px; }
  #board-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; gap: 6px; }
  #board-chips > * { flex: 1 1 auto; min-height: 40px; }
  .doc { flex-wrap: wrap; gap: 10px; }
  .doc > .kind { flex: 0 0 38px; }
  .doc-main { flex: 1 1 calc(100% - 60px); }
  .doc-side { margin-left: 48px; align-items: flex-start; text-align: left; white-space: normal; }
  .board-row { padding: 14px; }
  .board-money .trust { text-align: left; max-width: 100%; }
  .hero-stat { min-height: 104px; padding: 14px; }
  .hero-stat .val { font-size: 23px; }
  .obj-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .obj-kpis .tenant-kpi:last-child, .prem-tiles .prem-tile:last-child:nth-child(5) { grid-column: 1 / -1; }
  .dash-hero-intro { min-height: 0; padding: 15px; }
  .dash-hero-title { font-size: 23px; }
  .tenant-hero h2 { white-space: normal; overflow: visible; text-overflow: clip; font-size: 22px; }
  .tenant-hero .hero-actions .button-link { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
  .calc-overview-intro h2, .documents-overview-intro h2 { font-size: 18px; }
  .an-row { gap: 10px; }
  .an-row > :last-child { max-width: 100%; text-align: left; overflow-wrap: anywhere; white-space: normal; }
  .sheet-head { padding: 15px; }
  .sheet-head .name { font-size: 18px; }
  .sheet-card { border-radius: 16px 16px 0 0; }
}
@media (max-width: 360px) {
  .topbar-row .period { font-size: 11.5px; padding-left: 8px; padding-right: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .view:not([hidden]) { animation: none; }
  button, .button-link { transition: none; }
}
