/* Shared field/value layout. Breakpoints follow the content container, including
   narrow document workspaces and settings panels, rather than the viewport. */
.accounting-context { min-width:0; overflow-wrap:anywhere; }
.detail-groups { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,24rem),1fr)); gap:var(--space-6); align-items:start; }
.detail-groups > * { min-width:0; }
.info-surface { container:information / inline-size; min-width:0; max-width:80rem; }
.info-grid { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:var(--space-4) var(--space-6); margin:0; }
.info-grid > .info-item { grid-column:span 4; min-width:0; padding:var(--space-2) 0; border-bottom:1px solid var(--color-border); }
.info-grid > [data-info-size=short] { grid-column:span 2; }
.info-grid > [data-info-size=long] { grid-column:span 6; }
.info-grid > [data-info-size=full] { grid-column:1/-1; }
.info-grid dt { display:flex; align-items:center; gap:var(--space-1); margin:0 0 var(--space-1); color:var(--color-muted); font-size:var(--font-small); font-weight:var(--weight-medium); overflow-wrap:anywhere; }
.info-grid dt .help { flex:none; }
.info-grid dd { margin:0; min-width:0; font-size:var(--font-label); overflow-wrap:anywhere; white-space:normal; }
.info-grid dd.numeric { font-variant-numeric:tabular-nums; }
.info-grid [hidden] { display:none; }
.table-scroll:has(> .info-surface) { overflow:visible; max-height:none; }
@container information (max-width:800px) {
  .info-grid > .info-item { grid-column:span 6; }
  .info-grid > [data-info-size=full] { grid-column:1/-1; }
}
@container information (max-width:480px) {
  .info-grid { grid-template-columns:minmax(0,1fr); gap:var(--space-2); }
  .info-grid > .info-item { grid-column:1/-1; }
}

/* Financial field/value controls remain tables, with nearby labels and values. */
table.detail-table { width:auto; max-width:100%; table-layout:auto; }
table.detail-table th { width:auto; min-width:8rem; max-width:22rem; }
table.detail-table td { width:auto; max-width:40rem; }
.cost-check-panel .detail-table :is(th,td) { width:auto; }
/* Small record tables grow only as far as their actual content needs. */
table[data-table-width=content] { width:auto; max-width:100%; table-layout:auto; }
table[data-table-width=content] :is(th,td) { white-space:normal; }
table[data-table-width=content] td { max-width:32rem; overflow-wrap:anywhere; }
table[data-table-width=content] :is(.numeric,.number,.money) { white-space:nowrap; width:auto; }
table[data-table-key] :is(.table-action,.actions-cell,[data-column=is_active],[data-column=temporal_status]) { width:1%; }
table[data-table-key] :is([data-column=rooms],[data-column=area],[data-column=construction_year],[data-column=quota_label]) { width:1%; white-space:nowrap; }
table[data-table-key] [data-column=floor] { width:1%; }
table[data-table-key="portfolio.ownerships.1"] :is(th,td):first-child { min-width:12rem; max-width:26rem; }
table[data-table-key="portfolio.ownerships.1"] :is(th,td):nth-child(2) { white-space:nowrap; width:auto; }
table[data-table-key="portfolio.ownerships.1"] :is(th,td):last-child { max-width:32rem; }
/* Central contact data in a full-width owner table; scroll only this region. */
table.owner-contact-table { width:100%; min-width:74rem; table-layout:fixed; }
table.owner-contact-table :is(th,td) { white-space:normal; overflow-wrap:anywhere; vertical-align:top; }
table.owner-contact-table :is(th,td):first-child { width:19%; }
table.owner-contact-table :is(th,td)[data-column=birth-date] { width:13%; white-space:nowrap; }
table.owner-contact-table [data-column=address] { width:18%; }
table.owner-contact-table [data-column=email] { width:17%; }
table.owner-contact-table [data-column=phone] { width:13%; }
table.owner-contact-table :is(th,td)[data-column=share] { width:8%; white-space:normal; }
table.owner-contact-table [data-column=note] { width:12%; }
.owner-note { margin:0; }
.owner-note summary { cursor:pointer; color:var(--color-primary); }
.owner-note summary:focus-visible { outline:2px solid var(--color-focus); outline-offset:2px; }
.owner-note[open] > div { margin-top:var(--space-2); }

/* Existing form-field component supplies semantic width hints, never rules or
   validation. Unannotated specialist form grids keep their original geometry. */
.form-grid:has(> .field[data-field-width]) { container:form-fields / inline-size; grid-template-columns:repeat(12,minmax(0,1fr)); max-width:72rem; gap:var(--space-4) var(--space-4); }
.form-grid:has(> .field[data-field-width]) > * { grid-column:span 6; min-width:0; }
.form-grid > .field[data-field-width=short] { grid-column:span 2; }
.form-grid > .field[data-field-width=medium] { grid-column:span 4; }
.form-grid > .field[data-field-width=full], .form-grid > .field:has(textarea),
.form-grid > .field:has([data-unit-choice-table]) { grid-column:1/-1; }
.form-grid > .field[data-field-width] :is(input[type=text],input[type=email],input[type=url],input[type=tel],textarea) { max-width:100%; }
.form-grid > .field[data-field-width=short] :is(input,select) { max-width:12rem; }
@container form-fields (max-width:800px) {
  .form-grid > .field[data-field-width=short] { grid-column:span 3; }
  .form-grid > .field[data-field-width=medium] { grid-column:span 9; }
}
@container form-fields (max-width:540px) {
  .form-grid:has(> .field[data-field-width]) > * { grid-column:1/-1; }
}
@media(max-width:640px) {
  .form-grid:has(> .field[data-field-width]) { grid-template-columns:minmax(0,1fr); }
  .form-grid:has(> .field[data-field-width]) > * { grid-column:1/-1; }
}
@media print {
  .info-item { break-inside:avoid; }
}
