/* The address detail is a page-sized view, without the floating frame. */
.floating-contract-shell .company-floating-panel.company-address-detail-panel {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  inset: 0 !important;
  margin: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

/* The branch editor reuses the company form without exposing its parent window. */
.company-floating-panel.is-address-detail-editor {
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}
.company-floating-panel.is-address-detail-editor > .company-floating-header,
.company-floating-panel.is-address-detail-editor > .company-floating-body > :not(.company-floating-section),
.company-floating-panel.is-address-detail-editor .company-floating-section > :not([data-company-address-form]) {
  display: none !important;
}
.company-floating-panel.is-address-detail-editor > .company-floating-body {
  overflow: visible;
}
.company-floating-panel.is-address-detail-editor [data-company-address-form] {
  pointer-events: auto;
}
.company-address-detail-panel.is-address-editing[inert]::after {
  background: rgba(15, 23, 42, .18);
}

[data-company-address-form] .company-address-region-row {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
[data-company-address-form] .company-address-region-row > label {
  min-width: 0;
}

[data-company-address-form] .company-address-line {
  grid-column: 1 / -1;
  min-width: 0;
}

.floating-contract-shell .company-address-detail-panel .company-floating-header > div:first-child {
  align-items: center !important;
}
.company-address-detail-panel .company-address-detail-logo {
  display: grid;
  color: #fff;
  flex: 0 0 32px;
  font-size: 14px;
  height: 32px;
  width: 32px;
}

/* Company creation follows the same address layout as the branch editor. */
[data-company-create-form] .company-floating-form-grid,
[data-operation-supplier-add-form] .operation-supplier-add-fields {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
[data-company-create-form] .company-floating-form-grid > label,
[data-operation-supplier-add-form] .operation-supplier-add-fields > label {
  grid-column: span 3;
  min-width: 0;
}
[data-company-create-form] .company-floating-form-grid > label:nth-child(5),
[data-company-create-form] .company-floating-form-grid > label:nth-child(6),
[data-operation-supplier-add-form] .operation-supplier-add-fields > label:nth-child(5),
[data-operation-supplier-add-form] .operation-supplier-add-fields > label:nth-child(6) {
  grid-column: 1 / -1;
}
[data-company-create-form] .company-floating-form-grid > label:nth-child(n+7):nth-child(-n+9),
[data-operation-supplier-add-form] .operation-supplier-add-fields > label:nth-child(n+7):nth-child(-n+9) {
  grid-column: span 2;
}
[data-operation-supplier-add-form] {
  max-height: min(90dvh, 900px);
  overflow-y: auto;
}
[data-operation-supplier-add-form] .operation-supplier-add-actions {
  border-top: 0;
}
@media (max-width: 720px) {
  [data-company-create-form] .company-floating-form-grid > label,
  [data-operation-supplier-add-form] .operation-supplier-add-fields > label,
  [data-company-create-form] .company-floating-form-grid > label:nth-child(n+7):nth-child(-n+9),
  [data-operation-supplier-add-form] .operation-supplier-add-fields > label:nth-child(n+7):nth-child(-n+9) {
    grid-column: 1 / -1;
  }
}
