/* Storage uses POD spacing and WordPress controls in a shared column layout. */
.alter-storage-connections {
  max-width: 1180px;
  margin-block: 16px;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}
.alter-storage-connections * { box-sizing: border-box; }
.alter-storage-connections [hidden] { display: none !important; }
.alter-storage-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: 16px;
}
.alter-storage-section-head h3 { margin: 0 0 6px; }
.alter-storage-section-head p { margin: 0; color: #646970; }
.alter-storage-provider-add {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 40px;
  align-items: center;
  gap: 8px;
}
.alter-storage-provider-add select {
  width: 100%;
  height: 32px;
  min-height: 32px;
  margin: 0;
}
/* Override WP's .button .dashicons line-height, which otherwise shifts icons down. */
.wp-core-ui .alter-storage-connections .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 10px;
  line-height: 1;
  white-space: nowrap;
}
.wp-core-ui .alter-storage-connections .alter-storage-icon-button { width: 40px; padding: 0; }
.wp-core-ui .alter-storage-connections .button .dashicons { width: 20px; height: 20px; line-height: 20px; }
.alter-storage-table-wrap { overflow-x: auto; }
.alter-storage-table { width: 100%; min-width: 1000px; border-collapse: collapse; table-layout: fixed; }
.alter-storage-table th:nth-child(1) { width: 21%; }
.alter-storage-table th:nth-child(2) { width: 8%; }
.alter-storage-table th:nth-child(3) { width: 10%; }
.alter-storage-table th:nth-child(4) { width: 17%; }
.alter-storage-table th:nth-child(5) { width: 15%; }
.alter-storage-table th:nth-child(6) { width: 29%; }
.alter-storage-table > thead > tr > th { padding: 12px; background: #f6f7f7; font-weight: 600; }
.alter-storage-table > tbody > tr > td { padding: 16px 12px; border-top: 1px solid #dcdcde; vertical-align: middle; overflow-wrap: anywhere; }
.alter-storage-table > tbody > tr > td:nth-child(5),
.alter-storage-table > tbody > tr > td:nth-child(6) { vertical-align: top; }
.alter-storage-table strong { color: #1d2327; font-size: 13px; }
.alter-storage-location,
.alter-storage-table time { display: block; margin-block-start: 4px; color: #646970; font-size: 12px; }
.alter-storage-location { direction: ltr; unicode-bidi: isolate; }
.alter-storage-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.alter-storage-row-actions .button { min-width: 64px; }
.alter-storage-row-actions [data-storage-info] { min-width: 44px; }
.wp-core-ui .alter-storage-row-actions .alter-storage-remove { color: #b32d2e; }
.alter-storage-default-help { display: block; margin-block-start: 6px; font-size: 12px; }
.alter-storage-muted { color: #646970; }
.alter-storage-connection-status.is-tested { color: #008a20; }
.alter-storage-connection-status.is-failed { color: #b32d2e; }
[data-storage-list-status]:not(:empty), [data-storage-remove-status]:not(:empty) { margin-block-start: 12px; }
[data-storage-list-status].is-error, [data-storage-remove-status].is-error { color: #b32d2e; }
.alter-storage-table > tbody > .alter-storage-migration-row > td,
.alter-storage-table > tbody > .alter-storage-info-row > td { background: #f6f7f7; padding: 20px; }
.alter-storage-migration-row, .alter-storage-info-row { scroll-margin-top: 48px; }
.alter-storage-info-tools > :first-child { margin-top: 0; }
.alter-storage-info-tools > :last-child { margin-bottom: 0; }
.alter-storage-info-tools h3 { margin-top: 24px; }
.alter-storage-info-tools .widefat { background: #fff; }
.alter-storage-info-tools .widefat th { width: auto; }
.alter-storage-info-tools .widefat th, .alter-storage-info-tools .widefat td { padding: 10px; }
.alter-storage-info-tools .is-error { color: #b32d2e; }
.alter-storage-info-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 16px 0; }
.alter-storage-info-facts dt { color: #646970; margin-bottom: 4px; }
.alter-storage-info-facts dd { margin: 0; color: #1d2327; }
.alter-storage-info-details { margin: 16px 0; }
.alter-storage-info-details > summary { cursor: pointer; font-weight: 600; }
.alter-storage-migration-tools > :first-child { margin-top: 0; }
.alter-storage-migration-tools > :last-child { margin-bottom: 0; }
.alter-storage-migration-tools h3 { margin-top: 24px; }
.alter-storage-migration-tools .widefat th { width: auto; padding: 10px; }
.alter-storage-migration-tools .widefat td { padding: 12px 10px; vertical-align: top; }
.alter-storage-migration-tools .widefat { background: #fff; }
.alter-storage-migration-tools .is-error { color: #b32d2e; }
.alter-storage-migration-tools select { margin-inline-end: 6px; }
.alter-storage-flow { display: flex; align-items: center; gap: 20px; }
.alter-storage-flow > div { min-width: 0; }
.alter-storage-flow div > span { display: block; color: #646970; margin-bottom: 4px; }
.alter-storage-flow strong { display: block; overflow-wrap: anywhere; }
.alter-storage-flow > span { color: #8c8f94; font-size: 20px; }
.alter-storage-auto-actions { display: flex; gap: 8px; margin-top: 16px; }
[data-storage-auto-status] { min-height: 20px; }
[data-storage-auto-counts] { font-variant-numeric: tabular-nums; color: #50575e; }
[data-storage-advanced] { border-top: 1px solid #dcdcde; margin-top: 20px; padding-top: 16px; }
[data-storage-advanced] > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
[data-storage-advanced-fields] { border: 0; padding: 0; margin: 0; min-width: 0; }

dialog.alter-storage-modal,
dialog.alter-storage-remove-modal {
  width: min(740px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  border: 0;
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  color: #1d2327;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .32);
  overflow: auto;
}

dialog.alter-storage-modal::backdrop,
dialog.alter-storage-remove-modal::backdrop { background: rgba(0, 0, 0, .48); }
dialog.alter-storage-remove-modal { width: min(520px, calc(100vw - 32px)); }
.alter-storage-remove-modal h2 { margin-top: 0; }
.alter-storage-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 16px;
  align-items: start;
  margin-block-end: 16px;
}
.alter-storage-modal-head h2 { margin: 0; }
.alter-storage-modal-head [data-storage-close] {
  width: 34px;
  height: 34px;
  font-size: 26px;
  line-height: 1;
  color: #1d2327;
  text-decoration: none;
}
.alter-storage-modal .form-table { margin-top: 0; }
.alter-storage-modal .form-table th { width: 180px; }
.alter-storage-modal .form-table td { padding-inline-end: 0; }
.alter-storage-modal input.regular-text,
.alter-storage-modal select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  direction: ltr;
  unicode-bidi: isolate;
}
.alter-storage-modal .description { max-width: 100%; }
.alter-storage-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 18px;
}
.alter-storage-modal [data-storage-status] {
  min-height: 20px;
  margin-block-start: 12px;
  color: #2271b1;
}
.alter-storage-modal [data-storage-status].is-error { color: #b32d2e; }

@media (max-width: 600px) {
  .alter-storage-connections { padding: 12px; }
  .alter-storage-provider-add { width: 100%; grid-template-columns: minmax(0, 1fr) 40px; }
  dialog.alter-storage-modal { padding: 16px; }
  .alter-storage-modal .form-table th,
  .alter-storage-modal .form-table td { display: block; width: auto; padding: 8px 0; }
  .alter-storage-modal .form-table th { padding-block-end: 0; }
}

.alter-storage-help-links { margin-block: 12px 20px; }
.alter-storage-setup-guide { display: inline; }
.alter-storage-modal .alter-storage-setup-guide > summary { display: inline-block; margin-inline-start: 16px; cursor: pointer; }
.alter-storage-setup-guide > summary::-webkit-details-marker { display: none; }
.alter-storage-setup-guide > summary:focus-visible { outline: 2px solid #2271b1; outline-offset: 3px; }
.alter-storage-setup-content { border-block: 1px solid #dcdcde; margin-block-start: 16px; padding-block: 12px; }
.alter-storage-setup-content ol { margin-inline-start: 24px; }
.alter-storage-setup-content li { margin-block-end: 20px; }
.alter-storage-setup-content textarea { width: 100%; font-family: monospace; font-size: 12px; resize: vertical; white-space: pre; }
.alter-storage-setup-options th, .alter-storage-setup-options td { padding: 8px; overflow-wrap: anywhere; }
.alter-storage-setup-options th { width: 35%; }
