@media screen {
  .cabinet-content #app #company-details-form { max-width:none; }
  .company-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
  .company-fields p { margin:0; min-width:0; }
  .company-fields label { margin-top:0; }
  .company-fields input { max-width:none; width:100%; min-width:0; box-sizing:border-box; }
  .company-fields .company-wide { grid-column:1 / -1; }
  .company-field { min-width:0; }
  .company-lookup-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; }
  .company-lookup-row input { margin:0; height:44px; }
  .company-lookup-row button { margin:0; height:44px; min-height:44px; padding:0 12px; }
  .company-field [role=status] { margin:8px 0 0; overflow-wrap:anywhere; }
  .company-field .muted { margin:8px 0 0; }
  .company-card form>h2 { margin-top:24px; }
  .company-card .company-fields { gap:16px; }
  .dmdk-checks { list-style:none; padding:0; margin:24px 0; }
  .dmdk-checks li { padding:16px 0; border-bottom:1px solid var(--border, #dce1e8); }
  .dmdk-checks li>div { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px 24px; }
  .dmdk-checks p { margin:8px 0 0; overflow-wrap:anywhere; }
  .dmdk-check-status { color:#596579; }
  .dmdk-checks [data-state="passed"] .dmdk-check-status { color:#217144; }
  .dmdk-checks [data-state="action"] .dmdk-check-status { color:#9c421b; }
  .dmdk-device { padding:16px 0; border-bottom:1px solid var(--border, #dce1e8); }
  .dmdk-device h4 { margin:0; overflow-wrap:anywhere; }
  .dmdk-device-panel input { box-sizing:border-box; max-width:100%; }
  .dmdk-device-panel form { margin:16px 0; }
  .dmdk-device-panel button { max-width:100%; white-space:normal; }
  .dmdk-invitation { font-family:monospace; }
  @media(max-width:767px) {
    .company-fields { grid-template-columns:minmax(0,1fr); gap:16px; }
  }
}

/* Partner pairing: field action stays level with its input at every width. */
.dmdk-device-panel{min-width:0}
.dmdk-device-panel .dmdk-device{padding:16px 0;border-bottom:1px solid var(--border,#e3e6eb);overflow-wrap:anywhere}
.dmdk-device-panel form{display:flex;align-items:flex-end;gap:8px;margin:12px 0}
.dmdk-device-panel form label{flex:1;min-width:0;margin:0}
.dmdk-device-panel form input{width:100%;box-sizing:border-box;min-width:0;margin:4px 0 0}
.dmdk-device-panel form button{flex:0 0 auto;margin:0;min-height:44px}
.dmdk-device-panel .ozon-details dd{min-width:0;overflow-wrap:anywhere}
.dmdk-device-panel details{margin:12px 0}

/* Pairing actions precede optional diagnostics and historical attempts. */
.dmdk-device-panel h3{margin:0 0 12px;font-size:18px}
.dmdk-device-panel summary,.dmdk-initial-checks summary{min-height:44px;padding:10px 0;box-sizing:border-box;cursor:pointer;overflow-wrap:anywhere}
.dmdk-device-panel .primary{display:inline-flex;align-items:center;justify-content:center;min-height:44px;box-sizing:border-box;max-width:100%;white-space:normal}

/* First-time setup: one primary download action; same shared cabinet tokens. */
.dmdk-device-panel .integration-actions{justify-content:flex-start;margin:16px 0}
.dmdk-device-panel a.primary{padding:12px 16px;border-radius:10px;background:var(--cabinet-accent,#5062b4);color:#fff;text-decoration:none}
.dmdk-install-steps{padding-left:24px;line-height:1.6}
.dmdk-install-steps li{margin:8px 0}
.dmdk-device-panel .dmdk-install{padding:8px 0}
.dmdk-device-panel button[data-setup-ready]{min-height:44px}
@media(max-width:767px){
 .dmdk-device-panel .integration-actions>a.primary{width:100%;margin-right:0}
 .dmdk-device-panel button[data-setup-ready]{width:100%}
}

/* Separate, optional credential setup; never part of the company-details form. */
@media screen {
  .company-lookup-setup { min-width:0; margin-top:24px; }
  .company-lookup-setup summary { min-height:44px; padding:10px 0; box-sizing:border-box; cursor:pointer; overflow-wrap:anywhere; }
  .company-lookup-setup [hidden] { display:none!important; }
  .cabinet-content #app .company-lookup-setup form { max-width:none; margin-top:16px; }
  .company-lookup-setup input[type=password] { width:100%; max-width:none; min-width:0; box-sizing:border-box; }
  .company-lookup-setup .company-lookup-replace { display:flex; align-items:flex-start; gap:8px; margin-top:16px; min-height:44px; }
  .company-lookup-setup input[type=checkbox] { flex:0 0 20px; width:20px; height:20px; min-height:20px; padding:0; box-sizing:border-box; margin:2px 0 0; }
  .company-lookup-setup p,.company-lookup-setup label { overflow-wrap:anywhere; }
  .company-lookup-setup button { max-width:100%; min-height:44px; white-space:normal; }
  .company-lookup-setup .integration-actions { margin-top:16px; }
}
