/* Operational layout contract. Uses existing tokens; never derives financial state. */
.dialog-card, .sheet-card { max-height: calc(var(--dialog-viewport-height, 100vh) - 32px); overflow-y: auto; overscroll-behavior: contain; }
.dialog-card { min-width: 0; }
.dialog-text { overflow-wrap: anywhere; line-height: 1.45; }
.dialog-form .field > span { font-size: 13px; letter-spacing: 0; text-transform: none; }
.dialog-form :is(input,select,textarea), .dialog-input { font-size: 16px; min-height: 44px; width: 100%; min-width: 0; }
.dialog-form { display: flex; flex-direction: column; overflow: hidden; }
.dialog-fields { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px; margin-inline: -4px; }
.dialog-form > :not(.dialog-fields) { flex-shrink: 0; }
.dialog-acts { padding-block: 12px 4px; background: var(--surface); flex-wrap: wrap; }
.dialog-acts > button, .sheet-close { min-height: 44px; min-width: 44px; }
.field-error { color: var(--danger); font-size: 13px; line-height: 1.5; margin: 0; }
.dialog-card [aria-invalid=true] { border-color: var(--danger); }
.dialog-discard { padding: 12px; margin-block: 12px; background: var(--warn-soft); color: var(--text); border: 1px solid var(--warn); border-radius: 10px; }
.dialog-discard p { margin: 0 0 12px; }
.dialog-discard .dialog-acts { position: static; background: transparent; padding: 0; }
input:is([type=date],[type=month],[type=datetime-local],[type=time])::-webkit-calendar-picker-indicator { filter: none; opacity: .85; }
html { scrollbar-gutter: stable; }
::selection { background: var(--accent-soft); color: var(--text); }
input, textarea { caret-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
button, .button-link { font-size: 14px; line-height: 1.4; }
button:disabled { cursor: not-allowed; }
.page-context { display: none; }
.topbar-row { min-height: 88px; padding-block: 16px; }
.page-title { font-size: 26px; line-height: 1.25; }
.page-sub { line-height: 1.5; }
.rail .brand { box-shadow: none; }
.rail button.active::before { box-shadow: none; }
.rail-label { font-size: 12px; letter-spacing: .06em; }
main.wrap { padding-top: 20px; }
.tenant-hero, .obj-hero { box-shadow: var(--shadow); }
.tenant-hero .hero-main { padding: 20px 24px; }
.tenant-hero h2 { font-size: 24px; line-height: 1.3; margin-block: 8px 12px; }
.tenant-hero .hero-side { padding: 20px; }
.tenant-hero .hero-actions > button, .tenant-hero .hero-actions .button-link { min-height: 44px; font-size: 14px; }
.tenant-hero .hero-more-actions > button { white-space: normal; overflow-wrap: anywhere; }
.tenant-kpis { overflow: hidden; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); gap: 0; }
html .tenant-kpis .tenant-kpi { border-radius: 0; box-shadow: none; border: 0; border-right: 1px solid var(--line-soft); padding: 16px 18px; }
.tenant-kpis .tenant-kpi:last-child { border-right: 0; }
.tenant-kpi .cap { font-size: 12px; line-height: 1.45; }
.tenant-kpi .note { font-size: 12px; line-height: 1.5; }
.tenant-nav { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: none; padding: 4px; }
.tenant-nav-item { font-size: 14px; min-height: 44px; padding: 10px 12px; }
.tenant-block-head h3 { font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 650; }
.tenant-block-head { gap: 12px; align-items: baseline; }
.tenant-block-head > .muted { font-size: 12px; }
.tenant-block { padding: 20px; }
.tenant-col.side .tenant-block { background: var(--surface); }
.tenant-block .deadline { grid-template-columns: 104px minmax(0, 1fr); gap: 8px 12px; }
.tenant-block .deadline-side { grid-column: 2; justify-content: flex-start; padding: 0; }
.tenant-block .deadline-main { min-width: 0; overflow-wrap: anywhere; }
.months-head { gap: 12px; }
.months-sum { gap: 6px 16px; line-height: 1.5; }
.months-sum > b { flex-basis: 100%; font-size: 18px; }
.months-sum > span { font-size: 13px; }
.months-table { table-layout: fixed; font-size: 14px; }
.months-table th { font-size: 12px; }
.months-table th:first-child { width: 19%; }
.months-table:not(.with-extra) th:nth-child(2), .months-table:not(.with-extra) th:nth-child(3) { width: 28%; }
.months-table:not(.with-extra) th:nth-child(4) { width: 25%; }
.months-table td { padding: 12px 8px; overflow-wrap: anywhere; }
.months-table .m-part { min-width: 0; }
.months-table .m-state { font-size: 12px; line-height: 1.5; padding: 4px 7px; max-width: 100%; }
.months-table .m-amount { font-size: 14px; font-weight: 600; white-space: nowrap; }
.months-table .m-total { white-space: normal; line-height: 1.5; }
.months-table .m-total .muted { font-size: 12px; }
.months-table .mrow:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.months-table .mrow:focus-visible td { background: var(--accent-soft); }
.sheet-row { align-items: baseline; line-height: 1.5; }
.sheet-row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.sheet-row > :last-child { text-align: right; }
.object-debt-review, .settlement-panel, .rent-advance-panel { background: var(--surface-2); box-shadow: none; }
.obj-hero .obj-name { font-family: inherit; font-size: 32px; line-height: 1.25; }
.obj-hero.has-photo .obj-hero-body .obj-where, .obj-hero.has-photo .obj-hero-body .obj-fact { color: #fff; }
.obj-hero.has-photo .obj-hero-body .ghost { color: #fff; background: rgb(10 20 15 / .72); border-color: rgb(255 255 255 / .6); text-shadow: none; }
.obj-hero.has-photo .obj-hero-body .ghost:hover { background: rgb(10 20 15 / .88); }
.obj-hero.has-photo .photo-change { color: #fff; background: rgb(10 20 15 / .85); border-color: rgb(255 255 255 / .5); }
.obj-hero-body { padding: 24px; }
.obj-kicker { text-transform: none; letter-spacing: 0; font-size: 13px; }
.obj-hero .obj-plan-link { margin-block: 8px; }
.obj-tenant-foot { gap: 8px 16px; }
.obj-tenant-review { font-size: 14px; }
.calc-overview-panel, .documents-overview-panel { box-shadow: var(--shadow); }
.calc-overview-intro, .documents-overview-intro { background: var(--surface); padding: 20px; }
.calc-eyebrow, .documents-eyebrow { display: none; }
.calc-overview-intro h2, .documents-overview-intro h2 { font-size: 20px; line-height: 1.35; margin-top: 0; }
.calc-source, .documents-overview-source { font-size: 12px; line-height: 1.5; }
.calc-overview-metric .cap, .documents-overview-metric .cap { font-size: 12px; line-height: 1.4; }
.calc-overview-metric .note, .documents-overview-metric .note { font-size: 12px; line-height: 1.5; }
.calc-steps { padding: 20px; box-shadow: var(--shadow); }
.steps-head h3 { font-size: 14px; letter-spacing: 0; text-transform: none; }
.step-item { padding: 12px 0; gap: 12px; }
.step-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: start; }
.step-title { font-size: 14px; line-height: 1.5; }
.step-link { font-size: 13px; padding-inline: 8px; align-self: start; }
.step-when { grid-column: 1 / -1; margin: 0; font-size: 12px; white-space: normal; }
.step-detail { font-size: 13px; margin-top: 6px; line-height: 1.5; }
.step-blockers, .step-ready, .step-wait { font-size: 13px; line-height: 1.5; }
.step-blockers > summary { min-height: 44px; align-content: center; }
.step-item.current .step-mark { animation: none; box-shadow: none; }
.step-item.current { border-left-width: 1px; }
.step-blocker { border-left-width: 1px; }
.calc-steps .step-actions button, .calc-overview-go { min-height: 44px; }
.documents-overview-metric { min-height: 104px; }
#view-primary > .segmented { gap: 4px; padding: 4px; }
#view-primary > .segmented > button { min-height: 44px; font-size: 14px; }
.document-tools { gap: 8px; border: 0; background: transparent; padding: 0; }
.document-tools input, .document-tools select { min-height: 44px; font-size: 14px; }
.document-tools input { min-width: 0; }
.file-row .file-main { min-width: 0; }
.file-row .file-main a { font-size: 14px; line-height: 1.5; }
.file-row .size, .file-row .kind { font-size: 12px; }
.an-card h3 { font-size: 18px; line-height: 1.4; }
.an-card .an-desc, .an-kpi .note { font-size: 13px; line-height: 1.5; }
.an-row { gap: 12px; align-items: start; }
.an-row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.an-row > :last-child { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
@media(min-width:1180px) {
  .tenant-grid { grid-template-columns: minmax(0, 1.9fr) minmax(300px, .8fr); gap: 0 20px; }
  .calc-layout { grid-template-columns: minmax(300px, 350px) minmax(0, 1fr); gap: 20px; }
}
@media(max-width:900px) {
  .tenant-kpis .tenant-kpi:nth-child(2n) { border-right: 0; }
  .tenant-kpis .tenant-kpi:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}
@media(max-width:700px) {
  .topbar-row { min-height: 76px; padding-block: 12px; }
  .page-title { font-size: 22px; }
  main.wrap { padding-inline: 16px; padding-top: 16px; }
  .tenant-hero .hero-main, .tenant-hero .hero-side { padding: 16px; }
  .tenant-hero h2 { font-size: 20px; }
  .tenant-hero .hero-where, .tenant-hero .hero-main > .muted { font-size: 13px; line-height: 1.5; }
  .tenant-hero .hero-chips { gap: 6px; margin-top: 8px; }
  .hero-requisites > summary { min-height: 44px; align-content: center; cursor: pointer; color: var(--muted); font-size: 13px; }
  .tenant-nav { margin-inline: 0; border-radius: 12px; padding-left: 4px; }
  .tenant-block { padding: 16px; }
  .tenant-block .deadline { grid-template-columns: 96px minmax(0, 1fr); }
  .tenant-form :is(input,select,textarea), .document-tools :is(input,select), .search input { font-size: 16px; }
  .obj-hero-body { padding: 16px; }
  .obj-hero .obj-name { font-size: 24px; }
  .obj-hero .photo-change { top: 12px; right: 12px; }
  .obj-hero-body { padding-top: 64px; }
  .obj-kicker { line-height: 1.5; }
  .obj-hero { min-height: 280px; }
  .documents-overview-intro { padding: 16px; }
  .documents-overview-intro p { font-size: 14px; margin-bottom: 0; }
  .documents-overview-metric { min-height: 88px; padding: 12px 16px; }
  .documents-overview-intro h2, .calc-overview-intro h2 { font-size: 18px; }
  #view-primary > .segmented { display: flex; flex-wrap: nowrap; overflow-x: auto; }
  #view-primary > .segmented > button { flex: 0 0 auto; white-space: nowrap; padding-inline: 12px; }
  .document-tools input { flex-basis: 100%; }
  .calc-steps { padding: 16px; }
}
@media(min-width:701px) {
  .hero-requisites[open] > summary { display: none; }
  .hero-requisites .small { font-size: 13px; line-height: 1.5; }
}
@media(max-width:560px) {
  .tenant-kpis .tenant-kpi { padding: 12px 14px; }
  .months-table { display: block; }
  .months-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; }
  .months-table tbody { display: block; }
  .months-table .mrow { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
  .months-table td { display: block; border: 0; padding: 0; width: auto; min-width: 0; }
  .months-table .m-month { grid-column: 1 / -1; }
  .months-table .m-month b { display: inline; font-size: 15px; }
  .months-table .m-month > .muted { display: inline; margin-left: 8px; font-size: 12px; }
  .months-table .m-part::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
  .months-table .m-amount, .months-table.with-extra .m-amount { font-size: 15px; }
  .months-table .m-state, .months-table.with-extra .m-state { font-size: 12px; line-height: 1.5; }
  .months-table td.m-total { display: flex; grid-column: 1 / -1; gap: 4px 12px; flex-wrap: wrap; align-items: baseline; text-align: left; font-size: 14px; }
  .months-table .mrow-detail { display: block; }
  .months-table .mrow-detail > td { display: block; padding: 12px; }
  .months-table .mrow:hover td, .months-table .mrow:focus-visible td { background: transparent; }
  .months-table .mrow:hover, .months-table .mrow:focus-visible { background: var(--surface-2); }
  .months-table.with-extra .m-month b { font-size: 15px; }
  .months-sum > b { font-size: 17px; }
  .sheet-row { flex-wrap: wrap; gap: 4px 12px; }
}
@media(prefers-reduced-motion:reduce) {
  .tenant-nav-item, .months-table .mrow, .step-link { transition: none; transform: none; }
}
