/* Shared interface components. Screen-only; signed documents and print layouts stay independent. */
@media screen {
  body {
    --ui-canvas: #f4f6f8; --ui-surface: #ffffff; --ui-soft: #f0f3f6;
    --ui-ink: #202c38; --ui-muted: #596675; --ui-line: #d9e0e7;
    --ui-red: #b52c24; --ui-red-hover: #98251f; --ui-focus: #315e9a;
    --ui-positive: #edf7f1; --ui-positive-ink: #246644;
    --ui-radius: 10px; --ui-control-radius: 8px; --ui-control-height: 42px;
  }
  html[data-theme="dark"] body {
    --ui-canvas: #121820; --ui-surface: #1c232c; --ui-soft: #272f39;
    --ui-ink: #edf1f6; --ui-muted: #b8c3cf; --ui-line: #404a56;
    --ui-focus: #a9c9f3; --ui-positive: #243a30; --ui-positive-ink: #a2d8b9;
  }
  html body :is(.app-shell,.portal-main,.tech-app,.auth-shell) { color: var(--ui-ink); }
  html body .app-shell .content-area :is(.panel,.notice-library,.property-card,.mini-kpi-grid article),
  html body.portal-body .portal-panel,
  html body .tech-app :is(.tech-job-card,.tech-pay-summary) { border-color: var(--ui-line); border-radius: 12px; box-shadow: none; }
  html body :is(.app-header,.portal-topbar,.tech-header) { background: var(--ui-surface); border-color: var(--ui-line); box-shadow: none; backdrop-filter: none; }
  html body .app-header h1 { color: var(--ui-ink); font-weight: 650; letter-spacing: -.025em; }
  html body .app-header p { color: var(--ui-muted); font-size: 13px; line-height: 1.5; }
  html body .app-shell :is(.header-actions,.toolbar-actions)>:is(button.primary-btn,button.secondary-btn,.header-search-btn),
  html body .app-shell :is(.header-actions,.toolbar-actions)>.action-menu>summary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--ui-control-height); padding: 10px 14px; border-radius: var(--ui-control-radius);
    font-size: 13px; font-weight: 600; line-height: 1.3; white-space: nowrap; box-shadow: none;
  }
  html body .app-shell .header-actions { gap: 6px; }
  html body .app-shell .header-actions :is(button,summary)>svg { width: 17px; height: 17px; flex-shrink: 0; }
  html body .app-shell .header-actions>.header-search-btn,
  html body .app-shell .header-actions>.global-create-menu>summary,
  html body .app-shell .header-actions .appearance-button { border: 1px solid transparent; background: transparent; color: var(--ui-ink); box-shadow: none; }
  html body .app-shell .header-actions :is(.appearance-button,.header-search-btn) { display: inline-grid; place-items: center; width: 40px; min-width: 40px; height: 42px; padding: 0; border-radius: 8px; }
  html body .app-shell .header-actions>.header-search-btn :is(span,kbd) { display: none; }
  html body .app-shell .header-actions>.global-create-menu>summary:hover,
  html body .app-shell .header-actions :is(.appearance-button,.header-search-btn):hover { background: var(--ui-soft); }
  html body .app-shell .toolbar-actions>button.secondary-btn { color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line); }
  html body .app-shell .toolbar-actions>.action-menu>summary.secondary-btn { background: transparent; border-color: transparent; color: var(--ui-ink); }
  html body .app-shell .toolbar-actions>.action-menu>summary:hover,
  html body .app-shell .toolbar-actions>.action-menu[open]>summary.secondary-btn { background: var(--ui-soft); }
  html body .app-shell .action-menu>summary::after { color: var(--ui-muted); margin-left: 3px; }
  html body .app-shell .content-area .toolbar-actions>.compact-field { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 42px; margin: 0; padding: 0; border: 0; background: transparent; }
  html body .app-shell .content-area .toolbar-actions>.compact-field>span { flex: 0 0 auto; margin: 0; color: var(--ui-muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
  html body .app-shell .content-area .toolbar-actions>.compact-field>.compact-control { width: auto; min-width: 115px; margin: 0; font-weight: 550; }
  html body .app-shell .content-area .toolbar-actions>.period-status { align-self: center; min-height: 28px; margin: 0; padding: 4px 10px; border: 0; color: var(--ui-muted); background: var(--ui-soft); font-size: 11px; font-weight: 550; }
  html body .app-shell .content-area .toolbar-actions>.period-status.closed { color: var(--polish-pending-text); background: var(--polish-pending); }

  /* Page links describe section jumps rather than pretending to switch panels. */
  html body .app-shell .content-area .section-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin: 0 0 18px; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; background: transparent; box-shadow: none; }
  html body .app-shell .content-area .section-links-label { color: var(--ui-muted); font-size: 11px; font-weight: 500; }
  html body .app-shell .content-area .section-links button { flex: 0 0 auto; min-height: 36px; margin: 0; padding: 6px 0; border: 0; border-radius: 0; color: var(--ui-muted); background: transparent; box-shadow: none; font-size: 13px; font-weight: 500; text-decoration: none; }
  html body .app-shell .content-area .section-links button:hover { color: var(--ui-ink); text-decoration: underline; text-underline-offset: 5px; }
  html body .app-shell .content-area .section-links button[aria-current] { color: var(--ui-ink); font-weight: 600; }
  html body .app-shell .content-area .view[data-view="payments"]>.view-toolbar>.toolbar-actions>button[data-action="new-payment"] { display: none; }
  html body .app-shell .content-area .view[data-view="notices"] .document-section-nav { flex-wrap: wrap; overflow: visible; }

  /* One field system across admin forms, owner/tenant sheets, technician sheets, and sign-in. */
  html body .app-shell :is(.control,.compact-control),
  html body.portal-body :is(.portal-field,.tenant-request-field,.owner-property-tools,.owner-bulk-card) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),select,textarea),
  html body .tech-sheet-card :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),select,textarea),
  html body .auth-form :is(input:not([type="checkbox"]):not([type="hidden"]),select) {
    min-height: var(--ui-control-height); border: 1px solid var(--ui-line); border-radius: var(--ui-control-radius);
    background-color: var(--ui-surface); color: var(--ui-ink); font-size: 14px; line-height: 1.45; box-shadow: none;
  }
  html body .app-shell :is(.control,.compact-control) { padding: 10px 12px; }
  html body .app-shell textarea.control { min-height: 112px; }
  html body :is(.app-shell,.portal-main,.tech-sheet-card,.auth-form) :is(input,textarea)::placeholder { color: var(--ui-muted); opacity: 1; }
  html body .app-shell .modal-card .field>span,
  html body.portal-body .tenant-request-field>span { margin-bottom: 6px; color: var(--ui-muted); font-size: 13px; font-weight: 550; line-height: 1.5; }
  html body .app-shell .form-grid { gap: 18px 20px; }
  html body :is(.app-shell,.portal-main,.tech-sheet-card,.auth-form) :is(input,select,textarea):disabled { background-color: var(--ui-soft); color: var(--ui-muted); opacity: 1; cursor: not-allowed; }
  html body :is(.app-shell,.portal-main,.tech-app,.auth-shell) :is(button,a,summary,input,select,textarea):focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 3px; }
  html body :is(.modal-card,.tenant-request-card,.tenant-document-dialog-card,.tech-sheet-card) { background: var(--ui-surface); color: var(--ui-ink); }
  html body :is(.modal-card>.modal-header,.tenant-request-card>header,.tenant-document-dialog-head,.tech-sheet-card>header) { background: var(--ui-surface); border-color: var(--ui-line); }
  html body :is(.modal-card>.modal-header,.tenant-request-card>header,.tenant-document-dialog-head,.tech-sheet-card>header) h2 { color: var(--ui-ink); font-size: 21px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }
  html body :is(.modal-footer,.tenant-request-card>footer,.tenant-document-dialog-card>footer,.tech-sheet-card>footer) { gap: 10px; padding: 16px 20px; border-color: var(--ui-line); background: var(--ui-surface); }
  html body :is(.app-shell .modal-footer,.tenant-request-card>footer,.tenant-document-dialog-card>footer,.tech-sheet-card>footer) button { min-height: 44px; border-radius: var(--ui-control-radius); font-size: 14px; font-weight: 600; }
  html body .app-shell .primary-btn,
  html body .app-shell :is(.header-actions,.toolbar-actions)>button.primary-btn,
  html body.portal-body .portal-button:not(.secondary),
  html body .auth-primary { border-color: var(--ui-red); background: var(--ui-red); color: #fff; box-shadow: none; }
  html body .app-shell .primary-btn:hover,
  html body .app-shell :is(.header-actions,.toolbar-actions)>button.primary-btn:hover,
  html body.portal-body .portal-button:not(.secondary):hover,
  html body .auth-primary:hover { border-color: var(--ui-red-hover); background: var(--ui-red-hover); }
  html body .app-shell .primary-btn:disabled,
  html body .app-shell :is(.header-actions,.toolbar-actions)>button.primary-btn:disabled,
  html body.portal-body .portal-button:disabled,
  html body.portal-body .portal-button:disabled:hover,
  html body .auth-primary:disabled,
  html body .auth-primary:disabled:hover { border-color: var(--ui-line); background: var(--ui-soft); color: var(--ui-muted); cursor: not-allowed; }
  html body .app-shell .secondary-btn,
  html body.portal-body .portal-button.secondary { border-color: var(--ui-line); background: var(--ui-surface); color: var(--ui-ink); box-shadow: none; }
  html body.portal-body .portal-button { min-height: 44px; padding: 10px 16px; border-radius: var(--ui-control-radius); font-size: 14px; font-weight: 600; }
  html body .app-shell .modal-card .close-btn { width: 42px; min-width: 42px; height: 42px; border-radius: 8px; color: var(--ui-muted); background: var(--ui-soft); border-color: transparent; }
  html body .app-shell .modal-card .modal-subtitle { color: var(--ui-muted); font-size: 13px; line-height: 1.6; }
  /* Admin dialogs are siblings of .app-shell, so their picker styles are rooted at .modal. */
  html body .modal .rental-search-control { position: relative; width: 100%; min-width: 0; }
  html body .modal .rental-search-control::before { content: ''; position: absolute; left: 15px; top: 14px; width: 12px; height: 12px; border: 1.6px solid var(--ui-muted); border-radius: 50%; pointer-events: none; z-index: 1; }
  html body .modal .rental-search-control::after { content: ''; position: absolute; left: 27px; top: 27px; width: 6px; height: 1.6px; background: var(--ui-muted); transform: rotate(45deg); pointer-events: none; z-index: 1; }
  html body .modal .rental-search-control>input.control { width: 100%; height: 46px; min-height: 46px; margin: 0; padding: 10px 42px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); color: var(--ui-ink); font-size: 15px; line-height: 1.5; box-shadow: none; }
  html body .modal .rental-search-control>input.control:focus { border-color: var(--ui-focus); outline: 2px solid var(--ui-focus); outline-offset: 0; box-shadow: none; }
  html body .modal .rental-search-control>input::-webkit-search-cancel-button { -webkit-appearance: none; }
  html body .modal .rental-search-clear { position: absolute; top: 6px; right: 6px; width: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ui-muted); font-size: 24px; line-height: 1; }
  html body .modal .rental-search-clear:hover { background: var(--ui-soft); color: var(--ui-ink); }
  html body .modal [id$="-rental-search-status"] { display: block; min-height: 18px; margin-top: 7px; color: var(--ui-muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
  html body .modal .rental-search-results { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; max-height: min(300px,45dvh); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface); box-shadow: 0 12px 30px #10182026; scrollbar-width: thin; scrollbar-color: #8a96a3 var(--ui-surface); }
  html body .modal .rental-search-option { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--ui-line); color: var(--ui-ink); cursor: pointer; overflow-wrap: anywhere; }
  html body .modal .rental-search-option:last-child { border-bottom: 0; }
  html body .modal .rental-search-option:hover,
  html body .modal .rental-search-option[aria-selected="true"] { background: var(--ui-soft); box-shadow: inset 3px 0 var(--ui-red); }
  html body .modal .rental-search-copy { display: grid; min-width: 0; gap: 3px; }
  html body .modal .rental-search-copy strong { color: var(--ui-ink); font-size: 14px; font-weight: 600; line-height: 1.45; }
  html body .modal .rental-search-copy small { color: var(--ui-muted); font-size: 12px; font-weight: 400; line-height: 1.45; }
  html body .modal .rental-search-unit { flex: 0 0 auto; padding: 4px 8px; border-radius: 5px; color: var(--ui-ink); background: var(--ui-soft); font-size: 12px; font-weight: 550; white-space: nowrap; }
  html body .modal .rental-search-empty { padding: 20px 16px; color: var(--ui-muted); font-size: 13px; line-height: 1.5; }

  /* Payment suggestions appear only while typing; keep the field quiet at rest. */
  html body #payment-modal .rental-search-control>input.control {
    height: 44px; min-height: 44px; border-radius: 8px; font-size: 15px;
  }
  html body #payment-modal .rental-search-control>input.control:focus {
    outline: 0; border-color: var(--ui-focus); box-shadow: 0 0 0 2px #315e9a18;
  }
  html body #payment-modal .rental-search-results {
    position: static; width: 100%; margin-top: 6px; padding: 0;
    max-height: none; border: 1px solid var(--ui-line); border-radius: 8px;
    background: var(--ui-surface); box-shadow: none; overflow: hidden;
  }
  html body #payment-modal .rental-search-results[hidden] { display: none; }
  html body #payment-modal .rental-search-option {
    min-height: 44px; gap: 0; padding: 9px 12px; border-radius: 0;
    border-bottom: 1px solid var(--ui-line);
  }
  html body #payment-modal .rental-search-option:last-child { border-bottom: 0; }
  html body #payment-modal .rental-search-option:hover,
  html body #payment-modal .rental-search-option[aria-selected="true"] {
    background: var(--ui-soft); box-shadow: inset 3px 0 var(--ui-red);
  }
  html body #payment-modal .rental-search-copy { flex: 1; gap: 2px; }
  html body #payment-modal .rental-search-copy strong { font-size: 14px; font-weight: 550; line-height: 1.4; }
  html body #payment-modal .rental-search-copy small { font-size: 12px; line-height: 1.4; }
  html body #payment-modal #payment-rental-search-status { margin: 5px 0 0; min-height: 16px; }
  @media (max-width: 600px) {
    html body #payment-modal .rental-search-control>input.control { font-size: 16px; }
  }
  html body :is(.app-shell,.portal-main,.tech-app) :is(td.money,th.money) { text-align: right; font-variant-numeric: lining-nums tabular-nums; }

  /* Annual reporting follows the same calm financial hierarchy as monthly accounting. */
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-card { border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-surface); box-shadow: none; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-overview { padding: 20px 22px; border-top: 0; background: var(--ui-surface); color: var(--ui-ink); }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-head h3 { color: var(--ui-ink); font-size: 18px; font-weight: 600; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-light-btn { min-height: 40px; padding: 9px 13px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); color: var(--ui-ink); font-size: 13px; font-weight: 550; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-light-btn:hover { background: var(--ui-soft); }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-feature { margin-top: 18px; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-feature span { color: var(--ui-muted); font-size: 13px; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-feature strong { color: var(--ui-ink); font-size: 32px; font-weight: 650; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-metrics { background: var(--ui-surface); border-top: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-metrics>div { padding: 18px 20px; border-color: var(--ui-line); background: transparent; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-metrics span { min-height: 0; color: var(--ui-muted); font-size: 12px; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-metrics strong { color: var(--ui-ink); font-size: 21px; font-weight: 600; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-metrics .yearly-revenue { background: var(--ui-positive); }
  html body .app-shell .content-area [data-view="yearly"] .yearly-portfolio-summary { padding: 20px 22px; background: var(--ui-surface); }
  html body .app-shell .content-area [data-view="yearly"] .yearly-portfolio-summary :is(h4,strong) { color: var(--ui-ink); }
  html body .app-shell .content-area [data-view="yearly"] .yearly-portfolio-metrics span { color: var(--ui-muted); font-size: 12px; }

  /* Related portals share typography, controls, surfaces and branding; each keeps its workflow. */
  html body.portal-body .portal-main { max-width: 1320px; }
  html body.portal-body .portal-panel-head h2 { color: var(--ui-ink); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
  html body.portal-body .portal-panel-head :is(small,p) { color: var(--ui-muted); }
  html body.portal-body .portal-topbar .portal-brand img { filter: none; max-width: 200px; max-height: 58px; width: auto; height: auto; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
  html body.portal-body .portal-account>a { min-height: 42px; display: inline-flex; align-items: center; padding: 0 10px; border: 0; color: var(--ui-muted); background: transparent; font-size: 13px; font-weight: 500; white-space: nowrap; }
  html body.portal-body .portal-account>a:hover { color: var(--ui-ink); text-decoration: underline; }
  html body.portal-body .owner-overview article { border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-surface); box-shadow: none; }
  html body.portal-body .owner-overview .owner-payout-card { border-color: var(--ui-line); background: var(--ui-positive); color: var(--ui-positive-ink); }
  html body.portal-body .owner-payout-card strong { color: var(--ui-positive-ink); }
  html body.portal-body .owner-overview article>span { color: var(--ui-muted); font-size: 13px; font-weight: 500; }
  html body.portal-body .owner-overview strong { font-variant-numeric: tabular-nums; }
  html body.portal-body .owner-export>summary { border-color: var(--ui-line); border-radius: 8px; color: var(--ui-ink); background: var(--ui-surface); font-size: 13px; font-weight: 550; }
  html body .tech-app .tech-metrics article { background: var(--ui-surface); border-color: var(--ui-line); border-radius: 12px; box-shadow: none; }
  html body .tech-app .tech-metrics span { color: var(--ui-muted); font-size: 12px; font-weight: 500; }
  html body .tech-app .tech-metrics strong { color: var(--ui-ink); font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
  html body .tech-app .tech-metrics .urgent strong { color: var(--red); }
  html body .tech-app .tech-job-actions button { min-height: 44px; font-size: 13px; font-weight: 600; border-radius: 8px; }
  html body .tech-header>img { filter: none; width: 180px; background: #fff; padding: 4px; border-radius: 8px; }
  html body .tech-header a { color: var(--ui-muted); }
  html body .tech-sheet-card>header>button { color: var(--ui-muted); background: var(--ui-soft); border-radius: 8px; }
  html body.auth-body .auth-form label { color: var(--ui-ink); font-size: 14px; font-weight: 550; }
  html body.auth-body .auth-primary { min-height: 46px; border-radius: 8px; font-size: 15px; font-weight: 600; }
  html body.auth-body .auth-password-toggle { color: var(--ui-ink); background: var(--ui-soft); border-radius: 6px; }
}
@media screen and (min-width: 1024px) {
  html body .app-shell .app-header { padding: 16px 28px; min-height: 84px; }
  html body .app-shell .content-area .view:not(.command-dashboard):not(.payment-settings-view)>.view-toolbar { display: flex; justify-content: flex-end; align-items: center; min-height: 0; gap: 16px; margin: 0 0 14px; padding: 4px 0 12px; border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
  html body .app-shell .content-area .view:not(.command-dashboard)>.view-toolbar>.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; width: 100%; margin: 0; gap: 10px; }
  html body .app-shell .content-area .view:not(.command-dashboard)>.view-toolbar>.toolbar-actions>.compact-field:first-child { margin-right: auto; }
  html body .app-shell .content-area .view>.view-toolbar>.maintenance-toolbar-actions { display: grid; grid-template-columns: minmax(180px,1fr) minmax(135px,170px) minmax(160px,210px) auto; }
  html body .app-shell .content-area .view>.view-toolbar:has(>.toolbar-actions:empty) { display: none; }
  html body .app-shell .content-area :is(.filter-bar,.properties-command-bar) { padding: 10px 0 16px; gap: 16px; border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; background: transparent; box-shadow: none; }
  html body .app-shell .content-area :is(.filter-bar,.properties-command-bar) .field>span { font-size: 12px; font-weight: 500; }
}
@media screen {
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 4px 0 12px; border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; background: transparent; box-shadow: none; }
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head>div:first-child { min-width: 0; }
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head>.toolbar-actions { display: flex; width: auto; min-width: 0; margin: 0; gap: 0; flex-wrap: nowrap; }
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head .compact-field { display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; width: auto; min-height: 0; gap: 10px; margin: 0; padding: 0; border: 0; background: transparent; }
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head .compact-field>.compact-control { min-width: 150px; min-height: 38px; font-size: 13px; }
}
@media screen and (max-width: 760px) {
  body { --ui-control-height: 44px; }
  html body .app-shell .app-header { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
  html body .app-shell .app-header h1 { font-size: 24px; }
  html body .app-shell .header-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; width: 100%; gap: 6px; }
  html body .app-shell .header-actions :is(.appearance-button,.header-search-btn) { min-width: 44px; width: 44px; height: 44px; }
  html body .app-shell .header-actions>.global-create-menu>summary { width: 44px; min-width: 44px; padding: 0; }
  html body .app-shell .header-actions>.global-create-menu>summary>span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  html body .app-shell .header-actions>.global-create-menu>summary::after { display: none; }
  html body .app-shell .header-actions>.primary-btn { min-width: 0; padding-left: 12px; padding-right: 12px; font-size: 12px; }
  html body .app-shell .content-area .toolbar-actions>.compact-field { width: 100%; justify-content: space-between; }
  html body .app-shell .content-area .toolbar-actions>.compact-field>.compact-control { min-width: 0; max-width: 65%; }
  html body .app-shell .content-area .section-links { gap: 4px 16px; }
  html body .app-shell .content-area .section-links-label { flex-basis: 100%; }
  html body .app-shell .content-area .section-links button { min-height: 44px; font-size: 12px; }
  html body .app-shell :is(.control,.compact-control),
  html body.portal-body :is(.portal-field,.tenant-request-field,.owner-property-tools,.owner-bulk-card) :is(input,select,textarea),
  html body .tech-sheet-card :is(input,select,textarea), html body .auth-form input { font-size: 16px; }
  html body :is(.modal-footer,.tenant-request-card>footer,.tenant-document-dialog-card>footer,.tech-sheet-card>footer) { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  html body :is(.modal-card>.modal-header,.tenant-request-card>header,.tenant-document-dialog-head,.tech-sheet-card>header) h2 { font-size: 19px; }
  html body.portal-body .portal-topbar .portal-brand img { filter: none; max-width: 155px; max-height: 52px; }
  html body.portal-body .portal-account>a { min-height: 44px; padding: 0 7px; }
  html body .tech-header { gap: 10px; padding-left: 16px; padding-right: 16px; }
  html body .tech-header>img { width: 136px; }
  html body .tech-header>div { display: flex; align-items: center; gap: 6px; }
  html body .tech-header>div>strong { display: none; }
  html body .tech-header>div :is(button,a) { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-overview,
  html body .app-shell .content-area [data-view="yearly"] .yearly-portfolio-summary { padding: 18px 16px; }
  html body .app-shell .content-area [data-view="yearly"] .yearly-company-head { align-items: flex-start; }
}
@media screen and (max-width: 480px) {
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head { gap: 10px; }
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head h2 { font-size: 14px; }
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head .compact-field>span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head .compact-field>.compact-control { min-width: 0; max-width: 155px; min-height: 44px; }
}
@media screen and (max-width: 360px) {
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head { grid-template-columns: 1fr; }
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head>.toolbar-actions { width: 100%; }
  html body .app-shell .content-area .command-dashboard>.dashboard-command-head .compact-field>.compact-control { width: 100%; max-width: none; }
}

@media screen and (max-width: 360px) {
  html body .tech-header { flex-wrap: wrap; }
  html body .tech-header>div { margin-left: auto; }
}
@media screen and (prefers-reduced-motion: reduce) {
  html body :is(.app-shell,.portal-main,.tech-app,.auth-shell) *,
  html body :is(.app-shell,.portal-main,.tech-app,.auth-shell) *::before,
  html body :is(.app-shell,.portal-main,.tech-app,.auth-shell) *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media screen and (max-width: 760px) {
  html body .modal .rental-search-control>input.control { font-size: 16px; }
}

/* Keep the selected month's rent visible while recording a payment. */
@media screen {
  html body #payment-modal .payment-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; }
  html body #payment-modal .payment-summary-card { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; padding: 14px 17px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-soft); color: var(--ui-ink); }
  html body #payment-modal .payment-summary-card>span { font-size: 13px; font-weight: 600; line-height: 1.4; }
  html body #payment-modal .payment-summary-card>strong { color: var(--ui-ink); font-size: clamp(28px, 3vw, 36px); font-weight: 750; line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  html body #payment-modal .payment-summary-card>small { color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
  html body #payment-modal .payment-summary-balance[data-status="due"] { border-color: #e3b7b1; background: #fff4f1; }
  html body #payment-modal .payment-summary-balance[data-status="due"]>strong { color: #a52c22; }
  html body #payment-modal .payment-summary-balance[data-status="paid"] { background: var(--ui-positive); }
  html body #payment-modal .payment-summary-balance[data-status="paid"]>strong { color: var(--ui-positive-ink); }
  html body #payment-modal :is(.payment-summary-empty,.payment-summary-note) { grid-column: 1 / -1; margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.5; }
  html body #payment-modal .payment-summary-empty { padding: 14px 16px; border: 1px dashed var(--ui-line); border-radius: 10px; }
  html[data-theme="dark"] body #payment-modal .payment-summary-balance[data-status="due"] { border-color: #81544e; background: #382825; }
  html[data-theme="dark"] body #payment-modal .payment-summary-balance[data-status="due"]>strong { color: #ffb4a9; }
}
@media screen and (max-width: 480px) {
  html body #payment-modal .payment-summary { gap: 8px; }
  html body #payment-modal .payment-summary-card { padding: 13px 12px; }
  html body #payment-modal .payment-summary-card>strong { font-size: 27px; }
}

@media screen {
  html body #payment-modal .money-input { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  html body #payment-modal .money-input>.control { width: 100%; min-height: 44px; padding-left: 27px; border: 1px solid var(--ui-line); border-radius: var(--ui-control-radius); background: var(--ui-surface); color: var(--ui-ink); box-shadow: none; }
  html body #payment-modal .money-input>span { top: 50%; transform: translateY(-50%); color: var(--ui-muted); }
}
@media screen and (min-width: 761px) {
  html body #payment-modal .modal-header { padding: 16px 24px; }
  html body #payment-modal .modal-body { padding: 20px 24px; gap: 14px 18px; }
}

@media screen {
  html body #payment-modal :is(.payment-summary-arrears,.payment-summary-total) { padding-top: 11px; padding-bottom: 11px; }
  html body #payment-modal :is(.payment-summary-arrears,.payment-summary-total)>strong { font-size: 28px; }
}
@media screen and (max-width: 480px) {
  html body #payment-modal :is(.payment-summary-arrears,.payment-summary-total)>strong { font-size: 25px; }
}
